PCTex_InitSystemTextures

This commit is contained in:
krystalgamer 2024-09-20 19:09:06 +02:00
parent 0ccefeb9eb
commit 3ec3c61725
3 changed files with 26 additions and 3 deletions

View File

@ -52,7 +52,7 @@ RECT gRect;
EXPORT LPDIRECT3D7 g_D3D7;
LPDIRECT3DDEVICE7 g_D3DDevice7;
EXPORT D3DDEVICEDESC7 gD3DDevCaps;
D3DDEVICEDESC7 gD3DDevCaps;
// @Ok
void gsub_5027A0(void)

View File

@ -124,6 +124,7 @@ EXPORT extern i32 gDxOptionRelated;
EXPORT extern LPDIRECTDRAWSURFACE7 g_pDDS_SaveScreen;
EXPORT extern RECT gRect;
EXPORT extern LPDIRECTDRAWSURFACE7 g_pDDS_Scene;
EXPORT extern D3DDEVICEDESC7 gD3DDevCaps;
void validate_DXContext(void);
void validate_DXContextEntry(void);

View File

@ -2,10 +2,16 @@
#include "validate.h"
#include "mem.h"
#include "dcfileio.h"
#include "DXinit.h"
#include <cstring>
#include <cstdlib>
EXPORT u32 gMaxTextureAspectRatio;
EXPORT u32 gMaxTextureWidth;
EXPORT u32 gTextureHeight;
EXPORT bool gSquareOnly;
const i32 GLOBAL_TEXTURE_COUNT = 1024;
EXPORT SPCTexture gGlobalTextures[GLOBAL_TEXTURE_COUNT];
@ -251,10 +257,26 @@ i32 PCTex_GetTextureSplitCount(i32 index)
return gGlobalTextures[index].mSplitCount;
}
// @SMALLTODO
// @Ok
// @Matching
void PCTex_InitSystemTextures(void)
{
printf("PCTex_InitSystemTextures(void)");
if ( gLowGraphics )
{
gMaxTextureAspectRatio = 0;
gMaxTextureWidth = 256;
gTextureHeight = 256;
gSquareOnly = 0;
}
else
{
gMaxTextureWidth = gD3DDevCaps.dwMaxTextureWidth;
gTextureHeight = gD3DDevCaps.dwMaxTextureHeight;
gMaxTextureAspectRatio = gD3DDevCaps.dwMaxTextureAspectRatio;
gSquareOnly = (gD3DDevCaps.dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_SQUAREONLY) != 0;
}
PCTEX_Init();
}
// @MEDIUMTODO