From 5194eeb0e7bb5d2a2086c96ed04c2a47f9594d87 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Tue, 2 May 2023 19:16:22 +0100 Subject: Refactor the RGBA colour struct into engineapi.h In both the engine and SST it's used in more places than just console printing, so it makes more sense to give it a more appropriate nanme and location. --- src/build/codegen.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'src/build') diff --git a/src/build/codegen.c b/src/build/codegen.c index 391f572..bf3ae1e 100644 --- a/src/build/codegen.c +++ b/src/build/codegen.c @@ -1,5 +1,5 @@ /* - * Copyright © 2022 Michael Smith + * Copyright © 2023 Michael Smith * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -415,18 +415,17 @@ F( "static bool has_%s = false;", f->modname) } _( "") _( "static void initfeatures(void) {") - for (struct feature *f = features.x[0]; f; f = f->hdr.x[0]) { - featdfs(out, f); - } + for (struct feature *f = features.x[0]; f; f = f->hdr.x[0]) featdfs(out, f); _( "") // note: old success message is moved in here, to get the ordering right -_( " con_colourmsg(RGBA(64, 255, 64, 255),") +_( " con_colourmsg(&(struct rgba){64, 255, 64, 255},") _( " LONGNAME \" v\" VERSION \" successfully loaded\");") -_( " con_colourmsg(RGBA(255, 255, 255, 255), \" for game \");") -_( " con_colourmsg(RGBA(0, 255, 255, 255), \"%s\\n\", gameinfo_title);") -_( " struct con_colour white = {255, 255, 255, 255};") -_( " struct con_colour green = {128, 255, 128, 255};") -_( " struct con_colour red = {255, 128, 128, 255};") +_( " con_colourmsg(&(struct rgba){255, 255, 255, 255}, \" for game \");") +_( " con_colourmsg(&(struct rgba){0, 255, 255, 255}, \"%s\\n\", ") +_( " gameinfo_title);") +_( " struct rgba white = {255, 255, 255, 255};") +_( " struct rgba green = {128, 255, 128, 255};") +_( " struct rgba red = {255, 128, 128, 255};") _( " con_colourmsg(&white, \"---- List of plugin features ---\\n\");"); for (const struct feature *f = features_bydesc.x[0]; f; f = f->hdr_bydesc.x[0]) { -- cgit v1.2.3