- decoupled the software renderer entirely from FTexture - it will only look at FSoftwareTexture now, all access to the texture manager has been wrapped.
This commit is contained in:
parent
73b4fbe861
commit
9593cb56ae
23 changed files with 170 additions and 162 deletions
|
|
@ -123,13 +123,11 @@ namespace swrenderer
|
|||
}
|
||||
}
|
||||
|
||||
FTexture *tex = TexMan.GetPalettedTexture(decal->PicNum, true);
|
||||
|
||||
if (tex == NULL || !tex->isValid())
|
||||
FSoftwareTexture *WallSpriteTile = GetPalettedSWTexture(decal->PicNum, true);
|
||||
if (WallSpriteTile == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
FSoftwareTexture *WallSpriteTile = tex->GetSoftwareTexture();
|
||||
|
||||
// Determine left and right edges of sprite. Since this sprite is bound
|
||||
// to a wall, we use the wall's angle instead of the decal's. This is
|
||||
|
|
|
|||
|
|
@ -208,7 +208,7 @@ namespace swrenderer
|
|||
spriteframe_t* sprframe;
|
||||
FTextureID picnum;
|
||||
uint16_t flip;
|
||||
FTexture* tex;
|
||||
FGameTexture* tex;
|
||||
bool noaccel;
|
||||
double alpha = owner->Alpha;
|
||||
|
||||
|
|
@ -228,7 +228,7 @@ namespace swrenderer
|
|||
|
||||
picnum = sprframe->Texture[0];
|
||||
flip = sprframe->Flip & 1;
|
||||
tex = TexMan.GetTexture(picnum);
|
||||
tex = TexMan.GetGameTexture(picnum);
|
||||
|
||||
if (!tex->isValid())
|
||||
return;
|
||||
|
|
@ -267,7 +267,7 @@ namespace swrenderer
|
|||
double pspriteyscale = pspritexscale * viewport->BaseYaspectMul * ((double)SCREENHEIGHT / SCREENWIDTH) * r_viewwindow.WidescreenRatio;
|
||||
double pspritexiscale = 1 / pspritexscale;
|
||||
|
||||
int tleft = tex->GetDisplayLeftOffset();
|
||||
int tleft = tex->GetDisplayLeftOffset(0);
|
||||
int twidth = tex->GetDisplayWidth();
|
||||
|
||||
// calculate edges of the shape
|
||||
|
|
@ -290,7 +290,7 @@ namespace swrenderer
|
|||
|
||||
vis.renderflags = owner->renderflags;
|
||||
|
||||
FSoftwareTexture *stex = tex->GetSoftwareTexture();
|
||||
FSoftwareTexture* stex = GetSoftwareTexture(tex);
|
||||
vis.texturemid = (BASEYCENTER - sy) * stex->GetScale().Y + stex->GetTopOffset(0);
|
||||
|
||||
// Force it to use software rendering when drawing to a canvas texture.
|
||||
|
|
|
|||
|
|
@ -74,10 +74,8 @@ EXTERN_CVAR(Int, gl_texture_hqresize_targets)
|
|||
|
||||
namespace swrenderer
|
||||
{
|
||||
void RenderSprite::Project(RenderThread *thread, AActor *thing, const DVector3 &pos, FTexture *ttex, const DVector2 &spriteScale, int renderflags, WaterFakeSide fakeside, F3DFloor *fakefloor, F3DFloor *fakeceiling, sector_t *current_sector, int lightlevel, bool foggy, FDynamicColormap *basecolormap)
|
||||
void RenderSprite::Project(RenderThread *thread, AActor *thing, const DVector3 &pos, FSoftwareTexture *tex, const DVector2 &spriteScale, int renderflags, WaterFakeSide fakeside, F3DFloor *fakefloor, F3DFloor *fakeceiling, sector_t *current_sector, int lightlevel, bool foggy, FDynamicColormap *basecolormap)
|
||||
{
|
||||
FSoftwareTexture *tex = ttex->GetSoftwareTexture();
|
||||
|
||||
auto viewport = thread->Viewport.get();
|
||||
|
||||
const double thingxscalemul = spriteScale.X / tex->GetScale().X;
|
||||
|
|
@ -92,8 +90,8 @@ namespace swrenderer
|
|||
return;
|
||||
|
||||
// [RH] Added scaling
|
||||
int scaled_to = tex->GetScaledTopOffsetSW();
|
||||
int scaled_bo = scaled_to - tex->GetScaledHeight();
|
||||
double scaled_to = tex->GetScaledTopOffsetSW();
|
||||
double scaled_bo = scaled_to - tex->GetScaledHeight();
|
||||
double gzt = pos.Z + spriteScale.Y * scaled_to;
|
||||
double gzb = pos.Z + spriteScale.Y * scaled_bo;
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ namespace swrenderer
|
|||
class RenderSprite : public VisibleSprite
|
||||
{
|
||||
public:
|
||||
static void Project(RenderThread *thread, AActor *thing, const DVector3 &pos, FTexture *tex, const DVector2 &spriteScale, int renderflags, WaterFakeSide fakeside, F3DFloor *fakefloor, F3DFloor *fakeceiling, sector_t *current_sector, int lightlevel, bool foggy, FDynamicColormap *basecolormap);
|
||||
static void Project(RenderThread *thread, AActor *thing, const DVector3 &pos, FSoftwareTexture *tex, const DVector2 &spriteScale, int renderflags, WaterFakeSide fakeside, F3DFloor *fakefloor, F3DFloor *fakeceiling, sector_t *current_sector, int lightlevel, bool foggy, FDynamicColormap *basecolormap);
|
||||
|
||||
protected:
|
||||
void Render(RenderThread *thread, short *cliptop, short *clipbottom, int minZ, int maxZ, Fake3DTranslucent clip3DFloor) override;
|
||||
|
|
|
|||
|
|
@ -69,9 +69,8 @@
|
|||
|
||||
namespace swrenderer
|
||||
{
|
||||
void RenderWallSprite::Project(RenderThread *thread, AActor *thing, const DVector3 &pos, FTexture *ppic, const DVector2 &scale, int renderflags, int lightlevel, bool foggy, FDynamicColormap *basecolormap)
|
||||
void RenderWallSprite::Project(RenderThread *thread, AActor *thing, const DVector3 &pos, FSoftwareTexture *pic, const DVector2 &scale, int renderflags, int lightlevel, bool foggy, FDynamicColormap *basecolormap)
|
||||
{
|
||||
FSoftwareTexture *pic = ppic->GetSoftwareTexture();
|
||||
FWallCoords wallc;
|
||||
double x1, x2;
|
||||
DVector2 left, right;
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ namespace swrenderer
|
|||
class RenderWallSprite : public VisibleSprite
|
||||
{
|
||||
public:
|
||||
static void Project(RenderThread *thread, AActor *thing, const DVector3 &pos, FTexture *pic, const DVector2 &scale, int renderflags, int lightlevel, bool foggy, FDynamicColormap *basecolormap);
|
||||
static void Project(RenderThread *thread, AActor *thing, const DVector3 &pos, FSoftwareTexture *pic, const DVector2 &scale, int renderflags, int lightlevel, bool foggy, FDynamicColormap *basecolormap);
|
||||
|
||||
protected:
|
||||
bool IsWallSprite() const override { return true; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue