adjsutments for the old graphics hello module.

This commit is contained in:
ed
2026-07-11 00:11:32 -04:00
parent eccf17d21c
commit 541e52de2b
5 changed files with 45 additions and 45 deletions
+15 -15
View File
@@ -17,19 +17,19 @@ enum {
};
typedef U4 OrderingTable_Buffer[OrderingTbl_Len];
typedef def_farray(OrderingTable_Buffer, 2);
typedef Array_(OrderingTable_Buffer, 2);
typedef B1 PrimitiveBuffer[PrimitiveBuff_Len];
typedef def_farray(PrimitiveBuffer, 2);
typedef def_struct(PrimitiveArena) {
typedef Array_(PrimitiveBuffer, 2);
typedef Struct_(PrimitiveArena) {
A2_PrimitiveBuffer buf;
U4 used;
};
#define Cube_num_verts 8
typedef def_farray(V3_S2, Cube_num_verts);
typedef Array_(V3_S2, Cube_num_verts);
#define Cube_num_faces 6
typedef def_farray(V4_S2, Cube_num_faces);
typedef Array_(V4_S2, Cube_num_faces);
void ent_cube128_init(A8_V3_S2* verts, A6_V4_S2* faces) {
memory_copy(verts, & (A8_V3_S2) {
{ -128, -128, -128 },
@@ -40,7 +40,7 @@ void ent_cube128_init(A8_V3_S2* verts, A6_V4_S2* faces) {
{ 128, 128, -128 },
{ 128, 128, 128 },
{ -128, 128, 128 }
}, size_of(A8_V3_S2) );
}, S_(A8_V3_S2) );
memory_copy(faces, & (A6_V4_S2) {
{ 3, 2, 0, 1 },
{ 0, 1, 4, 5 },
@@ -48,10 +48,10 @@ void ent_cube128_init(A8_V3_S2* verts, A6_V4_S2* faces) {
{ 1, 2, 5, 6 },
{ 2, 3, 6, 7 },
{ 3, 0, 7, 4 },
}, size_of(A6_V4_S2) );
}, S_(A6_V4_S2) );
return;
}
typedef def_struct(Ent_Cube) {
typedef Struct_(Ent_Cube) {
V3_S4 accel;
V3_S4 vel;
V3_S4 pos;
@@ -62,22 +62,22 @@ typedef def_struct(Ent_Cube) {
};
#define Floor_num_verts 4
typedef def_farray(V3_S2, Floor_num_verts);
typedef Array_(V3_S2, Floor_num_verts);
#define Floor_num_faces 2
typedef def_farray(V3_S2, Floor_num_faces);
typedef Array_(V3_S2, Floor_num_faces);
void ent_floor_init(A4_V3_S2* verts, A2_V3_S2* faces) {
memory_copy(verts, &(A4_V3_S2) {
{ -900, 0, -900 },
{ -900, 0, 900 },
{ 900, 0, -900 },
{ 900, 0, 900 },
}, size_of(A8_V3_S2));
}, S_(A8_V3_S2));
memory_copy(faces, & (A2_V3_S2) {
{ 0, 1, 2 },
{ 1, 3, 2 },
}, size_of(A2_V3_S2));
}, S_(A2_V3_S2));
};
typedef def_struct(Ent_Floor) {
typedef Struct_(Ent_Floor) {
V3_S4 accel;
V3_S4 pos;
V3_S4 scale;
@@ -86,7 +86,7 @@ typedef def_struct(Ent_Floor) {
A2_V3_S2 faces;
};
typedef def_struct(SMemory) {
typedef Struct_(SMemory) {
DoubleBuffer screen_buf;
A2_OrderingTable_Buffer ordering_tbl;
PrimitiveArena primitives;
@@ -108,7 +108,7 @@ B1* prim__alloc(U4 type_width, Str8 type_name) {
pa->used += type_width;
return next;
}
#define prim_alloc(type) (type*)prim__alloc(size_of(type), txt( stringify(type)))
#define prim_alloc(type) (type*)prim__alloc(S_(type), slit( stringify(type)))
void gp_screen_init_c11(DoubleBuffer* screen_buf, S2* active_buf_id)
{