Skip to content

Commit

Permalink
Initial release.
Browse files Browse the repository at this point in the history
Supports saving best lap between sessions.
  • Loading branch information
Poyeyo committed Sep 21, 2020
1 parent 51a303c commit 6b4d175
Show file tree
Hide file tree
Showing 20 changed files with 4,966 additions and 0 deletions.
370 changes: 370 additions & 0 deletions deltabest_plugin/InternalsPlugin.hpp

Large diffs are not rendered by default.

133 changes: 133 additions & 0 deletions deltabest_plugin/RFPluginObjects.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
//╔═════════════════════════════════════════════════════════════════════════╗
//║ ║
//║ Module: Header file for plugin object types ║
//║ ║
//║ Description: interface declarations for plugin objects ║
//║ ║
//║ This source code module, and all information, data, and algorithms ║
//║ associated with it, are part of isiMotor Technology (tm). ║
//║ PROPRIETARY AND CONFIDENTIAL ║
//║ Copyright (c) 1996-2007 Image Space Incorporated. All rights reserved. ║
//║ ║
//║ Change history: ║
//║ kc.2004.0?.??: created ║
//║ mm.2004.05.25: added this description header ║
//║ mm.2004.05.20: splitting this file up so that each type of plugin ║
//║ gets its own header file. ║
//║ ║
//╚═════════════════════════════════════════════════════════════════════════╝
#ifndef _PLUGINOBJECT
#define _PLUGINOBJECT

#include <windows.h>


// forward referencing stuff
class PluginObjectInfo;


//┌────────────────────────────────────────────────────────────────────────┐
//│ typedefs for dll functions - easier to use a typedef than to type
//│ out the crazy syntax for declaring and casting function pointers
//└────────────────────────────────────────────────────────────────────────┘
typedef const char* (__cdecl *GETPLUGINNAME)();
typedef unsigned (__cdecl *GETPLUGINVERSION)();
typedef unsigned (__cdecl *GETPLUGINOBJECTCOUNT)();
typedef PluginObjectInfo* (__cdecl *GETPLUGINOBJECTINFO)(const unsigned uIndex);
typedef PluginObjectInfo* (__cdecl *GETPLUGINOBJECTINFO)(const unsigned uIndex);
typedef float (__cdecl *GETPLUGINSYSTEMVERSION) ();


//plugin object types
enum PluginObjectType
{
PO_VIDEO_EXPORT = 0x00000001,
PO_RFMODIFIER = 0x00000002,
PO_HWPLUGIN = 0x00000003,
PO_GAMESTATS = 0x00000004,
PO_NCPLUGIN = 0x00000005,
PO_MOTION = 0x00000006,
PO_IRCPLUGIN = 0x00000007,
PO_IVIBE = 0x00000008,
PO_INTERNALS = 0x00000009,
};


//┌────────────────────────────────────────────────────────────────────────┐
//│ Plugin Object Property
//│ - can be used to expose pluginobject settings to rFactor.
//│ In practice this feature has gone almost entirely unused
//└────────────────────────────────────────────────────────────────────────┘
enum POPType
{
POPTYPE_INT,
POPTYPE_FLOAT,
POPTYPE_STRING,
};

static char POPTypeNames[3][64] =
{
"POPTYPE_INT",
"POPTYPE_FLOAT",
"POPTYPE_STRING",
};

const unsigned POP_MAXNAME = 32;
const unsigned POP_MAXDESC = 256;

struct PluginObjectProperty
{
union
{
int iValue;
float fValue;
char* szValue;
};

POPType uPropertyType;
char szName[POP_MAXNAME];
char szDesc[POP_MAXDESC];
};

//┌────────────────────────────────────────────────────────────────────────┐
//│ PluginObject
//│ - interface used by plugin classes.
//└────────────────────────────────────────────────────────────────────────┘
class PluginObject
{
public:
PluginObject() {}
virtual ~PluginObject(){};
virtual void Destroy()=0;
virtual class PluginObjectInfo* GetInfo()=0;

virtual unsigned GetPropertyCount() const =0;
virtual PluginObjectProperty* GetProperty(const unsigned uIndex) =0;
virtual PluginObjectProperty* GetProperty(const char* szName) =0;
};

//┌────────────────────────────────────────────────────────────────────────┐
//│ PluginObjectInfo
//│ - interface used by plugin info classes.
//│ the purpose of the plugin info classes is to allow the game to get
//│ information about and instantiate the plugin objects contained in
//│ a dll without needing to know anything about the PO in advance
//└────────────────────────────────────────────────────────────────────────┘
class PluginObjectInfo
{
public:
virtual ~PluginObjectInfo() {};
virtual const char* GetName() const = 0;
virtual const char* GetFullName() const = 0;
virtual const char* GetDesc() const = 0;
virtual const unsigned GetType() const = 0;
virtual const char* GetSubType() const = 0;
virtual const unsigned GetVersion() const = 0;
virtual void* Create() const = 0;
};





#endif
Binary file added deltabest_plugin/SimpleRPMTestPlugin.tga
Binary file not shown.
Loading

0 comments on commit 6b4d175

Please sign in to comment.