mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-02 16:52:45 +03:00
Compare commits
1 Commits
e6429be108
...
017eb85b69
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
017eb85b69 |
@ -18,7 +18,6 @@
|
|||||||
#include "sound/Interface.hpp"
|
#include "sound/Interface.hpp"
|
||||||
#include "ui/FrameScript.hpp"
|
#include "ui/FrameScript.hpp"
|
||||||
#include "ui/FrameXML.hpp"
|
#include "ui/FrameXML.hpp"
|
||||||
#include "ui/Game.hpp"
|
|
||||||
#include "util/Random.hpp"
|
#include "util/Random.hpp"
|
||||||
#include "world/World.hpp"
|
#include "world/World.hpp"
|
||||||
#include <bc/Debug.hpp>
|
#include <bc/Debug.hpp>
|
||||||
@ -86,10 +85,6 @@ void ClientInitializeGame(uint32_t mapId, C3Vector position) {
|
|||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
|
|
||||||
CGGameUI::InitializeGame();
|
|
||||||
|
|
||||||
// TODO
|
|
||||||
|
|
||||||
EventRegister(EVENT_ID_IDLE, ClientIdle);
|
EventRegister(EVENT_ID_IDLE, ClientIdle);
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
|
|||||||
@ -25,7 +25,6 @@
|
|||||||
#include "ui/FrameScript.hpp"
|
#include "ui/FrameScript.hpp"
|
||||||
#include "ui/FrameXML.hpp"
|
#include "ui/FrameXML.hpp"
|
||||||
#include "ui/Interface.hpp"
|
#include "ui/Interface.hpp"
|
||||||
#include "ui/Key.hpp"
|
|
||||||
#include "ui/ScriptFunctions.hpp"
|
#include "ui/ScriptFunctions.hpp"
|
||||||
#include "ui/game/CGVideoOptions.hpp"
|
#include "ui/game/CGVideoOptions.hpp"
|
||||||
#include "ui/simple/CSimpleModelFFX.hpp"
|
#include "ui/simple/CSimpleModelFFX.hpp"
|
||||||
@ -37,6 +36,25 @@
|
|||||||
#include <common/MD5.hpp>
|
#include <common/MD5.hpp>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
|
||||||
|
unsigned char InterfaceKey[256] = {
|
||||||
|
0xC3, 0x5B, 0x50, 0x84, 0xB9, 0x3E, 0x32, 0x42, 0x8C, 0xD0, 0xC7, 0x48, 0xFA, 0x0E, 0x5D, 0x54,
|
||||||
|
0x5A, 0xA3, 0x0E, 0x14, 0xBA, 0x9E, 0x0D, 0xB9, 0x5D, 0x8B, 0xEE, 0xB6, 0x84, 0x93, 0x45, 0x75,
|
||||||
|
0xFF, 0x31, 0xFE, 0x2F, 0x64, 0x3F, 0x3D, 0x6D, 0x07, 0xD9, 0x44, 0x9B, 0x40, 0x85, 0x59, 0x34,
|
||||||
|
0x4E, 0x10, 0xE1, 0xE7, 0x43, 0x69, 0xEF, 0x7C, 0x16, 0xFC, 0xB4, 0xED, 0x1B, 0x95, 0x28, 0xA8,
|
||||||
|
0x23, 0x76, 0x51, 0x31, 0x57, 0x30, 0x2B, 0x79, 0x08, 0x50, 0x10, 0x1C, 0x4A, 0x1A, 0x2C, 0xC8,
|
||||||
|
0x8B, 0x8F, 0x05, 0x2D, 0x22, 0x3D, 0xDB, 0x5A, 0x24, 0x7A, 0x0F, 0x13, 0x50, 0x37, 0x8F, 0x5A,
|
||||||
|
0xCC, 0x9E, 0x04, 0x44, 0x0E, 0x87, 0x01, 0xD4, 0xA3, 0x15, 0x94, 0x16, 0x34, 0xC6, 0xC2, 0xC3,
|
||||||
|
0xFB, 0x49, 0xFE, 0xE1, 0xF9, 0xDA, 0x8C, 0x50, 0x3C, 0xBE, 0x2C, 0xBB, 0x57, 0xED, 0x46, 0xB9,
|
||||||
|
0xAD, 0x8B, 0xC6, 0xDF, 0x0E, 0xD6, 0x0F, 0xBE, 0x80, 0xB3, 0x8B, 0x1E, 0x77, 0xCF, 0xAD, 0x22,
|
||||||
|
0xCF, 0xB7, 0x4B, 0xCF, 0xFB, 0xF0, 0x6B, 0x11, 0x45, 0x2D, 0x7A, 0x81, 0x18, 0xF2, 0x92, 0x7E,
|
||||||
|
0x98, 0x56, 0x5D, 0x5E, 0x69, 0x72, 0x0A, 0x0D, 0x03, 0x0A, 0x85, 0xA2, 0x85, 0x9C, 0xCB, 0xFB,
|
||||||
|
0x56, 0x6E, 0x8F, 0x44, 0xBB, 0x8F, 0x02, 0x22, 0x68, 0x63, 0x97, 0xBC, 0x85, 0xBA, 0xA8, 0xF7,
|
||||||
|
0xB5, 0x40, 0x68, 0x3C, 0x77, 0x86, 0x6F, 0x4B, 0xD7, 0x88, 0xCA, 0x8A, 0xD7, 0xCE, 0x36, 0xF0,
|
||||||
|
0x45, 0x6E, 0xD5, 0x64, 0x79, 0x0F, 0x17, 0xFC, 0x64, 0xDD, 0x10, 0x6F, 0xF3, 0xF5, 0xE0, 0xA6,
|
||||||
|
0xC3, 0xFB, 0x1B, 0x8C, 0x29, 0xEF, 0x8E, 0xE5, 0x34, 0xCB, 0xD1, 0x2A, 0xCE, 0x79, 0xC3, 0x9A,
|
||||||
|
0x0D, 0x36, 0xEA, 0x01, 0xE0, 0xAA, 0x91, 0x20, 0x54, 0xF0, 0x72, 0xD8, 0x1E, 0xC7, 0x89, 0xD2
|
||||||
|
};
|
||||||
|
|
||||||
int32_t CGlueMgr::m_acceptedEULA = 1; // TODO
|
int32_t CGlueMgr::m_acceptedEULA = 1; // TODO
|
||||||
int32_t CGlueMgr::m_acceptedTerminationWithoutNotice;
|
int32_t CGlueMgr::m_acceptedTerminationWithoutNotice;
|
||||||
int32_t CGlueMgr::m_acceptedTOS = 1; // TODO
|
int32_t CGlueMgr::m_acceptedTOS = 1; // TODO
|
||||||
@ -987,53 +1005,51 @@ void CGlueMgr::Resume() {
|
|||||||
|
|
||||||
DeleteInterfaceFiles();
|
DeleteInterfaceFiles();
|
||||||
|
|
||||||
uint8_t digest1[16];
|
|
||||||
|
|
||||||
switch (FrameXML_CheckSignature("Interface\\GlueXML\\GlueXML.toc", nullptr, InterfaceKey, digest1)) {
|
|
||||||
case 0: {
|
|
||||||
status.Add(STATUS_WARNING, "GlueXML missing signature");
|
|
||||||
ClientPostClose(9);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
case 1: {
|
|
||||||
status.Add(STATUS_WARNING, "GlueXML has corrupt signature");
|
|
||||||
ClientPostClose(9);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
case 2: {
|
|
||||||
status.Add(STATUS_WARNING, "GlueXML is modified or corrupt");
|
|
||||||
ClientPostClose(9);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
case 3: {
|
|
||||||
// Success
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
default: {
|
|
||||||
ClientPostClose(9);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MD5_CTX md5;
|
MD5_CTX md5;
|
||||||
|
unsigned char digest1[16];
|
||||||
|
unsigned char digest2[16];
|
||||||
|
|
||||||
|
int32_t v8;
|
||||||
|
unsigned char* v9;
|
||||||
|
unsigned char* v10;
|
||||||
|
|
||||||
MD5Init(&md5);
|
MD5Init(&md5);
|
||||||
|
|
||||||
|
switch (FrameXML_CheckSignature("Interface\\GlueXML\\GlueXML.toc", 0, InterfaceKey, digest1)) {
|
||||||
|
case 0:
|
||||||
|
status.Add(STATUS_WARNING, "GlueXML missing signature");
|
||||||
|
ClientPostClose(9);
|
||||||
|
return;
|
||||||
|
|
||||||
|
case 1:
|
||||||
|
status.Add(STATUS_WARNING, "GlueXML has corrupt signature");
|
||||||
|
ClientPostClose(9);
|
||||||
|
return;
|
||||||
|
|
||||||
|
case 2:
|
||||||
|
status.Add(STATUS_WARNING, "GlueXML is modified or corrupt");
|
||||||
|
ClientPostClose(9);
|
||||||
|
return;
|
||||||
|
|
||||||
|
case 3:
|
||||||
FrameXML_FreeHashNodes();
|
FrameXML_FreeHashNodes();
|
||||||
|
FrameXML_CreateFrames("Interface\\GlueXML\\GlueXML.toc", 0, &md5, &status);
|
||||||
|
|
||||||
FrameXML_CreateFrames("Interface\\GlueXML\\GlueXML.toc", nullptr, &md5, &status);
|
|
||||||
|
|
||||||
uint8_t digest2[16];
|
|
||||||
MD5Final(digest2, &md5);
|
MD5Final(digest2, &md5);
|
||||||
|
|
||||||
// TODO digest validation
|
v8 = 16;
|
||||||
|
v9 = digest2;
|
||||||
|
v10 = digest1;
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
ClientPostClose(9);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
// - some kind of digest validation?
|
||||||
|
|
||||||
FrameScript_SignalEvent(22, nullptr);
|
FrameScript_SignalEvent(22, nullptr);
|
||||||
|
|
||||||
|
|||||||
@ -5,12 +5,6 @@
|
|||||||
|
|
||||||
int32_t FrameScript_Object::s_objectTypes = 0;
|
int32_t FrameScript_Object::s_objectTypes = 0;
|
||||||
|
|
||||||
FrameScript_Object::ScriptIx::~ScriptIx() {
|
|
||||||
if (this->luaRef) {
|
|
||||||
luaL_unref(FrameScript_GetContext(), LUA_REGISTRYINDEX, this->luaRef);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t FrameScript_Object::CreateScriptMetaTable(lua_State* L, void (*a2)(lua_State* L)) {
|
int32_t FrameScript_Object::CreateScriptMetaTable(lua_State* L, void (*a2)(lua_State* L)) {
|
||||||
lua_createtable(L, 0, 0);
|
lua_createtable(L, 0, 0);
|
||||||
lua_pushstring(L, "__index");
|
lua_pushstring(L, "__index");
|
||||||
@ -30,6 +24,12 @@ void FrameScript_Object::FillScriptMethodTable(lua_State *L, FrameScript_Method
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FrameScript_Object::~FrameScript_Object() {
|
||||||
|
if (this->m_onEvent.luaRef) {
|
||||||
|
luaL_unref(FrameScript_GetContext(), LUA_REGISTRYINDEX, this->m_onEvent.luaRef);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const char* FrameScript_Object::GetDisplayName() {
|
const char* FrameScript_Object::GetDisplayName() {
|
||||||
const char* name = this->GetName();
|
const char* name = this->GetName();
|
||||||
return name ? name : "<unnamed>";
|
return name ? name : "<unnamed>";
|
||||||
|
|||||||
@ -14,7 +14,6 @@ class FrameScript_Object {
|
|||||||
struct ScriptIx {
|
struct ScriptIx {
|
||||||
int32_t luaRef = 0;
|
int32_t luaRef = 0;
|
||||||
const char* unk = nullptr;
|
const char* unk = nullptr;
|
||||||
~ScriptIx();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class ScriptFunction {
|
class ScriptFunction {
|
||||||
@ -35,7 +34,7 @@ class FrameScript_Object {
|
|||||||
ScriptIx m_onEvent;
|
ScriptIx m_onEvent;
|
||||||
|
|
||||||
// Virtual member functions
|
// Virtual member functions
|
||||||
virtual ~FrameScript_Object() = default;
|
virtual ~FrameScript_Object();
|
||||||
virtual char* GetName() = 0;
|
virtual char* GetName() = 0;
|
||||||
virtual int32_t GetScriptMetaTable() = 0;
|
virtual int32_t GetScriptMetaTable() = 0;
|
||||||
virtual ScriptIx* GetScriptByName(const char* name, ScriptData& data);
|
virtual ScriptIx* GetScriptByName(const char* name, ScriptData& data);
|
||||||
|
|||||||
@ -1,6 +0,0 @@
|
|||||||
#ifndef UI_GAME_HPP
|
|
||||||
#define UI_GAME_HPP
|
|
||||||
|
|
||||||
#include "ui/game/CGGameUI.hpp"
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@ -1,20 +0,0 @@
|
|||||||
#include "ui/Key.hpp"
|
|
||||||
|
|
||||||
uint8_t InterfaceKey[256] = {
|
|
||||||
0xC3, 0x5B, 0x50, 0x84, 0xB9, 0x3E, 0x32, 0x42, 0x8C, 0xD0, 0xC7, 0x48, 0xFA, 0x0E, 0x5D, 0x54,
|
|
||||||
0x5A, 0xA3, 0x0E, 0x14, 0xBA, 0x9E, 0x0D, 0xB9, 0x5D, 0x8B, 0xEE, 0xB6, 0x84, 0x93, 0x45, 0x75,
|
|
||||||
0xFF, 0x31, 0xFE, 0x2F, 0x64, 0x3F, 0x3D, 0x6D, 0x07, 0xD9, 0x44, 0x9B, 0x40, 0x85, 0x59, 0x34,
|
|
||||||
0x4E, 0x10, 0xE1, 0xE7, 0x43, 0x69, 0xEF, 0x7C, 0x16, 0xFC, 0xB4, 0xED, 0x1B, 0x95, 0x28, 0xA8,
|
|
||||||
0x23, 0x76, 0x51, 0x31, 0x57, 0x30, 0x2B, 0x79, 0x08, 0x50, 0x10, 0x1C, 0x4A, 0x1A, 0x2C, 0xC8,
|
|
||||||
0x8B, 0x8F, 0x05, 0x2D, 0x22, 0x3D, 0xDB, 0x5A, 0x24, 0x7A, 0x0F, 0x13, 0x50, 0x37, 0x8F, 0x5A,
|
|
||||||
0xCC, 0x9E, 0x04, 0x44, 0x0E, 0x87, 0x01, 0xD4, 0xA3, 0x15, 0x94, 0x16, 0x34, 0xC6, 0xC2, 0xC3,
|
|
||||||
0xFB, 0x49, 0xFE, 0xE1, 0xF9, 0xDA, 0x8C, 0x50, 0x3C, 0xBE, 0x2C, 0xBB, 0x57, 0xED, 0x46, 0xB9,
|
|
||||||
0xAD, 0x8B, 0xC6, 0xDF, 0x0E, 0xD6, 0x0F, 0xBE, 0x80, 0xB3, 0x8B, 0x1E, 0x77, 0xCF, 0xAD, 0x22,
|
|
||||||
0xCF, 0xB7, 0x4B, 0xCF, 0xFB, 0xF0, 0x6B, 0x11, 0x45, 0x2D, 0x7A, 0x81, 0x18, 0xF2, 0x92, 0x7E,
|
|
||||||
0x98, 0x56, 0x5D, 0x5E, 0x69, 0x72, 0x0A, 0x0D, 0x03, 0x0A, 0x85, 0xA2, 0x85, 0x9C, 0xCB, 0xFB,
|
|
||||||
0x56, 0x6E, 0x8F, 0x44, 0xBB, 0x8F, 0x02, 0x22, 0x68, 0x63, 0x97, 0xBC, 0x85, 0xBA, 0xA8, 0xF7,
|
|
||||||
0xB5, 0x40, 0x68, 0x3C, 0x77, 0x86, 0x6F, 0x4B, 0xD7, 0x88, 0xCA, 0x8A, 0xD7, 0xCE, 0x36, 0xF0,
|
|
||||||
0x45, 0x6E, 0xD5, 0x64, 0x79, 0x0F, 0x17, 0xFC, 0x64, 0xDD, 0x10, 0x6F, 0xF3, 0xF5, 0xE0, 0xA6,
|
|
||||||
0xC3, 0xFB, 0x1B, 0x8C, 0x29, 0xEF, 0x8E, 0xE5, 0x34, 0xCB, 0xD1, 0x2A, 0xCE, 0x79, 0xC3, 0x9A,
|
|
||||||
0x0D, 0x36, 0xEA, 0x01, 0xE0, 0xAA, 0x91, 0x20, 0x54, 0xF0, 0x72, 0xD8, 0x1E, 0xC7, 0x89, 0xD2
|
|
||||||
};
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
#ifndef UI_KEY_HPP
|
|
||||||
#define UI_KEY_HPP
|
|
||||||
|
|
||||||
#include <cstdint>
|
|
||||||
|
|
||||||
extern uint8_t InterfaceKey[256];
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@ -1,94 +0,0 @@
|
|||||||
#include "ui/game/CGGameUI.hpp"
|
|
||||||
#include "client/Client.hpp"
|
|
||||||
#include "ui/FrameXML.hpp"
|
|
||||||
#include "ui/Key.hpp"
|
|
||||||
#include "ui/game/CGWorldFrame.hpp"
|
|
||||||
#include "ui/simple/CSimpleTop.hpp"
|
|
||||||
#include "util/CStatus.hpp"
|
|
||||||
#include <common/MD5.hpp>
|
|
||||||
|
|
||||||
CSimpleTop* CGGameUI::s_simpleTop;
|
|
||||||
|
|
||||||
void CGGameUI::Initialize() {
|
|
||||||
// TODO
|
|
||||||
|
|
||||||
CGGameUI::s_simpleTop = STORM_NEW(CSimpleTop);
|
|
||||||
|
|
||||||
// TODO
|
|
||||||
|
|
||||||
CGGameUI::RegisterFrameFactories();
|
|
||||||
|
|
||||||
// TODO
|
|
||||||
|
|
||||||
CStatus status;
|
|
||||||
|
|
||||||
// TODO
|
|
||||||
|
|
||||||
uint8_t digest1[16];
|
|
||||||
|
|
||||||
switch (FrameXML_CheckSignature("Interface\\FrameXML\\FrameXML.toc", "Interface\\FrameXML\\Bindings.xml", InterfaceKey, digest1)) {
|
|
||||||
case 0: {
|
|
||||||
status.Add(STATUS_WARNING, "FrameXML missing signature");
|
|
||||||
ClientPostClose(10);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case 1: {
|
|
||||||
status.Add(STATUS_WARNING, "FrameXML has corrupt signature");
|
|
||||||
ClientPostClose(10);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case 2: {
|
|
||||||
status.Add(STATUS_WARNING, "FrameXML is modified or corrupt");
|
|
||||||
ClientPostClose(10);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case 3: {
|
|
||||||
// Success
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
default: {
|
|
||||||
ClientPostClose(10);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MD5_CTX md5;
|
|
||||||
MD5Init(&md5);
|
|
||||||
|
|
||||||
// TODO file count and progress bar logic
|
|
||||||
|
|
||||||
FrameXML_FreeHashNodes();
|
|
||||||
|
|
||||||
FrameXML_CreateFrames("Interface\\FrameXML\\FrameXML.toc", nullptr, &md5, &status);
|
|
||||||
|
|
||||||
// TODO CGUIBindings::s_bindings->Load("Interface\\FrameXML\\Bindings.xml", &md5, &status);
|
|
||||||
|
|
||||||
uint8_t digest2[16];
|
|
||||||
MD5Final(digest2, &md5);
|
|
||||||
|
|
||||||
// TODO digest validation
|
|
||||||
|
|
||||||
// TODO
|
|
||||||
}
|
|
||||||
|
|
||||||
void CGGameUI::InitializeGame() {
|
|
||||||
// TODO
|
|
||||||
|
|
||||||
CGGameUI::Initialize();
|
|
||||||
|
|
||||||
// TODO
|
|
||||||
}
|
|
||||||
|
|
||||||
void CGGameUI::RegisterFrameFactories() {
|
|
||||||
FrameXML_RegisterFactory("WorldFrame", &CGWorldFrame::Create, true);
|
|
||||||
|
|
||||||
// TODO register remaining factories
|
|
||||||
}
|
|
||||||
@ -1,17 +0,0 @@
|
|||||||
#ifndef UI_GAME_C_G_GAME_UI_HPP
|
|
||||||
#define UI_GAME_C_G_GAME_UI_HPP
|
|
||||||
|
|
||||||
class CSimpleTop;
|
|
||||||
|
|
||||||
class CGGameUI {
|
|
||||||
public:
|
|
||||||
// Static variables
|
|
||||||
static CSimpleTop* s_simpleTop;
|
|
||||||
|
|
||||||
// Static functions
|
|
||||||
static void Initialize();
|
|
||||||
static void InitializeGame();
|
|
||||||
static void RegisterFrameFactories();
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@ -1,22 +0,0 @@
|
|||||||
#include "ui/game/CGWorldFrame.hpp"
|
|
||||||
#include <storm/Memory.hpp>
|
|
||||||
|
|
||||||
CSimpleFrame* CGWorldFrame::Create(CSimpleFrame* parent) {
|
|
||||||
// TODO use CDataAllocator
|
|
||||||
|
|
||||||
return STORM_NEW(CGWorldFrame)(parent);
|
|
||||||
}
|
|
||||||
|
|
||||||
CGWorldFrame::CGWorldFrame(CSimpleFrame* parent) : CSimpleFrame(parent) {
|
|
||||||
// TODO
|
|
||||||
|
|
||||||
CGWorldFrame::s_currentWorldFrame = this;
|
|
||||||
|
|
||||||
// TODO
|
|
||||||
|
|
||||||
this->EnableEvent(SIMPLE_EVENT_KEY, -1);
|
|
||||||
this->EnableEvent(SIMPLE_EVENT_MOUSE, -1);
|
|
||||||
this->EnableEvent(SIMPLE_EVENT_MOUSEWHEEL, -1);
|
|
||||||
|
|
||||||
// TODO
|
|
||||||
}
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
#ifndef UI_GAME_C_G_WORLD_FRAME_HPP
|
|
||||||
#define UI_GAME_C_G_WORLD_FRAME_HPP
|
|
||||||
|
|
||||||
#include "ui/simple/CSimpleFrame.hpp"
|
|
||||||
#include <cstdint>
|
|
||||||
|
|
||||||
class CGWorldFrame : public CSimpleFrame {
|
|
||||||
public:
|
|
||||||
// Static variables
|
|
||||||
CGWorldFrame* s_currentWorldFrame;
|
|
||||||
|
|
||||||
// Static functions
|
|
||||||
static CSimpleFrame* Create(CSimpleFrame* parent);
|
|
||||||
|
|
||||||
// Member functions
|
|
||||||
CGWorldFrame(CSimpleFrame* parent);
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@ -17,35 +17,6 @@ uint32_t CWorld::s_tickTimeMs;
|
|||||||
float CWorld::s_tickTimeSec;
|
float CWorld::s_tickTimeSec;
|
||||||
Weather* CWorld::s_weather;
|
Weather* CWorld::s_weather;
|
||||||
|
|
||||||
HWORLDOBJECT CWorld::AddObject(CM2Model* model, void* handler, void* handlerParam, uint64_t param64, uint32_t param32, uint32_t objFlags) {
|
|
||||||
auto entity = CMap::AllocEntity(objFlags & 0x8 ? true : false);
|
|
||||||
|
|
||||||
entity->m_model = model;
|
|
||||||
entity->m_param64 = param64;
|
|
||||||
entity->m_param32 = param32;
|
|
||||||
|
|
||||||
// TODO
|
|
||||||
|
|
||||||
entity->m_dirLightScale = 1.0f;
|
|
||||||
entity->m_dirLightScaleTarget = 1.0f;
|
|
||||||
|
|
||||||
// TODO
|
|
||||||
|
|
||||||
entity->m_type |= CMapBaseObj::Type_200;
|
|
||||||
|
|
||||||
// TODO
|
|
||||||
|
|
||||||
entity->m_flags = 0x0;
|
|
||||||
|
|
||||||
if (objFlags & 0x20) {
|
|
||||||
entity->m_flags = 0x20000;
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO
|
|
||||||
|
|
||||||
return reinterpret_cast<HWORLDOBJECT>(entity);
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32_t CWorld::GetCurTimeMs() {
|
uint32_t CWorld::GetCurTimeMs() {
|
||||||
return CWorld::s_curTimeMs;
|
return CWorld::s_curTimeMs;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,11 +2,9 @@
|
|||||||
#define WORLD_C_WORLD_HPP
|
#define WORLD_C_WORLD_HPP
|
||||||
|
|
||||||
#include "event/Event.hpp"
|
#include "event/Event.hpp"
|
||||||
#include "world/Types.hpp"
|
|
||||||
#include <tempest/Vector.hpp>
|
#include <tempest/Vector.hpp>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
class CM2Model;
|
|
||||||
class Weather;
|
class Weather;
|
||||||
|
|
||||||
class CWorld {
|
class CWorld {
|
||||||
@ -53,7 +51,6 @@ class CWorld {
|
|||||||
static Weather* s_weather;
|
static Weather* s_weather;
|
||||||
|
|
||||||
// Public static functions
|
// Public static functions
|
||||||
static HWORLDOBJECT AddObject(CM2Model* model, void* handler, void* handlerParam, uint64_t param64, uint32_t param32, uint32_t objFlags);
|
|
||||||
static uint32_t GetCurTimeMs();
|
static uint32_t GetCurTimeMs();
|
||||||
static float GetCurTimeSec();
|
static float GetCurTimeSec();
|
||||||
static uint32_t GetGameTimeFixed();
|
static uint32_t GetGameTimeFixed();
|
||||||
|
|||||||
@ -2,10 +2,11 @@
|
|||||||
#define WORLD_MAP_C_MAP_HPP
|
#define WORLD_MAP_C_MAP_HPP
|
||||||
|
|
||||||
#include "world/map/CMapBaseObj.hpp"
|
#include "world/map/CMapBaseObj.hpp"
|
||||||
#include "world/map/CMapEntity.hpp"
|
|
||||||
#include <storm/List.hpp>
|
#include <storm/List.hpp>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
|
class CMapEntity;
|
||||||
|
|
||||||
class CMap {
|
class CMap {
|
||||||
public:
|
public:
|
||||||
// Static variables
|
// Static variables
|
||||||
|
|||||||
@ -18,9 +18,6 @@ class CMapBaseObjLink {
|
|||||||
};
|
};
|
||||||
|
|
||||||
class CMapBaseObj {
|
class CMapBaseObj {
|
||||||
friend class CMap;
|
|
||||||
friend class CWorld;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Enums
|
// Enums
|
||||||
enum {
|
enum {
|
||||||
@ -32,13 +29,10 @@ class CMapBaseObj {
|
|||||||
Type_Entity = 0x20,
|
Type_Entity = 0x20,
|
||||||
Type_DoodadDef = 0x40,
|
Type_DoodadDef = 0x40,
|
||||||
Type_Light = 0x80,
|
Type_Light = 0x80,
|
||||||
Type_100 = 0x100,
|
|
||||||
Type_200 = 0x200,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Public member variables
|
// Public member variables
|
||||||
uint32_t m_memHandle;
|
uint32_t m_memHandle;
|
||||||
uint32_t m_flags = 0x0;
|
|
||||||
TSLink<CMapBaseObj> m_lameAssLink;
|
TSLink<CMapBaseObj> m_lameAssLink;
|
||||||
STORM_EXPLICIT_LIST(CMapBaseObjLink, ownerLink) m_parentLinkList;
|
STORM_EXPLICIT_LIST(CMapBaseObjLink, ownerLink) m_parentLinkList;
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +0,0 @@
|
|||||||
#include "world/map/CMapEntity.hpp"
|
|
||||||
|
|
||||||
CMapEntity::CMapEntity() {
|
|
||||||
this->m_type |= CMapBaseObj::Type_Entity;
|
|
||||||
}
|
|
||||||
@ -2,22 +2,10 @@
|
|||||||
#define WORLD_MAP_C_MAP_ENTITY_HPP
|
#define WORLD_MAP_C_MAP_ENTITY_HPP
|
||||||
|
|
||||||
#include "world/map/CMapStaticEntity.hpp"
|
#include "world/map/CMapStaticEntity.hpp"
|
||||||
#include <tempest/Vector.hpp>
|
|
||||||
|
|
||||||
class CMapEntity : public CMapStaticEntity {
|
class CMapEntity : public CMapStaticEntity {
|
||||||
public:
|
public:
|
||||||
// Member variables
|
|
||||||
void* m_handler = nullptr;
|
|
||||||
void* m_handlerParam = nullptr;
|
|
||||||
uint64_t m_param64 = 0;
|
|
||||||
uint32_t m_param32 = 0;
|
|
||||||
// TODO
|
// TODO
|
||||||
CImVector m_ambientTarget = { 0xFF, 0x00, 0x00, 0x00 };
|
|
||||||
float m_dirLightScaleTarget = 0.0f;
|
|
||||||
// TODO
|
|
||||||
|
|
||||||
// Member functions
|
|
||||||
CMapEntity();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -2,19 +2,10 @@
|
|||||||
#define WORLD_MAP_C_MAP_STATIC_ENTITY_HPP
|
#define WORLD_MAP_C_MAP_STATIC_ENTITY_HPP
|
||||||
|
|
||||||
#include "world/map/CMapBaseObj.hpp"
|
#include "world/map/CMapBaseObj.hpp"
|
||||||
#include <tempest/Vector.hpp>
|
|
||||||
|
|
||||||
class CM2Model;
|
|
||||||
|
|
||||||
class CMapStaticEntity : public CMapBaseObj {
|
class CMapStaticEntity : public CMapBaseObj {
|
||||||
public:
|
public:
|
||||||
// Member variables
|
|
||||||
// TODO
|
// TODO
|
||||||
CM2Model* m_model = nullptr;
|
|
||||||
// TODO
|
|
||||||
CImVector m_ambient = {};
|
|
||||||
CImVector m_interiorDirColor = {};
|
|
||||||
float m_dirLightScale = 0.0f;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user