Compare commits

..

12 Commits

Author SHA1 Message Date
Alex Tiernan-Berry
ee696c7b39
Merge 0573235a70 into b4751725a6 2026-02-10 08:55:23 +01:00
fallenoak
b4751725a6
feat(object): implement CGObject_C::AddWorldObject
Some checks are pending
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:cl compiler_name:MSVC cxx:cl os:windows-latest system_name:Windows test_path:WhoaTest]) (push) Waiting to run
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:clang compiler_name:Clang cxx:clang++ os:macos-latest system_name:macOS test_path:WhoaTest]) (push) Waiting to run
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:gcc compiler_name:GCC cxx:g++ os:ubuntu-latest system_name:Linux test_path:WhoaTest]) (push) Waiting to run
2026-02-09 15:40:23 -06:00
fallenoak
9f3160b1d2
feat(world): add CWorld::GetM2Scene 2026-02-09 15:38:48 -06:00
fallenoak
c604ae6d19
feat(ui): implement CSimpleFrame_UnregisterEvent
Some checks are pending
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:cl compiler_name:MSVC cxx:cl os:windows-latest system_name:Windows test_path:WhoaTest]) (push) Waiting to run
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:clang compiler_name:Clang cxx:clang++ os:macos-latest system_name:macOS test_path:WhoaTest]) (push) Waiting to run
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:gcc compiler_name:GCC cxx:g++ os:ubuntu-latest system_name:Linux test_path:WhoaTest]) (push) Waiting to run
2026-02-09 10:49:18 -06:00
fallenoak
17198939da
feat(ui): add FrameScript_Object::UnregisterScriptEvent 2026-02-09 10:48:58 -06:00
fallenoak
121f41d6b8
feat(ui): implement CSimpleFrame_CreateFontString 2026-02-09 08:33:24 -06:00
fallenoak
0d001d4b3f
feat(ui): implement Script_GetCVarDefault 2026-02-09 08:01:56 -06:00
fallenoak
e175894099
feat(ui): implement Script_GetNumRaidMembers 2026-02-09 06:09:41 -06:00
fallenoak
39bf2f5ad4
feat(ui): add RaidInfoRegisterScriptFunctions 2026-02-09 06:04:57 -06:00
fallenoak
8e67adc15f
feat(ui): add CGRaidInfo::NumMembers 2026-02-09 05:55:20 -06:00
fallenoak
8da307593d
feat(ui): implement Script_GetNumPartyMembers 2026-02-09 05:13:02 -06:00
fallenoak
4d003129be
feat(ui): add PartyInfoRegisterScriptFunctions 2026-02-09 05:07:34 -06:00
15 changed files with 510 additions and 6 deletions

View File

@ -1,4 +1,5 @@
#include "object/client/CGObject_C.hpp"
#include "model/Model2.hpp"
#include "object/client/ObjMgr.hpp"
#include "world/World.hpp"
@ -6,6 +7,7 @@ CGObject_C::CGObject_C(uint32_t time, CClientObjCreate& objCreate) {
// TODO
this->m_model = nullptr;
this->m_worldObject = 0;
// TODO
@ -28,7 +30,52 @@ CGObject_C::~CGObject_C() {
}
void CGObject_C::AddWorldObject() {
if (!this->m_model) {
const char* fileName;
if (this->GetModelFileName(fileName)) {
auto model = CWorld::GetM2Scene()->CreateModel(fileName, 0);
this->SetModel(model);
model->Release();
}
}
if (!this->m_model) {
return;
}
if (ClntObjMgrGetPlayerType() != PLAYER_NORMAL) {
return;
}
if (this->m_worldObject) {
// TODO SysMsgPrintf(1, 2, "OBJECTALREADYACTIVE|0x%016I64X", this->GetGUID());
return;
}
uint32_t objFlags = 0x0;
if (this->IsA(TYPE_GAMEOBJECT)) {
objFlags |= 0x8 | 0x2 | 0x1;
} else if (this->IsA(TYPE_DYNAMICOBJECT)) {
objFlags |= 0x8 | 0x2;
} else if (this->IsA(TYPE_CORPSE)) {
// TODO
} else if (this->IsA(TYPE_UNIT)) {
// TODO
objFlags |= 0x10;
if (this->IsA(TYPE_PLAYER)) {
objFlags |= 0x20;
}
}
this->m_worldObject = CWorld::AddObject(this->GetObjectModel(), nullptr, nullptr, this->GetGUID(), 0, objFlags);
if (!this->m_inReenable && this->m_postInited) {
this->UpdateWorldObject(false);
}
}
int32_t CGObject_C::CanBeTargetted() {
@ -48,6 +95,14 @@ void CGObject_C::Disable() {
this->m_disableTimeMs = CWorld::GetCurTimeMs();
}
int32_t CGObject_C::GetModelFileName(const char*& name) {
return false;
}
CM2Model* CGObject_C::GetObjectModel() {
return this->m_model;
}
int32_t CGObject_C::IsInReenable() {
return this->m_inReenable;
}
@ -90,6 +145,25 @@ void CGObject_C::SetDisablePending(int32_t pending) {
}
}
void CGObject_C::SetModel(CM2Model* model) {
// No change
if (this->m_model == model) {
return;
}
if (model) {
model->AddRef();
}
this->m_model = model;
this->SetModelFinish(model);
}
void CGObject_C::SetModelFinish(CM2Model* model) {
// TODO
}
void CGObject_C::SetObjectLocked(int32_t locked) {
if (locked) {
if (this->m_lockCount != 0xFFFF) {
@ -147,3 +221,7 @@ void CGObject_C::SetTypeID(OBJECT_TYPE_ID typeID) {
break;
}
}
void CGObject_C::UpdateWorldObject(int32_t a2) {
// TODO
}

View File

@ -5,6 +5,7 @@
#include "object/client/CClientObjCreate.hpp"
#include "object/client/CGObject.hpp"
#include "util/GUID.hpp"
#include "world/Types.hpp"
#include <storm/Hash.hpp>
#include <storm/List.hpp>
@ -18,6 +19,7 @@ class CGObject_C : public CGObject, public TSHashObject<CGObject_C, CHashKeyGUID
// TODO
CM2Model* m_model;
// TODO
HWORLDOBJECT m_worldObject;
uint32_t m_lockCount : 16;
uint32_t m_disabled : 1;
uint32_t m_inReenable : 1;
@ -32,9 +34,14 @@ class CGObject_C : public CGObject, public TSHashObject<CGObject_C, CHashKeyGUID
void Reenable();
void PostReenable();
virtual void HandleOutOfRange(OUT_OF_RANGE_TYPE type) {};
virtual void UpdateWorldObject(int32_t a2);
// TODO
virtual int32_t GetModelFileName(const char*& name);
// TODO
virtual int32_t CanHighlight();
virtual int32_t CanBeTargetted();
// TODO
virtual CM2Model* GetObjectModel();
// Public member functions
CGObject_C() = default;
@ -45,6 +52,8 @@ class CGObject_C : public CGObject, public TSHashObject<CGObject_C, CHashKeyGUID
void PostInit(uint32_t time, const CClientObjCreate& init, bool a4);
void SetBlock(uint32_t block, uint32_t value);
void SetDisablePending(int32_t pending);
void SetModel(CM2Model* model);
void SetModelFinish(CM2Model* model);
void SetObjectLocked(int32_t locked);
void SetStorage(uint32_t* storage, uint32_t* saved);
void SetTypeID(OBJECT_TYPE_ID typeID);

View File

@ -193,6 +193,25 @@ int32_t FrameScript_Object::SetScript(lua_State* L) {
return 0;
}
void FrameScript_Object::UnregisterScriptEvent(const char* name) {
auto event = FrameScript::s_scriptEventsHash.Ptr(name);
if (!event) {
return;
}
if (event->pendingSignalCount) {
for (auto node = event->registerListeners.Head(); node; node = event->registerListeners.Next(node)) {
if (node->listener == this) {
event->registerListeners.DeleteNode(node);
break;
}
}
}
FrameScript_UnregisterScriptEvent(this, event);
}
void FrameScript_Object::UnregisterScriptObject(const char* name) {
auto L = FrameScript_GetContext();

View File

@ -48,6 +48,7 @@ class FrameScript_Object {
void RegisterScriptObject(const char* name);
void RunScript(ScriptIx const& script, int32_t argCount, const char* a4);
int32_t SetScript(lua_State* L);
void UnregisterScriptEvent(const char* name);
void UnregisterScriptObject(const char* name);
};

View File

@ -19,6 +19,8 @@
#include "ui/game/CharacterInfoScript.hpp"
#include "ui/game/GMTicketInfoScript.hpp"
#include "ui/game/GameScript.hpp"
#include "ui/game/PartyInfoScript.hpp"
#include "ui/game/RaidInfoScript.hpp"
#include "ui/game/ScriptEvents.hpp"
#include "ui/game/TradeInfoScript.hpp"
#include "ui/game/Types.hpp"
@ -56,6 +58,7 @@ void LoadScriptFunctions() {
// TODO
ActionBarRegisterScriptFunctions();
PartyInfoRegisterScriptFunctions();
// TODO
@ -71,6 +74,10 @@ void LoadScriptFunctions() {
// TODO
RaidInfoRegisterScriptFunctions();
// TODO
GMTicketInfoRegisterScriptFunctions();
BattlenetUI_RegisterScriptFunctions();
}

View File

@ -0,0 +1,7 @@
#include "ui/game/CGRaidInfo.hpp"
uint32_t CGRaidInfo::s_numMembers;
uint32_t CGRaidInfo::NumMembers() {
return CGRaidInfo::s_numMembers;
}

View File

@ -0,0 +1,16 @@
#ifndef UI_GAME_C_G_RAID_INFO_HPP
#define UI_GAME_C_G_RAID_INFO_HPP
#include <cstdint>
class CGRaidInfo {
public:
// Public static functions
static uint32_t NumMembers();
private:
// Private static variables
static uint32_t s_numMembers;
};
#endif

View File

@ -206,7 +206,22 @@ int32_t Script_GetCVarBool(lua_State* L) {
}
int32_t Script_GetCVarDefault(lua_State* L) {
WHOA_UNIMPLEMENTED(0);
if (!lua_isstring(L, 1)) {
luaL_error(L, "Usage: GetCVarDefault(\"cvar\")");
return 0;
}
auto varName = lua_tostring(L, 1);
auto var = CVar::LookupRegistered(varName);
if (!var || (var->m_flags & 0x40)) {
luaL_error(L, "Couldn't find CVar named '%s'", varName);
return 0;
}
lua_pushstring(L, var->GetDefaultValue());
return 1;
}
int32_t Script_GetCVarMin(lua_State* L) {

View File

@ -0,0 +1,130 @@
#include "ui/game/PartyInfoScript.hpp"
#include "ui/FrameScript.hpp"
#include "ui/game/CGPartyInfo.hpp"
#include "util/Lua.hpp"
#include "util/Unimplemented.hpp"
namespace {
int32_t Script_GetNumPartyMembers(lua_State* L) {
lua_pushnumber(L, CGPartyInfo::NumMembers());
return 1;
}
int32_t Script_GetRealNumPartyMembers(lua_State* L) {
WHOA_UNIMPLEMENTED(0);
}
int32_t Script_GetPartyMember(lua_State* L) {
WHOA_UNIMPLEMENTED(0);
}
int32_t Script_GetPartyLeaderIndex(lua_State* L) {
WHOA_UNIMPLEMENTED(0);
}
int32_t Script_IsPartyLeader(lua_State* L) {
WHOA_UNIMPLEMENTED(0);
}
int32_t Script_IsRealPartyLeader(lua_State* L) {
WHOA_UNIMPLEMENTED(0);
}
int32_t Script_LeaveParty(lua_State* L) {
WHOA_UNIMPLEMENTED(0);
}
int32_t Script_GetLootMethod(lua_State* L) {
WHOA_UNIMPLEMENTED(0);
}
int32_t Script_SetLootMethod(lua_State* L) {
WHOA_UNIMPLEMENTED(0);
}
int32_t Script_GetLootThreshold(lua_State* L) {
WHOA_UNIMPLEMENTED(0);
}
int32_t Script_SetLootThreshold(lua_State* L) {
WHOA_UNIMPLEMENTED(0);
}
int32_t Script_SetPartyAssignment(lua_State* L) {
WHOA_UNIMPLEMENTED(0);
}
int32_t Script_ClearPartyAssignment(lua_State* L) {
WHOA_UNIMPLEMENTED(0);
}
int32_t Script_GetPartyAssignment(lua_State* L) {
WHOA_UNIMPLEMENTED(0);
}
int32_t Script_SilenceMember(lua_State* L) {
WHOA_UNIMPLEMENTED(0);
}
int32_t Script_UnSilenceMember(lua_State* L) {
WHOA_UNIMPLEMENTED(0);
}
int32_t Script_SetOptOutOfLoot(lua_State* L) {
WHOA_UNIMPLEMENTED(0);
}
int32_t Script_GetOptOutOfLoot(lua_State* L) {
WHOA_UNIMPLEMENTED(0);
}
int32_t Script_CanChangePlayerDifficulty(lua_State* L) {
WHOA_UNIMPLEMENTED(0);
}
int32_t Script_ChangePlayerDifficulty(lua_State* L) {
WHOA_UNIMPLEMENTED(0);
}
int32_t Script_IsPartyLFG(lua_State* L) {
WHOA_UNIMPLEMENTED(0);
}
int32_t Script_HasLFGRestrictions(lua_State* L) {
WHOA_UNIMPLEMENTED(0);
}
}
static FrameScript_Method s_ScriptFunctions[] = {
{ "GetNumPartyMembers", &Script_GetNumPartyMembers },
{ "GetRealNumPartyMembers", &Script_GetRealNumPartyMembers },
{ "GetPartyMember", &Script_GetPartyMember },
{ "GetPartyLeaderIndex", &Script_GetPartyLeaderIndex },
{ "IsPartyLeader", &Script_IsPartyLeader },
{ "IsRealPartyLeader", &Script_IsRealPartyLeader },
{ "LeaveParty", &Script_LeaveParty },
{ "GetLootMethod", &Script_GetLootMethod },
{ "SetLootMethod", &Script_SetLootMethod },
{ "GetLootThreshold", &Script_GetLootThreshold },
{ "SetLootThreshold", &Script_SetLootThreshold },
{ "SetPartyAssignment", &Script_SetPartyAssignment },
{ "ClearPartyAssignment", &Script_ClearPartyAssignment },
{ "GetPartyAssignment", &Script_GetPartyAssignment },
{ "SilenceMember", &Script_SilenceMember },
{ "UnSilenceMember", &Script_UnSilenceMember },
{ "SetOptOutOfLoot", &Script_SetOptOutOfLoot },
{ "GetOptOutOfLoot", &Script_GetOptOutOfLoot },
{ "CanChangePlayerDifficulty", &Script_CanChangePlayerDifficulty },
{ "ChangePlayerDifficulty", &Script_ChangePlayerDifficulty },
{ "IsPartyLFG", &Script_IsPartyLFG },
{ "HasLFGRestrictions", &Script_HasLFGRestrictions },
};
void PartyInfoRegisterScriptFunctions() {
for (auto& func : s_ScriptFunctions) {
FrameScript_RegisterFunction(func.name, func.method);
}
}

View File

@ -0,0 +1,6 @@
#ifndef UI_GAME_PARTY_INFO_SCRIPT_HPP
#define UI_GAME_PARTY_INFO_SCRIPT_HPP
void PartyInfoRegisterScriptFunctions();
#endif

View File

@ -0,0 +1,120 @@
#include "ui/game/RaidInfoScript.hpp"
#include "ui/FrameScript.hpp"
#include "ui/game/CGRaidInfo.hpp"
#include "util/Lua.hpp"
#include "util/Unimplemented.hpp"
namespace {
int32_t Script_GetNumRaidMembers(lua_State* L) {
lua_pushnumber(L, CGRaidInfo::NumMembers());
return 1;
}
int32_t Script_GetRealNumRaidMembers(lua_State* L) {
WHOA_UNIMPLEMENTED(0);
}
int32_t Script_GetRaidRosterInfo(lua_State* L) {
WHOA_UNIMPLEMENTED(0);
}
int32_t Script_SetRaidRosterSelection(lua_State* L) {
WHOA_UNIMPLEMENTED(0);
}
int32_t Script_GetRaidRosterSelection(lua_State* L) {
WHOA_UNIMPLEMENTED(0);
}
int32_t Script_IsRaidLeader(lua_State* L) {
WHOA_UNIMPLEMENTED(0);
}
int32_t Script_IsRealRaidLeader(lua_State* L) {
WHOA_UNIMPLEMENTED(0);
}
int32_t Script_IsRaidOfficer(lua_State* L) {
WHOA_UNIMPLEMENTED(0);
}
int32_t Script_SetRaidSubgroup(lua_State* L) {
WHOA_UNIMPLEMENTED(0);
}
int32_t Script_SwapRaidSubgroup(lua_State* L) {
WHOA_UNIMPLEMENTED(0);
}
int32_t Script_ConvertToRaid(lua_State* L) {
WHOA_UNIMPLEMENTED(0);
}
int32_t Script_PromoteToLeader(lua_State* L) {
WHOA_UNIMPLEMENTED(0);
}
int32_t Script_PromoteToAssistant(lua_State* L) {
WHOA_UNIMPLEMENTED(0);
}
int32_t Script_DemoteAssistant(lua_State* L) {
WHOA_UNIMPLEMENTED(0);
}
int32_t Script_SetRaidTarget(lua_State* L) {
WHOA_UNIMPLEMENTED(0);
}
int32_t Script_GetRaidTargetIndex(lua_State* L) {
WHOA_UNIMPLEMENTED(0);
}
int32_t Script_DoReadyCheck(lua_State* L) {
WHOA_UNIMPLEMENTED(0);
}
int32_t Script_ConfirmReadyCheck(lua_State* L) {
WHOA_UNIMPLEMENTED(0);
}
int32_t Script_GetReadyCheckTimeLeft(lua_State* L) {
WHOA_UNIMPLEMENTED(0);
}
int32_t Script_GetReadyCheckStatus(lua_State* L) {
WHOA_UNIMPLEMENTED(0);
}
}
static FrameScript_Method s_ScriptFunctions[] = {
{ "GetNumRaidMembers", &Script_GetNumRaidMembers },
{ "GetRealNumRaidMembers", &Script_GetRealNumRaidMembers },
{ "GetRaidRosterInfo", &Script_GetRaidRosterInfo },
{ "SetRaidRosterSelection", &Script_SetRaidRosterSelection },
{ "GetRaidRosterSelection", &Script_GetRaidRosterSelection },
{ "IsRaidLeader", &Script_IsRaidLeader },
{ "IsRealRaidLeader", &Script_IsRealRaidLeader },
{ "IsRaidOfficer", &Script_IsRaidOfficer },
{ "SetRaidSubgroup", &Script_SetRaidSubgroup },
{ "SwapRaidSubgroup", &Script_SwapRaidSubgroup },
{ "ConvertToRaid", &Script_ConvertToRaid },
{ "PromoteToLeader", &Script_PromoteToLeader },
{ "PromoteToAssistant", &Script_PromoteToAssistant },
{ "DemoteAssistant", &Script_DemoteAssistant },
{ "SetRaidTarget", &Script_SetRaidTarget },
{ "GetRaidTargetIndex", &Script_GetRaidTargetIndex },
{ "DoReadyCheck", &Script_DoReadyCheck },
{ "ConfirmReadyCheck", &Script_ConfirmReadyCheck },
{ "GetReadyCheckTimeLeft", &Script_GetReadyCheckTimeLeft },
{ "GetReadyCheckStatus", &Script_GetReadyCheckStatus },
};
void RaidInfoRegisterScriptFunctions() {
for (auto& func : s_ScriptFunctions) {
FrameScript_RegisterFunction(func.name, func.method);
}
}

View File

@ -0,0 +1,6 @@
#ifndef UI_GAME_RAID_INFO_SCRIPT_HPP
#define UI_GAME_RAID_INFO_SCRIPT_HPP
void RaidInfoRegisterScriptFunctions();
#endif

View File

@ -3,6 +3,8 @@
#include "ui/CBackdropGenerator.hpp"
#include "ui/FrameScript.hpp"
#include "ui/FrameXML.hpp"
#include "ui/simple/CSimpleFont.hpp"
#include "ui/simple/CSimpleFontString.hpp"
#include "ui/simple/CSimpleFrame.hpp"
#include "ui/simple/CSimpleTexture.hpp"
#include "util/Lua.hpp"
@ -85,7 +87,73 @@ int32_t CSimpleFrame_CreateTexture(lua_State* L) {
}
int32_t CSimpleFrame_CreateFontString(lua_State* L) {
WHOA_UNIMPLEMENTED(0);
auto type = CSimpleFrame::GetObjectType();
auto frame = static_cast<CSimpleFrame*>(FrameScript_GetObjectThis(L, type));
const char* name = nullptr;
if (lua_isstring(L, 2)) {
name = lua_tostring(L, 2);
}
int32_t drawlayer = DRAWLAYER_ARTWORK;
if (lua_isstring(L, 3)) {
auto drawlayerStr = lua_tostring(L, 3);
StringToDrawLayer(drawlayerStr, drawlayer);
}
CSimpleFont* inheritFont = nullptr;
XMLNode* inheritNode = nullptr;
if (lua_type(L, 4) == LUA_TSTRING) {
auto inheritName = lua_tostring(L, 4);
inheritFont = CSimpleFont::GetFont(inheritName, 0);
if (!inheritFont) {
const char* tainted;
bool locked;
inheritNode = FrameXML_AcquireHashNode(inheritName, tainted, locked);
if (!inheritNode) {
luaL_error(L, "%s:CreateFontString(): Couldn't find inherited node \"%s\"", frame->GetDisplayName(), inheritName);
return 0;
}
if (locked) {
luaL_error(L, "%s:CreateFontString(): Recursively inherited node \"%s\"", frame->GetDisplayName(), inheritName);
return 0;
}
}
}
// TODO CDataAllocator::GetData
auto string = STORM_NEW(CSimpleFontString)(frame, drawlayer, true);
if (name && *name) {
string->SetName(name);
}
if (inheritFont) {
string->SetFontObject(inheritFont);
} else if (inheritNode) {
CStatus status;
string->LoadXML(inheritNode, &status);
string->PostLoadXML(inheritNode, &status);
auto inheritName = lua_tostring(L, 4);
FrameXML_ReleaseHashNode(inheritName);
}
// TODO anim related logic?
if (!string->lua_registered) {
string->RegisterScriptObject(nullptr);
}
lua_rawgeti(L, LUA_REGISTRYINDEX, string->lua_objectRef);
return 1;
}
int32_t CSimpleFrame_GetBoundsRect(lua_State* L) {
@ -221,7 +289,19 @@ int32_t CSimpleFrame_RegisterEvent(lua_State* L) {
}
int32_t CSimpleFrame_UnregisterEvent(lua_State* L) {
WHOA_UNIMPLEMENTED(0);
auto type = CSimpleFrame::GetObjectType();
auto frame = static_cast<CSimpleFrame*>(FrameScript_GetObjectThis(L, type));
if (!lua_isstring(L, 2)) {
luaL_error(L, "Usage: %s:UnregisterEvent(\"event\")", frame->GetDisplayName());
return 0;
}
auto eventName = lua_tostring(L, 2);
frame->UnregisterScriptEvent(eventName);
return 0;
}
int32_t CSimpleFrame_RegisterAllEvents(lua_State* L) {

View File

@ -12,6 +12,7 @@ uint32_t CWorld::s_enables;
uint32_t CWorld::s_enables2;
uint32_t CWorld::s_gameTimeFixed;
float CWorld::s_gameTimeSec;
CM2Scene* CWorld::s_m2Scene;
uint32_t CWorld::s_tickTimeFixed;
uint32_t CWorld::s_tickTimeMs;
float CWorld::s_tickTimeSec;
@ -66,6 +67,10 @@ float CWorld::GetGameTimeSec() {
return CWorld::s_gameTimeSec;
}
CM2Scene* CWorld::GetM2Scene() {
return CWorld::s_m2Scene;
}
uint32_t CWorld::GetTickTimeFixed() {
return CWorld::s_tickTimeFixed;
}
@ -97,8 +102,6 @@ void CWorld::Initialize() {
CWorld::s_gameTimeFixed = 0;
CWorld::s_gameTimeSec = 0.0f;
// TODO
if (GxCaps().m_shaderTargets[GxSh_Pixel] > GxShPS_none) {
CWorld::s_enables |= Enables::Enable_PixelShader;
}
@ -109,6 +112,10 @@ void CWorld::Initialize() {
// TODO
CWorld::s_m2Scene = M2CreateScene();
// TODO
uint32_t m2Flags = M2GetCacheFlags();
CShaderEffect::InitShaderSystem(
(m2Flags & 0x8) != 0,

View File

@ -7,6 +7,7 @@
#include <cstdint>
class CM2Model;
class CM2Scene;
class Weather;
class CWorld {
@ -58,6 +59,7 @@ class CWorld {
static float GetCurTimeSec();
static uint32_t GetGameTimeFixed();
static float GetGameTimeSec();
static CM2Scene* GetM2Scene();
static uint32_t GetTickTimeFixed();
static uint32_t GetTickTimeMs();
static float GetTickTimeSec();
@ -72,6 +74,7 @@ class CWorld {
static float s_curTimeSec;
static uint32_t s_gameTimeFixed;
static float s_gameTimeSec;
static CM2Scene* s_m2Scene;
static uint32_t s_tickTimeFixed;
static uint32_t s_tickTimeMs;
static float s_tickTimeSec;