Fix resetting of immutable chasm/floor data storage on new world load

This commit is contained in:
2025-11-22 11:27:41 +00:00
parent 54ca961496
commit a381633dc8
6 changed files with 159 additions and 176 deletions
+4 -1
View File
@@ -1,4 +1,4 @@
module GLHelp (mglCreate,mglDelete,checkGLError) where
module GLHelp (mglCreate,mglDelete,checkGLError,glCreate) where
import Foreign.Marshal
import Foreign.Ptr
@@ -8,6 +8,9 @@ import Graphics.GL.Core45
mglCreate :: (GLsizei -> Ptr GLuint -> IO ()) -> IO GLuint
mglCreate f = alloca $ \ptr -> f 1 ptr >> peek ptr
glCreate :: (GLsizei -> Ptr GLuint -> IO ()) -> Int -> IO [GLuint]
glCreate f n = alloca $ \ptr -> f (fromIntegral n) ptr >> peekArray n ptr
mglDelete :: (GLsizei -> Ptr GLuint -> IO ()) -> GLuint -> IO ()
mglDelete f i = with i $ f 1