summaryrefslogtreecommitdiffstats
path: root/src/rw
diff options
context:
space:
mode:
Diffstat (limited to 'src/rw')
-rw-r--r--src/rw/MemoryMgr.cpp2
-rw-r--r--src/rw/RwHelper.cpp12
-rw-r--r--src/rw/TexRead.cpp9
-rw-r--r--src/rw/VisibilityPlugins.cpp20
-rw-r--r--src/rw/VisibilityPlugins.h3
5 files changed, 39 insertions, 7 deletions
diff --git a/src/rw/MemoryMgr.cpp b/src/rw/MemoryMgr.cpp
index e2f6f144..2379692c 100644
--- a/src/rw/MemoryMgr.cpp
+++ b/src/rw/MemoryMgr.cpp
@@ -93,7 +93,7 @@ MemoryMgrFree(void *ptr)
void *
RwMallocAlign(RwUInt32 size, RwUInt32 align)
{
-#ifdef FIX_BUGS
+#if defined (FIX_BUGS) || defined(FIX_BUGS_64)
uintptr ptralign = align-1;
void *mem = (void *)MemoryMgrMalloc(size + sizeof(uintptr) + ptralign);
diff --git a/src/rw/RwHelper.cpp b/src/rw/RwHelper.cpp
index 4ee3a0b3..65e342ed 100644
--- a/src/rw/RwHelper.cpp
+++ b/src/rw/RwHelper.cpp
@@ -1,7 +1,6 @@
-#if defined RW_D3D9 || defined RWLIBS
#define WITHD3D
-#endif
#include "common.h"
+#include <rpskin.h>
#include "RwHelper.h"
#include "Timecycle.h"
@@ -290,7 +289,8 @@ SkinGetBonePositionsToTable(RpClump *clump, RwV3d *boneTable)
parent = stack[sp--];
else
parent = i;
- assert(parent >= 0 && parent < numBones);
+
+ //assert(parent >= 0 && parent < numBones);
}
}
@@ -298,7 +298,7 @@ RpHAnimAnimation*
HAnimAnimationCreateForHierarchy(RpHAnimHierarchy *hier)
{
int i;
-#ifdef FIX_BUGS
+#if defined FIX_BUGS || defined LIBRW
int numNodes = hier->numNodes*2; // you're supposed to have at least two KFs per node
#else
int numNodes = hier->numNodes;
@@ -312,7 +312,7 @@ HAnimAnimationCreateForHierarchy(RpHAnimHierarchy *hier)
frame->q.real = 1.0f;
frame->q.imag.x = frame->q.imag.y = frame->q.imag.z = 0.0f;
frame->t.x = frame->t.y = frame->t.z = 0.0f;
-#ifdef FIX_BUGS
+#if defined FIX_BUGS || defined LIBRW
// times are subtracted and divided giving NaNs
// so they can't both be 0
frame->time = i/hier->numNodes;
@@ -400,7 +400,7 @@ CameraSize(RwCamera * camera, RwRect * rect,
RwRaster *zRaster;
// BUG: game just changes camera raster's sizes, but this is a hack
-#ifdef FIX_BUGS
+#if defined FIX_BUGS || defined LIBRW
/*
* Destroy rasters...
*/
diff --git a/src/rw/TexRead.cpp b/src/rw/TexRead.cpp
index d0addcca..c009af96 100644
--- a/src/rw/TexRead.cpp
+++ b/src/rw/TexRead.cpp
@@ -2,6 +2,9 @@
#pragma warning( disable : 4005)
#pragma warning( pop )
#include "common.h"
+#ifdef ANISOTROPIC_FILTERING
+#include "rpanisot.h"
+#endif
#include "crossplatform.h"
#include "platform.h"
@@ -48,6 +51,12 @@ RwTextureGtaStreamRead(RwStream *stream)
texLoadTime = (texNumLoaded * texLoadTime + (float)CTimer::GetCurrentTimeInCycles() / (float)CTimer::GetCyclesPerMillisecond() - preloadTime) / (float)(texNumLoaded+1);
texNumLoaded++;
}
+
+#ifdef ANISOTROPIC_FILTERING
+ if(tex && RpAnisotGetMaxSupportedMaxAnisotropy() > 1) // BUG? this was RpAnisotTextureGetMaxAnisotropy, but that doesn't make much sense
+ RpAnisotTextureSetMaxAnisotropy(tex, RpAnisotGetMaxSupportedMaxAnisotropy());
+#endif
+
return tex;
}
diff --git a/src/rw/VisibilityPlugins.cpp b/src/rw/VisibilityPlugins.cpp
index 916696de..32461d1c 100644
--- a/src/rw/VisibilityPlugins.cpp
+++ b/src/rw/VisibilityPlugins.cpp
@@ -2,6 +2,7 @@
#include "RwHelper.h"
#include "templates.h"
+#include "main.h"
#include "Entity.h"
#include "ModelInfo.h"
#include "Lights.h"
@@ -14,6 +15,9 @@
CLinkList<CVisibilityPlugins::AlphaObjectInfo> CVisibilityPlugins::m_alphaList;
CLinkList<CVisibilityPlugins::AlphaObjectInfo> CVisibilityPlugins::m_alphaEntityList;
+#ifdef NEW_RENDERER
+CLinkList<CVisibilityPlugins::AlphaObjectInfo> CVisibilityPlugins::m_alphaBuildingList;
+#endif
int32 CVisibilityPlugins::ms_atomicPluginOffset = -1;
int32 CVisibilityPlugins::ms_framePluginOffset = -1;
@@ -158,6 +162,12 @@ CVisibilityPlugins::Initialise(void)
#endif // ASPECT_RATIO_SCALE
m_alphaEntityList.head.item.sort = 0.0f;
m_alphaEntityList.tail.item.sort = 100000000.0f;
+
+#ifdef NEW_RENDERER
+ m_alphaBuildingList.Init(NUMALPHAENTITYLIST);
+ m_alphaBuildingList.head.item.sort = 0.0f;
+ m_alphaBuildingList.tail.item.sort = 100000000.0f;
+#endif
}
void
@@ -165,12 +175,18 @@ CVisibilityPlugins::Shutdown(void)
{
m_alphaList.Shutdown();
m_alphaEntityList.Shutdown();
+#ifdef NEW_RENDERER
+ m_alphaBuildingList.Shutdown();
+#endif
}
void
CVisibilityPlugins::InitAlphaEntityList(void)
{
m_alphaEntityList.Clear();
+#ifdef NEW_RENDERER
+ m_alphaBuildingList.Clear();
+#endif
}
bool
@@ -179,6 +195,10 @@ CVisibilityPlugins::InsertEntityIntoSortedList(CEntity *e, float dist)
AlphaObjectInfo item;
item.entity = e;
item.sort = dist;
+#ifdef NEW_RENDERER
+ if(gbNewRenderer && e->IsBuilding())
+ return !!m_alphaBuildingList.InsertSorted(item);
+#endif
bool ret = !!m_alphaEntityList.InsertSorted(item);
// if(!ret)
// printf("list full %d\n", m_alphaEntityList.Count());
diff --git a/src/rw/VisibilityPlugins.h b/src/rw/VisibilityPlugins.h
index 0721dfcc..f092de5a 100644
--- a/src/rw/VisibilityPlugins.h
+++ b/src/rw/VisibilityPlugins.h
@@ -22,6 +22,9 @@ public:
static CLinkList<AlphaObjectInfo> m_alphaList;
static CLinkList<AlphaObjectInfo> m_alphaEntityList;
+#ifdef NEW_RENDERER
+ static CLinkList<AlphaObjectInfo> m_alphaBuildingList;
+#endif
static RwCamera *ms_pCamera;
static RwV3d *ms_pCameraPosn;
static float ms_cullCompsDist;