feat(profile): add more work related to console

This commit is contained in:
phaneron 2024-12-17 00:28:01 -05:00
parent 08b49c5197
commit e95eb3354d
49 changed files with 9188 additions and 245 deletions

View file

@ -0,0 +1,82 @@
#ifndef BC_FILE_FILESYSTEM_H
#define BC_FILE_FILESYSTEM_H
#include "bc/systemfile/stacked.h"
DECLARE_ENUM(Blizzard__File__Operation);
DECLARE_STRUCT(Blizzard__File__Filesystem);
// invented enum
enum Blizzard__File__Operation {
cd,
close,
create,
cwd,
dirwalk,
exists,
flush,
getfileinfo,
getfreespace,
getpos,
getrootchars,
isabspath,
isreadonly,
makeabspath,
mkdir,
move,
copy,
open,
read,
readp,
rmdir,
setcachemode,
seteof,
setfileinfo,
setpos,
unlink,
write,
writep,
shutdown,
num_operations
};
#define FS_OP(N) bool (*f_##N)(Blizzard__File__Filesystem* fs, System_File__Stacked__FileParms* parms)
// 0x7C bytes = 4 + 4 + (29 * 4)
struct Blizzard__File__Filesystem {
Blizzard__File__Filesystem* base;
Blizzard__File__Filesystem* next;
FS_OP(cd);
FS_OP(close);
FS_OP(create);
FS_OP(cwd);
FS_OP(dirwalk);
FS_OP(exists);
FS_OP(flush);
FS_OP(getfileinfo);
FS_OP(getfreespace);
FS_OP(getpos);
FS_OP(getrootchars);
FS_OP(isabspath);
FS_OP(isreadonly);
FS_OP(makeabspath);
FS_OP(mkdir);
FS_OP(move);
FS_OP(copy);
FS_OP(open);
FS_OP(read);
FS_OP(readp);
FS_OP(rmdir);
FS_OP(setcachemode);
FS_OP(seteof);
FS_OP(setfileinfo);
FS_OP(setpos);
FS_OP(unlink);
FS_OP(write);
FS_OP(writep);
FS_OP(shutdown);
};
#endif

View file

@ -0,0 +1,10 @@
#ifndef BC_FILE_STREAM_H
#define BC_FILE_STREAM_H
DECLARE_STRUCT(Blizzard__File__StreamRecord);
struct Blizzard__File__StreamRecord {
void* handle;
};
#endif

View file

@ -0,0 +1,8 @@
#ifndef BC_OS_FILE_H
#define BC_OS_FILE_H
#include "common/handle.h"
DECLARE_HANDLE(HOSFILE);
#endif

View file

@ -0,0 +1,10 @@
#ifndef BC_SYSTEM_FILE_STACKED_H
#define BC_SYSTEM_FILE_STACKED_H
DECLARE_STRUCT(System_File__Stacked__FileParms);
struct System_File__Stacked__FileParms {
uint32_t offset;
};
#endif

View file

@ -0,0 +1,21 @@
#ifndef CONSOLE_COMMAND_H
#define CONSOLE_COMMAND_H
DECLARE_STRUCT(CONSOLECOMMAND);
#include "console/types.h"
#include "storm/hash.h"
STORM_TS_HASH(CONSOLECOMMAND, HASHKEY_STRI);
typedef int32_t (*COMMANDHANDLER)(const char*, const char*);
// class CONSOLECOMMAND : public TSHashObject<CONSOLECOMMAND, HASHKEY_STRI>
struct CONSOLECOMMAND {
TSHashObject_CONSOLECOMMAND_HASHKEY_STRI b_base;
COMMANDHANDLER m_handler;
const char* m_helpText;
CATEGORY m_category;
};
#endif

View file

@ -0,0 +1,24 @@
#ifndef CONSOLE_LINE_H
#define CONSOLE_LINE_H
DECLARE_STRUCT(CONSOLELINE);
#include "storm/list.h"
#include "console/types.h"
#include "gx/string.h"
STORM_TS_LIST(CONSOLELINE);
// struct CONSOLELINE : TSLinkedNode<CONSOLELINE>
struct CONSOLELINE {
TSLinkedNode_CONSOLELINE b_base;
uint8_t* buffer;
uint32_t chars;
uint32_t charsalloc;
uint32_t inputpos;
uint32_t inputstart;
COLOR_T colorType;
CGxString* fontPointer;
};
#endif

View file

@ -0,0 +1,51 @@
#ifndef CONSOLE_TYPES_H
#define CONSOLE_TYPES_H
DECLARE_ENUM(COLOR_T);
DECLARE_ENUM(CATEGORY);
DECLARE_ENUM(EXECMODE);
DECLARE_ENUM(CONSOLERESIZESTATE);
enum COLOR_T {
DEFAULT_COLOR = 0,
INPUT_COLOR = 1,
ECHO_COLOR = 2,
ERROR_COLOR = 3,
WARNING_COLOR = 4,
GLOBAL_COLOR = 5,
ADMIN_COLOR = 6,
HIGHLIGHT_COLOR = 7,
BACKGROUND_COLOR = 8,
NUM_COLORTYPES
};
enum CATEGORY {
DEBUG = 0,
GRAPHICS = 1,
CONSOLE = 2,
COMBAT = 3,
GAME = 4,
DEFAULT = 5,
NET = 6,
SOUND = 7,
GM = 8,
NONE = 9,
LAST
};
enum EXECMODE {
EM_PROMPTOVERWRITE = 0,
EM_RECORDING = 1,
EM_APPEND = 2,
EM_WRITEFILE = 3,
EM_NOTACTIVE = 4,
EM_NUM_EXECMODES
};
enum CONSOLERESIZESTATE {
CS_NONE = 0,
CS_STRETCH = 1,
NUM_CONSOLERESIZESTATES
};
#endif

View file

@ -0,0 +1,28 @@
#ifndef CONSOLE_VAR_H
#define CONSOLE_VAR_H
DECLARE_STRUCT(CVar);
#include "common/rcstring.h"
#include "storm/hash.h"
STORM_TS_HASH(CVar, HASHKEY_STRI);
// class CVar : public TSHashObject<CVar, HASHKEY_STRI>
struct CVar {
TSHashObject_CVar_HASHKEY_STRI b_base;
uint32_t m_category;
uint32_t m_flags;
RCString m_stringValue;
float m_floatValue;
int32_t m_intValue;
int32_t m_modified;
RCString m_defaultValue;
RCString m_resetValue;
RCString m_latchedValue;
RCString m_help;
bool (*m_callback)(CVar*, const char*, const char*, void*);
void* m_arg;
};
#endif

View file

@ -0,0 +1,35 @@
#ifndef DB_CLIENT_DB_H
#define DB_CLIENT_DB_H
#include "db/idatabase.h"
DECLARE_STRUCT(WowClientDB_Base);
DECLARE_STRUCT(WowClientDB_Base__v_table);
struct WowClientDB_Base__v_table {
void* v_fn_00;
};
struct WowClientDB_Base {
void** v_table;
// Member variables
int32_t m_loaded;
int32_t m_numRecords;
int32_t m_maxID;
int32_t m_minID;
const char* m_strings;
};
#define DB_CLIENT_DB(T) \
DB_I_DATABASE(T); \
typedef struct WowClientDB_Common_##T WowClientDB_Common_##T; \
typedef struct WowClientDB_##T WowClientDB_##T; \
struct WowClientDB_Common_##T { \
WowClientDB_Base b_base; \
}; \
struct WowClientDB_##T { \
WowClientDB_Common_##T b_base_01; \
IDatabase_##T b_base_02; \
}
#endif

View file

@ -0,0 +1,19 @@
#ifndef DB_I_DATABASE_H
#define DB_I_DATABASE_H
DECLARE_STRUCT(IDatabase__vtable);
struct IDatabase__vtable {
// T* GetRecord(int32_t id);
void* v_fn_GetRecord;
};
#define DB_I_DATABASE(T) \
typedef struct IDatabase_##T IDatabase_##T; \
struct IDatabase_##T { \
IDatabase__vtable* v_table; \
T* m_records; \
T** m_recordsById; \
}
#endif

File diff suppressed because it is too large Load diff

View file

@ -33,7 +33,7 @@ struct CGxFormat {
C2iVector size;
uint32_t unk1C;
uint32_t sampleCount;
float float24;
float float24; // multisampleQuality? write at 00769693
CGxFormat__Format colorFormat;
uint32_t refreshRate;
uint32_t vsync;

View file

@ -13,6 +13,11 @@
#include "async/object.h"
#include "async/queue.h"
#include "bc/file/filesystem.h"
#include "bc/file/stream.h"
#include "bc/systemfile/stacked.h"
#include "bc/osfile.h"
#include "camera/camera.h"
#include "cmd/option.h"
@ -25,6 +30,11 @@
#include "common/refcount.h"
#include "common/rcstring.h"
#include "console/command.h"
#include "console/line.h"
#include "console/var.h"
#include "console/types.h"
#include "cursor/types.h"
#include "event/types.h"
@ -76,6 +86,7 @@
#include "storm/queue.h"
#include "storm/region.h"
#include "storm/thread.h"
#include "storm/log.h"
#include "tempest/box.h"
#include "tempest/matrix.h"
@ -86,6 +97,8 @@
#include "tempest/sphere.h"
#include "tempest/vector.h"
#include "text/font.h"
#include "texture/blp.h"
#include "texture/texture.h"
#include "texture/tga.h"

View file

@ -0,0 +1,8 @@
#ifndef STORM_LOG_H
#define STORM_LOG_H
#include "common/handle.h"
DECLARE_HANDLE(HSLOG);
#endif

View file

@ -0,0 +1,10 @@
#ifndef TEXT_TYPES_H
#define TEXT_TYPES_H
#include "common/handle.h"
DECLARE_HANDLE(HTEXTBLOCK);
DECLARE_HANDLE(HTEXTFONT);
DECLARE_HANDLE(HFACE);
#endif