mirror of
https://github.com/Ragora/T2-IFC22Template.git
synced 2026-07-12 14:04:32 +00:00
Initial commit.
This commit is contained in:
commit
078afe49f6
13 changed files with 415 additions and 0 deletions
71
source/DLLmain.cpp
Normal file
71
source/DLLmain.cpp
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
/*
|
||||
* DLLMain.cpp
|
||||
*
|
||||
* Main code for the IFC22.dll replacement.
|
||||
* This is reverse engineered from LouCypher's
|
||||
* IFC22.dll replacement from somewhere on either
|
||||
* the TribesNext.com or The-Construct.net forums.
|
||||
*
|
||||
* Robert MacGregor
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
BOOL APIENTRY DllMain( HMODULE hModule,
|
||||
DWORD ul_reason_for_call,
|
||||
LPVOID lpReserved
|
||||
)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
class CImmCompoundEffect
|
||||
{
|
||||
public:
|
||||
_declspec(dllexport) int Start(unsigned long x, unsigned long y) { return 8; }
|
||||
_declspec(dllexport) int Stop() { return 1; }
|
||||
};
|
||||
|
||||
class CImmDevice
|
||||
{
|
||||
public:
|
||||
_declspec(dllexport) static CImmDevice * CreateDevice(HINSTANCE__ *, HWND__ *)
|
||||
{
|
||||
typedef void (*LPINITT2DLL)(void);
|
||||
HINSTANCE hDLL = NULL;
|
||||
LPINITT2DLL lpinitT2DLL = NULL;
|
||||
hDLL = LoadLibrary(L"t2dll.dll"); // AfxLoadLibrary is probably better.
|
||||
|
||||
if (hDLL == NULL)
|
||||
return 0; // The DLL doesn't exist
|
||||
else
|
||||
lpinitT2DLL = (LPINITT2DLL)GetProcAddress(hDLL, "_Z9initT2Dllv"); // Attempt to load our entry point
|
||||
|
||||
if (lpinitT2DLL == NULL)
|
||||
return 0; // Unable to load entry point
|
||||
else
|
||||
lpinitT2DLL(); // The function was loaded, call TribesNext and move on to postTN Startup
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
_declspec(dllexport) int UsesWin32MouseServices(int) { return 4; }
|
||||
};
|
||||
|
||||
class CImmProject
|
||||
{
|
||||
public:
|
||||
_declspec(dllexport) CImmProject() {}
|
||||
_declspec(dllexport) ~CImmProject() {}
|
||||
|
||||
_declspec(dllexport) CImmCompoundEffect *GetCreatedEffect(int) { return 0; }
|
||||
_declspec(dllexport) CImmCompoundEffect *GetCreatedEffect(const char *) { return 0; }
|
||||
_declspec(dllexport) CImmCompoundEffect *CreateEffect(char const *, CImmDevice *, unsigned long) { return 0; }
|
||||
_declspec(dllexport) int Start(char const *, unsigned long, unsigned long, class CImmDevice *) { return 1; }
|
||||
_declspec(dllexport) int Stop(const char *) { return 1; }
|
||||
_declspec(dllexport) int LoadProjectFromMemory(void *, CImmDevice *) { return 1; }
|
||||
};
|
||||
|
||||
#ifdef _MANAGED
|
||||
#pragma managed(pop)
|
||||
#endif
|
||||
8
source/stdafx.cpp
Normal file
8
source/stdafx.cpp
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
// stdafx.cpp : source file that includes just the standard includes
|
||||
// t2dll.pch will be the pre-compiled header
|
||||
// stdafx.obj will contain the pre-compiled type information
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
// TODO: reference any additional headers you need in STDAFX.H
|
||||
// and not in this file
|
||||
Loading…
Add table
Add a link
Reference in a new issue