[IGfxWorld] Sort world surfaces
This commit is contained in:
parent
0bfee50e26
commit
50345ce512
@ -36,6 +36,7 @@ namespace Assets
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
std::sort(surfs.begin(), surfs.end(), [](Game::GfxSurface* a, Game::GfxSurface* b)
|
||||
{
|
||||
if (a->material->name == nullptr && b->material->name == nullptr) return false;
|
||||
@ -52,6 +53,7 @@ namespace Assets
|
||||
}
|
||||
|
||||
asset->surfaces = tmpBuffer;
|
||||
*/
|
||||
|
||||
if (asset->surfacesBounds)
|
||||
{
|
||||
@ -432,6 +434,8 @@ namespace Assets
|
||||
{
|
||||
asset->heroOnlyLights = reader.readArray<Game::GfxHeroOnlyLight>(asset->heroOnlyLightCount);
|
||||
}
|
||||
|
||||
Game::SortWorldSurfaces(asset);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -498,7 +498,7 @@ namespace Components
|
||||
AssetHandler::OnLoad([](Game::XAssetType type, Game::XAssetHeader asset, std::string name, bool* /*restrict*/)
|
||||
{
|
||||
// they're basically the same right?
|
||||
if (type == Game::ASSET_TYPE_PIXELSHADER | type == Game::ASSET_TYPE_VERTEXSHADER)
|
||||
if (type == Game::ASSET_TYPE_PIXELSHADER || type == Game::ASSET_TYPE_VERTEXSHADER)
|
||||
{
|
||||
Utils::IO::CreateDir("userraw/shader_bin");
|
||||
|
||||
|
@ -196,6 +196,7 @@ namespace Game
|
||||
R_TextWidth_t R_TextWidth = R_TextWidth_t(0x5056C0);
|
||||
R_TextHeight_t R_TextHeight = R_TextHeight_t(0x505770);
|
||||
R_FlushSun_t R_FlushSun = R_FlushSun_t(0x53FB50);
|
||||
R_SortWorldSurfaces_t R_SortWorldSurfaces = R_SortWorldSurfaces_t(0x53DC10);
|
||||
|
||||
Scr_LoadGameType_t Scr_LoadGameType = Scr_LoadGameType_t(0x4D9520);
|
||||
|
||||
@ -732,4 +733,25 @@ namespace Game
|
||||
const char* maxrank = StringTable_Lookup(rankTable, 0, "maxrank", 1);
|
||||
return atoi(StringTable_Lookup(rankTable, 0, maxrank, 7));
|
||||
}
|
||||
|
||||
void SortWorldSurfaces(GfxWorld* world)
|
||||
{
|
||||
DWORD* specular1 = reinterpret_cast<DWORD*>(0x69F105C);
|
||||
DWORD* specular2 = reinterpret_cast<DWORD*>(0x69F92D4);
|
||||
DWORD saveSpecular1 = *specular1;
|
||||
DWORD saveSpecular2 = *specular2;
|
||||
|
||||
GfxWorld** gameWorld = reinterpret_cast<GfxWorld**>(0x66DEE94);
|
||||
GfxWorld* saveWorld = *gameWorld;
|
||||
|
||||
*specular1 = 1;
|
||||
*specular2 = 1;
|
||||
*gameWorld = world;
|
||||
|
||||
R_SortWorldSurfaces();
|
||||
|
||||
*gameWorld = saveWorld;
|
||||
*specular1 = saveSpecular1;
|
||||
*specular2 = saveSpecular2;
|
||||
}
|
||||
}
|
||||
|
@ -499,6 +499,9 @@ namespace Game
|
||||
typedef void(__cdecl * R_FlushSun_t)();
|
||||
extern R_FlushSun_t R_FlushSun;
|
||||
|
||||
typedef GfxWorld*(__cdecl * R_SortWorldSurfaces_t)();
|
||||
extern R_SortWorldSurfaces_t R_SortWorldSurfaces;
|
||||
|
||||
typedef void(__cdecl * Scr_ShutdownAllocNode_t)();
|
||||
extern Scr_ShutdownAllocNode_t Scr_ShutdownAllocNode;
|
||||
|
||||
@ -767,4 +770,6 @@ namespace Game
|
||||
void Com_SetParseNegativeNumbers(int parse);
|
||||
|
||||
int CL_GetMaxXP();
|
||||
|
||||
void SortWorldSurfaces(GfxWorld* world);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user