From 11fc54399c65483e29fe56ee0cd1a609d2dca921 Mon Sep 17 00:00:00 2001 From: Thomas von Dein Date: Sun, 2 Jun 2024 20:12:28 +0200 Subject: [PATCH] more zoom/center fixes. RLEs now load centered and visible. --- TODO.md | 11 +++++++++-- config.go | 10 +++++----- scene-play.go | 2 +- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/TODO.md b/TODO.md index c6ee53d..171c165 100644 --- a/TODO.md +++ b/TODO.md @@ -2,9 +2,16 @@ - changing options mid-game has no effect in most cases, even after a restart -- RLE file loading works, but if world is larger than screen, center is invisible. - - Statefile loading does not work correclty anymore. With larger grids everything is empty. With square grids part of the grid is cut off. Smaller grids load though +- Also when loading a state file, centering doesn't work anymore, I + think the geom calculation is overthrown by the parser func. So, put + this calc into its own func and always call. Or - as stated below - + put it onto camera.go and call from Init(). + +- Zoom 0 on reset only works when world= config.ScreenWidth { + // must be positive if world wider than screen + config.InitialCamPos[0] = math.Abs(config.InitialCamPos[0]) } if config.Height*config.Cellsize > config.ScreenHeight { config.InitialCamPos[1] = math.Abs(float64(((config.ScreenHeight - (config.Height * config.Cellsize)) / 2))) - repr.Println("y", config.InitialCamPos[1]) } return nil diff --git a/scene-play.go b/scene-play.go index bade611..3669f3a 100644 --- a/scene-play.go +++ b/scene-play.go @@ -19,7 +19,7 @@ type Images struct { } const ( - DEBUG_FORMAT = "FPS: %0.2f, TPG: %d, M: %0.2fMB, Generations: %d\nScale: %.02fZoom: %d, Cam: %.02f,%.02f Cursor: %d,%d %s" + DEBUG_FORMAT = "FPS: %0.2f, TPG: %d, M: %0.2fMB, Generations: %d\nScale: %.02f, Zoom: %d, Cam: %.02f,%.02f Cursor: %d,%d %s" ) type ScenePlay struct {