#1 12-01-2012 10:22

VintProg_Pro
Registered: 17-06-2010
Posts: 153

Спрайт не выводится.

есть функция:

                            ; int __thiscall CTexture__Draw(CTexture *, RwRect *rect, RwRGBA *color1, RwRGBA *color2, RwRGBA *color3, RwRGBA *color4, float, float, float, float, float)
.text:005786A0                                         CTexture__Draw  proc near               ; CODE XREF: _DrawHud+3F3p
.text:005786A0                                                                                 ; _DrawHud+4D7p
.text:005786A0                                                                                 ; _DrawHud+619p
.text:005786A0                                                                                 ; _DrawHud+749p ...
.text:005786A0
.text:005786A0                                         rect            = dword ptr  4
.text:005786A0                                         color1          = dword ptr  8
.text:005786A0                                         color2          = dword ptr  0Ch
.text:005786A0                                         color3          = dword ptr  10h
.text:005786A0                                         color4          = dword ptr  14h
.text:005786A0                                         f18_2           = dword ptr  18h
.text:005786A0                                         f14_3           = dword ptr  1Ch
.text:005786A0                                         f18_3           = dword ptr  20h
.text:005786A0                                         f14_4           = dword ptr  24h
.text:005786A0                                         f18_4           = dword ptr  28h
.text:005786A0
.text:005786A0 000 8B 44 24 04                                         mov     eax, [esp+rect]
.text:005786A4 000 8B 54 24 08                                         mov     edx, [esp+color1]
.text:005786A8 000 53                                                  push    ebx
.text:005786A9 004 89 CB                                               mov     ebx, ecx
.text:005786AB 004 FF 74 24 2C                                         push    [esp+4+f18_4]   ; f18_4
.text:005786AF 008 FF 74 24 2C                                         push    [esp+8+f14_4]   ; f14_4
.text:005786B3 00C FF 74 24 2C                                         push    [esp+0Ch+f18_3] ; f18_3
.text:005786B7 010 FF 74 24 2C                                         push    [esp+10h+f14_3] ; f14_3
.text:005786BB 014 FF 74 24 2C                                         push    [esp+14h+f18_2] ; f18_2
.text:005786BF 018 FF 74 24 2C                                         push    [esp+18h+color4] ; f14_2
.text:005786C3 01C FF 74 24 2C                                         push    [esp+1Ch+color3] ; f18_1
.text:005786C7 020 FF 74 24 2C                                         push    [esp+20h+color2] ; f14_1
.text:005786CB 024 52                                                  push    edx             ; color4
.text:005786CC 028 52                                                  push    edx             ; color3
.text:005786CD 02C 52                                                  push    edx             ; color2
.text:005786CE 030 52                                                  push    edx             ; color1
.text:005786CF 034 50                                                  push    eax             ; rect
.text:005786D0 038 E8 3B F9 FF FF                                      call    ResetPrimitiveVertices
.text:005786D5 038 8B 0B                                               mov     ecx, [ebx+CTexture.rwTexture] ; RwTexture*
.text:005786D7 038 83 C4 34                                            add     esp, 34h
.text:005786DA 004 85 C9                                               test    ecx, ecx
.text:005786DC 004 75 04                                               jnz     short loc_5786E2
.text:005786DE 004 6A 00                                               push    0
.text:005786E0 008 EB 03                                               jmp     short loc_5786E5
.text:005786E2                                         ; ---------------------------------------------------------------------------
.text:005786E2
.text:005786E2                                         loc_5786E2:                             ; CODE XREF: CTexture__Draw+3Cj
.text:005786E2 004 8B 01                                               mov     eax, [ecx+RwTexture.raster]
.text:005786E4 004 50                                                  push    eax             ; _DWORD
.text:005786E5
.text:005786E5                                         loc_5786E5:                             ; CODE XREF: CTexture__Draw+40j
.text:005786E5 008 6A 01                                               push    rwRENDERSTATETEXTURERASTER ; RwRenderState
.text:005786E7 00C E8 B4 14 0D 00                                      call    _rwSetCameraRenderState
.text:005786EC 00C 59                                                  pop     ecx
.text:005786ED 008 59                                                  pop     ecx
.text:005786EE 004 6A 04                                               push    4               ; vert_count
.text:005786F0 008 68 40 40 7D 00                                      push    offset _renderPrimitive ; vertices
.text:005786F5 00C 6A 05                                               push    5               ; fvf
.text:005786F7 010 E8 14 15 0D 00                                      call    Im2DRenderPrimitive ; первый параметр - flexible vertex format?
.text:005786FC 010 83 C4 0C                                            add     esp, 0Ch
.text:005786FF 004 5B                                                  pop     ebx
.text:00578700 000 C2 28 00                                            retn    28h
.text:00578700                                         CTexture__Draw  endp

написал ее для начала в таком ввиде:

void Draw_Texture(void* pTexture,  CRwRect * RwRect, CRwRGBA *color1, CRwRGBA *color2, CRwRGBA *color3, CRwRGBA *color4, CRwRGBA *color5, CRwRGBA *color6, CRwRGBA *color7, CRwRGBA *color8, CRwRGBA *color9){
DWORD A = ADDRESS_CTextureDraw;

__asm 
 {
  mov  ecx, pTexture;
  push color9;
  push color8;
  push color7;
  push color6;
  push color5;
  push color4;
  push color3;
  push color2;
  push color1;
  push RwRect;
  call A;
 };


};

CRwRGBA RGBA;
CRwRect rect;
DWORD  shotTexture = 0x0A10844;

RGBA.a = 255;
RGBA.b = 255;
RGBA.g = 255;
RGBA.r = 255;
rect.x = 128.0;
rect.y = 128.0;
rect.w = 128.0;
rect.h = 128.0;

пытаюсь вызывать ее, в таймере

Draw_Texture((void*)(0x0A10844),  &rect, &RGBA, &RGBA, &RGBA, &RGBA, &RGBA, &RGBA, &RGBA, &RGBA, &RGBA);

но не чего на экран не выводится... В чем может быть проблема.

Offline

Board footer

Powered by FluxBB