|
 |
|
|
|
|
|
GTA Modification Forums
Documenting GTA3/VC memory adresses Vice *and* GTA3
 |
|
 |
| |
Swoorup  |
Posted: Wednesday, Jan 18 2012, 18:07
|
innovator

Group: Members
Joined: Oct 28, 2008


|
@ModelingMan I have a request. Can you please convert or upload an txt version of your VC functions instead of htm in your site? I am having very low internet connections right now (dial up  ) so I cant download the htm file itself because my Download Manager is unable to query its size (it doesnot download it fully). Perhaps it would if it were a txt. Also do you have IDB version? Also I have a question. At 0x00578640 you have defined the function as | CODE | | CSprite2d::Draw((CRect const &,CRGBA const &,CRGBA const &,CRGBA const &,CRGBA const &)) |
But the idb posted by town civilian defines that function as this | CODE | void __thiscall CTexture__draw(CTexture *, RwRect *posInfo, RwRGBA *v1_color, RwRGBA *v2_color, RwRGBA *v3_color, RwRGBA *v4_color)
|
I am making a HUD for VICE using this function and found out that void __thiscall CTexture__draw works perfectly. Anyway my question is why is it different, why is CTexture * parameter missing? My guess for what I have found from site is that it is the hidden this pointer used in member function. But really I am not sure. Can you please elaborate to me? Also if you don't mind can you tell me how to initialise the CSprint2D class? Like can I set normal texture with different posInfo and alpha with different posinfo and draw them on to the screen? What I need to do is I need to constantly keep altering the bar value using a normal texture(rectangle shaped) with respect to player's health. And the alpha texture would be used but not altered to keep a rounded borders at the end of the bar( it would have same posinfo every time). | QUOTE (ModelingMan @ Feb 19 2010, 01:51) | I started up a little something I was working on a couple years ago. At first it started off wrapping D3D8 calls to D3D9. After that failed, I turned to redirecting all the referenced Renderware functions of VC to the Renderware 3.6 libs I have, which seems to be working so far.

If you've ever used the RW libs you'll recognize the logo in the bottom left corner.
My plan was to use the RW functions from the SA executable and redirect the functions in VC (and probably III) to them. This could allow more advanced graphics hacks for VC and III (HLSL shaders, etc.). |
Is this a pipe dream? Think i'll better make a program that documents VC functions and addresses, opcodes with tons of descriptions actually for my own purpose. so yeah.... EDIT: CRadar uses this function 004C1A20 CRadar::DrawRadarMask((void)) to make alpha mask for radar textures to give a round shape. I am sure this is done dynamically and is exactly what I need to draw that rounded HUD. Try nopping the address that calls 004C1A20 CRadar::DrawRadarMask((void)) and you will see the difference. 004C1A20 CRadar::DrawRadarMask((void)) uses the function 00577D10 CSprite2d::SetMaskVertices((int,float *)) inside it somewhere but I am confused about its parameters and how it works. I need to know how it applies mask to selected texture and about how position data are set. But now I am sure this will get my mod done. This post has been edited by Swoorup on Thursday, Jan 19 2012, 08:00
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
towncivilian  |
|
Player Hater

Group: Members
Joined: Aug 4, 2007

|
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
Swoorup  |
|
innovator

Group: Members
Joined: Oct 28, 2008


|
Anyone anything about memory structures of VC? A lot of things for structures are still undocumented. Camera, Entity. I need things like that desperately. To have SA like Vehicle Cam: Nop the call at 0x46C62E. NOP 5 bytes. Warning: Nop that before you actually start the game. This works best when you are in bike though. EDIT: I finally figured out how the radar masking works. But still I need to apply the same technique to my own textures which have not been done yet.004C1A20 CRadar::DrawRadarMask((void)) is called before every frame rendering if radar is enabled at the menu. The function then uses 00577D10 CSprite2d::SetMaskVertices((int numOfVertices,RwV2D* verticesOfPolygon[numofVertices])) to set up 4 polygons into which the extra radar textures are too be masked/erased out. The polygons are formed at each of the corners of the square (before masking). In a corner 8 sets of points/vertices are assigned to represent the polygon layer which is to be erased out and the polygon points are passed to CSprite2d::SetMaskVertices((int numOfVertices,RwV2D* verticesOfPolygon[numofVertices])) and some renderware functions are carried out. | CODE | signed int __cdecl CRadar__DrawRadarMask() { signed int v0; // ebx@1 double v1; // st6@2 double v2; // st7@2 double v3; // st4@3 double fradarDiameterExact; // st5@4 double v5; // st5@4 signed int v6; // ebp@5 long double v7; // st4@6 long double v8; // st6@6 __int16 v9; // fps@6 long double v10; // st4@8 __int16 v11; // fps@8 double v12; // st4@10 float v13; // ST0C_4@10 double v14; // st5@11 signed int v15; // eax@12 double v16; // st5@12 double v17; // st5@12 float v19; // [sp+0h] [bp-68h]@8 unsigned int v20; // [sp+8h] [bp-60h]@1 unsigned int v22; // [sp+Ch] [bp-5Ch]@1 unsigned int v24; // [sp+10h] [bp-58h]@1 unsigned int v26; // [sp+14h] [bp-54h]@1 unsigned int v27; // [sp+18h] [bp-50h]@1 unsigned int v25; // [sp+1Ch] [bp-4Ch]@1 unsigned int v23; // [sp+20h] [bp-48h]@1 unsigned int v21; // [sp+24h] [bp-44h]@1 float v28; // [sp+28h] [bp-40h]@3 float v29[15]; // [sp+2Ch] [bp-3Ch]@5
v20 = 0x3F800000u; v21 = 0xBF800000u; v22 = 0xBF800000u; v23 = 0xBF800000u; v24 = 0x3F800000u; v25 = 0x3F800000u; v26 = 0x3F800000u; v27 = 0xBF800000u; RwRenderStateSet(rwRENDERSTATETEXTURERASTER, 0); RwRenderStateSet(rwRENDERSTATESRCBLEND, 5); // nothing RwRenderStateSet(rwRENDERSTATEDESTBLEND, 6); // nothing RwRenderStateSet(rwRENDERSTATEFOGENABLE, 0); // nothing RwRenderStateSet(rwRENDERSTATETEXTUREFILTER, 2);// nothing RwRenderStateSet(rwRENDERSTATESHADEMODE, 1); // nothing RwRenderStateSet(rwRENDERSTATEZTESTENABLE, 0);// Nothing RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, 1);// Results no mask RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, 1);// Results black color in masked area RwD3D8SetRenderState(0x19u, 8u); v0 = 0; do { v2 = *(&v20 + 2 * v0); v1 = *(&v22 + 2 * v0); if ( CMenu.IsOnMapMenu ) { v28 = (fradarScaleX * CMenu.mapScale * v2 + flt_68FD10 * CMenu.mapScale + CMenu.mapPos.x) * SLODWORD(pResolutionX) * fradarDiamMultiplier; v3 = (CMenu.mapPos.y - flt_68FD1C * CMenu.mapScale - flt_68FD18 * CMenu.mapScale * v1) * SLODWORD(ResolutionX) * fradarUpScaleMul; } else { fradarDiameterExact = SLODWORD(pResolutionX) * fradarDiamMultiplier * fradarDiameterWRT640; v28 = v2 * fradarDiameterExact * fradarBy2Divider + fradarDiameterExact * fradarBy2Divider + fradarPosX; v5 = SLODWORD(ResolutionX) * fradarUpScaleMul; v2 = fradarScaleY * v5; v3 = v2 * fradarBy2Divider + SLODWORD(ResolutionX) - fradarPoxYfromBottom * v5 - v1 * v2 * fradarBy2Divider; } v29[0] = v3; v6 = 0; do { v8 = v6 * fradarCurvatureUnk * fradarCurvatureUnk2; v7 = cos(v8); UNDEF(v9); if ( v9 & 1024 ) v7 = cos(MakeAngleAccute(v2)); v19 = v7; v2 = *(&v20 + 2 * v0) * v19; v10 = sin(v8); UNDEF(v11); if ( v11 & 1024 ) v10 = sin(MakeAngleAccute(COERCE_FLOAT(COERCE_UNSIGNED_INT64(*(&v20 + 2 * v0) * v19)))); v13 = v10; v12 = *(&v22 + 2 * v0) * v13; if ( CMenu.IsOnMapMenu ) { v14 = CMenu.mapScale; v29[2 * v6 + 1] = (fradarScaleX * CMenu.mapScale * v2 + flt_68FD10 * CMenu.mapScale + CMenu.mapPos.x) * SLODWORD(pResolutionX) * fradarDiamMultiplier; v29[2 * v6 + 2] = (CMenu.mapPos.y - flt_68FD1C * v14 - flt_68FD18 * v14 * v12) * SLODWORD(ResolutionX) * fradarUpScaleMul; } else { v15 = LODWORD(ResolutionX); v16 = SLODWORD(pResolutionX) * fradarDiamMultiplier * fradarDiameterWRT640; v29[2 * v6 + 1] = v2 * v16 * fradarBy2Divider + v16 * fradarBy2Divider + fradarPosX; v17 = v15 * fradarUpScaleMul; v2 = fradarScaleY * v17; v29[2 * v6 + 2] = v2 * fradarBy2Divider + v15 - fradarPoxYfromBottom * v17 - v12 * v2 * fradarBy2Divider; } ++v6; } while ( v6 < 7 ); CSprite2d__SetMaskVertices(8, &v28); RwIm2DRenderPrimitive(rwPRIMTYPETRIFAN, &vert1_x, 8); ++v0; } while ( v0 < 4 ); return RwD3D8SetRenderState(25u, 5u); } | EDIT EDIT: It works If anyone wants the demonstration source code, then I could post it here. This post has been edited by Swoorup on Saturday, Feb 11 2012, 15:59
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
Pages:
(57) « First ... 51 52 [53] 54 55 ... Last »
Track this topic
Receive email notification when a reply has been made to this topic and you are not active on the board.
Subscribe to this forum
Receive email notification when a new topic is posted in this forum and you are not active on the board.
Download / Print this Topic
Download this topic in different formats or view a printer friendly version.
| |
 |
|
 |
|
|
|
|