ModLoader sources didn't add?

This commit is contained in:
Ragora 2014-08-05 00:49:47 -04:00
parent 44e5f33ee7
commit c1e04ef0a6
13 changed files with 582 additions and 1 deletions

7
ModLoader/include/config.h Executable file
View file

@ -0,0 +1,7 @@
/*
* config.h
* Contains configuration information for BulletDLL
* Copyright (c) 2013 Robert MacGregor
*/
#define MAXIMUM_BULLET_NODES 256

32
ModLoader/include/stdafx.h Executable file
View file

@ -0,0 +1,32 @@
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#pragma once
// Modify the following defines if you have to target a platform prior to the ones specified below.
// Refer to MSDN for the latest info on corresponding values for different platforms.
#ifndef WINVER // Allow use of features specific to Windows XP or later.
#define WINVER 0x0501 // Change this to the appropriate value to target other versions of Windows.
#endif
#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later.
#define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows.
#endif
#ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later.
#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later.
#endif
#ifndef _WIN32_IE // Allow use of features specific to IE 6.0 or later.
#define _WIN32_IE 0x0600 // Change this to the appropriate value to target other versions of IE.
#endif
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
// Windows Header Files:
#include <windows.h>
// TODO: reference additional headers your program requires here
#include "t2api.h"
#include "config.h"

15
ModLoader/include/t2ConCmds.h Executable file
View file

@ -0,0 +1,15 @@
/*
* t2conCmds.h
* Original code by Linker
* Modified by Robert MacGregor
*/
#include "stdafx.h"
// Linker's original functions
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[]);
// Mod Loader Implementation
bool conLoadMod(SimObject *obj,S32 argc, const char* argv[]);

109
ModLoader/include/t2api.h Executable file
View file

@ -0,0 +1,109 @@
#pragma once
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);