diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2022-12-03 01:35:22 -0700 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2022-12-03 01:35:22 -0700 |
commit | d7fb5d4551a93b4756db62f494b761c0cef2fda7 (patch) | |
tree | daa035d2abe0154c31eb9286212a5707a19c078e /Final.hs | |
parent | 1fdb567d8fcd6a46f8c38791249a416e4c198599 (diff) | |
download | terralloc-d7fb5d4551a93b4756db62f494b761c0cef2fda7.tar.gz terralloc-d7fb5d4551a93b4756db62f494b761c0cef2fda7.tar.bz2 terralloc-d7fb5d4551a93b4756db62f494b761c0cef2fda7.zip |
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.
Diffstat (limited to 'Final.hs')
-rw-r--r-- | Final.hs | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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 -} |