diff --git a/Toshi/Include/Defines.h b/Toshi/Include/TApplication/Defines.h similarity index 92% rename from Toshi/Include/Defines.h rename to Toshi/Include/TApplication/Defines.h index 65533ab..f82a619 100644 --- a/Toshi/Include/Defines.h +++ b/Toshi/Include/TApplication/Defines.h @@ -24,10 +24,10 @@ #define TOSHI_MULTIPLATFORM(FILENAME) STRINGIFY(STRCAT_3(Win/, FILENAME, Win.h)) #endif -#ifdef TOSHI_USER_ENGINE - #define TOSHI_EXPORT __declspec(dllexport) +#ifdef TAPPLICATION + #define TAPPLICATION_EXPORTS __declspec(dllexport) #else - #define TOSHI_EXPORT __declspec(dllimport) + #define TAPPLICATION_EXPORTS __declspec(dllimport) #endif #define TOSHI_API __stdcall diff --git a/Toshi/Include/TApplication/TApplication.h b/Toshi/Include/TApplication/TApplication.h index 46e7f79..f2ca481 100644 --- a/Toshi/Include/TApplication/TApplication.h +++ b/Toshi/Include/TApplication/TApplication.h @@ -1,10 +1,11 @@ #pragma once #include "TKernel/TKernelInterface.h" +#include "Defines.h" #include TOSHI_NAMESPACE_BEGIN -class TOSHI_EXPORT TApplication +class TAPPLICATION_EXPORTS TApplication { private: diff --git a/Toshi/Include/TKernel/Defines.h b/Toshi/Include/TKernel/Defines.h new file mode 100644 index 0000000..254b60e --- /dev/null +++ b/Toshi/Include/TKernel/Defines.h @@ -0,0 +1,64 @@ +#pragma once + +#define TNULL nullptr +#define TFALSE false +#define TTRUE true +#define BITFIELD(x) (1 << x) + +#if defined(TOSHI_RELEASE) || defined(TOSHI_DEBUG) +#define TOSHI_NOTFINAL +#endif + +#define STRINGIFY2(X) #X +#define STRINGIFY(X) STRINGIFY2(X) + +#define STRCAT2(X, Y) X##Y +#define STRCAT(X, Y) STRCAT2(X, Y) +#define STRCAT_2 CAT +#define STRCAT_3(X, Y, Z) STRCAT(X, STRCAT(Y, Z)) +#define STRCAT_4(A, X, Y, Z) STRCAT(A, STRCAT_3(X, Y, Z)) + +#define HASFLAG(flag) (flag) != 0 + +#ifdef TOSHI_SKU_WINDOWS + #define TOSHI_MULTIPLATFORM(FILENAME) STRINGIFY(STRCAT_3(Win/, FILENAME, Win.h)) +#endif + +#ifdef TKERNELINTERFACE +#define TKERNELINTERFACE_EXPORTS __declspec(dllexport) +#else +#define TKERNELINTERFACE_EXPORTS __declspec(dllimport) +#endif + +#define TOSHI_API __stdcall +#define TOSHI_CALLBACKAPI __cdecl + +#define TOSHI_NAMESPACE_BEGIN namespace Toshi { +#define TOSHI_NAMESPACE_END } +#define TOSHI_NAMESPACE_USING using namespace Toshi; + +#define TSTATICCAST(type, value) static_cast(value) + +#define _TS8(str) #str + +typedef bool TBOOL; +typedef int TINT; +typedef unsigned int TUINT; +typedef unsigned int TUINT32; +typedef unsigned __int64 TUINT64; +typedef short TSHORT; +typedef unsigned short TUSHORT; +typedef wchar_t TWCHAR; +typedef unsigned short* TPWCHAR; +typedef const char* TPCCHAR; +typedef char* TPCHAR; +typedef char TCHAR; +typedef const char TCCHAR; +typedef char TINT8; +typedef unsigned char TUINT8; +typedef unsigned char TBYTE; +typedef unsigned char* TPBYTE; +typedef void* TPVOID; +typedef const void* TPCVOID; +typedef float TFLOAT; +typedef const float TCFLOAT; \ No newline at end of file diff --git a/Toshi/Include/TKernel/TCString.h b/Toshi/Include/TKernel/TCString.h index 6afb7b2..1aa7501 100644 --- a/Toshi/Include/TKernel/TCString.h +++ b/Toshi/Include/TKernel/TCString.h @@ -6,7 +6,7 @@ TOSHI_NAMESPACE_BEGIN -class TOSHI_EXPORT TCString +class TKERNELINTERFACE_EXPORTS TCString { public: diff --git a/Toshi/Include/TKernel/TDLL.h b/Toshi/Include/TKernel/TDLL.h index f9190c5..7b78a88 100644 --- a/Toshi/Include/TKernel/TDLL.h +++ b/Toshi/Include/TKernel/TDLL.h @@ -4,7 +4,7 @@ TOSHI_NAMESPACE_BEGIN -class TOSHI_EXPORT TDLL +class TKERNELINTERFACE_EXPORTS TDLL { public: diff --git a/Toshi/Include/TKernel/TDList.h b/Toshi/Include/TKernel/TDList.h index 18a4ff1..09563a8 100644 --- a/Toshi/Include/TKernel/TDList.h +++ b/Toshi/Include/TKernel/TDList.h @@ -3,10 +3,10 @@ TOSHI_NAMESPACE_BEGIN -class TOSHI_EXPORT TGenericDList +class TKERNELINTERFACE_EXPORTS TGenericDList { public: - class TOSHI_EXPORT TNode + class TKERNELINTERFACE_EXPORTS TNode { protected: diff --git a/Toshi/Include/TKernel/TDebug.h b/Toshi/Include/TKernel/TDebug.h index 8f701d4..c10ce64 100644 --- a/Toshi/Include/TKernel/TDebug.h +++ b/Toshi/Include/TKernel/TDebug.h @@ -32,7 +32,7 @@ enum TDebug_Flags : TUINT FLAG_UNK3 = BITFIELD(2) }; -class TOSHI_EXPORT TDebug +class TKERNELINTERFACE_EXPORTS TDebug { public: @@ -57,22 +57,22 @@ class TOSHI_EXPORT TDebug }; -void TOSHI_EXPORT TOSHI_API TDebug_VPrintfDirect(TUINT a_uiFlags, TPCCHAR a_pcFormat, va_list a_vargs); +void TKERNELINTERFACE_EXPORTS TOSHI_API TDebug_VPrintfDirect(TUINT a_uiFlags, TPCCHAR a_pcFormat, va_list a_vargs); -void TOSHI_EXPORT TOSHI_API TDebug_VPrintf(TUINT a_uiFlags, TPCCHAR a_pcFormat, va_list a_vargs); +void TKERNELINTERFACE_EXPORTS TOSHI_API TDebug_VPrintf(TUINT a_uiFlags, TPCCHAR a_pcFormat, va_list a_vargs); -void TOSHI_EXPORT TOSHI_CALLBACKAPI TDebug_Printf(TPCCHAR a_pcFormat, ...); -void TOSHI_EXPORT TOSHI_CALLBACKAPI TDebug_Printf(TUINT a_uiFlags, TPCCHAR a_pcFormat, ...); +void TKERNELINTERFACE_EXPORTS TOSHI_CALLBACKAPI TDebug_Printf(TPCCHAR a_pcFormat, ...); +void TKERNELINTERFACE_EXPORTS TOSHI_CALLBACKAPI TDebug_Printf(TUINT a_uiFlags, TPCCHAR a_pcFormat, ...); -void TOSHI_EXPORT TOSHI_CALLBACKAPI TDebug_PrintfDirect(TPCCHAR a_pcFormat, ...); -void TOSHI_EXPORT TOSHI_CALLBACKAPI TDebug_PrintfDirect(TUINT a_uiFlags, TPCCHAR a_pcFormat, ...); +void TKERNELINTERFACE_EXPORTS TOSHI_CALLBACKAPI TDebug_PrintfDirect(TPCCHAR a_pcFormat, ...); +void TKERNELINTERFACE_EXPORTS TOSHI_CALLBACKAPI TDebug_PrintfDirect(TUINT a_uiFlags, TPCCHAR a_pcFormat, ...); -void TOSHI_EXPORT TOSHI_CALLBACKAPI TDebug_CPrintf(TINT a_iFlags, TPCCHAR a_pcFormat, ...); +void TKERNELINTERFACE_EXPORTS TOSHI_CALLBACKAPI TDebug_CPrintf(TINT a_iFlags, TPCCHAR a_pcFormat, ...); -void TOSHI_EXPORT TOSHI_CALLBACKAPI TDebug_Message(TDebug::MSGLEVEL a_eMsgLevel, TPCCHAR a_pcFormat, ...); +void TKERNELINTERFACE_EXPORTS TOSHI_CALLBACKAPI TDebug_Message(TDebug::MSGLEVEL a_eMsgLevel, TPCCHAR a_pcFormat, ...); -void TOSHI_EXPORT TOSHI_CALLBACKAPI TDebug_PrintError(TPCCHAR a_pcFormat, ...); -void TOSHI_EXPORT TOSHI_CALLBACKAPI TDebug_PrintWarning(TPCCHAR a_pcFormat, ...); +void TKERNELINTERFACE_EXPORTS TOSHI_CALLBACKAPI TDebug_PrintError(TPCCHAR a_pcFormat, ...); +void TKERNELINTERFACE_EXPORTS TOSHI_CALLBACKAPI TDebug_PrintWarning(TPCCHAR a_pcFormat, ...); TOSHI_NAMESPACE_END @@ -96,7 +96,7 @@ enum TDebug_Flags : TUINT FLAG_UNK3 = BITFIELD(2) }; -class TOSHI_EXPORT TDebug +class TKERNELINTERFACE_EXPORTS TDebug { public: @@ -119,7 +119,7 @@ class TOSHI_EXPORT TDebug }; -void TOSHI_EXPORT TOSHI_CALLBACKAPI TDebug_Message(TDebug::MSGLEVEL a_eMsgLevel, TPCCHAR a_pcFormat, ...); +void TKERNELINTERFACE_EXPORTS TOSHI_CALLBACKAPI TDebug_Message(TDebug::MSGLEVEL a_eMsgLevel, TPCCHAR a_pcFormat, ...); TOSHI_NAMESPACE_END diff --git a/Toshi/Include/TKernel/TFile.h b/Toshi/Include/TKernel/TFile.h index 9113c13..7c1e3ad 100644 --- a/Toshi/Include/TKernel/TFile.h +++ b/Toshi/Include/TKernel/TFile.h @@ -11,7 +11,7 @@ TOSHI_NAMESPACE_BEGIN class TFile; -class TOSHI_EXPORT TFileSystem : public TDList::TNode +class TKERNELINTERFACE_EXPORTS TFileSystem : public TDList::TNode { public: TFileSystem(TPCCHAR a_pcName) : TNode() @@ -53,7 +53,7 @@ class TOSHI_EXPORT TFileSystem : public TDList::TNode TCString m_sPrefix; // 0xC }; -class TOSHI_EXPORT TFileManager +class TKERNELINTERFACE_EXPORTS TFileManager { public: class TSysPathIter @@ -145,7 +145,7 @@ enum TMODE : TUINT TMODE_NOBUFFER = BITFIELD(4) }; -class TOSHI_EXPORT TFile +class TKERNELINTERFACE_EXPORTS TFile { protected: TFile(TFileSystem* a_pFileSystem) diff --git a/Toshi/Include/TKernel/TFreeList.h b/Toshi/Include/TKernel/TFreeList.h index 4636dae..500321d 100644 --- a/Toshi/Include/TKernel/TFreeList.h +++ b/Toshi/Include/TKernel/TFreeList.h @@ -4,10 +4,10 @@ TOSHI_NAMESPACE_BEGIN -class TOSHI_EXPORT TFreeList +class TKERNELINTERFACE_EXPORTS TFreeList { public: - struct TOSHI_EXPORT Node + struct TKERNELINTERFACE_EXPORTS Node { friend class TFreeList; public: diff --git a/Toshi/Include/TKernel/THPTimer.h b/Toshi/Include/TKernel/THPTimer.h index cbf4a86..bc5c8ee 100644 --- a/Toshi/Include/TKernel/THPTimer.h +++ b/Toshi/Include/TKernel/THPTimer.h @@ -4,7 +4,7 @@ TOSHI_NAMESPACE_BEGIN -class TOSHI_EXPORT THPTimer +class TKERNELINTERFACE_EXPORTS THPTimer { public: THPTimer(); diff --git a/Toshi/Include/TKernel/TKernelInterface.h b/Toshi/Include/TKernel/TKernelInterface.h index e64e621..38040ed 100644 --- a/Toshi/Include/TKernel/TKernelInterface.h +++ b/Toshi/Include/TKernel/TKernelInterface.h @@ -6,7 +6,7 @@ TOSHI_NAMESPACE_BEGIN -class TOSHI_EXPORT TKernelInterface : public TObject +class TKERNELINTERFACE_EXPORTS TKernelInterface : public TObject { DECLARE_DYNAMIC(TKernelInterface); public: diff --git a/Toshi/Include/TKernel/TLString.h b/Toshi/Include/TKernel/TLString.h index e456d58..020f96e 100644 --- a/Toshi/Include/TKernel/TLString.h +++ b/Toshi/Include/TKernel/TLString.h @@ -5,13 +5,13 @@ TOSHI_NAMESPACE_BEGIN -class TOSHI_EXPORT TLocale +class TKERNELINTERFACE_EXPORTS TLocale { public: static int const TEMP_START_INDEX = 0x40000000; }; -class TOSHI_EXPORT TLocalisedString +class TKERNELINTERFACE_EXPORTS TLocalisedString { public: static TFreeList& TOSHI_API GetFreeList() { return m_oFreelist; } diff --git a/Toshi/Include/TKernel/TMemory.h b/Toshi/Include/TKernel/TMemory.h index fc72e7c..e9e8867 100644 --- a/Toshi/Include/TKernel/TMemory.h +++ b/Toshi/Include/TKernel/TMemory.h @@ -9,7 +9,7 @@ inline static Toshi::TMutex* g_pMutex = TNULL; TOSHI_NAMESPACE_BEGIN -class TOSHI_EXPORT TMemory +class TKERNELINTERFACE_EXPORTS TMemory { struct HALMemInfo @@ -76,6 +76,6 @@ inline static TMemory g_oMemManager; TOSHI_NAMESPACE_END -TPVOID TOSHI_EXPORT TOSHI_API tmalloc(TINT a_iSize, TPCHAR a_pBuffer, TINT a_iUnk); -TPVOID TOSHI_EXPORT TOSHI_API tmemalign(TINT a_iAlign, TINT a_iSize); -void TOSHI_EXPORT TOSHI_API tfree(TPVOID a_pMem); \ No newline at end of file +TPVOID TKERNELINTERFACE_EXPORTS TOSHI_API tmalloc(TINT a_iSize, TPCHAR a_pBuffer, TINT a_iUnk); +TPVOID TKERNELINTERFACE_EXPORTS TOSHI_API tmemalign(TINT a_iAlign, TINT a_iSize); +void TKERNELINTERFACE_EXPORTS TOSHI_API tfree(TPVOID a_pMem); \ No newline at end of file diff --git a/Toshi/Include/TKernel/TNTree.h b/Toshi/Include/TKernel/TNTree.h index 0c6158a..6fc28d6 100644 --- a/Toshi/Include/TKernel/TNTree.h +++ b/Toshi/Include/TKernel/TNTree.h @@ -4,7 +4,7 @@ TOSHI_NAMESPACE_BEGIN -class TOSHI_EXPORT TGenericNTree +class TKERNELINTERFACE_EXPORTS TGenericNTree { class TNode { diff --git a/Toshi/Include/TKernel/TNodeList.h b/Toshi/Include/TKernel/TNodeList.h index 6a6ad7e..e376235 100644 --- a/Toshi/Include/TKernel/TNodeList.h +++ b/Toshi/Include/TKernel/TNodeList.h @@ -4,10 +4,10 @@ TOSHI_NAMESPACE_BEGIN -class TOSHI_EXPORT TGenericNodeList +class TKERNELINTERFACE_EXPORTS TGenericNodeList { public: - class TOSHI_EXPORT TNode + class TKERNELINTERFACE_EXPORTS TNode { friend class TGenericNodeList; public: @@ -70,7 +70,7 @@ class TOSHI_EXPORT TGenericNodeList TNode* m_pPrev; // 0x8 }; - class TOSHI_EXPORT Iterator + class TKERNELINTERFACE_EXPORTS Iterator { public: diff --git a/Toshi/Include/TKernel/TObject.h b/Toshi/Include/TKernel/TObject.h index 7839846..b8fa71b 100644 --- a/Toshi/Include/TKernel/TObject.h +++ b/Toshi/Include/TKernel/TObject.h @@ -20,7 +20,7 @@ typedef TBOOL (*t_RecurceTreeBaseEndCb)(class TClass*, TPCVOID); #define TGetClass(X) X::m_sClass #define TFindClass(X, Y) Toshi::TClass::Find(#X, Y) -class TOSHI_EXPORT TClass +class TKERNELINTERFACE_EXPORTS TClass { public: TClass(TPCCHAR a_pcName, TClass* a_pParent, t_CreateTObject a_Create, t_CreateTObjectInPlace a_CreateInPlace, t_InitializeStatic a_Init, t_UninitializeStatic a_Uninit, TUINT a_uiVersion); @@ -133,7 +133,7 @@ private: \ { TASSERT(!"This class does not support dynamic creation!"); return TNULL; } \ IMPLEMENT_RUNTIMECLASS(class_name, base_class_name, class_name::CreateObject, class_name::CreateObjectInPlace, 1) -class TOSHI_EXPORT TObject +class TKERNELINTERFACE_EXPORTS TObject { private: static TObject* TOSHI_API CreateObject() diff --git a/Toshi/Include/TKernel/TPCString.h b/Toshi/Include/TKernel/TPCString.h index 6c1d8d7..abdbd52 100644 --- a/Toshi/Include/TKernel/TPCString.h +++ b/Toshi/Include/TKernel/TPCString.h @@ -3,7 +3,7 @@ TOSHI_NAMESPACE_BEGIN -class TOSHI_EXPORT TPCString +class TKERNELINTERFACE_EXPORTS TPCString { }; diff --git a/Toshi/Include/TKernel/TProfiler.h b/Toshi/Include/TKernel/TProfiler.h index 9fb9051..de529b3 100644 --- a/Toshi/Include/TKernel/TProfiler.h +++ b/Toshi/Include/TKernel/TProfiler.h @@ -5,7 +5,7 @@ TOSHI_NAMESPACE_BEGIN -class TOSHI_EXPORT TProfiler +class TKERNELINTERFACE_EXPORTS TProfiler { public: void Start(); diff --git a/Toshi/Include/TKernel/TScheduler.h b/Toshi/Include/TKernel/TScheduler.h index b54e939..6407c47 100644 --- a/Toshi/Include/TKernel/TScheduler.h +++ b/Toshi/Include/TKernel/TScheduler.h @@ -9,7 +9,7 @@ TOSHI_NAMESPACE_BEGIN class TKernelInterface; -class TOSHI_EXPORT TScheduler : public TObject +class TKERNELINTERFACE_EXPORTS TScheduler : public TObject { DECLARE_DYNAMIC(TScheduler); public: diff --git a/Toshi/Include/TKernel/TSystemTools.h b/Toshi/Include/TKernel/TSystemTools.h index 0dad724..317ff25 100644 --- a/Toshi/Include/TKernel/TSystemTools.h +++ b/Toshi/Include/TKernel/TSystemTools.h @@ -3,7 +3,7 @@ TOSHI_NAMESPACE_BEGIN -class TOSHI_EXPORT TSystem +class TKERNELINTERFACE_EXPORTS TSystem { public: diff --git a/Toshi/Include/TKernel/TTask.h b/Toshi/Include/TKernel/TTask.h index 028ee4d..6d30682 100644 --- a/Toshi/Include/TKernel/TTask.h +++ b/Toshi/Include/TKernel/TTask.h @@ -7,7 +7,7 @@ TOSHI_NAMESPACE_BEGIN class TScheduler; -class TOSHI_EXPORT TTask : public TObject, public TNodeTree::TNode +class TKERNELINTERFACE_EXPORTS TTask : public TObject, public TNodeTree::TNode { DECLARE_DYNAMIC(TTask); diff --git a/Toshi/Include/TKernel/TThread.h b/Toshi/Include/TKernel/TThread.h index 2642588..b57d414 100644 --- a/Toshi/Include/TKernel/TThread.h +++ b/Toshi/Include/TKernel/TThread.h @@ -4,7 +4,7 @@ TOSHI_NAMESPACE_BEGIN -class TOSHI_EXPORT TMutexLock +class TKERNELINTERFACE_EXPORTS TMutexLock { public: diff --git a/Toshi/Include/TKernel/TUser.h b/Toshi/Include/TKernel/TUser.h index a32e256..d15b6f2 100644 --- a/Toshi/Include/TKernel/TUser.h +++ b/Toshi/Include/TKernel/TUser.h @@ -6,7 +6,7 @@ TOSHI_NAMESPACE_BEGIN -class TOSHI_EXPORT TUser +class TKERNELINTERFACE_EXPORTS TUser { friend class TUserHandler; public: @@ -26,7 +26,7 @@ class TOSHI_EXPORT TUser TSHORT m_iUserID; // 0x6 }; -class TOSHI_EXPORT TUserHandler +class TKERNELINTERFACE_EXPORTS TUserHandler { protected: TUserHandler(); diff --git a/Toshi/Include/TKernel/Win/TNativeFileWin.h b/Toshi/Include/TKernel/Win/TNativeFileWin.h index 1ea1248..9420400 100644 --- a/Toshi/Include/TKernel/Win/TNativeFileWin.h +++ b/Toshi/Include/TKernel/Win/TNativeFileWin.h @@ -5,7 +5,7 @@ TOSHI_NAMESPACE_BEGIN -class TOSHI_EXPORT TNativeFileSystem : public TFileSystem +class TKERNELINTERFACE_EXPORTS TNativeFileSystem : public TFileSystem { public: TNativeFileSystem(TPCCHAR a_pcName); @@ -19,12 +19,12 @@ class TOSHI_EXPORT TNativeFileSystem : public TFileSystem HANDLE m_hFileSystem; // 0x1C }; -class TOSHI_EXPORT TNativeFileManager : public TFileManager +class TKERNELINTERFACE_EXPORTS TNativeFileManager : public TFileManager { }; -class TOSHI_EXPORT TNativeFile : public TFile +class TKERNELINTERFACE_EXPORTS TNativeFile : public TFile { friend class TNativeFileSystem; public: diff --git a/Toshi/Include/TKernel/Win/TThreadWin.h b/Toshi/Include/TKernel/Win/TThreadWin.h index 8c204ee..258dbb4 100644 --- a/Toshi/Include/TKernel/Win/TThreadWin.h +++ b/Toshi/Include/TKernel/Win/TThreadWin.h @@ -9,7 +9,7 @@ enum TMutexLockFlag TMutexLockFlag_DoNotWait = 1, }; -class TOSHI_EXPORT TMutex +class TKERNELINTERFACE_EXPORTS TMutex { public: TMutex() diff --git a/Toshi/Include/TRender/Defines.h b/Toshi/Include/TRender/Defines.h new file mode 100644 index 0000000..3d1e4a7 --- /dev/null +++ b/Toshi/Include/TRender/Defines.h @@ -0,0 +1,64 @@ +#pragma once + +#define TNULL nullptr +#define TFALSE false +#define TTRUE true +#define BITFIELD(x) (1 << x) + +#if defined(TOSHI_RELEASE) || defined(TOSHI_DEBUG) +#define TOSHI_NOTFINAL +#endif + +#define STRINGIFY2(X) #X +#define STRINGIFY(X) STRINGIFY2(X) + +#define STRCAT2(X, Y) X##Y +#define STRCAT(X, Y) STRCAT2(X, Y) +#define STRCAT_2 CAT +#define STRCAT_3(X, Y, Z) STRCAT(X, STRCAT(Y, Z)) +#define STRCAT_4(A, X, Y, Z) STRCAT(A, STRCAT_3(X, Y, Z)) + +#define HASFLAG(flag) (flag) != 0 + +#ifdef TOSHI_SKU_WINDOWS + #define TOSHI_MULTIPLATFORM(FILENAME) STRINGIFY(STRCAT_3(Win/, FILENAME, Win.h)) +#endif + +#ifdef TRENDERINTERFACE +#define TRENDERINTERFACE_EXPORTS __declspec(dllexport) +#else +#define TRENDERINTERFACE_EXPORTS __declspec(dllimport) +#endif + +#define TOSHI_API __stdcall +#define TOSHI_CALLBACKAPI __cdecl + +#define TOSHI_NAMESPACE_BEGIN namespace Toshi { +#define TOSHI_NAMESPACE_END } +#define TOSHI_NAMESPACE_USING using namespace Toshi; + +#define TSTATICCAST(type, value) static_cast(value) + +#define _TS8(str) #str + +typedef bool TBOOL; +typedef int TINT; +typedef unsigned int TUINT; +typedef unsigned int TUINT32; +typedef unsigned __int64 TUINT64; +typedef short TSHORT; +typedef unsigned short TUSHORT; +typedef wchar_t TWCHAR; +typedef unsigned short* TPWCHAR; +typedef const char* TPCCHAR; +typedef char* TPCHAR; +typedef char TCHAR; +typedef const char TCCHAR; +typedef char TINT8; +typedef unsigned char TUINT8; +typedef unsigned char TBYTE; +typedef unsigned char* TPBYTE; +typedef void* TPVOID; +typedef const void* TPCVOID; +typedef float TFLOAT; +typedef const float TCFLOAT; \ No newline at end of file diff --git a/Toshi/Include/TRender/TNullResource.h b/Toshi/Include/TRender/TNullResource.h index 3bdf306..9999437 100644 --- a/Toshi/Include/TRender/TNullResource.h +++ b/Toshi/Include/TRender/TNullResource.h @@ -1,10 +1,11 @@ #pragma once #include "TResource.h" +#include "Defines.h" TOSHI_NAMESPACE_BEGIN -class TOSHI_EXPORT TNullResource : public TResource +class TRENDERINTERFACE_EXPORTS TNullResource : public TResource { DECLARE_DYNAMIC(TNullResource) }; diff --git a/Toshi/Include/TRender/TRenderContext.h b/Toshi/Include/TRender/TRenderContext.h index 957abc1..f824179 100644 --- a/Toshi/Include/TRender/TRenderContext.h +++ b/Toshi/Include/TRender/TRenderContext.h @@ -1,12 +1,13 @@ #pragma once #include "TKernel/TObject.h" #include "TKernel/TKernelInterface.h" +#include "Defines.h" TOSHI_NAMESPACE_BEGIN class TRenderInterface; -class TOSHI_EXPORT TRenderContext +class TRENDERINTERFACE_EXPORTS TRenderContext { private: TRenderInterface* m_pRenderInterface; // 0x4 diff --git a/Toshi/Include/TRender/TRenderInterface.h b/Toshi/Include/TRender/TRenderInterface.h index 0bd3b8a..5a5de18 100644 --- a/Toshi/Include/TRender/TRenderInterface.h +++ b/Toshi/Include/TRender/TRenderInterface.h @@ -7,7 +7,7 @@ TOSHI_NAMESPACE_BEGIN -class TOSHI_EXPORT TRenderInterface : public TObject +class TRENDERINTERFACE_EXPORTS TRenderInterface : public TObject { DECLARE_DYNAMIC(TRenderInterface) diff --git a/Toshi/Include/TRender/TResource.h b/Toshi/Include/TRender/TResource.h index 597d8ba..15c2a44 100644 --- a/Toshi/Include/TRender/TResource.h +++ b/Toshi/Include/TRender/TResource.h @@ -1,6 +1,7 @@ #pragma once #include "TKernel/TObject.h" #include "TKernel/TNodeTree.h" +#include "Defines.h" #define MAXNAMELEN 15 @@ -8,7 +9,7 @@ TOSHI_NAMESPACE_BEGIN class TRenderInterface; -class TOSHI_EXPORT TResource : public TObject, public TNodeTree::TNode +class TRENDERINTERFACE_EXPORTS TResource : public TObject, public TNodeTree::TNode { DECLARE_DYNAMIC(TResource) diff --git a/Toshi/Include/TRender/TTextureFactory.h b/Toshi/Include/TRender/TTextureFactory.h index 6a91622..fa4821f 100644 --- a/Toshi/Include/TRender/TTextureFactory.h +++ b/Toshi/Include/TRender/TTextureFactory.h @@ -9,7 +9,7 @@ TOSHI_NAMESPACE_BEGIN class TTextureResource; -class TOSHI_EXPORT TTextureFactory : public TResource +class TRENDERINTERFACE_EXPORTS TTextureFactory : public TResource { DECLARE_DYNAMIC(TTextureFactory) diff --git a/Toshi/Include/TRender/TTextureResource.h b/Toshi/Include/TRender/TTextureResource.h index 1a41432..e70aaba 100644 --- a/Toshi/Include/TRender/TTextureResource.h +++ b/Toshi/Include/TRender/TTextureResource.h @@ -15,7 +15,7 @@ enum TTEXTURERESOURCEFORMAT R4G4B4A4, }; -class TOSHI_EXPORT TTextureResource : public TResource +class TRENDERINTERFACE_EXPORTS TTextureResource : public TResource { DECLARE_DYNAMIC(TTextureResource) diff --git a/Toshi/Include/TRender/TVertexFactoryResourceInterface.h b/Toshi/Include/TRender/TVertexFactoryResourceInterface.h index 54af555..b620e71 100644 --- a/Toshi/Include/TRender/TVertexFactoryResourceInterface.h +++ b/Toshi/Include/TRender/TVertexFactoryResourceInterface.h @@ -23,7 +23,7 @@ class TVertexFactoryFormat class TVertexPoolResourceInterface; -class TOSHI_EXPORT TVertexFactoryResourceInterface : public TResource +class TRENDERINTERFACE_EXPORTS TVertexFactoryResourceInterface : public TResource { DECLARE_DYNAMIC(TVertexFactoryResourceInterface) public: diff --git a/Toshi/Include/TRenderD3D/Defines.h b/Toshi/Include/TRenderD3D/Defines.h new file mode 100644 index 0000000..31b5c46 --- /dev/null +++ b/Toshi/Include/TRenderD3D/Defines.h @@ -0,0 +1,64 @@ +#pragma once + +#define TNULL nullptr +#define TFALSE false +#define TTRUE true +#define BITFIELD(x) (1 << x) + +#if defined(TOSHI_RELEASE) || defined(TOSHI_DEBUG) +#define TOSHI_NOTFINAL +#endif + +#define STRINGIFY2(X) #X +#define STRINGIFY(X) STRINGIFY2(X) + +#define STRCAT2(X, Y) X##Y +#define STRCAT(X, Y) STRCAT2(X, Y) +#define STRCAT_2 CAT +#define STRCAT_3(X, Y, Z) STRCAT(X, STRCAT(Y, Z)) +#define STRCAT_4(A, X, Y, Z) STRCAT(A, STRCAT_3(X, Y, Z)) + +#define HASFLAG(flag) (flag) != 0 + +#ifdef TOSHI_SKU_WINDOWS + #define TOSHI_MULTIPLATFORM(FILENAME) STRINGIFY(STRCAT_3(Win/, FILENAME, Win.h)) +#endif + +#ifdef TRENDERINTERFACED3D +#define TRENDERINTERFACED3D_EXPORTS __declspec(dllexport) +#else +#define TRENDERINTERFACED3D_EXPORTS __declspec(dllimport) +#endif + +#define TOSHI_API __stdcall +#define TOSHI_CALLBACKAPI __cdecl + +#define TOSHI_NAMESPACE_BEGIN namespace Toshi { +#define TOSHI_NAMESPACE_END } +#define TOSHI_NAMESPACE_USING using namespace Toshi; + +#define TSTATICCAST(type, value) static_cast(value) + +#define _TS8(str) #str + +typedef bool TBOOL; +typedef int TINT; +typedef unsigned int TUINT; +typedef unsigned int TUINT32; +typedef unsigned __int64 TUINT64; +typedef short TSHORT; +typedef unsigned short TUSHORT; +typedef wchar_t TWCHAR; +typedef unsigned short* TPWCHAR; +typedef const char* TPCCHAR; +typedef char* TPCHAR; +typedef char TCHAR; +typedef const char TCCHAR; +typedef char TINT8; +typedef unsigned char TUINT8; +typedef unsigned char TBYTE; +typedef unsigned char* TPBYTE; +typedef void* TPVOID; +typedef const void* TPCVOID; +typedef float TFLOAT; +typedef const float TCFLOAT; \ No newline at end of file diff --git a/Toshi/Include/TRenderD3D/TRenderD3DInterface.h b/Toshi/Include/TRenderD3D/TRenderD3DInterface.h index 807c13d..e2e5ee3 100644 --- a/Toshi/Include/TRenderD3D/TRenderD3DInterface.h +++ b/Toshi/Include/TRenderD3D/TRenderD3DInterface.h @@ -1,11 +1,12 @@ #pragma once +#include "Defines.h" #include "TKernel/TDebug.h" #include "TRender/TRenderInterface.h" #include TOSHI_NAMESPACE_BEGIN -class TOSHI_EXPORT TRenderD3DInterface : public TRenderInterface +class TRENDERINTERFACED3D_EXPORTS TRenderD3DInterface : public TRenderInterface { public: static void TOSHI_API TD3DAssert(HRESULT a_hr, TPCCHAR a_pError); diff --git a/Toshi/Include/TRenderD3D/TTextureFactoryD3D.h b/Toshi/Include/TRenderD3D/TTextureFactoryD3D.h index e5fef73..e9f6058 100644 --- a/Toshi/Include/TRenderD3D/TTextureFactoryD3D.h +++ b/Toshi/Include/TRenderD3D/TTextureFactoryD3D.h @@ -1,11 +1,11 @@ #pragma once - +#include "Defines.h" #include "TRender/TResource.h" #include "TRender/TTextureResource.h" TOSHI_NAMESPACE_BEGIN -class TOSHI_EXPORT TTextureFactoryHAL : public TTextureFactory +class TRENDERINTERFACED3D_EXPORTS TTextureFactoryHAL : public TTextureFactory { DECLARE_DYNAMIC(TTextureFactoryHAL) diff --git a/Toshi/Include/TRenderD3D/TTextureResourceD3D.h b/Toshi/Include/TRenderD3D/TTextureResourceD3D.h index f2427ca..20467f2 100644 --- a/Toshi/Include/TRenderD3D/TTextureResourceD3D.h +++ b/Toshi/Include/TRenderD3D/TTextureResourceD3D.h @@ -1,10 +1,11 @@ #pragma once #include "TRender/TTextureResource.h" +#include "Defines.h" #include TOSHI_NAMESPACE_BEGIN -class TOSHI_EXPORT TTextureResourceHAL : public TTextureResource +class TRENDERINTERFACED3D_EXPORTS TTextureResourceHAL : public TTextureResource { DECLARE_DYNAMIC(TTextureResourceHAL) diff --git a/Toshi/Source/TKernel/TMemory.cpp b/Toshi/Source/TKernel/TMemory.cpp index ced4577..04c533f 100644 --- a/Toshi/Source/TKernel/TMemory.cpp +++ b/Toshi/Source/TKernel/TMemory.cpp @@ -73,7 +73,7 @@ TBOOL TMemory::Free(TPVOID a_pMem) return TBOOL(); } -TPVOID TOSHI_EXPORT TOSHI_API tmalloc(TINT a_iSize, TPCHAR a_pBuffer, TINT a_iUnk) +TPVOID TKERNELINTERFACE_EXPORTS TOSHI_API tmalloc(TINT a_iSize, TPCHAR a_pBuffer, TINT a_iUnk) { #ifdef TOSHI_NOTFINAL return malloc(a_iSize); @@ -82,7 +82,7 @@ TPVOID TOSHI_EXPORT TOSHI_API tmalloc(TINT a_iSize, TPCHAR a_pBuffer, TINT a_iUn #endif } -TPVOID TOSHI_EXPORT TOSHI_API tmemalign(TINT a_iAlign, TINT a_iSize) +TPVOID TKERNELINTERFACE_EXPORTS TOSHI_API tmemalign(TINT a_iAlign, TINT a_iSize) { #ifdef TOSHI_NOTFINAL return malloc(a_iSize); @@ -91,7 +91,7 @@ TPVOID TOSHI_EXPORT TOSHI_API tmemalign(TINT a_iAlign, TINT a_iSize) #endif } -void TOSHI_EXPORT TOSHI_API tfree(TPVOID a_pMem) +void TKERNELINTERFACE_EXPORTS TOSHI_API tfree(TPVOID a_pMem) { #ifdef TOSHI_NOTFINAL free(a_pMem); diff --git a/Toshi/premake5.lua b/Toshi/premake5.lua index 565f8b9..6533ed2 100644 --- a/Toshi/premake5.lua +++ b/Toshi/premake5.lua @@ -18,7 +18,7 @@ project ("TKernelInterface") defines { - "TOSHI_USER_ENGINE", + "TKERNELINTERFACE", "_CRT_SECURE_NO_WARNINGS" } @@ -92,7 +92,7 @@ project ("TApplication") defines { - "TOSHI_USER_ENGINE", + "TAPPLICATION", "_CRT_SECURE_NO_WARNINGS" } @@ -143,7 +143,7 @@ project ("TRenderInterface") defines { - "TOSHI_USER_ENGINE", + "TRENDERINTERFACE", "_CRT_SECURE_NO_WARNINGS" } @@ -217,7 +217,7 @@ project ("TRenderD3DInterface") defines { - "TOSHI_USER_ENGINE", + "TRENDERINTERFACED3D", "_CRT_SECURE_NO_WARNINGS" }