rodecomp/Source/Render/DX7/TextureBindingDX7.cpp
ragnarok-clanker 89450d494e Decompile fn_02119 (CRendererDX7::SetTexture)
Batch #16018 by Yommy: 1 byte-identical, 0 confirmed by peer review.

- fn_02119 CRendererDX7::SetTexture: byte-identical

Merged automatically: every function is byte-identical to the original.
2026-11-10 12:57:42 +00:00

36 lines
958 B
C++

#include "Render/DX7/RenderSystemDX7.h"
#include "Render/RendererDX7.h"
#include "Render/DX7/TextureDX7.h"
// OFFSET: 0x0055F7D0
// FUNCTION: fn_02119
void CRendererDX7::SetTexture(unsigned stage, CTextureDX7* texture) {
switch (stage) {
case 0:
if (this->boundTexture != texture) {
if (texture == nullptr) {
this->device->SetTexture(0, nullptr);
} else {
this->device->SetTexture(0, texture->NativeSurface());
}
this->boundTexture = texture;
}
break;
case 1:
if (this->boundLightmap != texture) {
if (texture == nullptr) {
this->device->SetTexture(1, nullptr);
} else {
this->device->SetTexture(1, texture->NativeSurface());
}
this->boundLightmap = texture;
}
break;
default:
if (texture != nullptr) {
this->device->SetTexture(stage, texture->NativeSurface());
} else {
this->device->SetTexture(stage, nullptr);
}
}
}