summaryrefslogtreecommitdiffstats
path: root/src/render
diff options
context:
space:
mode:
Diffstat (limited to 'src/render')
-rw-r--r--src/render/Fluff.cpp5
-rw-r--r--src/render/Font.h2
-rw-r--r--src/render/Renderer.cpp6
-rw-r--r--src/render/Rubbish.h4
-rw-r--r--src/render/Sprite2d.cpp9
5 files changed, 22 insertions, 4 deletions
diff --git a/src/render/Fluff.cpp b/src/render/Fluff.cpp
index f86801bf..690a1d3f 100644
--- a/src/render/Fluff.cpp
+++ b/src/render/Fluff.cpp
@@ -152,9 +152,9 @@ void CMovingThings::Shutdown()
void CMovingThings::Update()
{
- const int TIME_SPAN = 64; // frames to process all aMovingThings
-
int16 i;
+#ifndef SQUEEZE_PERFORMANCE
+ const int TIME_SPAN = 64; // frames to process all aMovingThings
int block = CTimer::GetFrameCounter() % TIME_SPAN;
@@ -167,6 +167,7 @@ void CMovingThings::Update()
if (aMovingThings[i].m_nHidden == 0)
aMovingThings[i].Update();
}
+#endif
for (i = 0; i < ARRAY_SIZE(aScrollBars); ++i)
{
diff --git a/src/render/Font.h b/src/render/Font.h
index 9b4e7132..48f5703d 100644
--- a/src/render/Font.h
+++ b/src/render/Font.h
@@ -68,8 +68,8 @@ class CFont
static int16 Size[MAX_FONTS][193];
#endif
static int16 NewLine;
- static CSprite2d Sprite[MAX_FONTS];
public:
+ static CSprite2d Sprite[MAX_FONTS];
static CFontDetails Details;
static void Initialise(void);
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp
index 88d412c9..717021a7 100644
--- a/src/render/Renderer.cpp
+++ b/src/render/Renderer.cpp
@@ -73,8 +73,12 @@ CRenderer::PreRender(void)
for(i = 0; i < ms_nNoOfVisibleEntities; i++)
ms_aVisibleEntityPtrs[i]->PreRender();
- for(i = 0; i < ms_nNoOfInVisibleEntities; i++)
+ for (i = 0; i < ms_nNoOfInVisibleEntities; i++) {
+#ifdef SQUEEZE_PERFORMANCE
+ if (ms_aInVisibleEntityPtrs[i]->IsVehicle() && ((CVehicle*)ms_aInVisibleEntityPtrs[i])->IsHeli())
+#endif
ms_aInVisibleEntityPtrs[i]->PreRender();
+ }
for(node = CVisibilityPlugins::m_alphaEntityList.head.next;
node != &CVisibilityPlugins::m_alphaEntityList.tail;
diff --git a/src/render/Rubbish.h b/src/render/Rubbish.h
index 2be592fe..37f895f3 100644
--- a/src/render/Rubbish.h
+++ b/src/render/Rubbish.h
@@ -4,7 +4,11 @@ class CVehicle;
enum {
// NB: not all values are allowed, check the code
+#ifdef SQUEEZE_PERFORMANCE
+ NUM_RUBBISH_SHEETS = 32
+#else
NUM_RUBBISH_SHEETS = 64
+#endif
};
class COneSheet
diff --git a/src/render/Sprite2d.cpp b/src/render/Sprite2d.cpp
index 52b85018..453ed004 100644
--- a/src/render/Sprite2d.cpp
+++ b/src/render/Sprite2d.cpp
@@ -4,6 +4,7 @@
#include "Draw.h"
#include "Camera.h"
#include "Sprite2d.h"
+#include "Font.h"
RwIm2DVertex CSprite2d::maVertices[8];
float CSprite2d::RecipNearClip;
@@ -27,14 +28,18 @@ CSprite2d::InitPerFrame(void)
mCurrentBank = 0;
for(i = 0; i < 10; i++)
mCurrentSprite[i] = 0;
+#ifndef SQUEEZE_PERFORMANCE
for(i = 0; i < 10; i++)
mpBankTextures[i] = nil;
+#endif
}
int32
CSprite2d::GetBank(int32 n, RwTexture *tex)
{
+#ifndef SQUEEZE_PERFORMANCE
mpBankTextures[mCurrentBank] = tex;
+#endif
mCurrentSprite[mCurrentBank] = 0;
mBankStart[mCurrentBank+1] = mBankStart[mCurrentBank] + n;
return mCurrentBank++;
@@ -59,8 +64,12 @@ CSprite2d::DrawBank(int32 bank)
{
if(mCurrentSprite[bank] == 0)
return;
+#ifndef SQUEEZE_PERFORMANCE
RwRenderStateSet(rwRENDERSTATETEXTURERASTER,
mpBankTextures[bank] ? RwTextureGetRaster(mpBankTextures[bank]) : nil);
+#else
+ CFont::Sprite[bank].SetRenderState();
+#endif
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
RwRenderStateSet(rwRENDERSTATETEXTUREFILTER, (void*)rwFILTERLINEAR);
RwIm2DRenderPrimitive(rwPRIMTYPETRILIST, &maBankVertices[6*mBankStart[bank]], 6*mCurrentSprite[bank]);