diff options
author | aap <aap@papnet.eu> | 2019-07-07 13:09:11 +0200 |
---|---|---|
committer | aap <aap@papnet.eu> | 2019-07-07 13:09:11 +0200 |
commit | 53023eb65bdcde43e341c1ecb7cf0c7f8ee524fb (patch) | |
tree | fc65a6c40fa719f9d43be9e0e15be79c490135e0 /src/NodeName.cpp | |
parent | finished CPhysical (diff) | |
download | re3-53023eb65bdcde43e341c1ecb7cf0c7f8ee524fb.tar re3-53023eb65bdcde43e341c1ecb7cf0c7f8ee524fb.tar.gz re3-53023eb65bdcde43e341c1ecb7cf0c7f8ee524fb.tar.bz2 re3-53023eb65bdcde43e341c1ecb7cf0c7f8ee524fb.tar.lz re3-53023eb65bdcde43e341c1ecb7cf0c7f8ee524fb.tar.xz re3-53023eb65bdcde43e341c1ecb7cf0c7f8ee524fb.tar.zst re3-53023eb65bdcde43e341c1ecb7cf0c7f8ee524fb.zip |
Diffstat (limited to 'src/NodeName.cpp')
-rw-r--r-- | src/NodeName.cpp | 77 |
1 files changed, 0 insertions, 77 deletions
diff --git a/src/NodeName.cpp b/src/NodeName.cpp deleted file mode 100644 index 2aea3c83..00000000 --- a/src/NodeName.cpp +++ /dev/null @@ -1,77 +0,0 @@ -#include "common.h" -#include "patcher.h" -#include "NodeName.h" - -static int32 &gPluginOffset = *(int32*)0x64C610; - -enum -{ - ID_NODENAME = MAKECHUNKID(rwVENDORID_ROCKSTAR, 0xFE), -}; - -#define NODENAMEEXT(o) (RWPLUGINOFFSET(char, o, gPluginOffset)) - -void* -NodeNameConstructor(void *object, RwInt32 offsetInObject, RwInt32 sizeInObject) -{ - if(gPluginOffset > 0) - NODENAMEEXT(object)[0] = '\0'; - return object; -} - -void* -NodeNameDestructor(void *object, RwInt32 offsetInObject, RwInt32 sizeInObject) -{ - return object; -} - -void* -NodeNameCopy(void *dstObject, const void *srcObject, RwInt32 offsetInObject, RwInt32 sizeInObject) -{ - strncpy(NODENAMEEXT(dstObject), NODENAMEEXT(srcObject), 23); - return nil; -} - -RwStream* -NodeNameStreamRead(RwStream *stream, RwInt32 binaryLength, void *object, RwInt32 offsetInObject, RwInt32 sizeInObject) -{ - RwStreamRead(stream, NODENAMEEXT(object), binaryLength); - NODENAMEEXT(object)[binaryLength] = '\0'; - return stream; -} - -RwStream* -NodeNameStreamWrite(RwStream *stream, RwInt32 binaryLength, const void *object, RwInt32 offsetInObject, RwInt32 sizeInObject) -{ - RwStreamWrite(stream, NODENAMEEXT(object), binaryLength); - return stream; -} - -RwInt32 -NodeNameStreamGetSize(const void *object, RwInt32 offsetInObject, RwInt32 sizeInObject) -{ - // game checks for null pointer on node name extension but that really happen - return rwstrlen(NODENAMEEXT(object)); -} - -bool -NodeNamePluginAttach(void) -{ - gPluginOffset = RwFrameRegisterPlugin(24, ID_NODENAME, - NodeNameConstructor, - NodeNameDestructor, - NodeNameCopy); - RwFrameRegisterPluginStream(ID_NODENAME, - NodeNameStreamRead, - NodeNameStreamWrite, - NodeNameStreamGetSize); - return gPluginOffset != -1; -} - -char* -GetFrameNodeName(RwFrame *frame) -{ - if(gPluginOffset < 0) - return nil; - return NODENAMEEXT(frame); -} |