From a093e6af9783e4c1cb3cc3aabb9ef50b5324a36d Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Thu, 23 Feb 2012 09:33:04 +0900 Subject: [PATCH] Move palette setting into viddef_t. --- include/QF/vid.h | 1 + include/vid_internal.h | 1 - libs/video/renderer/sw/draw.c | 2 +- libs/video/renderer/sw/vid_common_sw.c | 6 ------ libs/video/renderer/sw32/draw.c | 2 +- libs/video/renderer/sw32/vid_common_sw32.c | 6 ------ 6 files changed, 3 insertions(+), 15 deletions(-) diff --git a/include/QF/vid.h b/include/QF/vid.h index 87770d863..2575c4546 100644 --- a/include/QF/vid.h +++ b/include/QF/vid.h @@ -68,6 +68,7 @@ typedef struct { void (*flush_caches)(void); void (*init_caches)(void *cache, int size); void (*do_screen_buffer)(void); + void (*set_palette)(const byte *palette); void (*end_rendering)(void); void *(*load_library)(void); diff --git a/include/vid_internal.h b/include/vid_internal.h index cb8107c67..892e1227f 100644 --- a/include/vid_internal.h +++ b/include/vid_internal.h @@ -13,7 +13,6 @@ extern unsigned short sw32_8to16table[256]; void VID_GetWindowSize (int def_w, int def_h); void VID_SetPalette (unsigned char *palette); -void VID_ShiftPalette (unsigned char *palette); void VID_InitGamma (unsigned char *); qboolean VID_SetGamma (double); void VID_UpdateGamma (struct cvar_s *); diff --git a/libs/video/renderer/sw/draw.c b/libs/video/renderer/sw/draw.c index 31bb38b3d..0ce7bbf14 100644 --- a/libs/video/renderer/sw/draw.c +++ b/libs/video/renderer/sw/draw.c @@ -760,5 +760,5 @@ Draw_BlendScreen (quat_t color) newpal[2] = vid.gammatable[b]; newpal += 3; } - VID_ShiftPalette (pal); + vid.set_palette (pal); } diff --git a/libs/video/renderer/sw/vid_common_sw.c b/libs/video/renderer/sw/vid_common_sw.c index ec40d1b20..2038041c0 100644 --- a/libs/video/renderer/sw/vid_common_sw.c +++ b/libs/video/renderer/sw/vid_common_sw.c @@ -103,9 +103,3 @@ VID_InitBuffers (void) if (viddef.init_caches) viddef.init_caches (viddef.surfcache, cachesize); } - -void -VID_ShiftPalette (unsigned char *p) -{ - VID_SetPalette (p); -} diff --git a/libs/video/renderer/sw32/draw.c b/libs/video/renderer/sw32/draw.c index bc236db6b..e854c583e 100644 --- a/libs/video/renderer/sw32/draw.c +++ b/libs/video/renderer/sw32/draw.c @@ -1234,7 +1234,7 @@ sw32_Draw_BlendScreen (quat_t color) newpal[2] = vid.gammatable[b]; newpal += 3; } - VID_ShiftPalette (pal); + vid.set_palette (pal); } break; case 2: diff --git a/libs/video/renderer/sw32/vid_common_sw32.c b/libs/video/renderer/sw32/vid_common_sw32.c index 82224fd6b..eff0bf570 100644 --- a/libs/video/renderer/sw32/vid_common_sw32.c +++ b/libs/video/renderer/sw32/vid_common_sw32.c @@ -267,9 +267,3 @@ VID_InitBuffers (void) if (vid.init_caches) vid.init_caches (vid.surfcache, cachesize); } - -void -VID_ShiftPalette (unsigned char *p) -{ - VID_SetPalette (p); -}