Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit 47f7fb6

Browse files
committed
Move default AtomGroup resolution value from MovableMan into Constants
Don't abort on resolution 0 when autogenerating so default resolution is actually used
1 parent afe7a9e commit 47f7fb6

File tree

5 files changed

+4
-20
lines changed

5 files changed

+4
-20
lines changed

Entities/AtomGroup.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,12 @@ namespace RTE {
8989
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
9090

9191
int AtomGroup::Create(MOSRotating *ownerMOSRotating, Material const *material, int resolution, int depth) {
92-
if (!ownerMOSRotating || resolution < 0) {
93-
RTEAbort("Trying to generate an AtomGroup without sprite and//or 0 resolution setting!");
94-
}
92+
RTEAssert(ownerMOSRotating, "Trying to generate an AtomGroup for a MOSRotating without a sprite!");
9593

9694
m_OwnerMO = ownerMOSRotating;
9795
m_Material = material;
9896
m_AutoGenerate = true;
99-
m_Resolution = (resolution > 0) ? resolution : g_MovableMan.GetAGResolution();
97+
m_Resolution = (resolution > 0) ? resolution : c_DefaultAtomGroupResolution;
10098
m_Depth = depth;
10199

102100
GenerateAtomGroup(m_OwnerMO);

Managers/LuaMan.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2048,7 +2048,6 @@ int LuaMan::Create() {
20482048
.def("GetFirstOtherBrainActor", &MovableMan::GetFirstOtherBrainActor)
20492049
.def("GetUnassignedBrain", &MovableMan::GetUnassignedBrain)
20502050
.def("GetParticleCount", &MovableMan::GetParticleCount)
2051-
.def("GetAGResolution", &MovableMan::GetAGResolution)
20522051
.def("GetSplashRatio", &MovableMan::GetSplashRatio)
20532052
.property("MaxDroppedItems", &MovableMan::GetMaxDroppedItems, &MovableMan::SetMaxDroppedItems)
20542053
.def("SortTeamRoster", &MovableMan::SortTeamRoster)

Managers/MovableMan.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ void MovableMan::Clear()
6262
m_AddedAlarmEvents.clear();
6363
m_AlarmEvents.clear();
6464
m_MOIDIndex.clear();
65-
m_AGResolution = 1;
6665
m_SplashRatio = 0.75;
6766
m_MaxDroppedItems = 25;
6867
m_SloMoTimer.Reset();
@@ -109,8 +108,6 @@ int MovableMan::ReadProperty(std::string propName, Reader &reader)
109108
g_PresetMan.GetEntityPreset(reader);
110109
else if (propName == "AddActor")
111110
g_PresetMan.GetEntityPreset(reader);
112-
else if (propName == "DefaultAtomGroupResolution")
113-
reader >> m_AGResolution;
114111
else if (propName == "SplashRatio")
115112
reader >> m_SplashRatio;
116113
else if (propName == "MaxUnheldItems")

Managers/MovableMan.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -389,16 +389,6 @@ class MovableMan:
389389
long GetParticleCount() const { return m_Particles.size(); }
390390

391391

392-
//////////////////////////////////////////////////////////////////////////////////////////
393-
// Method: GetAGResolution
394-
//////////////////////////////////////////////////////////////////////////////////////////
395-
// Description: Gets the global default AtomGroup resolution setting.
396-
// Arguments: None.
397-
// Return value: The global AtomGroup resolution setting, from 1 (highest res) upward.
398-
399-
int GetAGResolution() const { return m_AGResolution; }
400-
401-
402392
//////////////////////////////////////////////////////////////////////////////////////////
403393
// Method: GetSplashRatio
404394
//////////////////////////////////////////////////////////////////////////////////////////
@@ -965,8 +955,6 @@ class MovableMan:
965955

966956
// The list created each frame to register all the current MO's
967957
std::vector<MovableObject *> m_MOIDIndex;
968-
// Global AtomGroup resolution setting.
969-
int m_AGResolution;
970958
// The ration of terrain pixels to be converted into MOPixel:s upon
971959
// deep impact of MO.
972960
float m_SplashRatio;

System/Constants.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ namespace RTE {
1818
static constexpr float c_MPP = 1.0F / c_PPM; //!< Meters per Pixel constant.
1919
static constexpr float c_PPL = 1000.0F / ((100.0F / c_PPM) * (100.0F / c_PPM) * (100.0F / c_PPM)); //!< Pixels per Liter constant.
2020
static constexpr float c_LPP = 1.0F / c_PPL; //!< Liters per Pixel constant.
21+
22+
static constexpr int c_DefaultAtomGroupResolution = 5; //!< The global default AtomGroup resolution setting.
2123
#pragma endregion
2224

2325
#pragma region Graphics Constants

0 commit comments

Comments
 (0)