Nothing new... but it'll be more clear for someone who wants to draw an item on the custom interface.
#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();
//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);