Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Support

    3. Suggestions

Help compiling 3dmarkers .h and .cpp


Sloth-
 Share

Recommended Posts

I have these codes 3DMarkers.cpp and 3DMarkers.h (thanks to @The Hero), and i was trying to compile them, but looks like there still could be some missing info:

 

First of all: I'll asume that uint8, uint16, int16 and uint32 (that doesn't appear by default in my enviroment as declared) can be defined as:

typedef unsigned char   uint8;typedef unsigned short  uint16;typedef signed short    int16;typedef unsigned int    uint32;

Here i had to make following changes:

*(uint8*)0x8D5D8B = 0xD1;	// cone marker alpha
uint8 coneMarkerAlpha = *(uint8*)0x8D5D8B;coneMarkerAlpha = 0xD1;    // cone marker alpha

Because compiler doesn't like the first expression.

 

 

And i guess i can change this:

InjectHook(0x7269FA, C3dMarkers::Init);          // original codepatch::RedirectCall(0x7269FA, C3dMarkers::Init); // my changePatch<BYTE>(0x585CCB, MARKER_SET_COLOR_B);      // original codepatch::Set<BYTE>(0x585CCB, MARKER_SET_COLOR_B); // my changeInjectHook(0x72576B, &C3dMarkerSizeHack, PATCH_CALL); // original codepatch::RedirectCall(0x7269FA, C3dMarkerSizeHack);     // my changeInjectHook(0x440F38, EnexMarkersColorBreak, PATCH_JUMP); // original codepatch::RedirectJump(0x440F38, EnexMarkersColorBreak);    // my changeNop(0x72563A, 6);         // original codepatch::Nop(0x72563A, 6);  // my change

But i don't know what is this:

Patch(0x7232C1, &C3dMarkers::m_pRpClumpArray[0]);

Maybe:

patch::Set<UnknownType>(0x7232C1, &C3dMarkers::m_pRpClumpArray[0]);

And there is still some other stuff that i don't know how to fix:

WRAPPER RpClump *C3dMarkers::LoadMarker(const char *name) { WRAPARG(name); EAXJMP(0x722810); }//WRAPPER appears as undefined

And in here:

CCoronas::RegisterCorona((uint32)marker, NULL,	marker->m_color.red, marker->m_color.green, marker->m_color.blue, 0x84,	*marker->m_mat.GetPos(), 1.2*marker->m_fSize, TheCamera.LODDistMultiplier * 50.0f,	gpCoronaTexture[1], 0, 0, 0, 0, 0.0, false, 1.5f, false, 255, false, true);// *marker->m_mat.GetPos()   // CMatrix C3DMarker::m_mat // CMatrix doesn't have a member called GetPos()// TheCamera.LODDistMultiplier // The compiler from Code::Blocks suggest me to change "LODDistMultiplier" by "m_fLODDistMultiplier"
RwFrame *f = RpAtomicGetFrame(marker->m_pAtomic);// RpAtomicGetFrame() is not defined

Thanks in advance.

Edited by Sloth-
Link to comment
Share on other sites

patch::Set<UnknownType>(0x7232C1, &C3dMarkers::m_pRpClumpArray[0]);

I Think should be.

patch::SetPointer(0x7232C1, &C3dMarkers::m_pRpClumpArray[0]);
//WRAPPER appears as undefined

Just use an define:

#define WRAPPER __declspec(naked)
// *marker->m_mat.GetPos() // CMatrix C3DMarker::m_mat // CMatrix doesn't have a member called GetPos()
GetPos()
pos
// RpAtomicGetFrame() is not defined

Replace the your code with:

RwFrame *f = (RwFrame *)marker->m_pAtomic->object.object.parent);
Edited by juarez
Link to comment
Share on other sites

Thank you very much! It helped a lot.

 

But there are another missing stuff:

WRAPARG(name); EAXJMP(0x722810);//undefined WRAPARG and EAXJMP
CMatrix mat(m_mat.pMatrix);// m_mat doesn't have a member called "pMatrix"

The closest member i could find is "m_mat.m_pAttachMatrix", but it seems to be incompatible (RwMatrix*).

RwFrameUpdateObjects(RpClumpGetFrame(m_pAtomic));// RpClumpGetFrame() not definedRpAtomicRender(m_pAtomic);// RpAtomicRender() not defined

And also there is this:

static StaticPatcher	Patcher([](){    // All the patch instructions});// StaticPatcher unknown

But i guess i can change it to this:

static void InstallPatches() {    // All the code}class My3DMarkers {public:    My3DMarkers() {        InstallPatches();    }} My3DMarkers;

Or maybe:

class My3DMarkers {public:    static void InstallPatches {        // All the code    }    My3DMarkers() {        InstallPatches();    }} My3DMarkers;

But there is one error anyways:

 

patch::RedirectCall(0x7250B1, &C3dMarker::Render); // argument of type "void (C3dMarker::*)()" is not compatible with parameter of type void *

 

Looks like if i redefine C3dMarker::Render as static, error dissapears but all the "C3dMarker" properties inside C3dMarker::Render() cannot be called inside a static method.

Link to comment
Share on other sites

//undefined WRAPARG and EAXJMP
#define WRAPARG(a) UNREFERENCED_PARAMETER(a)#define EAXJMP(a) { _asm mov eax, a _asm jmp eax }
CMatrix mat(m_mat.pMatrix);

 

// m_mat doesn't have a member called "pMatrix"

https://github.com/aap/skygfx/blob/10c0232b83305b89779cf3cc0aac7d3ce2993358/src/neo.h

So yep, you can use

m_pAttachMatrix
RwFrameUpdateObjects(RpClumpGetFrame(m_pAtomic));

 

// RpClumpGetFrame() not defined

RpClump != RpAtomic, RpClump have one or mulit RpAtomic.

 

RpAtomicRender(m_pAtomic);

 

// RpAtomicRender() not defined

m_pAtomic->renderCallBack(m_pAtomic); 
patch::RedirectCall(0x7250B1, &C3dMarker::Render);

 

Another trick to patching thiscall:

inline __declspec(naked) void* MemberFuncToPtr(...) {    __asm mov eax, [esp+4]__asm retn}void* ptr;ptr = MemberFuncToPtr(&C3dMarker::Render);CPatch::RedirectJump(0x7250B1, ptr);

Or if the above code will doesn't work use:

void __fastcall C3dMarker_Render(C3dMarker* pMarker, int edx0){pMarker->Render();}CPatch::RedirectJump(0x7250B1, C3dMarker_Render);
Edited by juarez
Link to comment
Share on other sites

So the last stuff my code lacks is this:

RwFrameUpdateObjects(RpClumpGetFrame(m_pAtomic));

Sorry, no idea about what to do with this. Looks like RpClumpGetFrame() was removed or changed into another method, but i have no clue about that.

Link to comment
Share on other sites

RwFrameUpdateObjects(RpClumpGetFrame(m_pAtomic));
RwFrameUpdateObjects(RpClumpGetFrame((RwFrame *)pAtomic->object.object.parent));

Now it's should work :)

Link to comment
Share on other sites

Sorry, i still lack RpClumpGetFrame() definition. Where i can find it? :blush:

Edited by Sloth-
Link to comment
Share on other sites



#define RpClumpGetFrame(_clump) ((RwFrame *) rwObjectGetParent(_clump))
#define rwObjectGetParent(object) (((const RwObject *)(object))->parent)

Edited by juarez
Link to comment
Share on other sites

Thanks a lot man!

 

Strange stuff:

 

Doing this:

RwFrameUpdateObjects(RpClumpGetFrame((RwFrame *)m_pAtomic->object.object.parent));

 

Makes game crash, but this don't:

RwFrameUpdateObjects(RpClumpGetFrame(m_pAtomic));

 

:wtf:

 

I'll study this code deeply because the resizing of arrow markers and spheres is doing fine but the rotation isn't ocurring.

 

Thanks again.

 

I hope to release the asi once finished.

 

----

EDIT: release will wait a long time. Code is harder to fix than i though. I don't know assembler and even original author of the code, who i contacted to ask for help, finds this code really confusing, and he lacks of time.

Gladly i could study assembler, trouble is: currently i don't have time, i'll be busy.

Edited by Sloth-
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.