mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2024-11-07 10:47:19 -05:00
30 lines
739 B
Go
30 lines
739 B
Go
package tests
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/hajimehoshi/ebiten"
|
|
|
|
_map "github.com/OpenDiablo2/OpenDiablo2/d2render/d2mapengine"
|
|
|
|
"github.com/OpenDiablo2/OpenDiablo2/d2common"
|
|
"github.com/OpenDiablo2/OpenDiablo2/d2core"
|
|
"github.com/OpenDiablo2/OpenDiablo2/d2data/d2mpq"
|
|
)
|
|
|
|
func TestMapGenerationPerformance(t *testing.T) {
|
|
d2mpq.InitializeCryptoBuffer()
|
|
d2common.ConfigBasePath = "../"
|
|
|
|
engine := d2core.CreateEngine()
|
|
gameState := d2core.CreateGameState()
|
|
mapEngine := _map.CreateMapEngine(gameState, engine.SoundManager, engine)
|
|
mapEngine.GenerateAct1Overworld()
|
|
surface, _ := ebiten.NewImage(800, 600, ebiten.FilterNearest)
|
|
for y := 0; y < 1000; y++ {
|
|
mapEngine.Render(surface)
|
|
mapEngine.OffsetY = float64(-y)
|
|
}
|
|
|
|
}
|