This commit is contained in:
Rachael Alexanderson 2017-05-21 05:52:27 -04:00
commit 3955b7a4f8
4 changed files with 21 additions and 17 deletions

View file

@ -255,8 +255,11 @@ DFrameBuffer *SDLGLVideo::CreateFrameBuffer (int width, int height, bool bgra, b
{ {
fb = (SDLBaseFB*)CreateGLSWFrameBuffer(width, height, bgra, fullscreen); fb = (SDLBaseFB*)CreateGLSWFrameBuffer(width, height, bgra, fullscreen);
if (!fb->IsValid()) if (!fb->IsValid())
{
delete fb;
fb = new SDLFB(width, height, bgra, fullscreen, nullptr); fb = new SDLFB(width, height, bgra, fullscreen, nullptr);
} }
}
retry = 0; retry = 0;

View file

@ -86,9 +86,6 @@ namespace swrenderer
texdata.ystep = args.TextureVStep(); texdata.ystep = args.TextureVStep();
texdata.xfrac = args.TextureUPos(); texdata.xfrac = args.TextureUPos();
texdata.yfrac = args.TextureVPos(); texdata.yfrac = args.TextureVPos();
texdata.yshift = 32 - texdata.ybits;
texdata.xshift = texdata.yshift - texdata.xbits;
texdata.xmask = ((1 << texdata.xbits) - 1) << texdata.ybits;
texdata.source = (const uint32_t*)args.TexturePixels(); texdata.source = (const uint32_t*)args.TexturePixels();
@ -111,7 +108,11 @@ namespace swrenderer
} }
} }
bool is_nearest_filter = !((magnifying && r_magfilter) || (!magnifying && r_minfilter)); texdata.yshift = 32 - texdata.ybits;
texdata.xshift = texdata.yshift - texdata.xbits;
texdata.xmask = ((1 << texdata.xbits) - 1) << texdata.ybits;
bool is_nearest_filter = (magnifying && !r_magfilter) || (!magnifying && !r_minfilter);
bool is_64x64 = texdata.xbits == 6 && texdata.ybits == 6; bool is_64x64 = texdata.xbits == 6 && texdata.ybits == 6;
auto shade_constants = args.ColormapConstants(); auto shade_constants = args.ColormapConstants();

View file

@ -86,9 +86,6 @@ namespace swrenderer
texdata.ystep = args.TextureVStep(); texdata.ystep = args.TextureVStep();
texdata.xfrac = args.TextureUPos(); texdata.xfrac = args.TextureUPos();
texdata.yfrac = args.TextureVPos(); texdata.yfrac = args.TextureVPos();
texdata.yshift = 32 - texdata.ybits;
texdata.xshift = texdata.yshift - texdata.xbits;
texdata.xmask = ((1 << texdata.xbits) - 1) << texdata.ybits;
texdata.source = (const uint32_t*)args.TexturePixels(); texdata.source = (const uint32_t*)args.TexturePixels();
@ -111,7 +108,11 @@ namespace swrenderer
} }
} }
bool is_nearest_filter = !((magnifying && r_magfilter) || (!magnifying && r_minfilter)); texdata.yshift = 32 - texdata.ybits;
texdata.xshift = texdata.yshift - texdata.xbits;
texdata.xmask = ((1 << texdata.xbits) - 1) << texdata.ybits;
bool is_nearest_filter = (magnifying && !r_magfilter) || (!magnifying && !r_minfilter);
bool is_64x64 = texdata.xbits == 6 && texdata.ybits == 6; bool is_64x64 = texdata.xbits == 6 && texdata.ybits == 6;
auto shade_constants = args.ColormapConstants(); auto shade_constants = args.ColormapConstants();

View file

@ -489,7 +489,7 @@ class PlayerPawn : Actor native
Pitch = 0.; Pitch = 0.;
} }
} }
CalcHeight (); player.mo.CalcHeight ();
if (player.attacker && player.attacker != self) if (player.attacker && player.attacker != self)
{ // Watch killer { // Watch killer
@ -1243,9 +1243,9 @@ class PlayerPawn : Actor native
CheckEnvironment(); CheckEnvironment();
CheckUse(); CheckUse();
CheckUndoMorph(); CheckUndoMorph();
// Cycle psprites // Cycle psprites.
TickPSprites(); // Note that after this point the PlayerPawn may have changed due to getting unmorphed so 'self' is no longer safe to use.
player.mo.TickPSprites();
// Other Counters // Other Counters
if (player.damagecount) player.damagecount--; if (player.damagecount) player.damagecount--;
if (player.bonuscount) player.bonuscount--; if (player.bonuscount) player.bonuscount--;
@ -1254,12 +1254,11 @@ class PlayerPawn : Actor native
{ {
player.hazardcount--; player.hazardcount--;
if (!(level.time % player.hazardinterval) && player.hazardcount > 16*TICRATE) if (!(level.time % player.hazardinterval) && player.hazardcount > 16*TICRATE)
DamageMobj (NULL, NULL, 5, player.hazardtype); player.mo.DamageMobj (NULL, NULL, 5, player.hazardtype);
} }
player.mo.CheckPoison();
CheckPoison(); player.mo.CheckDegeneration();
CheckDegeneration(); player.mo.CheckAirSupply();
CheckAirSupply();
} }
} }