mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
Refactoring
This commit is contained in:
parent
b594624105
commit
78755c9b09
@ -176,18 +176,14 @@ func (context *Context) flush() {
|
|||||||
func (context *Context) projectionMatrix() [16]float32 {
|
func (context *Context) projectionMatrix() [16]float32 {
|
||||||
texture := context.currentOffscreen
|
texture := context.currentOffscreen
|
||||||
|
|
||||||
var e11, e22, e41, e42 float32
|
e11 := float32(2) / float32(texture.textureWidth)
|
||||||
if texture != context.mainFramebufferTexture {
|
e22 := float32(2) / float32(texture.textureHeight)
|
||||||
e11 = float32(2) / float32(texture.textureWidth)
|
e41 := float32(-1)
|
||||||
e22 = float32(2) / float32(texture.textureHeight)
|
e42 := float32(-1)
|
||||||
e41 = -1
|
|
||||||
e42 = -1
|
if texture == context.mainFramebufferTexture {
|
||||||
} else {
|
e22 *= -1
|
||||||
height := float32(texture.height)
|
e42 += float32(texture.height)/float32(texture.textureHeight)*2
|
||||||
e11 = float32(2) / float32(texture.textureWidth)
|
|
||||||
e22 = -1 * float32(2) / float32(texture.textureHeight)
|
|
||||||
e41 = -1
|
|
||||||
e42 = -1 + height/float32(texture.textureHeight)*2
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return [...]float32{
|
return [...]float32{
|
||||||
|
Loading…
Reference in New Issue
Block a user