mirror of
https://github.com/Ragora/T2-CPP.git
synced 2026-02-23 00:23:37 +00:00
Restructured project structure to use a singular SLN; made the T2API common to all projects; adjusted watchdog timer to 8 seconds
This commit is contained in:
parent
e1c5d1dead
commit
527474ff24
79 changed files with 469 additions and 626 deletions
|
|
@ -2,6 +2,11 @@
|
|||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual C++ Express 2010
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RandomMod", "RandomMod\RandomMod.vcxproj", "{2A498B2D-84B2-4BBF-9532-EA17E5BA51BB}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{9B3A3214-400B-4245-85FD-EA12D5F791D4} = {9B3A3214-400B-4245-85FD-EA12D5F791D4}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Common", "..\..\CommonAPI\Common\Common.vcxproj", "{9B3A3214-400B-4245-85FD-EA12D5F791D4}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
|
|
@ -13,6 +18,10 @@ Global
|
|||
{2A498B2D-84B2-4BBF-9532-EA17E5BA51BB}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{2A498B2D-84B2-4BBF-9532-EA17E5BA51BB}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{2A498B2D-84B2-4BBF-9532-EA17E5BA51BB}.Release|Win32.Build.0 = Release|Win32
|
||||
{9B3A3214-400B-4245-85FD-EA12D5F791D4}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{9B3A3214-400B-4245-85FD-EA12D5F791D4}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{9B3A3214-400B-4245-85FD-EA12D5F791D4}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{9B3A3214-400B-4245-85FD-EA12D5F791D4}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -15,13 +15,11 @@
|
|||
<ClCompile Include="source\dllmain.cpp" />
|
||||
<ClCompile Include="source\mt.cc" />
|
||||
<ClCompile Include="source\randomCmds.cpp" />
|
||||
<ClCompile Include="source\t2api.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="include\BaseMod.h" />
|
||||
<ClInclude Include="include\mt.h" />
|
||||
<ClInclude Include="include\randomCmds.h" />
|
||||
<ClInclude Include="include\t2api.h" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{2A498B2D-84B2-4BBF-9532-EA17E5BA51BB}</ProjectGuid>
|
||||
|
|
@ -53,11 +51,13 @@
|
|||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<IncludePath>include;$(IncludePath)</IncludePath>
|
||||
<IncludePath>include;..\..\..\CommonAPI\Common\include;$(IncludePath)</IncludePath>
|
||||
<OutDir>$(SolutionDir)\Mods\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<IncludePath>include;$(IncludePath)</IncludePath>
|
||||
<IncludePath>include;..\..\..\CommonAPI\Common\include;$(IncludePath)</IncludePath>
|
||||
<OutDir>$(SolutionDir)\Mods\</OutDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
|
|
@ -69,6 +69,7 @@
|
|||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>$(SolutionDir)\Common.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
|
|
@ -85,6 +86,7 @@
|
|||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalDependencies>$(SolutionDir)\Common.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
|
|
|
|||
|
|
@ -18,9 +18,6 @@
|
|||
<ClCompile Include="source\BaseMod.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\t2api.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="source\dllmain.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
|
|
@ -32,9 +29,6 @@
|
|||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="include\t2api.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\BaseMod.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
#include <t2api.h>
|
||||
#include <LinkerAPI.h>
|
||||
|
||||
const char* conGuiTsCtrlProject(SimObject *obj,S32 argc, const char* argv[]);
|
||||
bool conNetObjectSetGhostable(SimObject *obj,S32 argc, const char* argv[]);
|
||||
const char* conGetVariable(SimObject *obj,S32 argc, const char* argv[]);
|
||||
const char* conGuiTsCtrlProject(Linker::SimObject *obj,S32 argc, const char* argv[]);
|
||||
bool conNetObjectSetGhostable(Linker::SimObject *obj,S32 argc, const char* argv[]);
|
||||
const char* conGetVariable(Linker::SimObject *obj,S32 argc, const char* argv[]);
|
||||
|
||||
// Merscenne Random
|
||||
const char *conMRandom(SimObject *obj, S32 argc, const char *argv[]);
|
||||
const char *conMSeed(SimObject *obj, S32 argc, const char *argv[]);
|
||||
const char *conMRandomFloat(SimObject *obj, S32 argc, const char *argv[]);
|
||||
const char *conMRandom(Linker::SimObject *obj, S32 argc, const char *argv[]);
|
||||
const char *conMSeed(Linker::SimObject *obj, S32 argc, const char *argv[]);
|
||||
const char *conMRandomFloat(Linker::SimObject *obj, S32 argc, const char *argv[]);
|
||||
|
||||
// Clock
|
||||
const char*conQPCBegin(SimObject *obj, S32 argc, const char *argv[]);
|
||||
const char*conQPCEnd(SimObject *obj, S32 argc, const char *argv[]);
|
||||
const char*conQPCBegin(Linker::SimObject *obj, S32 argc, const char *argv[]);
|
||||
const char*conQPCEnd(Linker::SimObject *obj, S32 argc, const char *argv[]);
|
||||
|
|
@ -1,111 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include <string.h>
|
||||
|
||||
void initT2Api();
|
||||
|
||||
|
||||
//api stuff
|
||||
|
||||
typedef unsigned int U32;
|
||||
typedef int S32;
|
||||
typedef float F32;
|
||||
|
||||
typedef unsigned int dsize_t;
|
||||
|
||||
//for addvariable
|
||||
#define TypeS32 1
|
||||
#define TypeBool 3
|
||||
#define TypeF32 5
|
||||
|
||||
|
||||
//dshit
|
||||
inline dsize_t dStrlen(const char *str)
|
||||
{
|
||||
return (dsize_t)strlen(str);
|
||||
}
|
||||
|
||||
class Namespace {
|
||||
const char* mName;
|
||||
};
|
||||
|
||||
|
||||
|
||||
class SimObject{
|
||||
SimObject* group;
|
||||
const char* objectName; //04h: objectName
|
||||
SimObject* nextNameObject; //8
|
||||
SimObject* nextManagerNameObject; //c
|
||||
SimObject* nextIdObject; //10h: nextIdObject
|
||||
U32 stuff; //14
|
||||
U32 mFlags; //18h
|
||||
U32 mNotifyList; //actually a pointer
|
||||
U32 mId; //20h: mId
|
||||
//more stuff
|
||||
};
|
||||
|
||||
class SimIdDictionary
|
||||
{
|
||||
enum
|
||||
{
|
||||
DefaultTableSize = 4096,
|
||||
TableBitMask = 4095
|
||||
};
|
||||
SimObject *table[DefaultTableSize];
|
||||
};
|
||||
extern SimIdDictionary* gIdDictionary;
|
||||
|
||||
class Point3F
|
||||
{
|
||||
public:
|
||||
F32 x;
|
||||
F32 y;
|
||||
F32 z;
|
||||
};
|
||||
|
||||
|
||||
//GuiTSCtrl
|
||||
class GuiTSCtrl {};
|
||||
class HoverVehicle {};
|
||||
void GuiTSCtrl_project(GuiTSCtrl *obj, const Point3F &pt, Point3F *dest); //fake
|
||||
|
||||
|
||||
namespace Sim {
|
||||
extern SimObject* (*findObject)(U32 id);
|
||||
}
|
||||
|
||||
|
||||
//console
|
||||
|
||||
typedef const char * (*StringCallback)(SimObject *obj, S32 argc, const char *argv[]);
|
||||
typedef S32 (*IntCallback)(SimObject *obj, S32 argc, const char *argv[]);
|
||||
typedef F32 (*FloatCallback)(SimObject *obj, S32 argc, const char *argv[]);
|
||||
typedef void (*VoidCallback)(SimObject *obj, S32 argc, const char *argv[]);
|
||||
typedef bool (*BoolCallback)(SimObject *obj, S32 argc, const char *argv[]);
|
||||
|
||||
|
||||
extern void (*someTest)(void);
|
||||
//functions
|
||||
namespace Con{
|
||||
|
||||
extern char * (*getReturnBuffer)(U32 bufferSize);
|
||||
|
||||
extern void (*addMethodB)(const char *nsName, const char *name, BoolCallback cb, const char *usage, S32 minArgs, S32 maxArgs);
|
||||
extern void (*addMethodS)(const char *nsName, const char *name, StringCallback cb, const char *usage, S32 minArgs, S32 maxArgs);
|
||||
|
||||
extern bool (*addVariable)(const char *name, S32 t, void *dp);
|
||||
|
||||
extern void (*printf)(const char* fmt,...);
|
||||
extern void (*errorf)(U32 type, const char* fmt,...);
|
||||
|
||||
extern const char * (*getVariable)(const char *name);
|
||||
extern const char * (*execute)(S32 argc, const char *argv[]);
|
||||
extern const char * (*executef)(S32 argc, ...);
|
||||
extern const char * (*executem)(SimObject *object, S32 argc, const char *argv[]);
|
||||
extern const char * (*evaluate)(const char* string, bool echo, const char *fileName, bool cf);
|
||||
}
|
||||
|
||||
//d-util
|
||||
extern int (*dSscanf)(const char *buffer, const char *format, ...);
|
||||
extern int (*dSprintf)(char *buffer, dsize_t bufferSize, const char *format, ...);
|
||||
extern bool (*dAtob)(const char *str);
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#include "BaseMod.h"
|
||||
|
||||
#include "t2api.h"
|
||||
#include "LinkerAPI.h"
|
||||
#include "randomCmds.h"
|
||||
|
||||
extern "C"
|
||||
|
|
|
|||
|
|
@ -8,11 +8,11 @@
|
|||
|
||||
#include "mt.h"
|
||||
|
||||
#include "t2api.h"
|
||||
#include "LinkerAPI.h"
|
||||
|
||||
// Merscenne Twister
|
||||
MersenneTwister *mt = NULL;
|
||||
const char *conMRandom(SimObject *obj, S32 argc, const char *argv[])
|
||||
const char *conMRandom(Linker::SimObject *obj, S32 argc, const char *argv[])
|
||||
{
|
||||
if (!mt)
|
||||
{
|
||||
|
|
@ -56,7 +56,7 @@ const char *conMRandom(SimObject *obj, S32 argc, const char *argv[])
|
|||
return mem;
|
||||
}
|
||||
|
||||
const char *conMRandomFloat(SimObject *obj, S32 argc, const char *argv[])
|
||||
const char *conMRandomFloat(Linker::SimObject *obj, S32 argc, const char *argv[])
|
||||
{
|
||||
if (!mt)
|
||||
{
|
||||
|
|
@ -95,7 +95,7 @@ const char *conMRandomFloat(SimObject *obj, S32 argc, const char *argv[])
|
|||
return mem;
|
||||
}
|
||||
|
||||
const char *conMSeed(SimObject *obj, S32 argc, const char *argv[])
|
||||
const char *conMSeed(Linker::SimObject *obj, S32 argc, const char *argv[])
|
||||
{
|
||||
if (!mt)
|
||||
{
|
||||
|
|
@ -125,7 +125,7 @@ static unsigned int CURRENT_STOPWATCH_COUNT = 0;
|
|||
static __int64 QPC_STOPWATCHES[QPC_MAX_STOPWATCHES];
|
||||
|
||||
__int64 STARTING_QPC_TIME;
|
||||
const char*conQPCBegin(SimObject *obj, S32 argc, const char *argv[])
|
||||
const char*conQPCBegin(Linker::SimObject *obj, S32 argc, const char *argv[])
|
||||
{
|
||||
if (!QueryPerformanceCounter((LARGE_INTEGER*)&QPC_STOPWATCHES[CURRENT_STOPWATCH_COUNT]))
|
||||
{
|
||||
|
|
@ -147,7 +147,7 @@ const char*conQPCBegin(SimObject *obj, S32 argc, const char *argv[])
|
|||
return result;
|
||||
}
|
||||
|
||||
const char*conQPCEnd(SimObject *obj, S32 argc, const char *argv[])
|
||||
const char*conQPCEnd(Linker::SimObject *obj, S32 argc, const char *argv[])
|
||||
{
|
||||
__int64 ENDING_QPC_TIME;
|
||||
if (!QueryPerformanceCounter((LARGE_INTEGER*)&ENDING_QPC_TIME))
|
||||
|
|
|
|||
|
|
@ -1,85 +0,0 @@
|
|||
#include "t2api.h"
|
||||
|
||||
SimIdDictionary* gIdDictionary = reinterpret_cast<SimIdDictionary*>(0x009E9194);
|
||||
|
||||
//439550
|
||||
namespace Sim {
|
||||
SimObject* (*findObject)(U32 id) =
|
||||
(SimObject* (_cdecl *)(U32 id) )
|
||||
0x439550;
|
||||
}
|
||||
|
||||
//hackey way to do member functions, ....
|
||||
void GuiTSCtrl_project(GuiTSCtrl *obj, const Point3F &pt, Point3F *dest) {
|
||||
typedef void (__cdecl *projFunc)(const Point3F &pt, Point3F *dest);
|
||||
static projFunc p = (projFunc)0x4d0b40;
|
||||
|
||||
__asm {
|
||||
push dest;
|
||||
push pt;
|
||||
mov ecx,obj;
|
||||
lea eax, p;
|
||||
mov eax, [eax];
|
||||
call eax;
|
||||
}
|
||||
}
|
||||
|
||||
namespace Con {
|
||||
|
||||
char* (*getReturnBuffer)(U32 bufferSize) =
|
||||
(char *(__cdecl *)(U32))
|
||||
0x42caa0;
|
||||
|
||||
void (*addMethodB)(const char *nsName, const char *name, BoolCallback cb, const char *usage, S32 minArgs, S32 maxArgs) =
|
||||
(void (__cdecl *)(const char *, const char *,BoolCallback,const char *,S32,S32))
|
||||
0x426510;
|
||||
|
||||
void (*addMethodS)(const char *, const char *,StringCallback, const char *, S32, S32) =
|
||||
(void (__cdecl *)(const char *,const char *,StringCallback,const char *,S32,S32))
|
||||
0x426410;
|
||||
|
||||
bool (*addVariable)(const char *name, S32 t, void *dp) =
|
||||
(bool (__cdecl *)(const char *name, S32 t, void *dp))
|
||||
0x4263B0;
|
||||
|
||||
const char * (*execute)(S32 argc, const char *argv[]) =
|
||||
(const char * (__cdecl *)(S32 argc, const char *argv[]))
|
||||
0x4267A0;
|
||||
|
||||
const char * (*executef)(S32 argc, ...) =
|
||||
(const char * (__cdecl *)(S32 argc, ...))
|
||||
0x4269E0;
|
||||
|
||||
const char * (*evaluate)(const char* string, bool echo, const char *fileName, bool cf) =
|
||||
(const char * (__cdecl *)(const char* string, bool echo, const char *fileName, bool cf))
|
||||
0x426690;
|
||||
|
||||
const char * (*executem)(SimObject *object, S32 argc, const char *argv[]) =
|
||||
(const char * (__cdecl *)(SimObject *object, S32 argc, const char *argv[]))
|
||||
0x426800;
|
||||
|
||||
const char * (*getVariable)(const char *name) =
|
||||
(const char * (__cdecl *)(const char *name))
|
||||
0x4261F0;
|
||||
|
||||
void (*printf)(const char* fmt,...) =
|
||||
(void (__cdecl *)(const char* fmt,...))
|
||||
0x425F30;
|
||||
|
||||
void (*errorf)(U32 type, const char* fmt,...)=
|
||||
(void (__cdecl *)(U32, const char*,...))
|
||||
0x425FB0;
|
||||
|
||||
}
|
||||
|
||||
int (*dSscanf)(const char *buffer, const char *format, ...) =
|
||||
(int (__cdecl *)(const char *,const char *,...))
|
||||
0x55b640;
|
||||
|
||||
int (*dSprintf)(char *buffer, dsize_t bufferSize, const char *format, ...) =
|
||||
(int (__cdecl *)(char *,dsize_t,const char *,...))
|
||||
0x55b5e0;
|
||||
|
||||
bool (*dAtob)(const char *str) =
|
||||
(bool (__cdecl *)(const char *str))
|
||||
0x55B490;
|
||||
Loading…
Add table
Add a link
Reference in a new issue