-
-
Notifications
You must be signed in to change notification settings - Fork 73
Closed
Labels
Description
There are a lot of parameters that go into libtcod's printing API and there are many different functions handle the different combinations them. I'd like to replace all these functions with a struct which contains any relevant arguments as parameters.
I'll be versioning these to preserve my sanity.
typedef struct TCOD_PrintParams1 {
...
} TCOD_PrintParams1;
int TCOD_printf_1(TCOD_Console* console, const TCOD_PrintParams1* params, const char* fmt, ...);
int TCOD_printn_1(TCOD_Console* console, const TCOD_PrintParams1* params, int n, const char* str);
int TCOD_vprintf_1(TCOD_Console* console, const TCOD_PrintParams1* params, const char* fmt, va_list args);const TCOD_PrintParams1 params = {
.x = 5;
.y = 5;
.fg = {255, 255, 0, 255};
}; // Yellow text with no background.
TCOD_printf_1(console, ¶ms, "%s", "Hello World");Having some kind of "style" struct for drawing functions and text might also help with this.
Reactions are currently unavailable