HGamer3D-Wire 0.3.2 → 0.3.3
raw patch · 2 files changed
+7/−7 lines, 2 files
Files
HGamer3D-Wire.cabal view
@@ -1,5 +1,5 @@ Name: HGamer3D-Wire-Version: 0.3.2+Version: 0.3.3 Synopsis: Wire Functionality for HGamer3D Description: HGamer3D is a game engine for developing 3D games in the programming
HGamer3D/Wire/EntityComponentSystem.hs view
@@ -73,8 +73,8 @@ writeIORef ref val return $ Just () -modifyIORef' :: IORef a -> (a -> a) -> MaybeT IO ()-modifyIORef' ref f = MaybeT $ do+modifyIORef'' :: IORef a -> (a -> a) -> MaybeT IO ()+modifyIORef'' ref f = MaybeT $ do x <- readIORef ref let x' = (f x) x' `seq` writeIORef ref x'@@ -102,7 +102,7 @@ setLocation :: Entity -> (Vec3 -> Vec3) -> MaybeT IO () setLocation e f = do LocationC l <- getC' e- modifyIORef' l f+ modifyIORef'' l f return () locationSystem :: SystemData (M.Map ObId (IORef Vec3, Object3D))@@ -130,7 +130,7 @@ setOrientation :: Entity -> (U -> U) -> MaybeT IO () setOrientation e f = do OrientationC o <- getC' e - modifyIORef' o f+ modifyIORef'' o f return () orientationSystem :: SystemData (M.Map ObId (IORef UnitQuaternion, Object3D))@@ -158,7 +158,7 @@ setVelocity :: Entity -> (Vec3 -> Vec3) -> MaybeT IO () setVelocity e f = do VelocityC v <- getC' e - modifyIORef' v f+ modifyIORef'' v f return () velocitySystem :: SystemData (M.Map ObId (IORef Vec3, IORef Vec3))@@ -172,7 +172,7 @@ mapM (\(rV, rP) -> do vel <- readIORef rV let t = realToFrac $ dtime s :: Float- runMaybeT (modifyIORef' rP (\pos -> pos &+ (vel &* t))) ) (map snd (M.toList mapIn)) + runMaybeT (modifyIORef'' rP (\pos -> pos &+ (vel &* t))) ) (map snd (M.toList mapIn)) return () in (SystemData fInit fAdd fRem runAction)