I don't know what your HandleActor() is doing...
CGame.h
Code:
#include "game.h"
class CGame
{
public:
UINT GetLocalActorGuid();
CActor *GetActor(ULONG guid);
//??? HandleActor(m_Local, CActor*);
int m_ActorsCount;
//??? m_Actors[???];
//??? m_Local;
}
#endif
CGame.cpp
Code:
#include "CGame.h"
#include "game.h"
struct Vec2;
struct Vec3;
struct Vec4;
struct Mat4;
class CActor;
class CActorMovement;
class CActorCommonData;
struct tObManStorage;
class ObMan;
class ObManPtr;
struct tObData;
class CObDataContainer;
class CObLocal;
UINT CGame::GetLocalActorGuid()
{
ObMan *ob = m_Engine.ObMan->Ptr;
if( !ob->Storage.Local ||
!ob->Storage.Data )
return ~0;
if( ob->Storage.Local->Index == ~0 )
return ~0;
CObDataContainer *Data = (CObDataContainer *) (
(ULONG_PTR)ob->Storage.Data + ob->Storage.Local->Index * 0x7FF8 );
return Data->Data.id_actor;
}
CActor *CGame::GetActor(ULONG guid)
{
if(guid == ~0)
return 0;
ObMan *ob = m_Engine.ObMan->Ptr;
if(!ob)
return 0;
typedef CActor TC; //<- template it to use with other lists!
tContainer<TC>* pct = ob->Storage.Actors;
if(!pct) // || sizeof(TC) != pct->SizeOf) // fcuk it. want to use unknown size
return 0;
USHORT id = (guid & 0xFFFF);
if(id > pct->Limit)
return 0;
USHORT l = (id >> pct->Bits);
USHORT e = id & ((1 << pct->Bits) - 1);
TC *Ret = (TC *)((ULONG_PTR)&pct->List[l][0] + pct->SizeOf * e);
return (Ret->id == guid) ? Ret : 0;
}
/*atm working on
tContainer<CActorCommonData>* ACD = *m_Engine.ObMan->Ptr->Storage.ACD;
CActorCommonData **List = ACD->List;
for(int i = 0; i < ACD->Count; i++)
{
CActorCommonData &c = List[0][i];
LOG("%3u [%08X] %s", i, &c, c.Name);
} */
game.h
Code:
#ifndef __GAME__H__
#define __GAME__H__
#include <Windows.h>
struct Vec2;
struct Vec3;
struct Vec4;
struct Mat4;
class CActor;
class CActorMovement;
class CActorCommonData;
struct tObManStorage;
class ObMan;
class ObManPtr;
struct tObData;
class CObDataContainer;
class CObLocal;
struct Vec2
{
float x; // 0x000
float y; // 0x004
};
struct Vec3
{
float x; // 0x000
float y; // 0x004
float z; // 0x008
};
class CActor
{
public:
ULONG id; // 0x000
ULONG id_animation; // 0x004
CHAR Name[56]; // 0x008
UCHAR unknown_40[80]; // 0x040
Vec3 Rot; // 0x090
float fRot; // 0x09C
Vec3 Pos; // 0x0A0
float f142; // 0x0AC
Vec3 Pos1; // 0x0B0
float f734; // 0x0BC
Vec3 Pos2; // 0x0C0
UCHAR unknown_CC[12]; // 0x0CC
ULONG guid_Mov; // 0x0D8
ULONG guid_Unk; // 0x0DC
UCHAR unknown_E0[32]; // 0x0E0
Vec3 Pos3; // 0x100
UCHAR unknown_10C[52]; // 0x10C
Vec3 Pos4; // 0x140
UCHAR unknown_14C[196]; // 0x14C
Vec3 PosObj; // 0x210
UCHAR unknown_21C[356]; // 0x21C
CActorMovement* Mov; // 0x380
float Direction; // 0x384
UCHAR unknown_388[24]; // 0x388
Vec3 Vel; // 0x3A0
Vec3 Pos6; // 0x3AC
UCHAR unknown_3B8[96]; // 0x3B8
ULONG Counter; // 0x418
UCHAR unknown_41C[12]; // 0x41C
};
class CActorMovement
{
public:
ULONG* vt; // 0x000
ULONG Active; // 0x004
float Speed; // 0x008
float SpeedCurrent; // 0x00C
UCHAR unknown_10[44]; // 0x010
Vec3 Pos; // 0x03C
UCHAR unknown_48[4]; // 0x048
Vec3 Pos2; // 0x04C
UCHAR unknown_58[28]; // 0x058
Vec3 Tp; // 0x074
UCHAR unknown_80[8]; // 0x080
ULONG unk; // 0x088
UCHAR unknown_8C[24]; // 0x08C
Vec3 Pos3; // 0x0A4
UCHAR unknown_B0[8]; // 0x0B0
float Speed2; // 0x0B8
UCHAR unknown_BC[160]; // 0x0BC
ULONG id; // 0x15C
ULONG FrameMov; // 0x160
ULONG Frame; // 0x164
ULONG FramePrev; // 0x168
UCHAR unknown_16C[4]; // 0x16C
float Direction; // 0x170
UCHAR unknown_174[707]; // 0x174
};
class CActorCommonData
{
public:
ULONG id; // 0x000
CHAR Name[128]; // 0x004
ULONG N11A3D0361; // 0x084
ULONG N11A3D036; // 0x088
ULONG N11A3DFFE; // 0x08C
UCHAR unknown_90[576]; // 0x090
};
template <class T>
class tContainer
{
public:
CHAR Name[256];
ULONG Limit;
ULONG SizeOf;
ULONG Count;
UCHAR unknown_10C[60];
T** List;
UCHAR unknown_14C[64];
ULONG Bits;
UCHAR unknown_190[64];
};
struct tObManStorage
{
UCHAR unknown_0[168]; // 0x000
CObDataContainer* Data; // 0x0A8
UCHAR unknown_AC[40]; // 0x0AC
tContainer<CActorCommonData>** ACD; // 0x0D4
UCHAR unknown_D8[92]; // 0x0D8
tContainer<CActor>* Actors; // 0x134
UCHAR unknown_138[128]; // 0x138
CObLocal* Local; // 0x1B8
UCHAR unknown_1BC[76]; // 0x1BC
};
class ObMan
{
public:
struct tPad
{
UCHAR unknown_0[56]; // 0x000
ULONG FrameCurrent; // 0x038
UCHAR unknown_3C[1856]; // 0x03C
};
tPad Data; // 0x000
tObManStorage Storage; // 0x77C <-- TLS, 0x94BB80
};
class ObManPtr
{
public:
ObMan* Ptr; // 0x000
};
struct tObData
{
UCHAR unknown_0[4]; // 0x000
ULONG id_anim; // 0x004
ULONG id_actor; // 0x008
UCHAR unknown_C[308]; // 0x00C
};
class CObDataContainer
{
public:
UCHAR unknown_0[88]; // 0x000
tObData Data; // 0x058
UCHAR unknown_198[256]; // 0x198
};
class CObLocal
{
public:
ULONG Index; // 0x000
UCHAR unknown_4[92]; // 0x004
};
struct
{
ObManPtr *ObMan;
} m_Engine;
#endif
I'm unsure how those class forward declarations work. I'm not sure if there suppose to be in both files. But I think I have it right..
nableng,
Your inbox is full, limit is 5. Delete a few so I can get a message in.
-Bit_Hacker