Compare commits

...

5 Commits

Author SHA1 Message Date
Tristan 'Natrist' Cormier
403cde0942
Merge b902b5484e into aa62781560 2026-01-22 09:37:42 +00:00
fallenoak
aa62781560
feat(world): populate CMapBaseObj
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-01-21 16:06:21 -06:00
fallenoak
536c94a7b7
feat(world): add HWORLDOBJECT
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-01-20 20:56:21 -06:00
fallenoak
88ea9325be
feat(world): stub core map entity classes 2026-01-20 20:56:04 -06:00
Tristan Cormier
b902b5484e feat(glue): implement Script_AcceptedScanning 2026-01-11 17:00:18 -05:00
10 changed files with 103 additions and 1 deletions

View File

@ -56,6 +56,7 @@ unsigned char InterfaceKey[256] = {
}; };
int32_t CGlueMgr::m_acceptedEULA = 1; // TODO int32_t CGlueMgr::m_acceptedEULA = 1; // TODO
int32_t CGlueMgr::m_acceptedScanning = 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
int32_t CGlueMgr::m_accountMsgAvailable; int32_t CGlueMgr::m_accountMsgAvailable;

View File

@ -33,6 +33,7 @@ class CGlueMgr {
// Static variables // Static variables
static int32_t m_acceptedEULA; static int32_t m_acceptedEULA;
static int32_t m_acceptedScanning;
static int32_t m_acceptedTerminationWithoutNotice; static int32_t m_acceptedTerminationWithoutNotice;
static int32_t m_acceptedTOS; static int32_t m_acceptedTOS;
static int32_t m_accountMsgAvailable; static int32_t m_accountMsgAvailable;

View File

@ -210,7 +210,14 @@ int32_t Script_ShowScanningNotice(lua_State* L) {
} }
int32_t Script_ScanningAccepted(lua_State* L) { int32_t Script_ScanningAccepted(lua_State* L) {
WHOA_UNIMPLEMENTED(0); if (CGlueMgr::m_acceptedScanning) {
lua_pushnumber(L, 1.0);
}
else {
lua_pushnil(L);
}
return 1;
} }
int32_t Script_AcceptScanning(lua_State* L) { int32_t Script_AcceptScanning(lua_State* L) {

8
src/world/Types.hpp Normal file
View File

@ -0,0 +1,8 @@
#ifndef WORLD_TYPES_HPP
#define WORLD_TYPES_HPP
#include <cstdint>
typedef uintptr_t HWORLDOBJECT;
#endif

View File

@ -1,6 +1,7 @@
#include "world/map/CMap.hpp" #include "world/map/CMap.hpp"
#include <storm/String.hpp> #include <storm/String.hpp>
STORM_EXPLICIT_LIST(CMapBaseObj, m_lameAssLink) CMap::s_entityList;
char CMap::s_mapName[256]; char CMap::s_mapName[256];
char CMap::s_mapPath[256]; char CMap::s_mapPath[256];
char CMap::s_wdtFilename[256]; char CMap::s_wdtFilename[256];

View File

@ -1,11 +1,14 @@
#ifndef WORLD_MAP_C_MAP_HPP #ifndef WORLD_MAP_C_MAP_HPP
#define WORLD_MAP_C_MAP_HPP #define WORLD_MAP_C_MAP_HPP
#include "world/map/CMapBaseObj.hpp"
#include <storm/List.hpp>
#include <cstdint> #include <cstdint>
class CMap { class CMap {
public: public:
// Static variables // Static variables
static STORM_EXPLICIT_LIST(CMapBaseObj, m_lameAssLink) s_entityList;
static char s_mapName[]; static char s_mapName[];
static char s_mapPath[]; static char s_mapPath[];
static char s_wdtFilename[]; static char s_wdtFilename[];

View File

@ -0,0 +1,5 @@
#include "world/map/CMapBaseObj.hpp"
uint32_t CMapBaseObj::GetType() {
return this->m_type;
}

View File

@ -0,0 +1,54 @@
#ifndef WORLD_MAP_C_MAP_BASE_OBJ_HPP
#define WORLD_MAP_C_MAP_BASE_OBJ_HPP
#include <storm/List.hpp>
#include <cstdint>
class CM2Lighting;
class CMapBaseObj;
class CMapBaseObjLink {
public:
// Member variables
uint32_t memHandle;
CMapBaseObj* owner;
CMapBaseObj* ref;
TSLink<CMapBaseObjLink> refLink;
TSLink<CMapBaseObjLink> ownerLink;
};
class CMapBaseObj {
public:
// Enums
enum {
Type_BaseObj = 0x1,
Type_Area = 0x2,
Type_Chunk = 0x4,
Type_MapObjDef = 0x8,
Type_MapObjDefGroup = 0x10,
Type_Entity = 0x20,
Type_DoodadDef = 0x40,
Type_Light = 0x80,
};
// Public member variables
uint32_t m_memHandle;
TSLink<CMapBaseObj> m_lameAssLink;
STORM_EXPLICIT_LIST(CMapBaseObjLink, ownerLink) m_parentLinkList;
// TODO
// Public virtual member functions
virtual ~CMapBaseObj() = default;
virtual void SelectLights(CM2Lighting* lighting) {};
virtual void SelectUnderwater(CM2Lighting* lighting) {};
// Public member functions
uint32_t GetType();
protected:
// Protected member variables
uint16_t m_type = Type_BaseObj;
};
#endif

View File

@ -0,0 +1,11 @@
#ifndef WORLD_MAP_C_MAP_ENTITY_HPP
#define WORLD_MAP_C_MAP_ENTITY_HPP
#include "world/map/CMapStaticEntity.hpp"
class CMapEntity : public CMapStaticEntity {
public:
// TODO
};
#endif

View File

@ -0,0 +1,11 @@
#ifndef WORLD_MAP_C_MAP_STATIC_ENTITY_HPP
#define WORLD_MAP_C_MAP_STATIC_ENTITY_HPP
#include "world/map/CMapBaseObj.hpp"
class CMapStaticEntity : public CMapBaseObj {
public:
// TODO
};
#endif