diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 362a3a071..6c785c0c5 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,3 +1,11 @@ +January 9, 2007 (Changes by Graf Zahl) +- Added Skulltag's REDMAP and GREENMAP. +- Fixed: The PlayerSpeedTrail must copy the player's scaling information + (from Skulltag) +- Added r_maxparticles CVAR from Skulltag. +- Changed PCX loader so that it always loads the last 768 bytes of 8 bit graphics + as a palette + January 8, 2007 - Added escape code support to the echo CCMD, so you can use colors with it. - Changed the color scheme for the startup log to light text on a dark diff --git a/src/g_shared/a_artifacts.cpp b/src/g_shared/a_artifacts.cpp index 8db392bf1..4f6be76ec 100644 --- a/src/g_shared/a_artifacts.cpp +++ b/src/g_shared/a_artifacts.cpp @@ -99,11 +99,27 @@ void APowerup::Tick () if (EffectTics > BLINKTHRESHOLD || (EffectTics & 8)) { - if (BlendColor == INVERSECOLOR) Owner->player->fixedcolormap = INVERSECOLORMAP; - else if (BlendColor == GOLDCOLOR) Owner->player->fixedcolormap = GOLDCOLORMAP; + if (BlendColor == INVERSECOLOR) + { + Owner->player->fixedcolormap = INVERSECOLORMAP; + } + else if (BlendColor == GOLDCOLOR) + { + Owner->player->fixedcolormap = GOLDCOLORMAP; + } + else if (BlendColor == REDCOLOR) + { + Owner->player->fixedcolormap = REDCOLORMAP; + } + else if (BlendColor == GREENCOLOR) + { + Owner->player->fixedcolormap = GREENCOLORMAP; + } } else if ((BlendColor == INVERSECOLOR && Owner->player->fixedcolormap == INVERSECOLORMAP) || - (BlendColor == GOLDCOLOR && Owner->player->fixedcolormap == GOLDCOLORMAP)) + (BlendColor == GOLDCOLOR && Owner->player->fixedcolormap == GOLDCOLORMAP) || + (BlendColor == REDCOLOR && Owner->player->fixedcolormap == REDCOLORMAP) || + (BlendColor == GREENCOLOR && Owner->player->fixedcolormap == GREENCOLORMAP)) { Owner->player->fixedcolormap = 0; } @@ -138,7 +154,11 @@ PalEntry APowerup::GetBlend () if (EffectTics <= BLINKTHRESHOLD && !(EffectTics & 8)) return 0; - if (BlendColor == INVERSECOLOR || BlendColor == GOLDCOLOR) + if (BlendColor == INVERSECOLOR || + BlendColor == GOLDCOLOR || + // [BC] HAX! + BlendColor == REDCOLOR || + BlendColor == GREENCOLOR) return 0; return BlendColor; @@ -1024,6 +1044,11 @@ void APowerSpeed::DoEffect () speedMo->sprite = Owner->sprite; speedMo->frame = Owner->frame; speedMo->floorclip = Owner->floorclip; + + // [BC] Also get the scale from the owner. + speedMo->scaleX = Owner->scaleX; + speedMo->scaleY = Owner->scaleY; + if (Owner == players[consoleplayer].camera && !(Owner->player->cheats & CF_CHASECAM)) { diff --git a/src/g_shared/a_artifacts.h b/src/g_shared/a_artifacts.h index 88b8fab92..b2c8ac76d 100644 --- a/src/g_shared/a_artifacts.h +++ b/src/g_shared/a_artifacts.h @@ -7,6 +7,10 @@ #define INVERSECOLOR 0x00345678 #define GOLDCOLOR 0x009abcde +// [BC] More hacks! +#define REDCOLOR 0x00beefee +#define GREENCOLOR 0x00beefad + #define STREAM_ENUM(e) \ inline FArchive &operator<< (FArchive &arc, e &i) \ { \ diff --git a/src/r_main.cpp b/src/r_main.cpp index 94945e024..7c0fbbeff 100644 --- a/src/r_main.cpp +++ b/src/r_main.cpp @@ -1160,6 +1160,14 @@ void R_SetupFrame (AActor *actor) fixedcolormap = InverseColormap; break; + case REDCOLORMAP: + fixedcolormap = RedColormap; + break; + + case GREENCOLORMAP: + fixedcolormap = GreenColormap; + break; + case GOLDCOLORMAP: fixedcolormap = GoldColormap; break; diff --git a/src/r_main.h b/src/r_main.h index c609dbf73..0ae0a8a04 100644 --- a/src/r_main.h +++ b/src/r_main.h @@ -91,6 +91,8 @@ extern bool r_dontmaplines; #define INVERSECOLORMAP 32 #define GOLDCOLORMAP 33 +#define REDCOLORMAP 34 +#define GREENCOLORMAP 35 // The size of a single colormap, in bits #define COLORMAPSHIFT 8 diff --git a/src/r_things.cpp b/src/r_things.cpp index 20b3b69fe..cc5b5cdf4 100644 --- a/src/r_things.cpp +++ b/src/r_things.cpp @@ -2119,15 +2119,34 @@ void R_DrawMasked (void) // [RH] Particle functions // +// [BC] Allow the maximum number of particles to be specified by a cvar (so people +// with lots of nice hardware can have lots of particles!). +CUSTOM_CVAR( Int, r_maxparticles, 4000, CVAR_ARCHIVE ) +{ + if ( self == 0 ) + self = 4000; + else if ( self < 100 ) + self = 100; + + if ( gamestate != GS_STARTUP ) + { + R_DeinitParticles( ); + R_InitParticles( ); + } +} + void R_InitParticles () { char *i; if ((i = Args.CheckValue ("-numparticles"))) NumParticles = atoi (i); - if (NumParticles == 0) - NumParticles = 4000; - else if (NumParticles < 100) + // [BC] Use r_maxparticles now. + else + NumParticles = r_maxparticles; + + // This should be good, but eh... + if ( NumParticles < 100 ) NumParticles = 100; Particles = new particle_t[NumParticles]; diff --git a/src/textures/pcxtexture.cpp b/src/textures/pcxtexture.cpp index c1f81d2b4..8842f426d 100644 --- a/src/textures/pcxtexture.cpp +++ b/src/textures/pcxtexture.cpp @@ -360,8 +360,9 @@ void FPCXTexture::MakeTexture() BYTE c; lump.Seek(-769, SEEK_END); lump >> c; - if (c !=0x0c) memcpy(PaletteMap, GrayMap, 256); // Fallback for files without palette - else for(int i=0;i<256;i++) + //if (c !=0x0c) memcpy(PaletteMap, GrayMap, 256); // Fallback for files without palette + //else + for(int i=0;i<256;i++) { BYTE r,g,b; lump >> r >> g >> b; diff --git a/src/thingdef.cpp b/src/thingdef.cpp index 6b65913c2..7e95504d3 100644 --- a/src/thingdef.cpp +++ b/src/thingdef.cpp @@ -3716,6 +3716,17 @@ static void PowerupColor (APowerupGiver *defaults, Baggage &bag) defaults->BlendColor = GOLDCOLOR; return; } + // [BC] Yay, more hacks. + else if ( SC_Compare( "REDMAP" )) + { + defaults->BlendColor = REDCOLOR; + return; + } + else if ( SC_Compare( "GREENMAP" )) + { + defaults->BlendColor = GREENCOLOR; + return; + } int c = V_GetColor(NULL, sc_String); r=RPART(c); diff --git a/src/v_palette.cpp b/src/v_palette.cpp index 94911cb4d..d2fcd38a7 100644 --- a/src/v_palette.cpp +++ b/src/v_palette.cpp @@ -61,6 +61,9 @@ FDynamicColormap NormalLight; FPalette GPalette; BYTE InverseColormap[NUMCOLORMAPS*256]; BYTE GoldColormap[NUMCOLORMAPS*256]; +// [BC] New Skulltag colormaps. +BYTE RedColormap[NUMCOLORMAPS*256]; +BYTE GreenColormap[NUMCOLORMAPS*256]; int Near255; static void FreeSpecialLights();; @@ -410,6 +413,28 @@ void InitPalette () *shade++ = ColorMatcher.Pick ( MIN (255, (intensity+intensity/2)>>8), intensity>>8, 0); } + + // [BC] Build the Doomsphere colormap. It is red! + shade = RedColormap; + for (c = 0; c < 256; c++) + { + intensity = ((GPalette.BaseColors[c].r * 77 + + GPalette.BaseColors[c].g * 143 + + GPalette.BaseColors[c].b * 37)); + *shade++ = ColorMatcher.Pick ( + MIN( 255, ( intensity + ( intensity / 2 )) >> 8 ), 0, 0 ); + } + + // [BC] Build the Guardsphere colormap. It's a greenish-white kind of thing. + shade = GreenColormap; + for (c = 0; c < 256; c++) + { + intensity = GPalette.BaseColors[c].r * 77 + + GPalette.BaseColors[c].g * 143 + + GPalette.BaseColors[c].b * 37; + *shade++ = ColorMatcher.Pick ( + MIN( 255, ( intensity + ( intensity / 2 )) >> 8 ), MIN( 255, ( intensity + ( intensity / 2 )) >> 8 ), intensity>>8 ); + } } extern "C" diff --git a/src/v_palette.h b/src/v_palette.h index ffd394db4..93d3e9eae 100644 --- a/src/v_palette.h +++ b/src/v_palette.h @@ -81,6 +81,9 @@ struct FDynamicColormap extern BYTE InverseColormap[NUMCOLORMAPS*256]; extern BYTE GoldColormap[NUMCOLORMAPS*256]; +// [BC] New Skulltag colormaps. +extern BYTE RedColormap[NUMCOLORMAPS*256]; +extern BYTE GreenColormap[NUMCOLORMAPS*256]; extern FPalette GPalette; extern "C" { extern FDynamicColormap NormalLight;