EDIT : je triche comme ca mais finalement, c'est bien pratique et transparent...
Code : Tout sélectionner
; SPH(2007)
; PB4.02
If InitSprite()=0 Or InitMouse() =0 Or InitKeyboard() =0
MessageRequester("Erreur", "Ne peux ouvrir DirectX7+...")
End
EndIf
;SetPriorityClass_ ( GetCurrentProcess_ (), #IDLE_PRIORITY_CLASS )
If ExamineDesktops() =0
MessageRequester("Erreur", "Parametres du bureau introuvable...")
End
EndIf
dw.w=DesktopWidth(0)
dh.w=DesktopHeight(0)
dc.w=DesktopDepth(0)
If dc<>32
MessageRequester("Message", "Le jeu va essayer de passer en couleurs 32 bits...")
EndIf
dc.w=32
If OpenScreen(dw,dh,dc,"") =0
MessageRequester("Erreur", "ScreenOpen impossible...")
End
EndIf
;;;;;;;;;;;
;;;;;;;;;;;
;;;;;;;;;;;
;;;;;;;;;;;
;;;;;;;;;;;
dw2.w= dw*2+Random(500)
dh2.w= dh*2+Random(500)
dw_min.w=16
dw_max.w=dw-17
dh_min.w=16
dh_max.w=dh-17
deca_x=150
deca_y=150
;If dc=32
Dim p.l(dw2*dh2)
;Else
;If dc=16
;Dim p.w(dw2*dh2)
;EndIf
;EndIf
For i=1 To 10000
p(Random(dw2*dh2))=RGB(Random(155)+100,Random(155)+100,Random(155)+100)
Next
For i=0 To dh2-1
p(i*dw2)=RGB(255,140,140)
Next
For i=0 To dh2-1
p(i*dw2+dw2-1)=RGB(50,255,50)
Next
For i=0 To dw2-1
p(i)=RGB(255,255,255)
p(i+(dw2*(dh2-1)))=RGB(0,255,255)
Next
;Resultat = LoadSprite(0, "pointeur.bmp")
xmouse.w=dw/2
ymouse.w=dh/2
sensiblemouse.f=3 ; RAPIDITé DE LA SOURIS (de 0.5 a 5) *******
sensiblescroll.f=2 ; RAPIDITé DU SCROLL (de 0.5 a 5) ********
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Repeat ; Until KeyboardPushed(#PB_Key_All)
ExamineMouse()
xdelta=MouseDeltaX()
ydelta=MouseDeltaY()
xmouse+xdelta*sensiblemouse
ymouse+ydelta*sensiblemouse
If xmouse<dw_min
deca_x+xdelta*sensiblescroll
xmouse=dw_min
If deca_x<0
deca_x=0
EndIf
Else
If xmouse>dw_max
deca_x+xdelta*sensiblescroll
xmouse=dw_max
If deca_x>dw2-dw
deca_x=dw2-dw
EndIf
EndIf
EndIf
If ymouse<dh_min
deca_y+ydelta*sensiblescroll
ymouse=dh_min
If deca_y<0
deca_y=0
EndIf
Else
If ymouse>dh_max
deca_y+ydelta*sensiblescroll
ymouse=dh_max
If deca_y>dh2-dh
deca_y=dh2-dh
EndIf
EndIf
EndIf
;*****
;Debug xdelta
;Debug (Str(deca_x)+" "+Str(deca_y))
StartDrawing(ScreenOutput())
;;;;;;;;;;;
;;;;;;;;;;;
;;;;;;;;;;;
;;;;;;;;;;;
;;;;;;;;;;;
;;;;;;;;;;;
;;;;;;;;;;;
MemVideo = DrawingBuffer()
;For u=0 To dh-1
;CopyMemory(@p()+ (deca_y+u)*dw2*4+ deca_x*4, MemVideo+ dw*u*4, dw* dc/8)
;Next
For u=0 To dh-1
CopyMemory(@p()+ (deca_y+u)*dw2*4+ deca_x*4, MemVideo+ dw*u*4, dw* dc/8)
Next
; For i=0 To 786430
; PokeL(AdresseMemoire+i*4,p(i))
; Next
;;;;;;;;;;;
;;;;;;;;;;;
;;;;;;;;;;;
;;;;;;;;;;;
;;;;;;;;;;;
;;;;;;;;;;;
Circle(xmouse,ymouse,20,RGB(255,255,255))
StopDrawing()
;DisplayTransparentSprite(0, xmouse, ymouse)
;*****
FlipBuffers(1)
Delay(1)
ExamineKeyboard()
Until KeyboardPushed(#PB_Key_All)
End