From 720747baef67cf18174924f864a2e88ad1e6fc79 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Fri, 17 Jul 2009 01:17:06 +0000 Subject: [PATCH] - Added a "BlueMap" for powerup colors. - Add the missing CF_WEAPONREADYALT and CF_WEAPONSWITCHOK flags. SVN r1723 (trunk) --- docs/rh-log.txt | 1 + src/d_player.h | 4 +++- src/g_shared/a_artifacts.cpp | 10 ++++++++-- src/g_shared/a_artifacts.h | 9 +++++---- src/r_main.cpp | 4 ++++ src/r_main.h | 1 + src/textures/multipatchtexture.cpp | 4 ++-- src/thingdef/thingdef_properties.cpp | 5 +++++ src/v_palette.cpp | 12 ++++++++++++ src/v_palette.h | 1 + 10 files changed, 42 insertions(+), 9 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 20d219f399..5257e777ff 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,5 @@ July 16, 2009 +- Added a "BlueMap" for powerup colors. - Added a NULL screen check when detaching HUD messages. - Added HotWax's A_SetArg. - Gez's patch for more A_WeaponReady flags: diff --git a/src/d_player.h b/src/d_player.h index 36881d58ba..1eacd7e397 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -184,7 +184,7 @@ typedef enum CF_INSTANTWEAPSWITCH= 1 << 11, // [RH] Switch weapons instantly CF_TOTALLYFROZEN = 1 << 12, // [RH] All players can do is press +use CF_PREDICTING = 1 << 13, // [RH] Player movement is being predicted - CF_WEAPONREADY = 1 << 14, // [RH] Weapon is in the ready state, so bob it when walking + CF_WEAPONREADY = 1 << 14, // [RH] Weapon is in the ready state and can fire its primary attack CF_TIMEFREEZE = 1 << 15, // Player has an active time freezer CF_DRAIN = 1 << 16, // Player owns a drain powerup CF_REGENERATION = 1 << 17, // Player owns a regeneration artifact @@ -195,6 +195,8 @@ typedef enum CF_EXTREMELYDEAD = 1 << 22, // [RH] Reliably let the status bar know about extreme deaths. CF_INFINITEAMMO = 1 << 23, // Player owns an infinite ammo artifact CF_WEAPONBOBBING = 1 << 24, // [HW] Bob weapon while the player is moving + CF_WEAPONREADYALT = 1 << 25, // Weapon can fire its secondary attack + CF_WEAPONSWITCHOK = 1 << 26, // It is okay to switch away from this weapon } cheat_t; #define WPIECE1 1 diff --git a/src/g_shared/a_artifacts.cpp b/src/g_shared/a_artifacts.cpp index 82bb719d74..d5dbfd3453 100644 --- a/src/g_shared/a_artifacts.cpp +++ b/src/g_shared/a_artifacts.cpp @@ -149,7 +149,8 @@ PalEntry APowerup::GetBlend () BlendColor == GOLDCOLOR || // [BC] HAX! BlendColor == REDCOLOR || - BlendColor == GREENCOLOR) + BlendColor == GREENCOLOR || + BlendColor == BLUECOLOR) return 0; return BlendColor; @@ -199,11 +200,16 @@ void APowerup::DoEffect () { Owner->player->fixedcolormap = GREENCOLORMAP; } + else if (BlendColor == BLUECOLOR) + { + Owner->player->fixedcolormap = BLUECOLORMAP; + } } else if ((BlendColor == INVERSECOLOR && Owner->player->fixedcolormap == INVERSECOLORMAP) || (BlendColor == GOLDCOLOR && Owner->player->fixedcolormap == GOLDCOLORMAP) || (BlendColor == REDCOLOR && Owner->player->fixedcolormap == REDCOLORMAP) || - (BlendColor == GREENCOLOR && Owner->player->fixedcolormap == GREENCOLORMAP)) + (BlendColor == GREENCOLOR && Owner->player->fixedcolormap == GREENCOLORMAP) || + (BlendColor == BLUECOLOR && Owner->player->fixedcolormap == BLUECOLORMAP)) { Owner->player->fixedcolormap = 0; } diff --git a/src/g_shared/a_artifacts.h b/src/g_shared/a_artifacts.h index c6a4098ab2..14b3123993 100644 --- a/src/g_shared/a_artifacts.h +++ b/src/g_shared/a_artifacts.h @@ -3,12 +3,13 @@ #include "a_pickups.h" -#define INVERSECOLOR 0x00345678 -#define GOLDCOLOR 0x009abcde +#define INVERSECOLOR 0x00345678 +#define GOLDCOLOR 0x009abcde // [BC] More hacks! -#define REDCOLOR 0x00beefee -#define GREENCOLOR 0x00beefad +#define REDCOLOR 0x00beefee +#define GREENCOLOR 0x00beefad +#define BLUECOLOR 0x00befeed class player_t; diff --git a/src/r_main.cpp b/src/r_main.cpp index 3ab29028ff..adac3dc19d 100644 --- a/src/r_main.cpp +++ b/src/r_main.cpp @@ -1170,6 +1170,10 @@ void R_SetupFrame (AActor *actor) fixedcolormap = GreenColormap; break; + case BLUECOLORMAP: + fixedcolormap = BlueColormap; + break; + case GOLDCOLORMAP: fixedcolormap = GoldColormap; break; diff --git a/src/r_main.h b/src/r_main.h index 515f77175d..0952219fe0 100644 --- a/src/r_main.h +++ b/src/r_main.h @@ -92,6 +92,7 @@ extern bool r_dontmaplines; #define GOLDCOLORMAP 33 #define REDCOLORMAP 34 #define GREENCOLORMAP 35 +#define BLUECOLORMAP 36 // The size of a single colormap, in bits #define COLORMAPSHIFT 8 diff --git a/src/textures/multipatchtexture.cpp b/src/textures/multipatchtexture.cpp index 995046936a..c186b63b94 100644 --- a/src/textures/multipatchtexture.cpp +++ b/src/textures/multipatchtexture.cpp @@ -416,11 +416,11 @@ const BYTE *FMultiPatchTexture::GetColumn (unsigned int column, const Span **spa //========================================================================== // -// FMultiPatchTexture :: GetColumn +// GetBlendMap // //========================================================================== -BYTE * GetBlendMap(PalEntry blend, BYTE *blendwork) +BYTE *GetBlendMap(PalEntry blend, BYTE *blendwork) { switch (blend.a==0 ? blend.r : -1) diff --git a/src/thingdef/thingdef_properties.cpp b/src/thingdef/thingdef_properties.cpp index be2c5e50e3..401b15914b 100644 --- a/src/thingdef/thingdef_properties.cpp +++ b/src/thingdef/thingdef_properties.cpp @@ -1570,6 +1570,11 @@ DEFINE_CLASS_PROPERTY_PREFIX(powerup, color, C_f, Inventory) *pBlendColor = GREENCOLOR; return; } + else if (!stricmp(name, "BLUEMAP")) + { + *pBlendColor = BLUECOLOR; + return; + } color = V_GetColor(NULL, name); } diff --git a/src/v_palette.cpp b/src/v_palette.cpp index 6306506f17..87a4f9177f 100644 --- a/src/v_palette.cpp +++ b/src/v_palette.cpp @@ -66,6 +66,7 @@ BYTE GoldColormap[256]; // [BC] New Skulltag colormaps. BYTE RedColormap[256]; BYTE GreenColormap[256]; +BYTE BlueColormap[256]; BYTE DesaturateColormap[31][256]; static void FreeSpecialLights();; @@ -435,6 +436,17 @@ void InitPalette () intensity>>8 ); } + // Build a blue colormap. + shade = BlueColormap; + for (c = 0; c < 256; c++) + { + intensity = ((GPalette.BaseColors[c].r * 77 + + GPalette.BaseColors[c].g * 143 + + GPalette.BaseColors[c].b * 37)); + shade[c] = ColorMatcher.Pick ( + MIN( 255, ( intensity + ( intensity / 2 )) >> 8 ), 0, 0 ); + } + // desaturated colormaps for(int m = 0; m < 31; m++) { diff --git a/src/v_palette.h b/src/v_palette.h index 0d6643645b..e723ba5c28 100644 --- a/src/v_palette.h +++ b/src/v_palette.h @@ -84,6 +84,7 @@ extern BYTE GoldColormap[256]; // [BC] New Skulltag colormaps. extern BYTE RedColormap[256]; extern BYTE GreenColormap[256]; +extern BYTE BlueColormap[256]; extern BYTE DesaturateColormap[31][256]; extern FPalette GPalette; extern "C" {