1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-06-07 01:29:30 +00:00

vector: split draw_wireframe_ortho() so that --oldralloc works

This commit is contained in:
Steven Hugg 2018-12-04 18:35:19 -05:00
parent 1e5b2dcab8
commit b6db88bc97
2 changed files with 16 additions and 6 deletions

View File

@ -337,13 +337,11 @@ void xform_vertices(Vector16* dest, const Vector8* src, const Matrix* m, byte nv
}
}
void draw_wireframe_ortho(const Wireframe* wf, const Matrix* m) {
void draw_wireframe(const Wireframe* wf, Vector16* scrnverts) {
const char* e = wf->edges;
byte bright = 0;
int x1 = 0;
int y1 = 0;
Vector16 scrnverts[16];
xform_vertices(scrnverts, wf->verts, m, wf->numverts);
do {
sbyte i = *e++;
if (i == -1)
@ -361,6 +359,12 @@ void draw_wireframe_ortho(const Wireframe* wf, const Matrix* m) {
} while (1);
}
void draw_wireframe_ortho(const Wireframe* wf, const Matrix* m) {
Vector16 scrnverts[16];
xform_vertices(scrnverts, wf->verts, m, wf->numverts);
draw_wireframe(wf, scrnverts);
}
// SHAPE CACHE
const Vector8 tetra_v[] = { {0,-86,86},{86,86,86},{-86,86,86},{0,0,-86} };

View File

@ -108,6 +108,8 @@ typedef struct {
const sbyte* edges; // array of vertex indices (edges)
} Wireframe;
const Matrix IDENTITY = {{{127,0,0},{0,127,0},{0,0,127}}};
void mat_identity(Matrix* m) {
memset(m, 0, sizeof(*m));
m->m[0][0] = 127;
@ -200,13 +202,11 @@ void xform_vertices(Vector16* dest, const Vector8* src, const Matrix* m, byte nv
}
}
void draw_wireframe_ortho(const Wireframe* wf, const Matrix* m) {
void draw_wireframe(const Wireframe* wf, Vector16* scrnverts) {
const char* e = wf->edges;
byte bright = 0;
int x1 = 0;
int y1 = 0;
Vector16 scrnverts[16];
xform_vertices(scrnverts, wf->verts, m, wf->numverts);
do {
sbyte i = *e++;
if (i == -1)
@ -224,6 +224,12 @@ void draw_wireframe_ortho(const Wireframe* wf, const Matrix* m) {
} while (1);
}
void draw_wireframe_ortho(const Wireframe* wf, const Matrix* m) {
Vector16 scrnverts[16];
xform_vertices(scrnverts, wf->verts, m, wf->numverts);
draw_wireframe(wf, scrnverts);
}
///
word frame;