Преглед на файлове

Added Double overloads.

Brucey преди 2 години
родител
ревизия
65b3b79f50
променени са 1 файла, в които са добавени 80 реда и са изтрити 4 реда
  1. 80 4
      max2d.mod/max2d.bmx

+ 80 - 4
max2d.mod/max2d.bmx

@@ -380,6 +380,10 @@ Function Plot( x:Float,y:Float )
 	_max2dDriver.Plot x+gc.origin_x,y+gc.origin_y
 	_max2dDriver.Plot x+gc.origin_x,y+gc.origin_y
 End Function
 End Function
 
 
+Function Plot( x:Double,y:Double )
+	Plot( Float(x),Float(y) )
+End Function
+
 Rem
 Rem
 bbdoc: Draw a rectangle
 bbdoc: Draw a rectangle
 about:
 about:
@@ -396,6 +400,10 @@ Function DrawRect( x:Float,y:Float,width:Float,height:Float )
 	x+gc.origin_x,y+gc.origin_y
 	x+gc.origin_x,y+gc.origin_y
 End Function
 End Function
 
 
+Function DrawRect( x:Double,y:Double,width:Double,height:Double )
+	DrawRect( Float(x),Float(y),Float(width),Float(height) )
+End Function
+
 Rem
 Rem
 bbdoc: Draw a line
 bbdoc: Draw a line
 about:
 about:
@@ -417,6 +425,10 @@ Function DrawLine( x:Float,y:Float,x2:Float,y2:Float,draw_last_pixel:Int=True )
 	px*gc.tform_ix+py*gc.tform_iy+x+gc.origin_x,px*gc.tform_jx+py*gc.tform_jy+y+gc.origin_y
 	px*gc.tform_ix+py*gc.tform_iy+x+gc.origin_x,px*gc.tform_jx+py*gc.tform_jy+y+gc.origin_y
 End Function
 End Function
 
 
+Function DrawLine( x:Double,y:Double,x2:Double,y2:Double,draw_last_pixel:Int=True )
+	DrawLine(Float(x),Float(y),Float(x2),Float(y2),draw_last_pixel)
+End Function
+
 Rem
 Rem
 bbdoc: Draw an oval
 bbdoc: Draw an oval
 about:
 about:
@@ -433,6 +445,10 @@ Function DrawOval( x:Float,y:Float,width:Float,height:Float )
 	x+gc.origin_x,y+gc.origin_y
 	x+gc.origin_x,y+gc.origin_y
 End Function
 End Function
 
 
+Function DrawOval( x:Double,y:Double,width:Double,height:Double )
+	DrawOval(Float(x),Float(y),Float(width),Float(height))
+End Function
+
 Rem
 Rem
 bbdoc: Draw a polygon
 bbdoc: Draw a polygon
 about:
 about:
@@ -468,6 +484,10 @@ Function DrawText( t:String,x:Float,y:Float )
 	gc.tform_ix,gc.tform_iy,gc.tform_jx,gc.tform_jy
 	gc.tform_ix,gc.tform_iy,gc.tform_jx,gc.tform_jy
 End Function
 End Function
 
 
+Function DrawText( t:String,x:Double,y:Double )
+	DrawText( t,Float(x),Float(y) )
+End Function
+
 Rem
 Rem
 bbdoc: Draw an image to the back buffer
 bbdoc: Draw an image to the back buffer
 about:
 about:
@@ -483,6 +503,10 @@ Function DrawImage( image:TImage,x:Float,y:Float,frame:Int=0 )
 	If iframe iframe.Draw x0,y0,x1,y1,x+gc.origin_x,y+gc.origin_y,0,0,image.width,image.height
 	If iframe iframe.Draw x0,y0,x1,y1,x+gc.origin_x,y+gc.origin_y,0,0,image.width,image.height
 End Function
 End Function
 
 
+Function DrawImage( image:TImage,x:Double,y:Double,frame:Int=0 )
+	DrawImage( image,Float(x),Float(y),frame)
+End Function
+
 Rem
 Rem
 bbdoc: Draw an image to a rectangular area of the back buffer
 bbdoc: Draw an image to a rectangular area of the back buffer
 about:
 about:
@@ -501,6 +525,10 @@ Function DrawImageRect( image:TImage,x:Float,y:Float,w:Float,h:Float,frame:Int=0
 	If iframe iframe.Draw x0,y0,x1,y1,x+gc.origin_x,y+gc.origin_y,0,0,image.width,image.height
 	If iframe iframe.Draw x0,y0,x1,y1,x+gc.origin_x,y+gc.origin_y,0,0,image.width,image.height
 End Function
 End Function
 
 
+Function DrawImageRect( image:TImage,x:Double,y:Double,w:Double,h:Double,frame:Int=0 )
+	DrawImageRect( image,Float(x),Float(y),Float(w),Float(h),frame )
+End Function
+
 Rem
 Rem
 bbdoc: Draw a sub rectangle of an image to a rectangular area of the back buffer
 bbdoc: Draw a sub rectangle of an image to a rectangular area of the back buffer
 about:
 about:
@@ -523,6 +551,10 @@ Function DrawSubImageRect( image:TImage,x:Float,y:Float,w:Float,h:Float,sx:Float
 	If iframe iframe.Draw x0,y0,x1,y1,x+gc.origin_x,y+gc.origin_y,sx,sy,sw,sh
 	If iframe iframe.Draw x0,y0,x1,y1,x+gc.origin_x,y+gc.origin_y,sx,sy,sw,sh
 End Function
 End Function
 
 
+Function DrawSubImageRect( image:TImage,x:Double,y:Double,w:Double,h:Double,sx:Double,sy:Double,sw:Double,sh:Double,hx:Double=0,hy:Double=0,frame:Int=0 )
+	DrawSubImageRect( image,Float(x),Float(y),Float(w),Float(h),Float(sx),Float(sy),Float(sw),Float(sh),Float(hx),Float(hy),frame )
+End Function
+
 Rem
 Rem
 bbdoc: Draw an image in a tiled pattern
 bbdoc: Draw an image in a tiled pattern
 about:
 about:
@@ -564,6 +596,10 @@ Function TileImage( image:TImage,x:Float=0:Float,y:Float=0:Float,frame:Int=0 )
 
 
 End Function
 End Function
 
 
+Function TileImage( image:TImage,x:Double,y:Double,frame:Int=0 )
+	TileImage( image,Float(x),Float(y),frame )
+End Function
+
 Rem
 Rem
 bbdoc: Set current color
 bbdoc: Set current color
 about:
 about:
@@ -641,6 +677,10 @@ Function SetAlpha( alpha:Float )
 	_max2dDriver.SetAlpha alpha
 	_max2dDriver.SetAlpha alpha
 End Function
 End Function
 
 
+Function SetAlpha( alpha:Double )
+	SetAlpha( Float(alpha) )
+End Function
+
 Rem
 Rem
 bbdoc: Get current alpha setting.
 bbdoc: Get current alpha setting.
 returns: the current alpha value in the range 0..1.0 
 returns: the current alpha value in the range 0..1.0 
@@ -657,6 +697,10 @@ Function SetLineWidth( width:Float )
 	_max2dDriver.SetLineWidth width
 	_max2dDriver.SetLineWidth width
 End Function
 End Function
 
 
+Function SetLineWidth( width:Double )
+	SetLineWidth( Float(width) )
+End Function
+
 Rem
 Rem
 bbdoc: Get line width
 bbdoc: Get line width
 returns: Current line width, in pixels
 returns: Current line width, in pixels
@@ -703,6 +747,10 @@ Function SetVirtualResolution( width:Float,height:Float )
 	_max2dDriver.SetResolution width,height
 	_max2dDriver.SetResolution width,height
 End Function
 End Function
 
 
+Function SetVirtualResolution( width:Double,height:Double )
+	SetVirtualResolution( Float(width),Float(height) )
+End Function
+
 Rem
 Rem
 bbdoc: Get virtual graphics resolution width
 bbdoc: Get virtual graphics resolution width
 End Rem
 End Rem
@@ -752,6 +800,10 @@ Function MoveVirtualMouse( x:Float,y:Float )
 	MoveMouse Int(x/gc.vres_mousexscale),Int(y/gc.vres_mouseyscale)
 	MoveMouse Int(x/gc.vres_mousexscale),Int(y/gc.vres_mouseyscale)
 End Function
 End Function
 
 
+Function MoveVirtualMouse( x:Double,y:Double )
+	MoveVirtualMouse( Float(x),Float(y) )
+End Function
+
 Rem
 Rem
 bbdoc: Set drawing viewport
 bbdoc: Set drawing viewport
 about:
 about:
@@ -791,6 +843,10 @@ Function SetOrigin( x:Float,y:Float )
 	gc.origin_y=y
 	gc.origin_y=y
 End Function
 End Function
 
 
+Function SetOrigin( x:Double,y:Double )
+	SetOrigin( Float(x),Float(y) )
+End Function
+
 Rem
 Rem
 bbdoc: Get current origin position.
 bbdoc: Get current origin position.
 returns: The horizontal and vertical position of the current origin. 
 returns: The horizontal and vertical position of the current origin. 
@@ -814,6 +870,10 @@ Function SetHandle( x:Float,y:Float )
 	gc.handle_y=-y
 	gc.handle_y=-y
 End Function
 End Function
 
 
+Function SetHandle( x:Double,y:Double )
+	SetHandle( Float(x),Float(y) )
+End Function
+
 Rem
 Rem
 bbdoc: Get current drawing handle.
 bbdoc: Get current drawing handle.
 returns: The horizontal and vertical position of the current drawing handle.
 returns: The horizontal and vertical position of the current drawing handle.
@@ -828,11 +888,15 @@ bbdoc: Set current rotation
 about:
 about:
 @rotation is given in degrees and should be in the range 0 to 360.
 @rotation is given in degrees and should be in the range 0 to 360.
 End Rem
 End Rem
-Function SetRotation( Rotation:Float )
-	gc.tform_rot=Rotation
+Function SetRotation( rotation:Float )
+	gc.tform_rot=rotation
 	UpdateTransform
 	UpdateTransform
 End Function
 End Function
 
 
+Function SetRotation( rotation:Double )
+	SetRotation(Float(rotation))
+End Function
+
 Rem
 Rem
 bbdoc: Get current Max2D rotation setting.
 bbdoc: Get current Max2D rotation setting.
 returns: The rotation in degrees.
 returns: The rotation in degrees.
@@ -854,6 +918,10 @@ Function SetScale( scale_x:Float,scale_y:Float )
 	UpdateTransform
 	UpdateTransform
 End Function
 End Function
 
 
+Function SetScale( scale_x:Double,scale_y:Double )
+	SetScale(Float(scale_x),Float(scale_y))
+End Function
+
 Rem
 Rem
 bbdoc: Get current Max2D scale settings.
 bbdoc: Get current Max2D scale settings.
 returns: The current x and y scale values in the variables supplied. 
 returns: The current x and y scale values in the variables supplied. 
@@ -869,13 +937,17 @@ about:
 SetTransform is a shortcut for setting both the rotation and
 SetTransform is a shortcut for setting both the rotation and
 scale parameters in Max2D with a single function call.
 scale parameters in Max2D with a single function call.
 End Rem
 End Rem
-Function SetTransform( Rotation:Float=0,scale_x:Float=1,scale_y:Float=1 )
-	gc.tform_rot=Rotation
+Function SetTransform( rotation:Float=0,scale_x:Float=1,scale_y:Float=1 )
+	gc.tform_rot=rotation
 	gc.tform_scale_x=scale_x
 	gc.tform_scale_x=scale_x
 	gc.tform_scale_y=scale_y
 	gc.tform_scale_y=scale_y
 	UpdateTransform
 	UpdateTransform
 End Function
 End Function
 
 
+Function SetTransform( rotation:Double,scale_x:Double=1,scale_y:Double=1 )
+	SetTransform(Float(rotation),Float(scale_x),Float(scale_y))
+End Function
+
 Rem
 Rem
 bbdoc: Make the mouse pointer visible
 bbdoc: Make the mouse pointer visible
 End Rem
 End Rem
@@ -1030,6 +1102,10 @@ Function SetImageHandle( image:TImage,x:Float,y:Float )
 	image.handle_y=y
 	image.handle_y=y
 End Function
 End Function
 
 
+Function SetImageHandle( image:TImage,x:Double,y:Double )
+	SetImageHandle(image,Float(x),Float(y))
+End Function
+
 Rem
 Rem
 bbdoc: Enable or disable auto midhandle mode
 bbdoc: Enable or disable auto midhandle mode
 about:
 about: