From 8e38e5ae505333a5319d0d42c4635ee1538c208b Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Sun, 31 Mar 2019 20:56:37 +0200 Subject: [PATCH] Minor (mostly) cosmetics changes --- Sources/Engine/Base/Base.h | 4 +++ Sources/Engine/Base/Profiling.h | 10 ++++++-- Sources/Engine/Brushes/Brush.h | 6 ++++- Sources/Engine/Brushes/BrushArchive.cpp | 0 Sources/Engine/Classes/MovableEntity.es | 0 Sources/Engine/Engine.cpp | 28 ++++++++++----------- Sources/Engine/Entities/FieldBSPTesting.cpp | 0 Sources/Engine/Light/LightSource.cpp | 0 Sources/Engine/Rendering/RenCache.cpp | 0 Sources/Engine/Rendering/RenderAdding.cpp | 0 Sources/Engine/Rendering/Render_internal.h | 0 Sources/Engine/Templates/BSP.cpp | 2 +- Sources/Engine/Templates/BSP_internal.h | 6 +++++ 13 files changed, 38 insertions(+), 18 deletions(-) mode change 100644 => 100755 Sources/Engine/Brushes/Brush.h mode change 100644 => 100755 Sources/Engine/Brushes/BrushArchive.cpp mode change 100644 => 100755 Sources/Engine/Classes/MovableEntity.es mode change 100644 => 100755 Sources/Engine/Entities/FieldBSPTesting.cpp mode change 100644 => 100755 Sources/Engine/Light/LightSource.cpp mode change 100644 => 100755 Sources/Engine/Rendering/RenCache.cpp mode change 100644 => 100755 Sources/Engine/Rendering/RenderAdding.cpp mode change 100644 => 100755 Sources/Engine/Rendering/Render_internal.h mode change 100644 => 100755 Sources/Engine/Templates/BSP_internal.h diff --git a/Sources/Engine/Base/Base.h b/Sources/Engine/Base/Base.h index 5ecf0dc..79b3496 100755 --- a/Sources/Engine/Base/Base.h +++ b/Sources/Engine/Base/Base.h @@ -81,6 +81,10 @@ with this program; if not, write to the Free Software Foundation, Inc., # define INDEX_T unsigned short # define INDEX_GL GL_UNSIGNED_SHORT # define FASTMATH __attribute__((pcs("aapcs-vfp"))) +#elif defined(__arm__) +# define INDEX_T unsigned short +# define INDEX_GL GL_UNSIGNED_SHORT +# define FASTMATH #else # define INDEX_T INDEX # define INDEX_GL GL_UNSIGNED_INT diff --git a/Sources/Engine/Base/Profiling.h b/Sources/Engine/Base/Profiling.h index ad59143..6fae05a 100755 --- a/Sources/Engine/Base/Profiling.h +++ b/Sources/Engine/Base/Profiling.h @@ -19,7 +19,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once #endif -#if ENGINE_INTERNAL && !defined(PANDORA) +#if ENGINE_INTERNAL #include #include @@ -68,7 +68,7 @@ private: class CProfileForm { public: -#if ENGINE_INTERNAL && !defined(PANDORA) +#if ENGINE_INTERNAL // implementation: CTString pf_strTitle; // main title of the profiling form CTString pf_strAveragingUnits; // name for averaging units @@ -118,6 +118,9 @@ public: /* Get current value of a counter. */ INDEX GetCounterCount(INDEX iCounter); + inline void CountersClear() {pf_apcCounters.Clear();}; + inline void TimersClear() {pf_aptTimers.Clear();}; + #if TIMER_PROFILING /* Start a timer. */ inline void StartTimer(INDEX iTimer) { @@ -173,11 +176,14 @@ public: inline void IncrementCounter(INDEX iCounter, INDEX ctAdd=1) {} inline void StartTimer(INDEX iTimer) {}; inline void StopTimer(INDEX iTimer) {}; + inline void IncrementAveragingCounter(INDEX ctAdd=1) {}; inline void IncrementTimerAveragingCounter(INDEX iTimer, INDEX ctAdd=1) {}; inline void SetCounterName_internal(INDEX iCounter, const CTString &strName) {}; inline void SetTimerName_internal(INDEX iTimer, const CTString &strName, const CTString &strAveragingName) {}; #define SETCOUNTERNAME(a,b) SetCounterName_internal(a,"") #define SETTIMERNAME(a,b,c) SetTimerName_internal(a,"","") + inline void CountersClear() {}; + inline void TimersClear() {}; #endif // ENGINE_INTERNAL diff --git a/Sources/Engine/Brushes/Brush.h b/Sources/Engine/Brushes/Brush.h old mode 100644 new mode 100755 index 3bc91de..bd991c3 --- a/Sources/Engine/Brushes/Brush.h +++ b/Sources/Engine/Brushes/Brush.h @@ -482,7 +482,11 @@ public: // get amount of memory used by this object SLONG GetUsedMemory(void); -} __attribute__((aligned(64))); +} +#ifdef __arm__ +__attribute__((aligned(64))) +#endif +; // get pointer to embedding brush polygon inline CBrushPolygon *CBrushShadowMap::GetBrushPolygon(void) { diff --git a/Sources/Engine/Brushes/BrushArchive.cpp b/Sources/Engine/Brushes/BrushArchive.cpp old mode 100644 new mode 100755 diff --git a/Sources/Engine/Classes/MovableEntity.es b/Sources/Engine/Classes/MovableEntity.es old mode 100644 new mode 100755 diff --git a/Sources/Engine/Engine.cpp b/Sources/Engine/Engine.cpp index b5a530d..9f6e839 100755 --- a/Sources/Engine/Engine.cpp +++ b/Sources/Engine/Engine.cpp @@ -780,20 +780,20 @@ ENGINE_API void SE_EndEngine(void) // shutdown profilers _sfStats.Clear(); - _pfGfxProfile .pf_apcCounters.Clear(); - _pfGfxProfile .pf_aptTimers .Clear(); - _pfModelProfile .pf_apcCounters.Clear(); - _pfModelProfile .pf_aptTimers .Clear(); - _pfSoundProfile .pf_apcCounters.Clear(); - _pfSoundProfile .pf_aptTimers .Clear(); - _pfNetworkProfile .pf_apcCounters.Clear(); - _pfNetworkProfile .pf_aptTimers .Clear(); - _pfRenderProfile .pf_apcCounters.Clear(); - _pfRenderProfile .pf_aptTimers .Clear(); - _pfWorldEditingProfile .pf_apcCounters.Clear(); - _pfWorldEditingProfile .pf_aptTimers .Clear(); - _pfPhysicsProfile .pf_apcCounters.Clear(); - _pfPhysicsProfile .pf_aptTimers .Clear(); + _pfGfxProfile .CountersClear(); + _pfGfxProfile .TimersClear(); + _pfModelProfile .CountersClear(); + _pfModelProfile .TimersClear(); + _pfSoundProfile .CountersClear(); + _pfSoundProfile .TimersClear(); + _pfNetworkProfile .CountersClear(); + _pfNetworkProfile .TimersClear(); + _pfRenderProfile .CountersClear(); + _pfRenderProfile .TimersClear(); + _pfWorldEditingProfile .CountersClear(); + _pfWorldEditingProfile .TimersClear(); + _pfPhysicsProfile .CountersClear(); + _pfPhysicsProfile .TimersClear(); // remove default fonts if needed if( _pfdDisplayFont != NULL) { delete _pfdDisplayFont; _pfdDisplayFont=NULL; } diff --git a/Sources/Engine/Entities/FieldBSPTesting.cpp b/Sources/Engine/Entities/FieldBSPTesting.cpp old mode 100644 new mode 100755 diff --git a/Sources/Engine/Light/LightSource.cpp b/Sources/Engine/Light/LightSource.cpp old mode 100644 new mode 100755 diff --git a/Sources/Engine/Rendering/RenCache.cpp b/Sources/Engine/Rendering/RenCache.cpp old mode 100644 new mode 100755 diff --git a/Sources/Engine/Rendering/RenderAdding.cpp b/Sources/Engine/Rendering/RenderAdding.cpp old mode 100644 new mode 100755 diff --git a/Sources/Engine/Rendering/Render_internal.h b/Sources/Engine/Rendering/Render_internal.h old mode 100644 new mode 100755 diff --git a/Sources/Engine/Templates/BSP.cpp b/Sources/Engine/Templates/BSP.cpp index 250365a..ee781d3 100755 --- a/Sources/Engine/Templates/BSP.cpp +++ b/Sources/Engine/Templates/BSP.cpp @@ -506,7 +506,7 @@ FLOAT BSPNode::TestSphere(const Vector &vS } } } -#define SPHERE_HACK + #ifdef SPHERE_HACK // truncate doubles in d0-d3 to floats in d0-d1 // destroys d2-d7 diff --git a/Sources/Engine/Templates/BSP_internal.h b/Sources/Engine/Templates/BSP_internal.h old mode 100644 new mode 100755 index edeb047..c68eeb2 --- a/Sources/Engine/Templates/BSP_internal.h +++ b/Sources/Engine/Templates/BSP_internal.h @@ -21,6 +21,10 @@ with this program; if not, write to the Free Software Foundation, Inc., extern FLOAT mth_fCSGEpsilon; +#ifdef __arm__ +#define SPHERE_HACK +#endif + /* * Type used to identify BSP-node locations */ @@ -169,7 +173,9 @@ public: /* Test if a sphere is inside, outside, or intersecting. (Just a trivial rejection test) */ FLOAT TestSphere(const Vector &vSphereCenter, Type tSphereRadius) const; + #ifdef SPHERE_HACK int TestSphere_hack(const FLOAT *params) const; + #endif /* Test if a box is inside, outside, or intersecting. (Just a trivial rejection test) */ FLOAT TestBox(const OBBox &box) const; };