Spore ModAPI  2.4.0
API for creating C++ mods for Spore
GameViewManager.h
Go to the documentation of this file.
1 /****************************************************************************
2 * Copyright (C) 2019 Eric Mor
3 *
4 * This file is part of Spore ModAPI.
5 *
6 * Spore ModAPI is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 ****************************************************************************/
19 
20 #pragma once
21 
22 #include <Spore\Object.h>
23 #include <Spore\MathUtils.h>
28 #include <Spore\App\cViewer.h>
30 #include <EASTL\intrusive_list.h>
31 #include <EASTL\vector.h>
32 #include <EASTL\map.h>
33 #include <EASTL\hash_map.h>
34 #include <EASTL\fixed_vector.h>
35 
36 namespace Addresses(Simulator)
37 {
38  DeclareAddress(LightingWorld_ptr, SelectAddress(0x1682CD4, NO_ADDRESS, 0x167EA54));
39 }
40 
41 namespace Simulator
42 {
43  using namespace Math;
44 
45  class cCombatant;
46 
47  class cGameViewManager
48  : public Graphics::IRenderable
49  , public App::IMessageListener
50  , public cStrategy
51  {
52  public:
54  static const uint32_t GraphicsWorldID = 0xEB9968;
56  static const uint32_t LightingWorldID = 0x4A4DEA0;
57 
58  //PLACEHOLDER initialize alll simulator systems? sub_B33270
59 
60  //TODO PLACEHOLDER
61  /* 10h */ virtual void func10h_();
62  /* 14h */ virtual void PrepareSimulator();
63  /* 18h */ virtual void func18h_();
64  /* 1Ch */ virtual void func1Ch_();
65  /* 20h */ virtual void func20h_();
66  /* 24h */ virtual void func24h_();
67  /* 28h */ virtual void func28h_();
68  /* 2Ch */ virtual void func2Ch_();
69  /* 30h */ virtual void func30h_(long nEllapsedMilliseconds);
70  /* 34h */ virtual int func34h_(); // get cRotationRing?
71  /* 38h */ virtual Vector3 func38h_(int, struct Vector3);
72  /* 3Ch */ virtual Vector3 func3Ch_(int);
73  // if pPlayer is not null, it ignores it when checking the position
74  // apparently only detects certain objects like airplanes, creatures, city walls, buildings but not planet ornaments
75  /* 40h */ virtual Vector3 GetWorldMousePosition(int=0, cCombatant* pCombanant=nullptr);
76 
77  protected:
78  /* 24h */ intrusive_list<int> field_24;
79  /* 2Ch */ fixed_vector<int, 16> field_2C;
80  /* 84h */ uint32_t mGameModeID; // -1
81  /* 88h */ intrusive_ptr<Object> field_88;
82  /* 8Ch */ hash_map<int, int> field_8C;
83  /* ACh */ vector<int> field_AC;
84  /* C0h */ bool field_C0;
85  /* C1h */ bool field_C1; // visible?
86  /* C4h */ intrusive_ptr<int> field_C4; // release at 8
87  /* C8h */ map<int, int> field_C8;
88  /* E4h */ intrusive_ptr<Object> field_E4; // IModelWorld?
89  /* E8h */ intrusive_ptr<Object> field_E8;
90  /* ECh */ App::cViewer* field_EC; // with hologram render type
91  /* F0h */ int field_F0; // not initialized, ResourceKey?
92  /* F4h */ int field_F4; // not initialized
93  /* F8h */ int field_F8; // not initialized
94  /* FCh */ int field_FC;
95  /* 100h */ int field_100;
96  /* 104h */ int field_104;
97  /* 108h */ intrusive_ptr<Object> mpCreatureFXAnimWorld;
98  /* 10Ch */ bool mbSuperHighResVehicles;
99  /* 10Dh */ bool mbSuperHighResIgnoreCount;
100  /* 10Eh */ bool mbSuperHighResBuildings;
101  /* 110h */ fixed_vector<int, 32> field_110; // ?
102 
103  public:
105  static cGameViewManager* Get();
106  };
107 
109  return cGameViewManager::Get();
110  }
111 
113  return *(Graphics::ILightingWorld**)(GetAddress(Simulator, LightingWorld_ptr));
114  }
115 
116 
120 
121  static_assert(sizeof(cGameViewManager) == 0x1A8, "sizeof(cGameViewManager) != 1A8h");
122 
123  namespace Addresses(cGameViewManager)
124  {
125  DeclareAddress(Get, SelectAddress(0xB3D1A0, 0xB3D310, 0xB3D340));
126  }
127 }
IModelWorld.h
MathUtils.h
App::IMessageListener
An interface that can receive messages sent through the app.
Definition: IMessageListener.h:49
Graphics::IRenderable
This interface defines an object that can be rendered, and whose render method is called on every gam...
Definition: IRenderable.h:42
cViewer.h
DeclareAddress
#define DeclareAddress(name, value)
Definition: CppRevEngBase.h:124
Simulator::cStrategy
Definition: cStrategy.h:65
App::cViewer
Definition: cViewer.h:49
GetAddress
#define GetAddress(namespaceName, name)
Definition: CppRevEngBase.h:127
IRenderable.h
Simulator::cCombatant
Any object that has hit points and can combat other units.
Definition: cCombatant.h:44
cStrategy.h
Math
Definition: MathUtils.h:36
Simulator::GameViewManager
cGameViewManager * GameViewManager()
Definition: GameViewManager.h:107
Simulator::cGameViewManager
Definition: GameViewManager.h:46
Graphics::ILightingWorld
A lighting world is a space with a specific lighting configuration.
Definition: ILightingWorld.h:50
ILightingWorld.h
Simulator
Definition: IMessageListener.h:167
IMessageListener.h
Simulator::GetLightingWorld
Graphics::ILightingWorld * GetLightingWorld()
Definition: GameViewManager.h:111
Object.h
Math::Vector3
A vector of 3 float values (x, y, z).
Definition: MathUtils.h:105
SelectAddress
#define SelectAddress(addressStandard, addressSteam, addressSteamPatched)
Definition: Internal.h:113