mercredi 19 février 2014

[Help] SetTuxture works just small amount of frames topic




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:

PHP Code:







function DrawIndexedPrimitiveCallback(selfpointer_TypeTD3DPrimitiveTypeBaseVertexIndexIntegerMinVertexIndexNumVerticesstartIndexprimCountLongWord): HResultstdcall;
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









SetTexture always returns 0, so it seems to work fine, but how it's possible that i see original texture then?





Aucun commentaire:

Enregistrer un commentaire