mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-02 00:32:45 +03:00
feat(gx): Implemented CGxDevice::LogOpen()
The OsCreateDirectory and SlogCreate functions still need to be implemented.
This commit is contained in:
parent
49c938a6be
commit
5acc19abdd
@ -1,5 +1,6 @@
|
|||||||
#include "client/Console.hpp"
|
#include "client/Console.hpp"
|
||||||
#include "gx/Device.hpp"
|
#include "gx/Device.hpp"
|
||||||
|
#include "gx/Gx.hpp"
|
||||||
#include "util/CVar.hpp"
|
#include "util/CVar.hpp"
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
@ -148,6 +149,7 @@ void ConsoleInitializeClientCVar(const char* a1) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ConsoleDeviceInitialize(const char* title) {
|
void ConsoleDeviceInitialize(const char* title) {
|
||||||
|
GxLogOpen();
|
||||||
// TODO
|
// TODO
|
||||||
|
|
||||||
// TODO proper logic
|
// TODO proper logic
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
#include "gx/Shader.hpp"
|
#include "gx/Shader.hpp"
|
||||||
#include "gx/texture/CGxTex.hpp"
|
#include "gx/texture/CGxTex.hpp"
|
||||||
#include "util/SFile.hpp"
|
#include "util/SFile.hpp"
|
||||||
|
#include "util/Filesystem.hpp"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
@ -70,6 +71,17 @@ uint32_t CGxDevice::s_texFormatBytesPerBlock[] = {
|
|||||||
4 // GxTex_D24X8
|
4 // GxTex_D24X8
|
||||||
};
|
};
|
||||||
|
|
||||||
|
HSLOG* CGxDevice::m_log = nullptr;
|
||||||
|
uint32_t CGxDevice::m_logbytes = 0;
|
||||||
|
|
||||||
|
void CGxDevice::LogOpen() {
|
||||||
|
if (!CGxDevice::m_log) {
|
||||||
|
OsCreateDirectory("Logs",0);
|
||||||
|
SLogCreate("Logs\\gx.log",0,CGxDevice::m_log);
|
||||||
|
CGxDevice::m_logbytes = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
CGxDevice* CGxDevice::NewD3d() {
|
CGxDevice* CGxDevice::NewD3d() {
|
||||||
// TODO
|
// TODO
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|||||||
@ -10,6 +10,7 @@
|
|||||||
#include "gx/Shader.hpp"
|
#include "gx/Shader.hpp"
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <storm/Hash.hpp>
|
#include <storm/Hash.hpp>
|
||||||
|
#include <util/Log.hpp>
|
||||||
#include <tempest/Box.hpp>
|
#include <tempest/Box.hpp>
|
||||||
#include <tempest/Rect.hpp>
|
#include <tempest/Rect.hpp>
|
||||||
|
|
||||||
@ -44,8 +45,12 @@ class CGxDevice {
|
|||||||
static uint32_t s_streamPoolSize[];
|
static uint32_t s_streamPoolSize[];
|
||||||
static uint32_t s_texFormatBitDepth[];
|
static uint32_t s_texFormatBitDepth[];
|
||||||
static uint32_t s_texFormatBytesPerBlock[];
|
static uint32_t s_texFormatBytesPerBlock[];
|
||||||
|
static HSLOG* m_log;
|
||||||
|
static uint32_t m_logbytes;
|
||||||
|
|
||||||
// Static functions
|
// Static functions
|
||||||
|
static void LogOpen();
|
||||||
|
|
||||||
static CGxDevice* NewD3d();
|
static CGxDevice* NewD3d();
|
||||||
static CGxDevice* NewD3d9Ex();
|
static CGxDevice* NewD3d9Ex();
|
||||||
#if defined(WHOA_SYSTEM_MAC)
|
#if defined(WHOA_SYSTEM_MAC)
|
||||||
|
|||||||
@ -94,3 +94,7 @@ void GxFormatColor(CImVector& color) {
|
|||||||
color = formattedColor;
|
color = formattedColor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GxLogOpen() {
|
||||||
|
CGxDevice::LogOpen();
|
||||||
|
}
|
||||||
|
|||||||
@ -18,4 +18,6 @@ void GxCapsWindowSize(CRect&);
|
|||||||
|
|
||||||
void GxFormatColor(CImVector&);
|
void GxFormatColor(CImVector&);
|
||||||
|
|
||||||
|
void GxLogOpen();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -11,6 +11,10 @@ enum SYSMSG_TYPE {
|
|||||||
SYSMSG_NUMTYPES = 0x4
|
SYSMSG_NUMTYPES = 0x4
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct HSLOG {
|
||||||
|
int32_t unused;
|
||||||
|
};
|
||||||
|
|
||||||
bool SLogCreate(const char*, uint32_t, void*);
|
bool SLogCreate(const char*, uint32_t, void*);
|
||||||
|
|
||||||
void SysMsgPrintf(SYSMSG_TYPE, const char*, ...);
|
void SysMsgPrintf(SYSMSG_TYPE, const char*, ...);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user