Skip to content

Commit 340d9dd

Browse files
committed
Avoid classic texture uploads during modern view changes
1 parent 6994438 commit 340d9dd

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

‎src/xvt/render/render_quad.c‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#include "xvt/render/render_quad.h"
22

3+
#ifdef XVT_MODERN
4+
#include "aeron/compat/host.h"
5+
#endif
6+
37
#include "xvt/assets/object_type.h"
48
#include "xvt/flight/flight.h"
59
#include "xvt/flight/flight_view.h"
@@ -119,6 +123,12 @@ void RenderQuad_DrawRotatedSprite(int angle, int screenX, int screenY, uint16_t
119123
int rleFormat;
120124
Std3DTexCacheNode* texture;
121125

126+
#ifdef XVT_MODERN
127+
/* Suppress before texture lookup so hidden classic draws do not refill the cache. */
128+
if (AeronDx5_IsClassicFlightRenderingSuppressed())
129+
return;
130+
#endif
131+
122132
textureBytes = (const uint8_t*)textureLevel;
123133
imageHeader = (const TexLevelImageHeader*)textureLevel;
124134
screenY = g_flightVpHeight - screenY;

‎src/xvt/render/render_scene.c‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "xvt/render/render_scene.h"
22
#ifdef XVT_MODERN
3+
#include "aeron/compat/host.h"
34
#include "xvt_runtime/assets/opt_native.h"
45
#endif
56

@@ -491,6 +492,12 @@ void RenderScene_DrawMeshFaces(const SceneMesh* mesh) {
491492
COLOR_KEY_TRIANGLE_FLAGS = STD3D_RS_ALPHA_BLEND
492493
};
493494

495+
#ifdef XVT_MODERN
496+
/* Suppress before texture lookup so hidden classic draws do not refill the cache. */
497+
if (AeronDx5_IsClassicFlightRenderingSuppressed())
498+
return;
499+
#endif
500+
494501
vertexIndex = mesh->vertBaseIndex;
495502
previousTexels = NULL;
496503
vertices = (RenderClipVertex*)&g_projVertList[vertexIndex];

0 commit comments

Comments
 (0)