diff --git a/docs/rh-log.txt b/docs/rh-log.txt index f10a6faea..fb7d2acc2 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,3 +1,9 @@ +February 8, 2008 +- Fixed: D_ReadUserInfoString() parsed the final element of a compact string + as the empty string. Since that was the player class, this meant that any + games with more than one class would pick a random class in multiplayer. +- Fixed: FCanvasTexture::RenderView() should not have color 0 in its output. + February 5, 2008 - Updated the GCC-targeted makefiles to turn off two optimizations that cause fmopl.cpp to compile incorrectly: tree-dominator-opts and tree-fre diff --git a/src/d_netinfo.cpp b/src/d_netinfo.cpp index 4b42d0f26..db91e781e 100644 --- a/src/d_netinfo.cpp +++ b/src/d_netinfo.cpp @@ -642,7 +642,7 @@ void D_ReadUserInfoStrings (int i, BYTE **stream, bool update) if (compact) { - value = D_UnescapeUserInfo(ptr, breakpt - ptr); + value = D_UnescapeUserInfo(ptr, breakpt != NULL ? breakpt - ptr : strlen(ptr)); infotype++; } else @@ -676,7 +676,6 @@ void D_ReadUserInfoStrings (int i, BYTE **stream, bool update) infotype = j; } } - switch (infotype) { case INFO_Autoaim: { @@ -749,7 +748,7 @@ void D_ReadUserInfoStrings (int i, BYTE **stream, bool update) break; case INFO_NeverSwitchOnPickup: - if (*value >= '0' && *value <= '9') + if (value[0] >= '0' && value[0] <= '9') { info->neverswitch = atoi (value) ? true : false; } diff --git a/src/r_defs.h b/src/r_defs.h index d667b236a..ad58b39e5 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -741,7 +741,7 @@ protected: static void FlipSquareBlock (BYTE *block, int x, int y); static void FlipSquareBlockRemap (BYTE *block, int x, int y, const BYTE *remap); static void FlipNonSquareBlock (BYTE *blockto, const BYTE *blockfrom, int x, int y, int srcpitch); - static void FlipNonSquareBlockRemap (BYTE *blockto, const BYTE *blockfrom, int x, int y, const BYTE *remap); + static void FlipNonSquareBlockRemap (BYTE *blockto, const BYTE *blockfrom, int x, int y, int srcpitch, const BYTE *remap); friend class D3DTex; }; diff --git a/src/textures/canvastexture.cpp b/src/textures/canvastexture.cpp index 25fbeb1f3..988610e6e 100644 --- a/src/textures/canvastexture.cpp +++ b/src/textures/canvastexture.cpp @@ -154,11 +154,11 @@ void FCanvasTexture::RenderView (AActor *viewpoint, int fov) R_SetFOV (savedfov); if (Pixels == Canvas->GetBuffer()) { - FlipSquareBlock (Pixels, Width, Height); + FlipSquareBlockRemap (Pixels, Width, Height, GPalette.Remap); } else { - FlipNonSquareBlock (Pixels, Canvas->GetBuffer(), Width, Height, Canvas->GetPitch()); + FlipNonSquareBlockRemap (Pixels, Canvas->GetBuffer(), Width, Height, Canvas->GetPitch(), GPalette.Remap); } bNeedsUpdate = false; bDidUpdate = true; diff --git a/src/textures/pcxtexture.cpp b/src/textures/pcxtexture.cpp index d746fd9fd..87d622eaa 100644 --- a/src/textures/pcxtexture.cpp +++ b/src/textures/pcxtexture.cpp @@ -387,7 +387,7 @@ void FPCXTexture::MakeTexture() else { BYTE *newpix = new BYTE[Width*Height]; - FlipNonSquareBlockRemap (newpix, Pixels, Width, Height, PaletteMap); + FlipNonSquareBlockRemap (newpix, Pixels, Width, Height, Width, PaletteMap); BYTE *oldpix = Pixels; Pixels = newpix; delete[] oldpix; diff --git a/src/textures/pngtexture.cpp b/src/textures/pngtexture.cpp index 958835cfc..a0069fd7a 100644 --- a/src/textures/pngtexture.cpp +++ b/src/textures/pngtexture.cpp @@ -391,7 +391,7 @@ void FPNGTexture::MakeTexture () BYTE *newpix = new BYTE[Width*Height]; if (PaletteMap != NULL) { - FlipNonSquareBlockRemap (newpix, Pixels, Width, Height, PaletteMap); + FlipNonSquareBlockRemap (newpix, Pixels, Width, Height, Width, PaletteMap); } else { diff --git a/src/textures/texture.cpp b/src/textures/texture.cpp index c162e3acc..2799d46fb 100644 --- a/src/textures/texture.cpp +++ b/src/textures/texture.cpp @@ -393,7 +393,7 @@ void FTexture::FlipNonSquareBlock (BYTE *dst, const BYTE *src, int x, int y, int } } -void FTexture::FlipNonSquareBlockRemap (BYTE *dst, const BYTE *src, int x, int y, const BYTE *remap) +void FTexture::FlipNonSquareBlockRemap (BYTE *dst, const BYTE *src, int x, int y, int srcpitch, const BYTE *remap) { int i, j; @@ -401,7 +401,7 @@ void FTexture::FlipNonSquareBlockRemap (BYTE *dst, const BYTE *src, int x, int y { for (j = 0; j < y; ++j) { - dst[i*y+j] = remap[src[i+j*x]]; + dst[i*y+j] = remap[src[i+j*srcpitch]]; } } }