Skip to content

Commit

Permalink
Fix DarkStalkers after the just-merged refactoring.
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed May 14, 2020
1 parent cbb9b32 commit 864d138
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions GPU/Software/SoftGpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,11 @@ void SoftGPU::SetDisplayFramebuffer(u32 framebuf, u32 stride, GEBufferFormat for

bool g_DarkStalkerStretch;

void SoftGPU::ConvertTextureDescFrom16(Draw::TextureDesc &desc, int srcwidth, int srcheight) {
void SoftGPU::ConvertTextureDescFrom16(Draw::TextureDesc &desc, int srcwidth, int srcheight, u8 *overrideData) {
// TODO: This should probably be converted in a shader instead..
fbTexBuffer_.resize(srcwidth * srcheight);
FormatBuffer displayBuffer;
displayBuffer.data = Memory::GetPointer(displayFramebuf_);
displayBuffer.data = overrideData ? overrideData : Memory::GetPointer(displayFramebuf_);
for (int y = 0; y < srcheight; ++y) {
u32 *buf_line = &fbTexBuffer_[y * srcwidth];
const u16 *fb_line = &displayBuffer.as16[y * displayStride_];
Expand All @@ -158,6 +158,7 @@ void SoftGPU::ConvertTextureDescFrom16(Draw::TextureDesc &desc, int srcwidth, in

default:
ERROR_LOG_REPORT(G3D, "Software: Unexpected framebuffer format: %d", displayFormat_);
break;
}
}

Expand Down Expand Up @@ -210,7 +211,7 @@ void SoftGPU::CopyToCurrentFboFromDisplayRam(int srcwidth, int srcheight) {
desc.format = Draw::DataFormat::A1R5G5B5_UNORM_PACK16;
outputFlags |= OutputFlags::RB_SWIZZLE;
} else {
ConvertTextureDescFrom16(desc, srcwidth, srcheight);
ConvertTextureDescFrom16(desc, srcwidth, srcheight, data);
fillDesc = false;
}
if (fillDesc) {
Expand Down
2 changes: 1 addition & 1 deletion GPU/Software/SoftGpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class SoftGPU : public GPUCommon {
protected:
void FastRunLoop(DisplayList &list) override;
void CopyToCurrentFboFromDisplayRam(int srcwidth, int srcheight);
void ConvertTextureDescFrom16(Draw::TextureDesc &desc, int srcwidth, int srcheight);
void ConvertTextureDescFrom16(Draw::TextureDesc &desc, int srcwidth, int srcheight, u8 *overrideData = nullptr);

private:
bool framebufferDirty_;
Expand Down

0 comments on commit 864d138

Please sign in to comment.