mirror of
https://github.com/zeldaret/ss
synced 2026-07-02 04:00:20 -04:00
Start StateEfb
This commit is contained in:
@@ -1,3 +1,45 @@
|
||||
#include "egg/gfx/eggStateEfb.h"
|
||||
|
||||
namespace EGG {} // namespace EGG
|
||||
#include "common.h"
|
||||
#include "egg/gfx/eggTextureBuffer.h"
|
||||
|
||||
namespace EGG {
|
||||
|
||||
StateEfb::Buffer StateEfb::spBufferSet[BUFFER_MAX];
|
||||
f32 StateEfb::sWorkSpaceV[6];
|
||||
f32 StateEfb::sWorkSpaceHideV[6];
|
||||
f32 StateEfb::sUnkBuffer[6];
|
||||
|
||||
u32 StateEfb::sFlag = 4;
|
||||
s32 StateEfb::sWorkBuffer = -1;
|
||||
|
||||
s32 StateEfb::sPushCount;
|
||||
|
||||
void StateEfb::Clean() {
|
||||
sFlag &= ~(1 | 2);
|
||||
sWorkBuffer = -1;
|
||||
sPushCount = 0;
|
||||
|
||||
for (u32 i = 0; i < ARRAY_LENGTH(spBufferSet); i++) {
|
||||
spBufferSet[i].field_0x08 = 0;
|
||||
}
|
||||
|
||||
for (u32 i = 0; i < ARRAY_LENGTH(sWorkSpaceV); i++) {
|
||||
sWorkSpaceV[i] = 0.0f;
|
||||
sWorkSpaceHideV[i] = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
bool StateEfb::releaseEfb(BufferType type, u32 userData) {
|
||||
if (spBufferSet[type].buf != nullptr && spBufferSet[type].userData == userData) {
|
||||
spBufferSet[type].buf->free();
|
||||
spBufferSet[type].buf = nullptr;
|
||||
spBufferSet[type].userData = 0;
|
||||
spBufferSet[type].field_0x08 = 0;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace EGG
|
||||
|
||||
@@ -34,7 +34,7 @@ static const f32 identity[3][4] = {
|
||||
|
||||
namespace EGG {
|
||||
|
||||
GXTexObj StateGX::sDefaultTexObj;
|
||||
GXTexObj ALIGN_DECL(32) StateGX::sDefaultTexObj;
|
||||
StateGX::MemLayout StateGX::s_tmem_layout;
|
||||
StateGX::CacheGX StateGX::s_cacheGX;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user