From d7fb5d4551a93b4756db62f494b761c0cef2fda7 Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Sat, 3 Dec 2022 01:35:22 -0700 Subject: Figured out what the problem was and fixed it. It was using the wrong numebr of bytes per pixel. That was solved by writing a routine to determine it. It looks like there are some branches that add snow and first person to the application. I'll see about merging those in. --- Final.hs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Final.hs') diff --git a/Final.hs b/Final.hs index 951edce..3a7596f 100644 --- a/Final.hs +++ b/Final.hs @@ -4,6 +4,7 @@ module Main where +import Text.Printf import Graphics.Rendering.OpenGL as GL import SDL.Image as SDLImg import SDL @@ -41,6 +42,10 @@ import qualified SDL -} buildArray :: SDL.Surface -> SDL.Surface -> IO (Array (Int,Int) Tile) buildArray terrain height = do + bpp <- fromIntegral <$> (getSurfaceBytesPerPixel terrain) :: IO Int + printf "Terrain BBP: %d\n" bpp + + (V2 (fromIntegral -> w) (fromIntegral -> h)) <- SDL.surfaceDimensions terrain {- Pick the minimum width and height between the two images -} let {- Function that returns a Tile for an x y coordinate -} -- cgit