- 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.


SVN r735 (trunk)
This commit is contained in:
Randy Heit 2008-02-09 03:09:56 +00:00
parent 22df389ad7
commit 0bb9fc1e2d
7 changed files with 15 additions and 10 deletions

View file

@ -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 February 5, 2008
- Updated the GCC-targeted makefiles to turn off two optimizations that cause - Updated the GCC-targeted makefiles to turn off two optimizations that cause
fmopl.cpp to compile incorrectly: tree-dominator-opts and tree-fre fmopl.cpp to compile incorrectly: tree-dominator-opts and tree-fre

View file

@ -642,7 +642,7 @@ void D_ReadUserInfoStrings (int i, BYTE **stream, bool update)
if (compact) if (compact)
{ {
value = D_UnescapeUserInfo(ptr, breakpt - ptr); value = D_UnescapeUserInfo(ptr, breakpt != NULL ? breakpt - ptr : strlen(ptr));
infotype++; infotype++;
} }
else else
@ -676,7 +676,6 @@ void D_ReadUserInfoStrings (int i, BYTE **stream, bool update)
infotype = j; infotype = j;
} }
} }
switch (infotype) switch (infotype)
{ {
case INFO_Autoaim: { case INFO_Autoaim: {
@ -749,7 +748,7 @@ void D_ReadUserInfoStrings (int i, BYTE **stream, bool update)
break; break;
case INFO_NeverSwitchOnPickup: case INFO_NeverSwitchOnPickup:
if (*value >= '0' && *value <= '9') if (value[0] >= '0' && value[0] <= '9')
{ {
info->neverswitch = atoi (value) ? true : false; info->neverswitch = atoi (value) ? true : false;
} }

View file

@ -741,7 +741,7 @@ protected:
static void FlipSquareBlock (BYTE *block, int x, int y); static void FlipSquareBlock (BYTE *block, int x, int y);
static void FlipSquareBlockRemap (BYTE *block, int x, int y, const BYTE *remap); 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 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; friend class D3DTex;
}; };

View file

@ -154,11 +154,11 @@ void FCanvasTexture::RenderView (AActor *viewpoint, int fov)
R_SetFOV (savedfov); R_SetFOV (savedfov);
if (Pixels == Canvas->GetBuffer()) if (Pixels == Canvas->GetBuffer())
{ {
FlipSquareBlock (Pixels, Width, Height); FlipSquareBlockRemap (Pixels, Width, Height, GPalette.Remap);
} }
else else
{ {
FlipNonSquareBlock (Pixels, Canvas->GetBuffer(), Width, Height, Canvas->GetPitch()); FlipNonSquareBlockRemap (Pixels, Canvas->GetBuffer(), Width, Height, Canvas->GetPitch(), GPalette.Remap);
} }
bNeedsUpdate = false; bNeedsUpdate = false;
bDidUpdate = true; bDidUpdate = true;

View file

@ -387,7 +387,7 @@ void FPCXTexture::MakeTexture()
else else
{ {
BYTE *newpix = new BYTE[Width*Height]; BYTE *newpix = new BYTE[Width*Height];
FlipNonSquareBlockRemap (newpix, Pixels, Width, Height, PaletteMap); FlipNonSquareBlockRemap (newpix, Pixels, Width, Height, Width, PaletteMap);
BYTE *oldpix = Pixels; BYTE *oldpix = Pixels;
Pixels = newpix; Pixels = newpix;
delete[] oldpix; delete[] oldpix;

View file

@ -391,7 +391,7 @@ void FPNGTexture::MakeTexture ()
BYTE *newpix = new BYTE[Width*Height]; BYTE *newpix = new BYTE[Width*Height];
if (PaletteMap != NULL) if (PaletteMap != NULL)
{ {
FlipNonSquareBlockRemap (newpix, Pixels, Width, Height, PaletteMap); FlipNonSquareBlockRemap (newpix, Pixels, Width, Height, Width, PaletteMap);
} }
else else
{ {

View file

@ -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; 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) for (j = 0; j < y; ++j)
{ {
dst[i*y+j] = remap[src[i+j*x]]; dst[i*y+j] = remap[src[i+j*srcpitch]];
} }
} }
} }