problem de variable non reconnu
Publié : sam. 12/juil./2008 10:20
salut les tronche de l'asm
j'ai récupéré un petit bout de code sur le forum anglais!
il semblerai que la fonction Atan2()
ne passe pas a cause que les variables ne sont pas reconnues ...
pouvez vous confirmer, et éventuellement apporter une soluce ??
ptete une histoire de syntaxe..
j'ai récupéré un petit bout de code sur le forum anglais!
il semblerai que la fonction Atan2()
ne passe pas a cause que les variables ne sont pas reconnues ...
pouvez vous confirmer, et éventuellement apporter une soluce ??
ptete une histoire de syntaxe..

Code : Tout sélectionner
; *************************************************************************************
; * P r o j e c t : T u n n e l - F x
; *************************************************************************************
; *
; * Part3: Creating Angle Table / Texture:
; * --------------------------------------
; * This small example shows you, how to to create the needed angle table and how
; * does this looks like for doing the rotations of our tunnel. Dont forget to enable
; * inline assembler. Otherwise as you see, you will see nothing. :D
; *
; * Source and Tutorial (c) by Thorsten Will aka va!n
; * All rigths reserved.
; *
; *************************************************************************************
#image=0
Procedure.d ATan2(y.d, x.d)
!FLD qword[P.v_y]
!FLD qword[P.v_x]
!FPATAN
ProcedureReturn
EndProcedure
; -------- Init Code --------
lTextureSize.l = 256
lScreenWidth.l = 640
lScreenHeight.l = 480
CreateImage (0, lScreenWidth, lScreenHeight)
; -------- Generating Angle Table / Texture --------
StartDrawing(ImageOutput(#image))
dParts.d = 0.5
For x = 0 To lScreenWidth -1
For y = 0 To lScreenHeight -1
dAngle.d = (dParts * lTextureSize * ATan2(y-lScreenHeight/2, x-lScreenWidth/2) / #PI)
lColor = Int (256 - dAngle) & 255
Plot (x, y, RGB(lColor, lColor, lColor) )
Next
Next
StopDrawing()
; -------- Saving Table as Texture --------
SaveImage (0, "c:\TunnelFx_Angle.bmp")
; *************** ecran minimum **********************************
If InitSprite() = 0 Or InitKeyboard() = 0
MessageRequester("Error", "Can't open DirectX 7 or later", 0)
End
EndIf
OpenScreen(1024,768,32,"texture")
Repeat
If StartDrawing(ScreenOutput())
DrawText(10,10,"ok")
DrawImage(ImageID(#image),100,100,256,256)
StopDrawing()
EndIf
; Inverse the buffers (the back become the front (visible)... And we can do the rendering on the back)
FlipBuffers()
; ClearScreen(RGB(0,0,0))
ExamineKeyboard()
Until KeyboardPushed(#PB_Key_Escape)
; *************************************************************************************
; *************************************************************************************