mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-12-01 00:21:35 +00:00
- Fixed: When using PALVERS on the sky, it used the scaling from the true color version. (Side Note: I changed a line that scales the sky position according to the y scaling factor. This is because a 2x high resolution sky at 2048x256 wasn't positioned the same as a 1024x128 unscaled version. I moved the expression to the > 200 height path only, but I'm not sure if it's even still needed.)
- Fixed: PALVERS crashed with unknown textures since a value was never given for %s. - Fixed: FON2 loader didn't set ActiveColors correctly. SVN r3973 (trunk)
This commit is contained in:
parent
c5ffb499ee
commit
c845675b9b
3 changed files with 14 additions and 10 deletions
|
@ -69,8 +69,8 @@ void R_InitSkyMap ()
|
||||||
int skyheight;
|
int skyheight;
|
||||||
FTexture *skytex1, *skytex2;
|
FTexture *skytex1, *skytex2;
|
||||||
|
|
||||||
skytex1 = TexMan[sky1texture];
|
skytex1 = TexMan(sky1texture, true);
|
||||||
skytex2 = TexMan[sky2texture];
|
skytex2 = TexMan(sky2texture, true);
|
||||||
|
|
||||||
if (skytex1 == NULL)
|
if (skytex1 == NULL)
|
||||||
return;
|
return;
|
||||||
|
@ -107,9 +107,8 @@ void R_InitSkyMap ()
|
||||||
}
|
}
|
||||||
else if (skyheight > 200)
|
else if (skyheight > 200)
|
||||||
{
|
{
|
||||||
skytexturemid = (200 - skyheight) << FRACBITS;
|
skytexturemid = FixedMul((200 - skyheight) << FRACBITS, skytex1->yScale);
|
||||||
}
|
}
|
||||||
skytexturemid = FixedMul(skytexturemid, skytex1->yScale);
|
|
||||||
|
|
||||||
if (viewwidth != 0 && viewheight != 0)
|
if (viewwidth != 0 && viewheight != 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -51,11 +51,16 @@
|
||||||
#include "farchive.h"
|
#include "farchive.h"
|
||||||
#include "v_video.h"
|
#include "v_video.h"
|
||||||
#include "r_renderer.h"
|
#include "r_renderer.h"
|
||||||
|
#include "r_sky.h"
|
||||||
#include "textures/textures.h"
|
#include "textures/textures.h"
|
||||||
|
|
||||||
FTextureManager TexMan;
|
FTextureManager TexMan;
|
||||||
|
|
||||||
CVAR(Bool, vid_nopalsubstitutions, false, CVAR_ARCHIVE)
|
CUSTOM_CVAR(Bool, vid_nopalsubstitutions, false, CVAR_ARCHIVE)
|
||||||
|
{
|
||||||
|
// This is in case the sky texture has been substituted.
|
||||||
|
R_InitSkyMap ();
|
||||||
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
//
|
//
|
||||||
|
@ -1026,13 +1031,13 @@ void FTextureManager::InitPalettedVersions()
|
||||||
FTextureID pic1 = CheckForTexture(sc.String, FTexture::TEX_Any);
|
FTextureID pic1 = CheckForTexture(sc.String, FTexture::TEX_Any);
|
||||||
if (!pic1.isValid())
|
if (!pic1.isValid())
|
||||||
{
|
{
|
||||||
sc.ScriptMessage("Unknown texture %s to replace");
|
sc.ScriptMessage("Unknown texture %s to replace", sc.String);
|
||||||
}
|
}
|
||||||
sc.MustGetString();
|
sc.MustGetString();
|
||||||
FTextureID pic2 = CheckForTexture(sc.String, FTexture::TEX_Any);
|
FTextureID pic2 = CheckForTexture(sc.String, FTexture::TEX_Any);
|
||||||
if (!pic2.isValid())
|
if (!pic2.isValid())
|
||||||
{
|
{
|
||||||
sc.ScriptMessage("Unknown texture %s to use as replacement");
|
sc.ScriptMessage("Unknown texture %s to use as replacement", sc.String);
|
||||||
}
|
}
|
||||||
if (pic1.isValid() && pic2.isValid())
|
if (pic1.isValid() && pic2.isValid())
|
||||||
{
|
{
|
||||||
|
|
|
@ -1073,7 +1073,7 @@ void FSingleLumpFont::LoadFON2 (int lump, const BYTE *data)
|
||||||
FontHeight = data[4] + data[5]*256;
|
FontHeight = data[4] + data[5]*256;
|
||||||
FirstChar = data[6];
|
FirstChar = data[6];
|
||||||
LastChar = data[7];
|
LastChar = data[7];
|
||||||
ActiveColors = data[10];
|
ActiveColors = data[10]+1;
|
||||||
PatchRemap = NULL;
|
PatchRemap = NULL;
|
||||||
RescalePalette = data[9] == 0;
|
RescalePalette = data[9] == 0;
|
||||||
|
|
||||||
|
@ -1125,9 +1125,9 @@ void FSingleLumpFont::LoadFON2 (int lump, const BYTE *data)
|
||||||
SpaceWidth = totalwidth * 2 / (3 * count);
|
SpaceWidth = totalwidth * 2 / (3 * count);
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(PaletteData, palette, (ActiveColors+1)*3);
|
memcpy(PaletteData, palette, ActiveColors*3);
|
||||||
|
|
||||||
data_p = palette + (ActiveColors+1)*3;
|
data_p = palette + ActiveColors*3;
|
||||||
|
|
||||||
for (i = 0; i < count; ++i)
|
for (i = 0; i < count; ++i)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue