Use US spelling of "color" everywhere

This commit is contained in:
Dominic Szablewski 2023-08-30 12:38:34 +02:00
parent 69122122f0
commit 2c5c3d3f13
6 changed files with 183 additions and 183 deletions

View file

@ -73,36 +73,36 @@ void droid_draw(droid_t *droid) {
switch (prm.f3->type) { switch (prm.f3->type) {
case PRM_TYPE_GT3: case PRM_TYPE_GT3:
prm.gt3->colour[0].r = r; prm.gt3->color[0].r = r;
prm.gt3->colour[0].g = g; prm.gt3->color[0].g = g;
prm.gt3->colour[0].b = b; prm.gt3->color[0].b = b;
prm.gt3->colour[1].r = r; prm.gt3->color[1].r = r;
prm.gt3->colour[1].g = g; prm.gt3->color[1].g = g;
prm.gt3->colour[1].b = b; prm.gt3->color[1].b = b;
prm.gt3->colour[2].r = r; prm.gt3->color[2].r = r;
prm.gt3->colour[2].g = g; prm.gt3->color[2].g = g;
prm.gt3->colour[2].b = b; prm.gt3->color[2].b = b;
prm.gt3++; prm.gt3++;
break; break;
case PRM_TYPE_GT4: case PRM_TYPE_GT4:
prm.gt4->colour[0].r = r; prm.gt4->color[0].r = r;
prm.gt4->colour[0].g = g; prm.gt4->color[0].g = g;
prm.gt4->colour[0].b = b; prm.gt4->color[0].b = b;
prm.gt4->colour[1].r = r; prm.gt4->color[1].r = r;
prm.gt4->colour[1].g = g; prm.gt4->color[1].g = g;
prm.gt4->colour[1].b = b; prm.gt4->color[1].b = b;
prm.gt4->colour[2].r = r; prm.gt4->color[2].r = r;
prm.gt4->colour[2].g = g; prm.gt4->color[2].g = g;
prm.gt4->colour[2].b = b; prm.gt4->color[2].b = b;
prm.gt4->colour[3].r = 40; prm.gt4->color[3].r = 40;
prm.gt4->colour[3].g = 40; prm.gt4->color[3].g = 40;
prm.gt4->colour[3].b = 40; prm.gt4->color[3].b = 40;
prm.gt4++; prm.gt4++;
break; break;
} }

View file

@ -97,7 +97,7 @@ Object *objects_load(char *name, texture_list_t tl) {
prm.f3->coords[1] = get_i16(bytes, &p); prm.f3->coords[1] = get_i16(bytes, &p);
prm.f3->coords[2] = get_i16(bytes, &p); prm.f3->coords[2] = get_i16(bytes, &p);
prm.f3->pad1 = get_i16(bytes, &p); prm.f3->pad1 = get_i16(bytes, &p);
prm.f3->colour = rgba_from_u32(get_u32(bytes, &p)); prm.f3->color = rgba_from_u32(get_u32(bytes, &p));
break; break;
case PRM_TYPE_F4: case PRM_TYPE_F4:
@ -106,7 +106,7 @@ Object *objects_load(char *name, texture_list_t tl) {
prm.f4->coords[1] = get_i16(bytes, &p); prm.f4->coords[1] = get_i16(bytes, &p);
prm.f4->coords[2] = get_i16(bytes, &p); prm.f4->coords[2] = get_i16(bytes, &p);
prm.f4->coords[3] = get_i16(bytes, &p); prm.f4->coords[3] = get_i16(bytes, &p);
prm.f4->colour = rgba_from_u32(get_u32(bytes, &p)); prm.f4->color = rgba_from_u32(get_u32(bytes, &p));
break; break;
case PRM_TYPE_FT3: case PRM_TYPE_FT3:
@ -126,7 +126,7 @@ Object *objects_load(char *name, texture_list_t tl) {
prm.ft3->v2 = get_i8(bytes, &p); prm.ft3->v2 = get_i8(bytes, &p);
prm.ft3->pad1 = get_i16(bytes, &p); prm.ft3->pad1 = get_i16(bytes, &p);
prm.ft3->colour = rgba_from_u32(get_u32(bytes, &p)); prm.ft3->color = rgba_from_u32(get_u32(bytes, &p));
break; break;
case PRM_TYPE_FT4: case PRM_TYPE_FT4:
@ -148,7 +148,7 @@ Object *objects_load(char *name, texture_list_t tl) {
prm.ft4->u3 = get_i8(bytes, &p); prm.ft4->u3 = get_i8(bytes, &p);
prm.ft4->v3 = get_i8(bytes, &p); prm.ft4->v3 = get_i8(bytes, &p);
prm.ft4->pad1 = get_i16(bytes, &p); prm.ft4->pad1 = get_i16(bytes, &p);
prm.ft4->colour = rgba_from_u32(get_u32(bytes, &p)); prm.ft4->color = rgba_from_u32(get_u32(bytes, &p));
break; break;
case PRM_TYPE_G3: case PRM_TYPE_G3:
@ -157,9 +157,9 @@ Object *objects_load(char *name, texture_list_t tl) {
prm.g3->coords[1] = get_i16(bytes, &p); prm.g3->coords[1] = get_i16(bytes, &p);
prm.g3->coords[2] = get_i16(bytes, &p); prm.g3->coords[2] = get_i16(bytes, &p);
prm.g3->pad1 = get_i16(bytes, &p); prm.g3->pad1 = get_i16(bytes, &p);
prm.g3->colour[0] = rgba_from_u32(get_u32(bytes, &p)); prm.g3->color[0] = rgba_from_u32(get_u32(bytes, &p));
prm.g3->colour[1] = rgba_from_u32(get_u32(bytes, &p)); prm.g3->color[1] = rgba_from_u32(get_u32(bytes, &p));
prm.g3->colour[2] = rgba_from_u32(get_u32(bytes, &p)); prm.g3->color[2] = rgba_from_u32(get_u32(bytes, &p));
break; break;
case PRM_TYPE_G4: case PRM_TYPE_G4:
@ -168,10 +168,10 @@ Object *objects_load(char *name, texture_list_t tl) {
prm.g4->coords[1] = get_i16(bytes, &p); prm.g4->coords[1] = get_i16(bytes, &p);
prm.g4->coords[2] = get_i16(bytes, &p); prm.g4->coords[2] = get_i16(bytes, &p);
prm.g4->coords[3] = get_i16(bytes, &p); prm.g4->coords[3] = get_i16(bytes, &p);
prm.g4->colour[0] = rgba_from_u32(get_u32(bytes, &p)); prm.g4->color[0] = rgba_from_u32(get_u32(bytes, &p));
prm.g4->colour[1] = rgba_from_u32(get_u32(bytes, &p)); prm.g4->color[1] = rgba_from_u32(get_u32(bytes, &p));
prm.g4->colour[2] = rgba_from_u32(get_u32(bytes, &p)); prm.g4->color[2] = rgba_from_u32(get_u32(bytes, &p));
prm.g4->colour[3] = rgba_from_u32(get_u32(bytes, &p)); prm.g4->color[3] = rgba_from_u32(get_u32(bytes, &p));
break; break;
case PRM_TYPE_GT3: case PRM_TYPE_GT3:
@ -190,9 +190,9 @@ Object *objects_load(char *name, texture_list_t tl) {
prm.gt3->u2 = get_i8(bytes, &p); prm.gt3->u2 = get_i8(bytes, &p);
prm.gt3->v2 = get_i8(bytes, &p); prm.gt3->v2 = get_i8(bytes, &p);
prm.gt3->pad1 = get_i16(bytes, &p); prm.gt3->pad1 = get_i16(bytes, &p);
prm.gt3->colour[0] = rgba_from_u32(get_u32(bytes, &p)); prm.gt3->color[0] = rgba_from_u32(get_u32(bytes, &p));
prm.gt3->colour[1] = rgba_from_u32(get_u32(bytes, &p)); prm.gt3->color[1] = rgba_from_u32(get_u32(bytes, &p));
prm.gt3->colour[2] = rgba_from_u32(get_u32(bytes, &p)); prm.gt3->color[2] = rgba_from_u32(get_u32(bytes, &p));
break; break;
case PRM_TYPE_GT4: case PRM_TYPE_GT4:
@ -214,10 +214,10 @@ Object *objects_load(char *name, texture_list_t tl) {
prm.gt4->u3 = get_i8(bytes, &p); prm.gt4->u3 = get_i8(bytes, &p);
prm.gt4->v3 = get_i8(bytes, &p); prm.gt4->v3 = get_i8(bytes, &p);
prm.gt4->pad1 = get_i16(bytes, &p); prm.gt4->pad1 = get_i16(bytes, &p);
prm.gt4->colour[0] = rgba_from_u32(get_u32(bytes, &p)); prm.gt4->color[0] = rgba_from_u32(get_u32(bytes, &p));
prm.gt4->colour[1] = rgba_from_u32(get_u32(bytes, &p)); prm.gt4->color[1] = rgba_from_u32(get_u32(bytes, &p));
prm.gt4->colour[2] = rgba_from_u32(get_u32(bytes, &p)); prm.gt4->color[2] = rgba_from_u32(get_u32(bytes, &p));
prm.gt4->colour[3] = rgba_from_u32(get_u32(bytes, &p)); prm.gt4->color[3] = rgba_from_u32(get_u32(bytes, &p));
break; break;
@ -227,7 +227,7 @@ Object *objects_load(char *name, texture_list_t tl) {
prm.lsf3->coords[1] = get_i16(bytes, &p); prm.lsf3->coords[1] = get_i16(bytes, &p);
prm.lsf3->coords[2] = get_i16(bytes, &p); prm.lsf3->coords[2] = get_i16(bytes, &p);
prm.lsf3->normal = get_i16(bytes, &p); prm.lsf3->normal = get_i16(bytes, &p);
prm.lsf3->colour = rgba_from_u32(get_u32(bytes, &p)); prm.lsf3->color = rgba_from_u32(get_u32(bytes, &p));
break; break;
case PRM_TYPE_LSF4: case PRM_TYPE_LSF4:
@ -238,7 +238,7 @@ Object *objects_load(char *name, texture_list_t tl) {
prm.lsf4->coords[3] = get_i16(bytes, &p); prm.lsf4->coords[3] = get_i16(bytes, &p);
prm.lsf4->normal = get_i16(bytes, &p); prm.lsf4->normal = get_i16(bytes, &p);
prm.lsf4->pad1 = get_i16(bytes, &p); prm.lsf4->pad1 = get_i16(bytes, &p);
prm.lsf4->colour = rgba_from_u32(get_u32(bytes, &p)); prm.lsf4->color = rgba_from_u32(get_u32(bytes, &p));
break; break;
case PRM_TYPE_LSFT3: case PRM_TYPE_LSFT3:
@ -257,7 +257,7 @@ Object *objects_load(char *name, texture_list_t tl) {
prm.lsft3->v1 = get_i8(bytes, &p); prm.lsft3->v1 = get_i8(bytes, &p);
prm.lsft3->u2 = get_i8(bytes, &p); prm.lsft3->u2 = get_i8(bytes, &p);
prm.lsft3->v2 = get_i8(bytes, &p); prm.lsft3->v2 = get_i8(bytes, &p);
prm.lsft3->colour = rgba_from_u32(get_u32(bytes, &p)); prm.lsft3->color = rgba_from_u32(get_u32(bytes, &p));
break; break;
case PRM_TYPE_LSFT4: case PRM_TYPE_LSFT4:
@ -279,7 +279,7 @@ Object *objects_load(char *name, texture_list_t tl) {
prm.lsft4->v2 = get_i8(bytes, &p); prm.lsft4->v2 = get_i8(bytes, &p);
prm.lsft4->u3 = get_i8(bytes, &p); prm.lsft4->u3 = get_i8(bytes, &p);
prm.lsft4->v3 = get_i8(bytes, &p); prm.lsft4->v3 = get_i8(bytes, &p);
prm.lsft4->colour = rgba_from_u32(get_u32(bytes, &p)); prm.lsft4->color = rgba_from_u32(get_u32(bytes, &p));
break; break;
case PRM_TYPE_LSG3: case PRM_TYPE_LSG3:
@ -290,9 +290,9 @@ Object *objects_load(char *name, texture_list_t tl) {
prm.lsg3->normals[0] = get_i16(bytes, &p); prm.lsg3->normals[0] = get_i16(bytes, &p);
prm.lsg3->normals[1] = get_i16(bytes, &p); prm.lsg3->normals[1] = get_i16(bytes, &p);
prm.lsg3->normals[2] = get_i16(bytes, &p); prm.lsg3->normals[2] = get_i16(bytes, &p);
prm.lsg3->colour[0] = rgba_from_u32(get_u32(bytes, &p)); prm.lsg3->color[0] = rgba_from_u32(get_u32(bytes, &p));
prm.lsg3->colour[1] = rgba_from_u32(get_u32(bytes, &p)); prm.lsg3->color[1] = rgba_from_u32(get_u32(bytes, &p));
prm.lsg3->colour[2] = rgba_from_u32(get_u32(bytes, &p)); prm.lsg3->color[2] = rgba_from_u32(get_u32(bytes, &p));
break; break;
case PRM_TYPE_LSG4: case PRM_TYPE_LSG4:
@ -305,10 +305,10 @@ Object *objects_load(char *name, texture_list_t tl) {
prm.lsg4->normals[1] = get_i16(bytes, &p); prm.lsg4->normals[1] = get_i16(bytes, &p);
prm.lsg4->normals[2] = get_i16(bytes, &p); prm.lsg4->normals[2] = get_i16(bytes, &p);
prm.lsg4->normals[3] = get_i16(bytes, &p); prm.lsg4->normals[3] = get_i16(bytes, &p);
prm.lsg4->colour[0] = rgba_from_u32(get_u32(bytes, &p)); prm.lsg4->color[0] = rgba_from_u32(get_u32(bytes, &p));
prm.lsg4->colour[1] = rgba_from_u32(get_u32(bytes, &p)); prm.lsg4->color[1] = rgba_from_u32(get_u32(bytes, &p));
prm.lsg4->colour[2] = rgba_from_u32(get_u32(bytes, &p)); prm.lsg4->color[2] = rgba_from_u32(get_u32(bytes, &p));
prm.lsg4->colour[3] = rgba_from_u32(get_u32(bytes, &p)); prm.lsg4->color[3] = rgba_from_u32(get_u32(bytes, &p));
break; break;
case PRM_TYPE_LSGT3: case PRM_TYPE_LSGT3:
@ -329,9 +329,9 @@ Object *objects_load(char *name, texture_list_t tl) {
prm.lsgt3->v1 = get_i8(bytes, &p); prm.lsgt3->v1 = get_i8(bytes, &p);
prm.lsgt3->u2 = get_i8(bytes, &p); prm.lsgt3->u2 = get_i8(bytes, &p);
prm.lsgt3->v2 = get_i8(bytes, &p); prm.lsgt3->v2 = get_i8(bytes, &p);
prm.lsgt3->colour[0] = rgba_from_u32(get_u32(bytes, &p)); prm.lsgt3->color[0] = rgba_from_u32(get_u32(bytes, &p));
prm.lsgt3->colour[1] = rgba_from_u32(get_u32(bytes, &p)); prm.lsgt3->color[1] = rgba_from_u32(get_u32(bytes, &p));
prm.lsgt3->colour[2] = rgba_from_u32(get_u32(bytes, &p)); prm.lsgt3->color[2] = rgba_from_u32(get_u32(bytes, &p));
break; break;
case PRM_TYPE_LSGT4: case PRM_TYPE_LSGT4:
@ -355,10 +355,10 @@ Object *objects_load(char *name, texture_list_t tl) {
prm.lsgt4->u2 = get_i8(bytes, &p); prm.lsgt4->u2 = get_i8(bytes, &p);
prm.lsgt4->v2 = get_i8(bytes, &p); prm.lsgt4->v2 = get_i8(bytes, &p);
prm.lsgt4->pad1 = get_i16(bytes, &p); prm.lsgt4->pad1 = get_i16(bytes, &p);
prm.lsgt4->colour[0] = rgba_from_u32(get_u32(bytes, &p)); prm.lsgt4->color[0] = rgba_from_u32(get_u32(bytes, &p));
prm.lsgt4->colour[1] = rgba_from_u32(get_u32(bytes, &p)); prm.lsgt4->color[1] = rgba_from_u32(get_u32(bytes, &p));
prm.lsgt4->colour[2] = rgba_from_u32(get_u32(bytes, &p)); prm.lsgt4->color[2] = rgba_from_u32(get_u32(bytes, &p));
prm.lsgt4->colour[3] = rgba_from_u32(get_u32(bytes, &p)); prm.lsgt4->color[3] = rgba_from_u32(get_u32(bytes, &p));
break; break;
@ -369,7 +369,7 @@ Object *objects_load(char *name, texture_list_t tl) {
prm.spr->width = get_i16(bytes, &p); prm.spr->width = get_i16(bytes, &p);
prm.spr->height = get_i16(bytes, &p); prm.spr->height = get_i16(bytes, &p);
prm.spr->texture = texture_from_list(tl, get_i16(bytes, &p)); prm.spr->texture = texture_from_list(tl, get_i16(bytes, &p));
prm.spr->colour = rgba_from_u32(get_u32(bytes, &p)); prm.spr->color = rgba_from_u32(get_u32(bytes, &p));
break; break;
case PRM_TYPE_SPLINE: case PRM_TYPE_SPLINE:
@ -386,7 +386,7 @@ Object *objects_load(char *name, texture_list_t tl) {
prm.spline->control2.y = get_i32(bytes, &p); prm.spline->control2.y = get_i32(bytes, &p);
prm.spline->control2.z = get_i32(bytes, &p); prm.spline->control2.z = get_i32(bytes, &p);
p += 4; // padding p += 4; // padding
prm.spline->colour = rgba_from_u32(get_u32(bytes, &p)); prm.spline->color = rgba_from_u32(get_u32(bytes, &p));
break; break;
case PRM_TYPE_POINT_LIGHT: case PRM_TYPE_POINT_LIGHT:
@ -395,7 +395,7 @@ Object *objects_load(char *name, texture_list_t tl) {
prm.pointLight->position.y = get_i32(bytes, &p); prm.pointLight->position.y = get_i32(bytes, &p);
prm.pointLight->position.z = get_i32(bytes, &p); prm.pointLight->position.z = get_i32(bytes, &p);
p += 4; // padding p += 4; // padding
prm.pointLight->colour = rgba_from_u32(get_u32(bytes, &p)); prm.pointLight->color = rgba_from_u32(get_u32(bytes, &p));
prm.pointLight->startFalloff = get_i16(bytes, &p); prm.pointLight->startFalloff = get_i16(bytes, &p);
prm.pointLight->endFalloff = get_i16(bytes, &p); prm.pointLight->endFalloff = get_i16(bytes, &p);
break; break;
@ -410,7 +410,7 @@ Object *objects_load(char *name, texture_list_t tl) {
prm.spotLight->direction.y = get_i16(bytes, &p); prm.spotLight->direction.y = get_i16(bytes, &p);
prm.spotLight->direction.z = get_i16(bytes, &p); prm.spotLight->direction.z = get_i16(bytes, &p);
p += 2; // padding p += 2; // padding
prm.spotLight->colour = rgba_from_u32(get_u32(bytes, &p)); prm.spotLight->color = rgba_from_u32(get_u32(bytes, &p));
prm.spotLight->startFalloff = get_i16(bytes, &p); prm.spotLight->startFalloff = get_i16(bytes, &p);
prm.spotLight->endFalloff = get_i16(bytes, &p); prm.spotLight->endFalloff = get_i16(bytes, &p);
prm.spotLight->coneAngle = get_i16(bytes, &p); prm.spotLight->coneAngle = get_i16(bytes, &p);
@ -423,7 +423,7 @@ Object *objects_load(char *name, texture_list_t tl) {
prm.infiniteLight->direction.y = get_i16(bytes, &p); prm.infiniteLight->direction.y = get_i16(bytes, &p);
prm.infiniteLight->direction.z = get_i16(bytes, &p); prm.infiniteLight->direction.z = get_i16(bytes, &p);
p += 2; // padding p += 2; // padding
prm.infiniteLight->colour = rgba_from_u32(get_u32(bytes, &p)); prm.infiniteLight->color = rgba_from_u32(get_u32(bytes, &p));
break; break;
@ -467,17 +467,17 @@ void object_draw(Object *object, mat4_t *mat) {
{ {
.pos = vertex[coord2], .pos = vertex[coord2],
.uv = {poly.gt3->u2, poly.gt3->v2}, .uv = {poly.gt3->u2, poly.gt3->v2},
.color = poly.gt3->colour[2] .color = poly.gt3->color[2]
}, },
{ {
.pos = vertex[coord1], .pos = vertex[coord1],
.uv = {poly.gt3->u1, poly.gt3->v1}, .uv = {poly.gt3->u1, poly.gt3->v1},
.color = poly.gt3->colour[1] .color = poly.gt3->color[1]
}, },
{ {
.pos = vertex[coord0], .pos = vertex[coord0],
.uv = {poly.gt3->u0, poly.gt3->v0}, .uv = {poly.gt3->u0, poly.gt3->v0},
.color = poly.gt3->colour[0] .color = poly.gt3->color[0]
}, },
} }
}, poly.gt3->texture); }, poly.gt3->texture);
@ -496,17 +496,17 @@ void object_draw(Object *object, mat4_t *mat) {
{ {
.pos = vertex[coord2], .pos = vertex[coord2],
.uv = {poly.gt4->u2, poly.gt4->v2}, .uv = {poly.gt4->u2, poly.gt4->v2},
.color = poly.gt4->colour[2] .color = poly.gt4->color[2]
}, },
{ {
.pos = vertex[coord1], .pos = vertex[coord1],
.uv = {poly.gt4->u1, poly.gt4->v1}, .uv = {poly.gt4->u1, poly.gt4->v1},
.color = poly.gt4->colour[1] .color = poly.gt4->color[1]
}, },
{ {
.pos = vertex[coord0], .pos = vertex[coord0],
.uv = {poly.gt4->u0, poly.gt4->v0}, .uv = {poly.gt4->u0, poly.gt4->v0},
.color = poly.gt4->colour[0] .color = poly.gt4->color[0]
}, },
} }
}, poly.gt4->texture); }, poly.gt4->texture);
@ -515,17 +515,17 @@ void object_draw(Object *object, mat4_t *mat) {
{ {
.pos = vertex[coord2], .pos = vertex[coord2],
.uv = {poly.gt4->u2, poly.gt4->v2}, .uv = {poly.gt4->u2, poly.gt4->v2},
.color = poly.gt4->colour[2] .color = poly.gt4->color[2]
}, },
{ {
.pos = vertex[coord3], .pos = vertex[coord3],
.uv = {poly.gt4->u3, poly.gt4->v3}, .uv = {poly.gt4->u3, poly.gt4->v3},
.color = poly.gt4->colour[3] .color = poly.gt4->color[3]
}, },
{ {
.pos = vertex[coord1], .pos = vertex[coord1],
.uv = {poly.gt4->u1, poly.gt4->v1}, .uv = {poly.gt4->u1, poly.gt4->v1},
.color = poly.gt4->colour[1] .color = poly.gt4->color[1]
}, },
} }
}, poly.gt4->texture); }, poly.gt4->texture);
@ -543,17 +543,17 @@ void object_draw(Object *object, mat4_t *mat) {
{ {
.pos = vertex[coord2], .pos = vertex[coord2],
.uv = {poly.ft3->u2, poly.ft3->v2}, .uv = {poly.ft3->u2, poly.ft3->v2},
.color = poly.ft3->colour .color = poly.ft3->color
}, },
{ {
.pos = vertex[coord1], .pos = vertex[coord1],
.uv = {poly.ft3->u1, poly.ft3->v1}, .uv = {poly.ft3->u1, poly.ft3->v1},
.color = poly.ft3->colour .color = poly.ft3->color
}, },
{ {
.pos = vertex[coord0], .pos = vertex[coord0],
.uv = {poly.ft3->u0, poly.ft3->v0}, .uv = {poly.ft3->u0, poly.ft3->v0},
.color = poly.ft3->colour .color = poly.ft3->color
}, },
} }
}, poly.ft3->texture); }, poly.ft3->texture);
@ -572,17 +572,17 @@ void object_draw(Object *object, mat4_t *mat) {
{ {
.pos = vertex[coord2], .pos = vertex[coord2],
.uv = {poly.ft4->u2, poly.ft4->v2}, .uv = {poly.ft4->u2, poly.ft4->v2},
.color = poly.ft4->colour .color = poly.ft4->color
}, },
{ {
.pos = vertex[coord1], .pos = vertex[coord1],
.uv = {poly.ft4->u1, poly.ft4->v1}, .uv = {poly.ft4->u1, poly.ft4->v1},
.color = poly.ft4->colour .color = poly.ft4->color
}, },
{ {
.pos = vertex[coord0], .pos = vertex[coord0],
.uv = {poly.ft4->u0, poly.ft4->v0}, .uv = {poly.ft4->u0, poly.ft4->v0},
.color = poly.ft4->colour .color = poly.ft4->color
}, },
} }
}, poly.ft4->texture); }, poly.ft4->texture);
@ -591,17 +591,17 @@ void object_draw(Object *object, mat4_t *mat) {
{ {
.pos = vertex[coord2], .pos = vertex[coord2],
.uv = {poly.ft4->u2, poly.ft4->v2}, .uv = {poly.ft4->u2, poly.ft4->v2},
.color = poly.ft4->colour .color = poly.ft4->color
}, },
{ {
.pos = vertex[coord3], .pos = vertex[coord3],
.uv = {poly.ft4->u3, poly.ft4->v3}, .uv = {poly.ft4->u3, poly.ft4->v3},
.color = poly.ft4->colour .color = poly.ft4->color
}, },
{ {
.pos = vertex[coord1], .pos = vertex[coord1],
.uv = {poly.ft4->u1, poly.ft4->v1}, .uv = {poly.ft4->u1, poly.ft4->v1},
.color = poly.ft4->colour .color = poly.ft4->color
}, },
} }
}, poly.ft4->texture); }, poly.ft4->texture);
@ -618,15 +618,15 @@ void object_draw(Object *object, mat4_t *mat) {
.vertices = { .vertices = {
{ {
.pos = vertex[coord2], .pos = vertex[coord2],
.color = poly.g3->colour[2] .color = poly.g3->color[2]
}, },
{ {
.pos = vertex[coord1], .pos = vertex[coord1],
.color = poly.g3->colour[1] .color = poly.g3->color[1]
}, },
{ {
.pos = vertex[coord0], .pos = vertex[coord0],
.color = poly.g3->colour[0] .color = poly.g3->color[0]
}, },
} }
}, RENDER_NO_TEXTURE); }, RENDER_NO_TEXTURE);
@ -644,15 +644,15 @@ void object_draw(Object *object, mat4_t *mat) {
.vertices = { .vertices = {
{ {
.pos = vertex[coord2], .pos = vertex[coord2],
.color = poly.g4->colour[2] .color = poly.g4->color[2]
}, },
{ {
.pos = vertex[coord1], .pos = vertex[coord1],
.color = poly.g4->colour[1] .color = poly.g4->color[1]
}, },
{ {
.pos = vertex[coord0], .pos = vertex[coord0],
.color = poly.g4->colour[0] .color = poly.g4->color[0]
}, },
} }
}, RENDER_NO_TEXTURE); }, RENDER_NO_TEXTURE);
@ -660,15 +660,15 @@ void object_draw(Object *object, mat4_t *mat) {
.vertices = { .vertices = {
{ {
.pos = vertex[coord2], .pos = vertex[coord2],
.color = poly.g4->colour[2] .color = poly.g4->color[2]
}, },
{ {
.pos = vertex[coord3], .pos = vertex[coord3],
.color = poly.g4->colour[3] .color = poly.g4->color[3]
}, },
{ {
.pos = vertex[coord1], .pos = vertex[coord1],
.color = poly.g4->colour[1] .color = poly.g4->color[1]
}, },
} }
}, RENDER_NO_TEXTURE); }, RENDER_NO_TEXTURE);
@ -685,15 +685,15 @@ void object_draw(Object *object, mat4_t *mat) {
.vertices = { .vertices = {
{ {
.pos = vertex[coord2], .pos = vertex[coord2],
.color = poly.f3->colour .color = poly.f3->color
}, },
{ {
.pos = vertex[coord1], .pos = vertex[coord1],
.color = poly.f3->colour .color = poly.f3->color
}, },
{ {
.pos = vertex[coord0], .pos = vertex[coord0],
.color = poly.f3->colour .color = poly.f3->color
}, },
} }
}, RENDER_NO_TEXTURE); }, RENDER_NO_TEXTURE);
@ -711,15 +711,15 @@ void object_draw(Object *object, mat4_t *mat) {
.vertices = { .vertices = {
{ {
.pos = vertex[coord2], .pos = vertex[coord2],
.color = poly.f4->colour .color = poly.f4->color
}, },
{ {
.pos = vertex[coord1], .pos = vertex[coord1],
.color = poly.f4->colour .color = poly.f4->color
}, },
{ {
.pos = vertex[coord0], .pos = vertex[coord0],
.color = poly.f4->colour .color = poly.f4->color
}, },
} }
}, RENDER_NO_TEXTURE); }, RENDER_NO_TEXTURE);
@ -727,15 +727,15 @@ void object_draw(Object *object, mat4_t *mat) {
.vertices = { .vertices = {
{ {
.pos = vertex[coord2], .pos = vertex[coord2],
.color = poly.f4->colour .color = poly.f4->color
}, },
{ {
.pos = vertex[coord3], .pos = vertex[coord3],
.color = poly.f4->colour .color = poly.f4->color
}, },
{ {
.pos = vertex[coord1], .pos = vertex[coord1],
.color = poly.f4->colour .color = poly.f4->color
}, },
} }
}, RENDER_NO_TEXTURE); }, RENDER_NO_TEXTURE);
@ -754,7 +754,7 @@ void object_draw(Object *object, mat4_t *mat) {
vertex[coord0].z vertex[coord0].z
), ),
vec2i(poly.spr->width, poly.spr->height), vec2i(poly.spr->width, poly.spr->height),
poly.spr->colour, poly.spr->color,
poly.spr->texture poly.spr->texture
); );

View file

@ -18,7 +18,7 @@ typedef struct F3 {
int16_t flag; int16_t flag;
int16_t coords[3]; // Indices of the coords int16_t coords[3]; // Indices of the coords
int16_t pad1; int16_t pad1;
rgba_t colour; rgba_t color;
} F3; } F3;
typedef struct FT3 { typedef struct FT3 {
@ -35,14 +35,14 @@ typedef struct FT3 {
uint8_t u2; uint8_t u2;
uint8_t v2; uint8_t v2;
int16_t pad1; int16_t pad1;
rgba_t colour; rgba_t color;
} FT3; } FT3;
typedef struct F4 { typedef struct F4 {
int16_t type; // Type of primitive int16_t type; // Type of primitive
int16_t flag; int16_t flag;
int16_t coords[4]; // Indices of the coords int16_t coords[4]; // Indices of the coords
rgba_t colour; rgba_t color;
} F4; } F4;
typedef struct FT4 { typedef struct FT4 {
@ -61,7 +61,7 @@ typedef struct FT4 {
uint8_t u3; uint8_t u3;
uint8_t v3; uint8_t v3;
int16_t pad1; int16_t pad1;
rgba_t colour; rgba_t color;
} FT4; } FT4;
typedef struct G3 { typedef struct G3 {
@ -69,7 +69,7 @@ typedef struct G3 {
int16_t flag; int16_t flag;
int16_t coords[3]; // Indices of the coords int16_t coords[3]; // Indices of the coords
int16_t pad1; int16_t pad1;
rgba_t colour[3]; rgba_t color[3];
} G3; } G3;
typedef struct GT3 { typedef struct GT3 {
@ -86,14 +86,14 @@ typedef struct GT3 {
uint8_t u2; uint8_t u2;
uint8_t v2; uint8_t v2;
int16_t pad1; int16_t pad1;
rgba_t colour[3]; rgba_t color[3];
} GT3; } GT3;
typedef struct G4 { typedef struct G4 {
int16_t type; // Type of primitive int16_t type; // Type of primitive
int16_t flag; int16_t flag;
int16_t coords[4]; // Indices of the coords int16_t coords[4]; // Indices of the coords
rgba_t colour[4]; rgba_t color[4];
} G4; } G4;
typedef struct GT4 { typedef struct GT4 {
@ -112,7 +112,7 @@ typedef struct GT4 {
uint8_t u3; uint8_t u3;
uint8_t v3; uint8_t v3;
int16_t pad1; int16_t pad1;
rgba_t colour[4]; rgba_t color[4];
} GT4; } GT4;
@ -126,7 +126,7 @@ typedef struct LSF3 {
int16_t flag; int16_t flag;
int16_t coords[3]; // Indices of the coords int16_t coords[3]; // Indices of the coords
int16_t normal; // Indices of the normals int16_t normal; // Indices of the normals
rgba_t colour; rgba_t color;
} LSF3; } LSF3;
typedef struct LSFT3 { typedef struct LSFT3 {
@ -143,7 +143,7 @@ typedef struct LSFT3 {
uint8_t v1; uint8_t v1;
uint8_t u2; uint8_t u2;
uint8_t v2; uint8_t v2;
rgba_t colour; rgba_t color;
} LSFT3; } LSFT3;
typedef struct LSF4 { typedef struct LSF4 {
@ -152,7 +152,7 @@ typedef struct LSF4 {
int16_t coords[4]; // Indices of the coords int16_t coords[4]; // Indices of the coords
int16_t normal; // Indices of the normals int16_t normal; // Indices of the normals
int16_t pad1; int16_t pad1;
rgba_t colour; rgba_t color;
} LSF4; } LSF4;
typedef struct LSFT4 { typedef struct LSFT4 {
@ -171,7 +171,7 @@ typedef struct LSFT4 {
uint8_t v2; uint8_t v2;
uint8_t u3; uint8_t u3;
uint8_t v3; uint8_t v3;
rgba_t colour; rgba_t color;
} LSFT4; } LSFT4;
typedef struct LSG3 { typedef struct LSG3 {
@ -179,7 +179,7 @@ typedef struct LSG3 {
int16_t flag; int16_t flag;
int16_t coords[3]; // Indices of the coords int16_t coords[3]; // Indices of the coords
int16_t normals[3]; // Indices of the normals int16_t normals[3]; // Indices of the normals
rgba_t colour[3]; rgba_t color[3];
} LSG3; } LSG3;
typedef struct LSGT3 { typedef struct LSGT3 {
@ -196,7 +196,7 @@ typedef struct LSGT3 {
uint8_t v1; uint8_t v1;
uint8_t u2; uint8_t u2;
uint8_t v2; uint8_t v2;
rgba_t colour[3]; rgba_t color[3];
} LSGT3; } LSGT3;
typedef struct LSG4 { typedef struct LSG4 {
@ -204,7 +204,7 @@ typedef struct LSG4 {
int16_t flag; int16_t flag;
int16_t coords[4]; // Indices of the coords int16_t coords[4]; // Indices of the coords
int16_t normals[4]; // Indices of the normals int16_t normals[4]; // Indices of the normals
rgba_t colour[4]; rgba_t color[4];
} LSG4; } LSG4;
typedef struct LSGT4 { typedef struct LSGT4 {
@ -224,7 +224,7 @@ typedef struct LSGT4 {
uint8_t u3; uint8_t u3;
uint8_t v3; uint8_t v3;
int16_t pad1; int16_t pad1;
rgba_t colour[4]; rgba_t color[4];
} LSGT4; } LSGT4;
@ -241,7 +241,7 @@ typedef struct SPR {
int16_t width; int16_t width;
int16_t height; int16_t height;
int16_t texture; int16_t texture;
rgba_t colour; rgba_t color;
} SPR; } SPR;
@ -251,7 +251,7 @@ typedef struct Spline {
vec3_t control1; vec3_t control1;
vec3_t position; vec3_t position;
vec3_t control2; vec3_t control2;
rgba_t colour; rgba_t color;
} Spline; } Spline;
@ -259,7 +259,7 @@ typedef struct PointLight {
int16_t type; int16_t type;
int16_t flag; int16_t flag;
vec3_t position; vec3_t position;
rgba_t colour; rgba_t color;
int16_t startFalloff; int16_t startFalloff;
int16_t endFalloff; int16_t endFalloff;
} PointLight; } PointLight;
@ -270,7 +270,7 @@ typedef struct SpotLight {
int16_t flag; int16_t flag;
vec3_t position; vec3_t position;
vec3_t direction; vec3_t direction;
rgba_t colour; rgba_t color;
int16_t startFalloff; int16_t startFalloff;
int16_t endFalloff; int16_t endFalloff;
int16_t coneAngle; int16_t coneAngle;
@ -282,7 +282,7 @@ typedef struct InfiniteLight {
int16_t type; int16_t type;
int16_t flag; int16_t flag;
vec3_t direction; vec3_t direction;
rgba_t colour; rgba_t color;
} InfiniteLight; } InfiniteLight;

View file

@ -168,9 +168,9 @@ void scene_set_start_booms(int light_index) {
for (int j = 0; j < lights_len; j++) { for (int j = 0; j < lights_len; j++) {
for (int v = 0; v < 4; v++) { for (int v = 0; v < 4; v++) {
libPoly.gt4->colour[v].r = color.r; libPoly.gt4->color[v].r = color.r;
libPoly.gt4->colour[v].g = color.g; libPoly.gt4->color[v].g = color.g;
libPoly.gt4->colour[v].b = color.b; libPoly.gt4->color[v].b = color.b;
} }
libPoly.gt4 += 1; libPoly.gt4 += 1;
} }
@ -183,9 +183,9 @@ void scene_pulsate_red_light(Object *obj) {
Prm libPoly = {.primitive = obj->primitives}; Prm libPoly = {.primitive = obj->primitives};
for (int v = 0; v < 4; v++) { for (int v = 0; v < 4; v++) {
libPoly.gt4->colour[v].r = r; libPoly.gt4->color[v].r = r;
libPoly.gt4->colour[v].g = 0x00; libPoly.gt4->color[v].g = 0x00;
libPoly.gt4->colour[v].b = 0x00; libPoly.gt4->color[v].b = 0x00;
} }
} }
@ -237,25 +237,25 @@ void scene_update_aurora_borealis() {
int16_t *coords = aurora_borealis.coords[i]; int16_t *coords = aurora_borealis.coords[i];
if (aurora_borealis.grey_coords[i] != -2) { if (aurora_borealis.grey_coords[i] != -2) {
aurora_borealis.primitives[i]->colour[0].r = (sin(coords[0] * phase) * 64.0) + 190; aurora_borealis.primitives[i]->color[0].r = (sin(coords[0] * phase) * 64.0) + 190;
aurora_borealis.primitives[i]->colour[0].g = (sin(coords[0] * (phase + 0.054)) * 64.0) + 190; aurora_borealis.primitives[i]->color[0].g = (sin(coords[0] * (phase + 0.054)) * 64.0) + 190;
aurora_borealis.primitives[i]->colour[0].b = (sin(coords[0] * (phase + 0.039)) * 64.0) + 190; aurora_borealis.primitives[i]->color[0].b = (sin(coords[0] * (phase + 0.039)) * 64.0) + 190;
} }
if (aurora_borealis.grey_coords[i] != -2) { if (aurora_borealis.grey_coords[i] != -2) {
aurora_borealis.primitives[i]->colour[1].r = (sin(coords[1] * phase) * 64.0) + 190; aurora_borealis.primitives[i]->color[1].r = (sin(coords[1] * phase) * 64.0) + 190;
aurora_borealis.primitives[i]->colour[1].g = (sin(coords[1] * (phase + 0.054)) * 64.0) + 190; aurora_borealis.primitives[i]->color[1].g = (sin(coords[1] * (phase + 0.054)) * 64.0) + 190;
aurora_borealis.primitives[i]->colour[1].b = (sin(coords[1] * (phase + 0.039)) * 64.0) + 190; aurora_borealis.primitives[i]->color[1].b = (sin(coords[1] * (phase + 0.039)) * 64.0) + 190;
} }
if (aurora_borealis.grey_coords[i] != -1) { if (aurora_borealis.grey_coords[i] != -1) {
aurora_borealis.primitives[i]->colour[2].r = (sin(coords[2] * phase) * 64.0) + 190; aurora_borealis.primitives[i]->color[2].r = (sin(coords[2] * phase) * 64.0) + 190;
aurora_borealis.primitives[i]->colour[2].g = (sin(coords[2] * (phase + 0.054)) * 64.0) + 190; aurora_borealis.primitives[i]->color[2].g = (sin(coords[2] * (phase + 0.054)) * 64.0) + 190;
aurora_borealis.primitives[i]->colour[2].b = (sin(coords[2] * (phase + 0.039)) * 64.0) + 190; aurora_borealis.primitives[i]->color[2].b = (sin(coords[2] * (phase + 0.039)) * 64.0) + 190;
} }
if (aurora_borealis.grey_coords[i] != -1) { if (aurora_borealis.grey_coords[i] != -1) {
aurora_borealis.primitives[i]->colour[3].r = (sin(coords[3] * phase) * 64.0) + 190; aurora_borealis.primitives[i]->color[3].r = (sin(coords[3] * phase) * 64.0) + 190;
aurora_borealis.primitives[i]->colour[3].g = (sin(coords[3] * (phase + 0.054)) * 64.0) + 190; aurora_borealis.primitives[i]->color[3].g = (sin(coords[3] * (phase + 0.054)) * 64.0) + 190;
aurora_borealis.primitives[i]->colour[3].b = (sin(coords[3] * (phase + 0.039)) * 64.0) + 190; aurora_borealis.primitives[i]->color[3].b = (sin(coords[3] * (phase + 0.039)) * 64.0) + 190;
} }
} }
} }

View file

@ -291,10 +291,10 @@ void ship_init_exhaust_plume(ship_t *self) {
indices[indices_len++] = prm.ft3->coords[2]; indices[indices_len++] = prm.ft3->coords[2];
flags_add(prm.ft3->flag, PRM_TRANSLUCENT); flags_add(prm.ft3->flag, PRM_TRANSLUCENT);
prm.ft3->colour.r = 180; prm.ft3->color.r = 180;
prm.ft3->colour.g = 97 ; prm.ft3->color.g = 97 ;
prm.ft3->colour.b = 120; prm.ft3->color.b = 120;
prm.ft3->colour.a = 140; prm.ft3->color.a = 140;
} }
prm.ft3 += 1; prm.ft3 += 1;
break; break;
@ -328,10 +328,10 @@ void ship_init_exhaust_plume(ship_t *self) {
flags_add(prm.gt3->flag, PRM_TRANSLUCENT); flags_add(prm.gt3->flag, PRM_TRANSLUCENT);
for (int j = 0; j < 3; j++) { for (int j = 0; j < 3; j++) {
prm.gt3->colour[j].r = 180; prm.gt3->color[j].r = 180;
prm.gt3->colour[j].g = 97 ; prm.gt3->color[j].g = 97 ;
prm.gt3->colour[j].b = 120; prm.gt3->color[j].b = 120;
prm.gt3->colour[j].a = 140; prm.gt3->color[j].a = 140;
} }
} }
prm.gt3 += 1; prm.gt3 += 1;

View file

@ -353,15 +353,15 @@ void weapon_update_mine_lights(weapon_t *self, int index) {
for (int i = 0; i < 8; i++) { for (int i = 0; i < 8; i++) {
switch (prm.primitive->type) { switch (prm.primitive->type) {
case PRM_TYPE_GT3: case PRM_TYPE_GT3:
prm.gt3->colour[0].r = 230; prm.gt3->color[0].r = 230;
prm.gt3->colour[1].r = r; prm.gt3->color[1].r = r;
prm.gt3->colour[2].r = r; prm.gt3->color[2].r = r;
prm.gt3->colour[0].g = 0; prm.gt3->color[0].g = 0;
prm.gt3->colour[1].g = 0x40; prm.gt3->color[1].g = 0x40;
prm.gt3->colour[2].g = 0x40; prm.gt3->color[2].g = 0x40;
prm.gt3->colour[0].b = 0; prm.gt3->color[0].b = 0;
prm.gt3->colour[1].b = 0; prm.gt3->color[1].b = 0;
prm.gt3->colour[2].b = 0; prm.gt3->color[2].b = 0;
prm.gt3 += 1; prm.gt3 += 1;
break; break;
} }
@ -585,20 +585,20 @@ void weapon_update_shield(weapon_t *self) {
col1 = sin(color_timer * coords[1]) * 127 + 128; col1 = sin(color_timer * coords[1]) * 127 + 128;
col2 = sin(color_timer * coords[2]) * 127 + 128; col2 = sin(color_timer * coords[2]) * 127 + 128;
poly.g3->colour[0].r = col0; poly.g3->color[0].r = col0;
poly.g3->colour[0].g = col0; poly.g3->color[0].g = col0;
poly.g3->colour[0].b = 255; poly.g3->color[0].b = 255;
poly.g3->colour[0].a = shield_alpha; poly.g3->color[0].a = shield_alpha;
poly.g3->colour[1].r = col1; poly.g3->color[1].r = col1;
poly.g3->colour[1].g = col1; poly.g3->color[1].g = col1;
poly.g3->colour[1].b = 255; poly.g3->color[1].b = 255;
poly.g3->colour[1].a = shield_alpha; poly.g3->color[1].a = shield_alpha;
poly.g3->colour[2].r = col2; poly.g3->color[2].r = col2;
poly.g3->colour[2].g = col2; poly.g3->color[2].g = col2;
poly.g3->colour[2].b = 255; poly.g3->color[2].b = 255;
poly.g3->colour[2].a = shield_alpha; poly.g3->color[2].a = shield_alpha;
poly.g3 += 1; poly.g3 += 1;
break; break;
@ -610,25 +610,25 @@ void weapon_update_shield(weapon_t *self) {
col2 = sin(color_timer * coords[2]) * 127 + 128; col2 = sin(color_timer * coords[2]) * 127 + 128;
col3 = sin(color_timer * coords[3]) * 127 + 128; col3 = sin(color_timer * coords[3]) * 127 + 128;
poly.g4->colour[0].r = col0; poly.g4->color[0].r = col0;
poly.g4->colour[0].g = col0; poly.g4->color[0].g = col0;
poly.g4->colour[0].b = 255; poly.g4->color[0].b = 255;
poly.g4->colour[0].a = shield_alpha; poly.g4->color[0].a = shield_alpha;
poly.g4->colour[1].r = col1; poly.g4->color[1].r = col1;
poly.g4->colour[1].g = col1; poly.g4->color[1].g = col1;
poly.g4->colour[1].b = 255; poly.g4->color[1].b = 255;
poly.g4->colour[1].a = shield_alpha; poly.g4->color[1].a = shield_alpha;
poly.g4->colour[2].r = col2; poly.g4->color[2].r = col2;
poly.g4->colour[2].g = col2; poly.g4->color[2].g = col2;
poly.g4->colour[2].b = 255; poly.g4->color[2].b = 255;
poly.g4->colour[2].a = shield_alpha; poly.g4->color[2].a = shield_alpha;
poly.g4->colour[3].r = col3; poly.g4->color[3].r = col3;
poly.g4->colour[3].g = col3; poly.g4->color[3].g = col3;
poly.g4->colour[3].b = 255; poly.g4->color[3].b = 255;
poly.g4->colour[3].a = shield_alpha; poly.g4->color[3].a = shield_alpha;
poly.g4 += 1; poly.g4 += 1;
break; break;
} }