summaryrefslogtreecommitdiff
path: root/src/ui_script.c
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2011-03-25 19:59:39 +0300
committerAndrey Nazarov <skuller@skuller.net>2011-03-26 14:43:07 +0300
commitbc9ae76c1f5c91810cd36e5d19ccad3790b35715 (patch)
tree2c90fa2b993f10bc3924f53ea2fded0c8824d00c /src/ui_script.c
parente7a0d43b36389b2a0304b30963b8db18517fd8e6 (diff)
Clean up and fix 32-bit color API.
Make color_t a union to work around aliasing issues. Get rid of FastColorCopy macro in favor of direct assignment. Get rid of DRAW_COLOR_* macros in favor of separate APIs for clearing and setting 32-bit color and alpha values. Rename R_DrawFill/R_DrawFillEx into R_DrawFill8/R_DrawFill32 for consistency. Remove unused fields from laser_t struct. Fix 32-bit particles fading out too soon. Fix console text drawing with software renderer. Fix possible SCR_ParseColor buffer overflow.
Diffstat (limited to 'src/ui_script.c')
-rw-r--r--src/ui_script.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/ui_script.c b/src/ui_script.c
index e656471..772073b 100644
--- a/src/ui_script.c
+++ b/src/ui_script.c
@@ -312,9 +312,9 @@ static void Parse_Blank( menuFrameWork_t *menu ) {
static void Parse_Background( menuFrameWork_t *menu ) {
char *s = Cmd_Argv( 1 );
- if( SCR_ParseColor( s, menu->color ) ) {
+ if( SCR_ParseColor( s, &menu->color ) ) {
menu->image = 0;
- if( menu->color[3] != 255 ) {
+ if( menu->color.u8[3] != 255 ) {
menu->transparent = qtrue;
}
} else {
@@ -335,13 +335,13 @@ static void Parse_Color( void ) {
c = Cmd_Argv( 2 );
if( !strcmp( s, "normal" ) ) {
- SCR_ParseColor( c, uis.color.normal );
+ SCR_ParseColor( c, &uis.color.normal );
} else if( !strcmp( s, "active" ) ) {
- SCR_ParseColor( c, uis.color.active );
+ SCR_ParseColor( c, &uis.color.active );
} else if( !strcmp( s, "selection" ) ) {
- SCR_ParseColor( c, uis.color.selection );
+ SCR_ParseColor( c, &uis.color.selection );
} else if( !strcmp( s, "disabled" ) ) {
- SCR_ParseColor( c, uis.color.disabled );
+ SCR_ParseColor( c, &uis.color.disabled );
} else {
Com_Printf( "Unknown state '%s'\n", s );
}
@@ -473,7 +473,7 @@ static qboolean Parse_File( const char *path, int depth ) {
menu->pop = Menu_Pop;
menu->free = Menu_Free;
menu->image = uis.backgroundHandle;
- FastColorCopy( uis.color.background, menu->color );
+ menu->color.u32 = uis.color.background.u32;
} else if( !strcmp( cmd, "include" ) ) {
char *s = Cmd_Argv( 1 );
if( !*s ) {
@@ -490,7 +490,7 @@ static qboolean Parse_File( const char *path, int depth ) {
} else if( !strcmp( cmd, "background" ) ) {
char *s = Cmd_Argv( 1 );
- if( SCR_ParseColor( s, uis.color.background ) ) {
+ if( SCR_ParseColor( s, &uis.color.background ) ) {
uis.backgroundHandle = 0;
} else {
uis.backgroundHandle = R_RegisterPic( s );