- everything compiles again.
As a bonus this already fixes several bugs caused by the botched texture scaling implementation the original texture manager came with. System cursors are currently disabled because they rely on functionality that needs to be moved to different classes.
This commit is contained in:
parent
6eab4a882c
commit
a4d61e6fb1
41 changed files with 268 additions and 197 deletions
|
|
@ -83,15 +83,15 @@ sector_t *SWSceneDrawer::RenderView(player_t *player)
|
|||
FBTextureIndex = (FBTextureIndex + 1) % 2;
|
||||
auto &fbtex = FBTexture[FBTextureIndex];
|
||||
|
||||
if (fbtex == nullptr || fbtex->SystemTexture[0] == nullptr ||
|
||||
fbtex->GetWidth() != screen->GetWidth() ||
|
||||
fbtex->GetHeight() != screen->GetHeight() ||
|
||||
(V_IsTrueColor() ? 1:0) != fbtex->WidthBits)
|
||||
if (fbtex == nullptr || fbtex->GetSystemTexture(0) == nullptr ||
|
||||
fbtex->GetDisplayWidth() != screen->GetWidth() ||
|
||||
fbtex->GetDisplayHeight() != screen->GetHeight() ||
|
||||
(V_IsTrueColor() ? 1:0) != fbtex->GetColorFormat())
|
||||
{
|
||||
// This manually constructs its own material here.
|
||||
fbtex.reset();
|
||||
fbtex.reset(new FWrapperTexture(screen->GetWidth(), screen->GetHeight(), V_IsTrueColor()));
|
||||
fbtex->SystemTexture[0]->AllocateBuffer(screen->GetWidth(), screen->GetHeight(), V_IsTrueColor() ? 4 : 1);
|
||||
fbtex->GetSystemTexture(0)->AllocateBuffer(screen->GetWidth(), screen->GetHeight(), V_IsTrueColor() ? 4 : 1);
|
||||
auto mat = FMaterial::ValidateTexture(fbtex.get(), false);
|
||||
mat->AddTextureLayer(PaletteTexture.get());
|
||||
|
||||
|
|
@ -99,10 +99,10 @@ sector_t *SWSceneDrawer::RenderView(player_t *player)
|
|||
Canvas.reset(new DCanvas(screen->GetWidth(), screen->GetHeight(), V_IsTrueColor()));
|
||||
}
|
||||
|
||||
auto buf = fbtex->SystemTexture[0]->MapBuffer();
|
||||
auto buf = fbtex->GetSystemTexture(0)->MapBuffer();
|
||||
if (!buf) I_FatalError("Unable to map buffer for software rendering");
|
||||
SWRenderer->RenderView(player, Canvas.get(), buf);
|
||||
fbtex->SystemTexture[0]->CreateTexture(nullptr, screen->GetWidth(), screen->GetHeight(), 0, false, 0, "swbuffer");
|
||||
fbtex->GetSystemTexture(0)->CreateTexture(nullptr, screen->GetWidth(), screen->GetHeight(), 0, false, 0, "swbuffer");
|
||||
|
||||
auto map = swrenderer::CameraLight::Instance()->ShaderColormap();
|
||||
screen->DrawTexture(fbtex.get(), 0, 0, DTA_SpecialColormap, map, TAG_DONE);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue