mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
Avoid copying arrays
This commit is contained in:
parent
265a85e922
commit
8994ffad9b
@ -19,13 +19,12 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func glMatrix(m *[4][4]float64) []float32 {
|
func glMatrix(m *[4][4]float64) []float32 {
|
||||||
result := make([]float32, 16)
|
return []float32{
|
||||||
for j := 0; j < 4; j++ {
|
float32(m[0][0]), float32(m[1][0]), float32(m[2][0]), float32(m[3][0]),
|
||||||
for i := 0; i < 4; i++ {
|
float32(m[0][1]), float32(m[1][1]), float32(m[2][1]), float32(m[3][1]),
|
||||||
result[i+j*4] = float32(m[i][j])
|
float32(m[0][2]), float32(m[1][2]), float32(m[2][2]), float32(m[3][2]),
|
||||||
|
float32(m[0][3]), float32(m[1][3]), float32(m[2][3]), float32(m[3][3]),
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return result
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type Matrix interface {
|
type Matrix interface {
|
||||||
|
Loading…
Reference in New Issue
Block a user