Skip to content
This repository has been archived by the owner on Jan 1, 2022. It is now read-only.

Commit

Permalink
SetScissor XNA bug fixed native in Monkey v58
Browse files Browse the repository at this point in the history
  • Loading branch information
devolonter committed May 2, 2012
1 parent 10f043f commit 41a2f93
Showing 1 changed file with 0 additions and 46 deletions.
46 changes: 0 additions & 46 deletions flxcamera.monkey
Expand Up @@ -104,10 +104,6 @@ Private

Field _id:Int

#If TARGET = "xna"
Field _xnaRectHelper:FlxRect
#End

Global _Inkrement:Int

Public
Expand Down Expand Up @@ -148,10 +144,6 @@ Public

_id = _Inkrement
_Inkrement += 1

#If TARGET = "xna"
_xnaRectHelper = New FlxRect()
#End
End Method

Method Destroy:Void()
Expand All @@ -166,53 +158,15 @@ Public
_fxShakeComplete = Null
_fxShakeOffset = Null
_fill = Null

#If TARGET = "xna"
_xnaRectHelper = Null
#End
End Method

Method Lock:Void()
If (_clipped) Then
#If TARGET = "xna"
_xnaRectHelper.Make(_realX, _realY, _realWidth, _realHeight)

If (_fxShakeOffset.x <> 0) Then
_xnaRectHelper.x += _fxShakeOffset.x * FlxG._DeviceScaleFactorX
End If

If (_fxShakeOffset.y <> 0) Then
_xnaRectHelper.y += _fxShakeOffset.y * FlxG._DeviceScaleFactorY
End If

If (_xnaRectHelper.x < 0) Then
_xnaRectHelper.width += _xnaRectHelper.x
_xnaRectHelper.x = 0
End If

If (_xnaRectHelper.y < 0) Then
_xnaRectHelper.height += _xnaRectHelper.y
_xnaRectHelper.y = 0
End If

If (_xnaRectHelper.Right > FlxG.DeviceWidth) Then
_xnaRectHelper.width -= _xnaRectHelper.Right - FlxG.DeviceWidth
End If

If (_xnaRectHelper.Bottom > FlxG.DeviceHeight) Then
_xnaRectHelper.height -= _xnaRectHelper.Bottom - FlxG.DeviceHeight
End If

If (_xnaRectHelper.width > 0 And _xnaRectHelper.height > 0) Then
SetScissor(_xnaRectHelper.x, _xnaRectHelper.y, _xnaRectHelper.width, _xnaRectHelper.height)
End If
#Else
If (_fxShakeOffset.x <> 0 Or _fxShakeOffset.y <> 0) Then
SetScissor(_realX + _fxShakeOffset.x * FlxG._DeviceScaleFactorX, _realY + _fxShakeOffset.y * FlxG._DeviceScaleFactorY, _realWidth, _realHeight)
Else
SetScissor(_realX, _realY, _realWidth, _realHeight)
End If
#End
End If

PushMatrix()
Expand Down

0 comments on commit 41a2f93

Please sign in to comment.