Im replacing texture for specific object in game, and it works... but it draws my texture just for some milliseconds (mostly it just flashes and disappears), and after that original texture returns to it place =\
Btw when Im changing visual appearance for player model (toggle options and such) my texture shows up again but less than a second after - original texture returns!
I mean I found all the parameters for DrawIndexedPrimitive and all, but what Im doing wrong??
Here's my callback func:
SetTexture always returns 0, so it seems to work fine, but how it's possible that i see original texture then?
Btw when Im changing visual appearance for player model (toggle options and such) my texture shows up again but less than a second after - original texture returns!
I mean I found all the parameters for DrawIndexedPrimitive and all, but what Im doing wrong??
Here's my callback func:
PHP Code:
function DrawIndexedPrimitiveCallback(self: pointer; _Type: TD3DPrimitiveType; BaseVertexIndex: Integer; MinVertexIndex, NumVertices, startIndex, primCount: LongWord): HResult; stdcall;
begin
asm pushad end;
if self=nil then begin
Result:=DrawIndexedPrimitiveNext(self,_Type,BaseVertexIndex,MinVertexIndex,NumVertices,startIndex,primCount);
exit;
end;
if(cst=0)and(NumVertices>610)and(NumVertices<3900)and(primCount>75)and(primCount<4450)and(startIndex=2580)then begin
//IDirect3DDevice9(self).SetRenderState(D3DRS_FOGENABLE,0);
if(logo=nil)then begin
D3DXCreateTextureFromFile(IDirect3DDevice9(self),pchar(logof),logo);
end;
writeln(log,'SetTex:',IDirect3DDevice9(self).SetTexture(0,logo));
//IDirect3DDevice9(self).SetTexture(1,nil);
end;
asm popad end;
Result := DrawIndexedPrimitiveNext(self,_Type,BaseVertexIndex,MinVertexIndex,NumVertices,startIndex,primCount);
end;
Aucun commentaire:
Enregistrer un commentaire