From 4667bfe46f65664cda4a6f9ba19c6c51201d2f16 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 22 Apr 2008 18:48:30 +0000 Subject: [PATCH] - Added translucent blending modes to FMultipatchTexture (not tested yet!) - Also changed all true color texture creation functions to use proper alpha values instead of inverted ones. - Changed FRemapTable so that all palette entries must contain proper alpha values. - Fixed: The F1 screen check in m_menu.cpp was missing a NULL pointer check. - Changed: The boss brain's explosions play weapons/rocklx which is an unlimited sound. This can become extremely loud. Replaced with a new sound which is just an alias to weapons/rocklx but has a limit of 4. SVN r932 (trunk) --- docs/rh-log.txt | 15 ++ src/g_doom/a_bossbrain.cpp | 1 + src/m_menu.cpp | 6 +- src/r_data.h | 5 +- src/r_defs.h | 2 +- src/r_translate.cpp | 13 +- src/textures/bitmap.cpp | 150 ++++++++++++++----- src/textures/bitmap.h | 54 ++++++- src/textures/jpegtexture.cpp | 2 +- src/textures/multipatchtexture.cpp | 59 ++++++-- src/textures/pcxtexture.cpp | 4 +- src/textures/pngtexture.cpp | 3 +- src/textures/texture.cpp | 12 +- src/textures/tgatexture.cpp | 4 +- src/thingdef/thingdef_properties.cpp | 4 +- src/version.h | 2 +- src/win32/fb_d3d9.cpp | 6 +- src/win32/i_input.cpp | 2 +- tools/updaterevision/updaterevision.vcproj | 158 ++++++++++----------- wadsrc/sndinfo.txt | 7 + 20 files changed, 351 insertions(+), 158 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index a79fcbc59..70f8914b3 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,3 +1,18 @@ +April 22, 2008 (Changes by Graf Zahl) +- Added translucent blending modes to FMultipatchTexture (not tested yet!) +- Also changed all true color texture creation functions to use proper alpha + values instead of inverted ones. +- Changed FRemapTable so that all palette entries must contain proper alpha + values. + +April 21, 2008 (Changes by Graf Zahl) +- Fixed: The F1 screen check in m_menu.cpp was missing a NULL pointer check. + +April 20, 2008 (Changes by Graf Zahl) +- Changed: The boss brain's explosions play weapons/rocklx which is an + unlimited sound. This can become extremely loud. Replaced with a new + sound which is just an alias to weapons/rocklx but has a limit of 4. + April 19, 2008 - Fixed: MugShotFrame::getTexture() allocated space for the sprite name that it never freed. I'm not sure it's a good assumption that 9 characters is diff --git a/src/g_doom/a_bossbrain.cpp b/src/g_doom/a_bossbrain.cpp index b8e33a44a..73d619bac 100644 --- a/src/g_doom/a_bossbrain.cpp +++ b/src/g_doom/a_bossbrain.cpp @@ -187,6 +187,7 @@ static void BrainishExplosion (fixed_t x, fixed_t y, fixed_t z) AActor *boom = Spawn("Rocket", x, y, z, NO_REPLACE); if (boom != NULL) { + boom->DeathSound = S_FindSound("misc/brainexplode"); boom->momz = pr_brainscream() << 9; boom->SetState (&ABossBrain::States[S_BRAINEXPLODE]); boom->effects = 0; diff --git a/src/m_menu.cpp b/src/m_menu.cpp index 2151a7d24..e3afe73c3 100644 --- a/src/m_menu.cpp +++ b/src/m_menu.cpp @@ -1464,7 +1464,7 @@ void M_DrawReadThis () else { // Did the mapper choose a custom help page via MAPINFO? - if (level.info->f1[0] != 0) + if ((level.info != NULL) && level.info->f1[0] != 0) { tex = TexMan.FindTexture(level.info->f1); } @@ -3513,7 +3513,7 @@ void M_Init (void) for (i = 0; i < 256; i++) { FireRemap.Remap[i] = ColorMatcher.Pick (i/2+32, 0, i/4); - FireRemap.Palette[i] = PalEntry(i/2+32, 0, i/4); + FireRemap.Palette[i] = PalEntry(255, i/2+32, 0, i/4); } } else @@ -3522,7 +3522,7 @@ void M_Init (void) for (i = 0; i < 256; ++i) { FireRemap.Remap[i] = ColorMatcher.Pick (i/4, i*13/40+7, i/4); - FireRemap.Palette[i] = PalEntry(i/4, i*13/40+7, i/4); + FireRemap.Palette[i] = PalEntry(255, i/4, i*13/40+7, i/4); } } } diff --git a/src/r_data.h b/src/r_data.h index 94ae3ab46..eb5a5ecff 100644 --- a/src/r_data.h +++ b/src/r_data.h @@ -107,16 +107,19 @@ protected: SWORD OriginX, OriginY; BYTE Rotate; bool textureOwned; + BYTE op; FRemapTable *Translation; PalEntry Blend; FTexture *Texture; + fixed_t Alpha; TexPart(); }; int NumParts; TexPart *Parts; - bool bRedirect; + bool bRedirect:1; + bool bTranslucentPatches:1; void MakeTexture (); diff --git a/src/r_defs.h b/src/r_defs.h index 3aa1319d0..ab96d5e22 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -797,7 +797,7 @@ public: virtual const BYTE *GetPixels () = 0; virtual int CopyTrueColorPixels(FBitmap *bmp, int x, int y, int rotate=0, FCopyInfo *inf = NULL); - int CopyTrueColorTranslated(FBitmap *bmp, int x, int y, int rotate, FRemapTable *remap); + int CopyTrueColorTranslated(FBitmap *bmp, int x, int y, int rotate, FRemapTable *remap, FCopyInfo *inf = NULL); virtual bool UseBasePalette(); virtual int GetSourceLump() { return -1; } diff --git a/src/r_translate.cpp b/src/r_translate.cpp index 153f0e819..04aa4f88e 100644 --- a/src/r_translate.cpp +++ b/src/r_translate.cpp @@ -160,9 +160,7 @@ void FRemapTable::Serialize(FArchive &arc) } for (int j = 0; j < NumEntries; ++j) { - arc << Palette[j].r - << Palette[j].g - << Palette[j].b; + arc << Palette[j]; } } @@ -179,6 +177,10 @@ void FRemapTable::MakeIdentity() { Palette[i] = GPalette.BaseColors[i]; } + for (i = 1; i < NumEntries; ++i) + { + Palette[i].a = 255; + } } bool FRemapTable::IsIdentity() const @@ -232,6 +234,7 @@ void FRemapTable::AddIndexRange(int start, int end, int pal1, int pal2) { Remap[start] = pal1; Palette[start] = GPalette.BaseColors[pal1]; + Palette[start].a = start==0? 0:255; return; } palcol = pal1 << FRACBITS; @@ -240,6 +243,7 @@ void FRemapTable::AddIndexRange(int start, int end, int pal1, int pal2) { Remap[i] = palcol >> FRACBITS; Palette[i] = GPalette.BaseColors[palcol >> FRACBITS]; + Palette[i].a = i==0? 0:255; } } @@ -278,6 +282,7 @@ void FRemapTable::AddColorRange(int start, int end, int _r1,int _g1, int _b1, in Remap[start] = ColorMatcher.Pick (r >> FRACBITS, g >> FRACBITS, b >> FRACBITS); Palette[start] = PalEntry(r >> FRACBITS, g >> FRACBITS, b >> FRACBITS); + Palette[start].a = start==0? 0:255; } else { @@ -288,7 +293,7 @@ void FRemapTable::AddColorRange(int start, int end, int _r1,int _g1, int _b1, in { Remap[i] = ColorMatcher.Pick (r >> FRACBITS, g >> FRACBITS, b >> FRACBITS); - Palette[i] = PalEntry(r >> FRACBITS, g >> FRACBITS, b >> FRACBITS); + Palette[i] = PalEntry(start==0? 0:255, r >> FRACBITS, g >> FRACBITS, b >> FRACBITS); r += rs; g += gs; b += bs; diff --git a/src/textures/bitmap.cpp b/src/textures/bitmap.cpp index 6fbc9824a..25bfdc4b2 100644 --- a/src/textures/bitmap.cpp +++ b/src/textures/bitmap.cpp @@ -233,7 +233,7 @@ void iCopyColors(BYTE *pout, const BYTE *pin, int count, int step, FCopyInfo *in typedef void (*CopyFunc)(BYTE *pout, const BYTE *pin, int count, int step, FCopyInfo *inf); -static CopyFunc copyfuncs[9]= +static const CopyFunc copyfuncs[][9]={ { iCopyColors, iCopyColors, @@ -244,7 +244,74 @@ static CopyFunc copyfuncs[9]= iCopyColors, iCopyColors, iCopyColors - }; + }, + { + iCopyColors, + iCopyColors, + iCopyColors, + iCopyColors, + iCopyColors, + iCopyColors, + iCopyColors, + iCopyColors, + iCopyColors + }, + { + iCopyColors, + iCopyColors, + iCopyColors, + iCopyColors, + iCopyColors, + iCopyColors, + iCopyColors, + iCopyColors, + iCopyColors + }, + { + iCopyColors, + iCopyColors, + iCopyColors, + iCopyColors, + iCopyColors, + iCopyColors, + iCopyColors, + iCopyColors, + iCopyColors + }, + { + iCopyColors, + iCopyColors, + iCopyColors, + iCopyColors, + iCopyColors, + iCopyColors, + iCopyColors, + iCopyColors, + iCopyColors + }, + { + iCopyColors, + iCopyColors, + iCopyColors, + iCopyColors, + iCopyColors, + iCopyColors, + iCopyColors, + iCopyColors, + iCopyColors + }, + { + iCopyColors, + iCopyColors, + iCopyColors, + iCopyColors, + iCopyColors, + iCopyColors, + iCopyColors, + iCopyColors, + iCopyColors + }, +}; //=========================================================================== // @@ -373,13 +440,55 @@ void FBitmap::CopyPixelDataRGB(int originx, int originy, const BYTE *patch, int if (ClipCopyPixelRect(Width, Height, originx, originy, patch, srcwidth, srcheight, step_x, step_y, rotate)) { BYTE *buffer = data + 4 * originx + Pitch * originy; + int op = inf==NULL? OP_COPY : inf->op; for (int y=0;y +void iCopyPaletted(BYTE *buffer, const BYTE * patch, int srcwidth, int srcheight, int Pitch, + int step_x, int step_y, int rotate, PalEntry * palette, FCopyInfo *inf) +{ + int x,y,pos; + + for (y=0;y, + iCopyPaletted, + iCopyPaletted, + iCopyPaletted, + iCopyPaletted, + iCopyPaletted, + iCopyPaletted, +}; + //=========================================================================== // // Paletted to True Color texture copy function @@ -388,8 +497,6 @@ void FBitmap::CopyPixelDataRGB(int originx, int originy, const BYTE *patch, int void FBitmap::CopyPixelData(int originx, int originy, const BYTE * patch, int srcwidth, int srcheight, int step_x, int step_y, int rotate, PalEntry * palette, FCopyInfo *inf) { - int x,y,pos; - if (ClipCopyPixelRect(Width, Height, originx, originy, patch, srcwidth, srcheight, step_x, step_y, rotate)) { BYTE *buffer = data + 4*originx + Pitch*originy; @@ -397,39 +504,12 @@ void FBitmap::CopyPixelData(int originx, int originy, const BYTE * patch, int sr if (inf && inf->blend) { - // The palette's alpha is inverted so in order to use the - // True Color copy functions it has to be inverted temporarily. - memcpy(penew, palette, 4*256); - for(int i=0;i<256;i++) penew[i].a = 255-penew[i].a; - copyfuncs[CF_PalEntry]((BYTE*)penew, (BYTE*)penew, 256, 4, inf); - for(int i=0;i<256;i++) penew[i].a = 255-penew[i].a; + iCopyColors((BYTE*)penew, (const BYTE*)palette, 256, 4, inf); palette = penew; } - - for (y=0;y(buffer[pos+3] + (( 255-buffer[pos+3]) * (255-palette[v].a))/255, 0, 255); - } - } - } + copypalettedfuncs[inf==NULL? OP_COPY : inf->op](buffer, patch, srcwidth, srcheight, Pitch, + step_x, step_y, rotate, palette, inf); } } diff --git a/src/textures/bitmap.h b/src/textures/bitmap.h index a63182032..75401547f 100644 --- a/src/textures/bitmap.h +++ b/src/textures/bitmap.h @@ -37,6 +37,7 @@ #define __BITMAP_H__ #include "doomtype.h" +#include "templates.h" struct FCopyInfo; @@ -272,14 +273,24 @@ enum EBlend BLEND_OVERLAY = -2, }; +enum ECopyOp +{ + OP_COPY, + OP_BLEND, + OP_ADD, + OP_SUBTRACT, + OP_REVERSESUBTRACT, + OP_MODULATE, + OP_COPYALPHA +}; + struct FCopyInfo { - //ECopyOp op; + ECopyOp op; EBlend blend; fixed_t blendcolor[4]; -// fixed_t alpha; -// fixed_t invalpha; - + fixed_t alpha; + fixed_t invalpha; }; struct bCopy @@ -288,6 +299,41 @@ struct bCopy static __forceinline void OpA(BYTE &d, BYTE s, FCopyInfo *i) { d = s; } }; +struct bBlend +{ + static __forceinline void OpC(BYTE &d, BYTE s, BYTE a, FCopyInfo *i) { d = (d*i->invalpha + s*i->alpha) >> FRACBITS; } + static __forceinline void OpA(BYTE &d, BYTE s, FCopyInfo *i) { d = s; } +}; + +struct bAdd +{ + static __forceinline void OpC(BYTE &d, BYTE s, BYTE a, FCopyInfo *i) { d = MIN((d*FRACUNIT + s*i->alpha) >> FRACBITS, 255); } + static __forceinline void OpA(BYTE &d, BYTE s, FCopyInfo *i) { d = s; } +}; + +struct bSubtract +{ + static __forceinline void OpC(BYTE &d, BYTE s, BYTE a, FCopyInfo *i) { d = MAX((d*FRACUNIT - s*i->alpha) >> FRACBITS, 0); } + static __forceinline void OpA(BYTE &d, BYTE s, FCopyInfo *i) { d = s; } +}; + +struct bReverseSubtract +{ + static __forceinline void OpC(BYTE &d, BYTE s, BYTE a, FCopyInfo *i) { d = MAX((-d*FRACUNIT + s*i->alpha) >> FRACBITS, 0); } + static __forceinline void OpA(BYTE &d, BYTE s, FCopyInfo *i) { d = s; } +}; + +struct bModulate +{ + static __forceinline void OpC(BYTE &d, BYTE s, BYTE a, FCopyInfo *i) { d = (s*d)/255; } + static __forceinline void OpA(BYTE &d, BYTE s, FCopyInfo *i) { d = s; } +}; + +struct bCopyAlpha +{ + static __forceinline void OpC(BYTE &d, BYTE s, BYTE a, FCopyInfo *i) { d = (s*a + d*(255-a))/255; } + static __forceinline void OpA(BYTE &d, BYTE s, FCopyInfo *i) { d = s; } +}; diff --git a/src/textures/jpegtexture.cpp b/src/textures/jpegtexture.cpp index 9c6f9ba95..599e70eed 100644 --- a/src/textures/jpegtexture.cpp +++ b/src/textures/jpegtexture.cpp @@ -381,7 +381,7 @@ int FJPEGTexture::CopyTrueColorPixels(FBitmap *bmp, int x, int y, int rotate, FC break; case JCS_GRAYSCALE: - for(int i=0;i<256;i++) pe[i]=PalEntry(0,i,i,i); // default to a gray map + for(int i=0;i<256;i++) pe[i]=PalEntry(255,i,i,i); // default to a gray map bmp->CopyPixelData(x, y, buff, cinfo.output_width, cinfo.output_height, 1, cinfo.output_width, rotate, pe, inf); break; diff --git a/src/textures/multipatchtexture.cpp b/src/textures/multipatchtexture.cpp index 0d4fd02a1..2a0a9754b 100644 --- a/src/textures/multipatchtexture.cpp +++ b/src/textures/multipatchtexture.cpp @@ -66,7 +66,7 @@ //========================================================================== FMultiPatchTexture::FMultiPatchTexture (const void *texdef, FPatchLookup *patchlookup, int maxpatchnum, bool strife, int deflumpnum) -: Pixels (0), Spans(0), Parts(0), bRedirect(false) +: Pixels (0), Spans(0), Parts(0), bRedirect(false), bTranslucentPatches(false) { union { @@ -361,15 +361,38 @@ void FMultiPatchTexture::MakeTexture () Pixels = new BYTE[numpix]; memset (Pixels, 0, numpix); - for (int i = 0; i < NumParts; ++i) + if (!bTranslucentPatches) { - BYTE *trans = Parts[i].Translation? Parts[i].Translation->Remap : NULL; - if (Parts[i].Blend != BLEND_NONE) + for (int i = 0; i < NumParts; ++i) { - trans = GetBlendMap(Parts[i].Blend, blendwork); + BYTE *trans = Parts[i].Translation? Parts[i].Translation->Remap : NULL; + if (Parts[i].Blend != BLEND_NONE) + { + trans = GetBlendMap(Parts[i].Blend, blendwork); + } + Parts[i].Texture->CopyToBlock (Pixels, Width, Height, + Parts[i].OriginX, Parts[i].OriginY, Parts[i].Rotate, trans); } - Parts[i].Texture->CopyToBlock (Pixels, Width, Height, - Parts[i].OriginX, Parts[i].OriginY, Parts[i].Rotate, trans); + } + else + { + // In case there are translucent patches let's do the composition in + // True color to keep as much precision as possible before downconverting to the palette. + BYTE *buffer = new BYTE[Width * Height * 4]; + FillBuffer(buffer, Width * 4, Height, TEX_RGB); + for(int y = 0; y < Height; y++) + { + BYTE *in = buffer + Width * y * 4; + BYTE *out = Pixels + y; + for (int x = 0; x < Width; x--) + { + // I don't know if this is precise enough... + *out = RGB32k[in[2]>>3][in[1]>>3][in[0]>>3]; + out += Height; + in += 4; + } + } + delete [] buffer; } } @@ -393,10 +416,13 @@ int FMultiPatchTexture::CopyTrueColorPixels(FBitmap *bmp, int x, int y, int rota if (!Parts[i].Texture->bComplex || inf == NULL) { memset (&info, 0, sizeof (info)); + info.alpha = Parts[i].Alpha; + info.invalpha = FRACUNIT - info.alpha; + info.op = ECopyOp(Parts[i].op); if (Parts[i].Translation != NULL) { // Using a translation forces downconversion to the base palette - ret = Parts[i].Texture->CopyTrueColorTranslated(bmp, x+Parts[i].OriginX, y+Parts[i].OriginY, Parts[i].Rotate, Parts[i].Translation); + ret = Parts[i].Texture->CopyTrueColorTranslated(bmp, x+Parts[i].OriginX, y+Parts[i].OriginY, Parts[i].Rotate, Parts[i].Translation, &info); } else { @@ -626,6 +652,8 @@ FMultiPatchTexture::TexPart::TexPart() Texture = NULL; Translation = NULL; Blend = 0; + Alpha = FRACUNIT; + op = OP_COPY; } //========================================================================== @@ -980,6 +1008,19 @@ void FMultiPatchTexture::ParsePatch(FScanner &sc, TexPart & part) else part.Blend.a = 255; bComplex = true; } + else if (sc.Compare("alpha")) + { + sc.MustGetFloat(); + part.Alpha = clamp(FLOAT2FIXED(sc.Float), 0, FRACUNIT); + // bComplex is not set because it is only needed when the style is not OP_COPY. + } + else if (sc.Compare("style")) + { + static const char *styles[] = {"copy", "blend", "add", "subtract", "reversesubtract", "modulate", "copyalpha", NULL }; + sc.MustGetString(); + part.op = sc.MustMatchString(styles); + bTranslucentPatches = bComplex = (part.op != OP_COPY); + } } } if (Mirror & 2) @@ -995,7 +1036,7 @@ void FMultiPatchTexture::ParsePatch(FScanner &sc, TexPart & part) FMultiPatchTexture::FMultiPatchTexture (FScanner &sc, int usetype) -: Pixels (0), Spans(0), Parts(0), bRedirect(false) +: Pixels (0), Spans(0), Parts(0), bRedirect(false), bTranslucentPatches(false) { TArray parts; diff --git a/src/textures/pcxtexture.cpp b/src/textures/pcxtexture.cpp index cd248deb8..0a710a423 100644 --- a/src/textures/pcxtexture.cpp +++ b/src/textures/pcxtexture.cpp @@ -462,13 +462,13 @@ int FPCXTexture::CopyTrueColorPixels(FBitmap *bmp, int x, int y, int rotate, FCo c=0x0c; // Apparently there's many non-compliant PCXs out there... if (c !=0x0c) { - for(int i=0;i<256;i++) pe[i]=PalEntry(0,i,i,i); // default to a gray map + for(int i=0;i<256;i++) pe[i]=PalEntry(255,i,i,i); // default to a gray map } else for(int i=0;i<256;i++) { BYTE r,g,b; lump >> r >> g >> b; - pe[i] = PalEntry(r,g,b); + pe[i] = PalEntry(255, r,g,b); } lump.Seek(sizeof(header), SEEK_SET); ReadPCX8bits (Pixels, lump, &header); diff --git a/src/textures/pngtexture.cpp b/src/textures/pngtexture.cpp index 8e36c89d1..55f1908f4 100644 --- a/src/textures/pngtexture.cpp +++ b/src/textures/pngtexture.cpp @@ -511,7 +511,7 @@ int FPNGTexture::CopyTrueColorPixels(FBitmap *bmp, int x, int y, int rotate, FCo } lump->Seek (33, SEEK_SET); - for(int i=0;i<256;i++) pe[i]=PalEntry(0,i,i,i); // default to a gray map + for(int i=0;i<256;i++) pe[i]=PalEntry(255,i,i,i); // default to a gray map (*lump) >> len >> id; while (id != MAKE_ID('I','D','A','T') && id != MAKE_ID('I','E','N','D')) @@ -534,7 +534,6 @@ int FPNGTexture::CopyTrueColorPixels(FBitmap *bmp, int x, int y, int rotate, FCo for(DWORD i=0;i> pe[i].a; - pe[i].a=255-pe[i].a; // use inverse alpha so the default palette can be used unchanged if (pe[i].a!=0 && pe[i].a!=255) transpal = true; } break; diff --git a/src/textures/texture.cpp b/src/textures/texture.cpp index 8bea144c7..6fde43848 100644 --- a/src/textures/texture.cpp +++ b/src/textures/texture.cpp @@ -483,20 +483,16 @@ void FTexture::FillBuffer(BYTE *buff, int pitch, int height, FTextureFormat fmt) int FTexture::CopyTrueColorPixels(FBitmap *bmp, int x, int y, int rotate, FCopyInfo *inf) { PalEntry *palette = screen->GetPalette(); - palette[0].a=255; // temporarily modify the first color's alpha + for(int i=1;i<256;i++) palette[i].a = 255; // set proper alpha values bmp->CopyPixelData(x, y, GetPixels(), Width, Height, Height, 1, rotate, palette, inf); - - palette[0].a=0; + for(int i=1;i<256;i++) palette[i].a = 0; return 0; } -int FTexture::CopyTrueColorTranslated(FBitmap *bmp, int x, int y, int rotate, FRemapTable *remap) +int FTexture::CopyTrueColorTranslated(FBitmap *bmp, int x, int y, int rotate, FRemapTable *remap, FCopyInfo *inf) { PalEntry *palette = remap->Palette; - palette[0].a=255; // temporarily modify the first color's alpha - bmp->CopyPixelData(x, y, GetPixels(), Width, Height, Height, 1, rotate, palette); - - palette[0].a=0; + bmp->CopyPixelData(x, y, GetPixels(), Width, Height, Height, 1, rotate, palette, inf); return 0; } diff --git a/src/textures/tgatexture.cpp b/src/textures/tgatexture.cpp index cf5446293..97fe0455e 100644 --- a/src/textures/tgatexture.cpp +++ b/src/textures/tgatexture.cpp @@ -436,7 +436,7 @@ int FTGATexture::CopyTrueColorPixels(FBitmap *bmp, int x, int y, int rotate, FCo r=g=b=a=0; break; } - pe[i] = PalEntry(255-a, r, g, b); + pe[i] = PalEntry(a, r, g, b); } } @@ -506,7 +506,7 @@ int FTGATexture::CopyTrueColorPixels(FBitmap *bmp, int x, int y, int rotate, FCo switch (hdr.bpp) { case 8: - for(int i=0;i<256;i++) pe[i]=PalEntry(0,i,i,i); // gray map + for(int i=0;i<256;i++) pe[i]=PalEntry(255,i,i,i); // gray map bmp->CopyPixelData(x, y, ptr, Width, Height, step_x, Pitch, rotate, pe, inf); break; diff --git a/src/thingdef/thingdef_properties.cpp b/src/thingdef/thingdef_properties.cpp index 1501edfaa..c96991dfd 100644 --- a/src/thingdef/thingdef_properties.cpp +++ b/src/thingdef/thingdef_properties.cpp @@ -1283,11 +1283,11 @@ static void ActorStates (FScanner &sc, AActor *defaults, Baggage &bag) static void ActorRenderStyle (FScanner &sc, AActor *defaults, Baggage &bag) { static const char * renderstyles[]={ - "NONE","NORMAL","FUZZY","SOULTRANS","OPTFUZZY","STENCIL","TRANSLUCENT", "ADD",NULL}; + "NONE","NORMAL","FUZZY","SOULTRANS","OPTFUZZY","STENCIL","TRANSLUCENT", "ADD","SHADED", NULL}; static const int renderstyle_values[]={ STYLE_None, STYLE_Normal, STYLE_Fuzzy, STYLE_SoulTrans, STYLE_OptFuzzy, - STYLE_TranslucentStencil, STYLE_Translucent, STYLE_Add}; + STYLE_TranslucentStencil, STYLE_Translucent, STYLE_Add, STYLE_Shaded}; sc.MustGetString(); defaults->RenderStyle = LegacyRenderStyles[renderstyle_values[sc.MustMatchString(renderstyles)]]; diff --git a/src/version.h b/src/version.h index c98b5fea8..61edd2e90 100644 --- a/src/version.h +++ b/src/version.h @@ -75,7 +75,7 @@ // SAVESIG should match SAVEVER. // MINSAVEVER is the minimum level snapshot version that can be loaded. -#define MINSAVEVER 922 +#define MINSAVEVER 932 #if SVN_REVISION_NUMBER < MINSAVEVER // Never write a savegame with a version lower than what we need diff --git a/src/win32/fb_d3d9.cpp b/src/win32/fb_d3d9.cpp index 3a34231cc..4fae6a995 100644 --- a/src/win32/fb_d3d9.cpp +++ b/src/win32/fb_d3d9.cpp @@ -2086,13 +2086,13 @@ bool D3DPal::Update() for (i = 0; i < skipat; ++i) { - buff[i] = D3DCOLOR_ARGB(i == 0 ? 0 : 255, pal[i].r, pal[i].g, pal[i].b); + buff[i] = D3DCOLOR_ARGB(pal[i].a, pal[i].r, pal[i].g, pal[i].b); } for (++i; i < Remap->NumEntries; ++i) { - buff[i] = D3DCOLOR_ARGB(255, pal[i-1].r, pal[i-1].g, pal[i-1].b); + buff[i] = D3DCOLOR_ARGB(pal[i].a, pal[i-1].r, pal[i-1].g, pal[i-1].b); } - BorderColor = D3DCOLOR_ARGB(255, pal[i-1].r, pal[i-1].g, pal[i-1].b); + BorderColor = D3DCOLOR_ARGB(pal[i].a, pal[i-1].r, pal[i-1].g, pal[i-1].b); Tex->UnlockRect(0); return true; diff --git a/src/win32/i_input.cpp b/src/win32/i_input.cpp index 53973dea5..13ef6b632 100644 --- a/src/win32/i_input.cpp +++ b/src/win32/i_input.cpp @@ -746,7 +746,7 @@ LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { SetPriorityClass (GetCurrentProcess (), IDLE_PRIORITY_CLASS); } - SetSoundPaused (wParam); + //SetSoundPaused (wParam); break; case WM_WTSSESSION_CHANGE: diff --git a/tools/updaterevision/updaterevision.vcproj b/tools/updaterevision/updaterevision.vcproj index f3c1ebdf7..c41849593 100644 --- a/tools/updaterevision/updaterevision.vcproj +++ b/tools/updaterevision/updaterevision.vcproj @@ -1,7 +1,7 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + +