Refactor text rendering

This commit is contained in:
jgk
2021-06-23 01:35:38 +02:00
parent 39218ed3b5
commit 899c1c5f6e
13 changed files with 48 additions and 56 deletions
+2 -2
View File
@@ -396,9 +396,9 @@ longGun = defaultGun
, _itIdentity = LongGun
, _wpMaxAmmo = 1
, _wpLoadedAmmo = 1
, _wpReloadTime = 80
, _wpReloadTime = 100
, _wpReloadState = 0
, _wpReloadType = PassiveReload sineRaisePitchOneSecSound
, _wpReloadType = PassiveReload skwareFadeTwoSecSound
, _itUseRate = 100
, _itUseTime = 0
, _itUse = shootWithSound (fromIntegral longGunSound)
+1 -1
View File
@@ -16,7 +16,7 @@ makeLaserScope
-> Float -- ^ Fraction of red/green
-> Particle
makeLaserScope p ep relFrac = Particle
{_ptDraw = const $ onLayer PtLayer $ pictures
{_ptDraw = const $ setLayer 1 $ onLayer PtLayer $ pictures
[lineAlphaThick 0.5 0.5
,lineAlphaThick 0.2 1.5
,lineAlphaThick 0.1 2
+1 -1
View File
@@ -10,7 +10,7 @@ import Dodge.Picture.Layer.Data
import Picture
{- | Uses a layer to set the depth. -}
onLayer :: Layer -> Picture -> Picture
onLayer l = setDepth $ 1 - fromIntegral (levLayer l) / 100
onLayer l = setDepth $ (1 - fromIntegral (levLayer l) / 100) / 100
{- | Set a depth according to a list of numbers.
Lists are lexicographically ordered if input values are always less than 100.
Higher numbers will get placed on top of lower numbers. -}
+2 -1
View File
@@ -56,7 +56,8 @@ doDrawing pdata w = do
pic = worldPictures w
wallPoints = map fst wallPointsCol
-- set the coordinate uniforms ready for drawing elements using world coordinates
setIsoMatrixUniforms pdata rot camzoom trans wins
--setIsoMatrixUniforms pdata rot camzoom trans wins
setPerpMatrixUniforms pdata rot camzoom trans wins viewFroms
depthFunc $= Just Less
pmat <- (newMatrix RowMajor $ perspectiveMatrix rot camzoom trans wins viewFroms)
:: IO (GLmatrix GLfloat)
+2
View File
@@ -50,6 +50,7 @@ loadSounds = do
foamSprayFadeOut <- Mix.load "./data/sound/foamSprayFadeOut.wav"
sineRaisePitchOneSec <- Mix.load "./data/sound/sineRaisePitchOneSec.wav"
sineRaisePitchTwoSec <- Mix.load "./data/sound/sineRaisePitchTwoSec.wav"
skwareFadeTwoSec <- Mix.load "./data/sound/skwareFadeTwoSec.wav"
return $ IM.fromList $ zip [0..]
[ pFireSound
, click
@@ -96,6 +97,7 @@ loadSounds = do
, foamSprayFadeOut
, sineRaisePitchOneSec
, sineRaisePitchTwoSec
, skwareFadeTwoSec
]
loadMusic :: IO (IM.IntMap Mix.Music)
+2
View File
@@ -30,6 +30,8 @@ sineRaisePitchOneSecSound :: Int
sineRaisePitchOneSecSound = 43
sineRaisePitchTwoSecSound :: Int
sineRaisePitchTwoSecSound = 44
skwareFadeTwoSecSound :: Int
skwareFadeTwoSecSound = 45
drawWeaponSound = 4
holsterWeaponSound = 5