Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate

Autor Topic: [1.04e]RenderItem3D function (DrawItem)  (Visto 2164 veces)

0 Miembros and 3 Guests are viewing this topic.

Offline bimaloha Posteado: March 07, 2022, 12:09:22 PM | Modificado: March 08, 2022, 11:52:12 PM by bimaloha

  • 0 puntos por ventas
  • *
  • Rank: Sup. destacado
  • Posts: 117
  • Gracias recibida: 4289
  • vn
Nothing new... but it'll be more clear for someone who wants to draw an item on the custom interface.

Code: [Select]
#define EnableAlphaTest			((void(__cdecl*)(BYTE Mode)) 0x635FD0)
#define DisableAlphaBlend ((void(__cdecl*)()) 0x635F50)
#define BeginBitmap ((void(*)()) 0x00637770)
#define EndBitmap ((void(*)()) 0x00637870)
#define glViewport2 ((void(__cdecl*)(GLint x, int a2, GLsizei width, GLsizei height)) 0x006363D0)
#define gluPerspective2 ((int(__cdecl*)(float Fov,float Aspect,float ZNear,float ZFar)) 0x006358A0)
#define UpdateMousePositionn ((void(*)()) 0x00636720)
#define CameraMatrix 0x87933A0
#define GetOpenGLMatrix ((void(__cdecl*)(LPVOID a1)) 0x00635830)
#define EnableDepthTest ((void(*)()) 0x00635DE0)
#define EnableDepthMask ((void(*)()) 0x00635E40)
#define RenderItem3D ((int(__cdecl*)(float sx,float sy,float Width,float Height,int Type,int Level,int Option1,int ExtOption,bool PickUp)) 0x005CF310)

//Render image

EnableAlphaTest(1);
EndBitmap();
glMatrixMode(0x1701u);
glPushMatrix();
glLoadIdentity();
glViewport2(0, 0, *(GLsizei*)0x00E61E58, *(GLsizei*)0x00E61E5C);
gluPerspective2(1.5f, *(float*)0x00E61E58 / *(float*)0x00E61E5C, 20.0, 2000.0);
//the first argument 1.5f is Fov - lower value makes item smaller and bigger value make it bigger
glMatrixMode(0x1700u);
glPushMatrix();
glLoadIdentity();
GetOpenGLMatrix((LPVOID)CameraMatrix);
EnableDepthTest();
EnableDepthMask();
glClear(0x100u);

for (int i = 0; i < 9; i++) {
RenderItem3D(122 * (i % 3) + 102, 121 * (i / 3) + 51, 108.0, 58.0, ITEM(12, 7 + i), 0, 0, 0, 0);
//the 3rd and 4th arguments (108.0, 58.0) are the area where mouse hover make item spin around
}

UpdateMousePositionn();
glMatrixMode(0x1700u);
glPopMatrix();
glMatrixMode(0x1701u);
glPopMatrix();
BeginBitmap();
glColor3f(1, 1, 1);
DisableAlphaBlend();

Make draw item center of width + height area by Xshop function:

Code: [Select]
//Interface.h
//Add to class interface (public to accesable, not private )
void                  DrawItem3D(float sx, float sy, float Width, float Height, int Type, int Level, int ExtOption, int Ancient, bool PickUp, float Scale, bool Center);
BOOL DrawItem3DCenterImage;

//Interface.cpp
//function draw:
void Interface::DrawItem3D(float sx, float sy, float Width, float Height, int Type, int Level, int ExtOption, int Ancient, bool PickUp, float Scale, bool Center)
{
glMatrixMode(0x1701);
glPushMatrix();
glLoadIdentity();
sub_6363D0_Addr(0, 0, *(GLsizei*)0x00E61E58, *(GLsizei*)0x00E61E5C);
float v2 = *(float*)0x00E61E58 / *(float*)0x00E61E5C;
sub_6358A0_Addr(Scale, v2, *(float*)0xE61E38, *(float*)0xE61E3C);
glMatrixMode(0x1700);
glPushMatrix();
glLoadIdentity();
sub_635830_Addr((LPVOID)0x87933A0);
sub_635DE0_Addr();
sub_635E40_Addr();

gInterface.DrawItem3DCenterImage = Center;

pDrawItemModel(sx, sy, Width, Height, Type, Level, ExtOption, Ancient, PickUp);
gInterface.DrawItem3DCenterImage = false;

testfunc();
glColor3f(1, 1, 1);
pSetBlend(false);
return;
}

//hook to Load():
bool InGameShopIsInGameShopRect(float _x, float _y)
{
if (gInterface.DrawItem3DCenterImage)
return true;
if (pCheckWindow(pWindowThis(), ObjWindow::CashShop)) //ObjWindow::CashShop = 65
return _x >= 0 && _x < 640 && _y < 429 && _y >= 0;
return false;
}

SetCompleteHook(0xE8, 0x005CF3AC, &InGameShopIsInGameShopRect);

//demo code:
gInterface.DrawItem3D(50, 100, 77, 47, ITEM(0, 19), 0, 0, 0, 0);

(https://imgur.com/a/dZORhHW)

Gracias:


Offline NghienMU #1 Posteado: March 07, 2022, 07:34:04 PM

  • 0 puntos por ventas
  • *
  • Rank: Liga mayor
  • Posts: 189
  • Gracias recibida: 56
  • vn

Offline bimaloha #2 Posteado: March 07, 2022, 08:01:52 PM

  • 0 puntos por ventas
  • *
  • Rank: Sup. destacado
  • Posts: 117
  • Gracias recibida: 4289
  • vn
Can you upload an image?

It's from X shop draw items.
(https://imgur.com/a/EONOTme)
I'll post full function to make item drawing in center soon.

Gracias:


Online muccone #3 Posteado: March 07, 2022, 10:17:26 PM

  • 0 puntos por ventas
  • *
  • Rank: Dedicado
  • Posts: 50
  • Gracias recibida: 172
  • tw
Telegram Account :@mucone    develop Mu

Offline NghienMU #4 Posteado: March 07, 2022, 10:56:35 PM

  • 0 puntos por ventas
  • *
  • Rank: Liga mayor
  • Posts: 189
  • Gracias recibida: 56
  • vn
Can you upload an image?

It's from X shop draw items.
(https://imgur.com/a/EONOTme)
I'll post full function to make item drawing in center soon.


ok thanks man! :D


Offline Rindy #5 Posteado: March 08, 2022, 09:52:24 AM

  • 0 puntos por ventas
  • *
  • Rank: Usuario activo
  • Posts: 78
  • Gracias recibida: 1738
  • gb

Offline bimaloha #6 Posteado: March 08, 2022, 11:55:10 PM

  • 0 puntos por ventas
  • *
  • Rank: Sup. destacado
  • Posts: 117
  • Gracias recibida: 4289
  • vn

Offline NghienMU #7 Posteado: March 09, 2022, 12:34:28 AM

  • 0 puntos por ventas
  • *
  • Rank: Liga mayor
  • Posts: 189
  • Gracias recibida: 56
  • vn
Can you upload an image?

It's from X shop draw items.
(https://imgur.com/a/EONOTme)
I'll post full function to make item drawing in center soon.

so it's function to align item position in Xshop


Offline bimaloha #8 Posteado: March 09, 2022, 12:39:23 AM

  • 0 puntos por ventas
  • *
  • Rank: Sup. destacado
  • Posts: 117
  • Gracias recibida: 4289
  • vn
Can you upload an image?

It's from X shop draw items.
(https://imgur.com/a/EONOTme)
I'll post full function to make item drawing in center soon.

so it's function to align item position in Xshop
Yep, do you want to edit Xshop? Just check the function at 0x00942F56.


Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate


 

Related Topics

  Subject / Started by Replies Last post
0 Replies
970 Views
Last post January 26, 2021, 11:46:03 PM
by zodiacddos
1 Replies
1649 Views
Last post June 30, 2021, 04:56:20 AM
by emersonx13
8 Replies
3700 Views
Last post August 08, 2021, 06:26:05 PM
by onlinezajzaj
1 Replies
2515 Views
Last post August 21, 2023, 04:12:42 PM
by wellwisher22
0 Replies
522 Views
Last post December 06, 2022, 08:51:17 AM
by vcore30