]> git.xolatile.top Git - xolatile-badassbug.git/commitdiff
all
authorxolatile <xolatile@proton.me>
Sat, 9 Aug 2025 22:19:46 +0000 (00:19 +0200)
committerxolatile <xolatile@proton.me>
Sat, 9 Aug 2025 22:19:46 +0000 (00:19 +0200)
47 files changed:
config.cfg [new file with mode: 0644]
data/glsl.cfg
data/menus.cfg
init.cfg [new file with mode: 0644]
restore.cfg
servers.cfg [new file with mode: 0644]
src/Makefile
src/engine/3dgui.cpp
src/engine/animmodel.h
src/engine/client.cpp
src/engine/decal.cpp
src/engine/dynlight.cpp [deleted file]
src/engine/engine.h
src/engine/lightmap.cpp
src/engine/main.cpp
src/engine/octa.h
src/engine/octaedit.cpp
src/engine/physics.cpp
src/engine/rendergl.cpp
src/engine/rendermodel.cpp
src/engine/renderparticles.cpp
src/engine/renderva.cpp
src/engine/server.cpp
src/engine/serverbrowser.cpp
src/engine/shader.cpp
src/engine/shadowmap.cpp
src/engine/skelmodel.h
src/engine/sound.cpp
src/engine/texture.cpp
src/engine/world.cpp
src/engine/worldio.cpp
src/fpsgame/ai.cpp
src/fpsgame/ai.h
src/fpsgame/client.cpp
src/fpsgame/entities.cpp
src/fpsgame/fps.cpp
src/fpsgame/game.h
src/fpsgame/render.cpp
src/fpsgame/server.cpp
src/fpsgame/weapon.cpp
src/shared/cube2font.c
src/shared/glexts.h
src/shared/iengine.h
src/shared/igame.h
src/shared/stream.cpp
src/shared/tools.h
src/shared/zip.cpp

diff --git a/config.cfg b/config.cfg
new file mode 100644 (file)
index 0000000..d12049a
--- /dev/null
@@ -0,0 +1,391 @@
+// automatically written on exit, DO NOT MODIFY
+// delete this file to have data/defaults.cfg overwrite these settings
+// modify settings in game, or put settings in autoexec.cfg to override anything
+
+name "xolatile"
+
+loadcrosshair "data/crosshair.png" 0
+
+ammobar 1
+ammobaralign 0
+ammobarcountscale 1.5
+ammobarcountsep 20
+ammobarflip 0
+ammobarhideempty 1
+ammobarhorizontal 0
+ammobarscale 0.5
+ammobarsep 20
+ammobarx 0.025
+ammobary 0.5
+ammohud 1
+aniso 0
+applydialog 1
+armourcolors 1
+aspect 0.0
+attackspawn 1
+autoauth 1
+autocompactvslots 256
+autosortservers 1
+autoupdateservers 1
+bilinear 1
+blood 1
+blurshadowmap 1
+blursmsigma 100
+bumpmodels 1
+chainsawhudgun 1
+clockerror 1000000
+clockfix 0
+compresspng 9
+confade 30
+confilter 11519
+connectname ""
+connectport 0
+conscale 0.33
+consize 5
+contags 3
+crosshaircolors 1
+crosshairfx 1
+crosshairsize 15
+cursorsize 30
+damagecompass 1
+damagecompassalpha 25
+damagecompassfade 1000
+damagecompassmax 200
+damagecompassmin 25
+damagecompasssize 30
+deadpush 2
+deathscore 1
+decalfade 10000
+decals 1
+demodir "demo"
+dynlightdist 1024
+editinview 1
+emitmillis 17
+entcamdir 1
+explodebright 1.0
+fewparticles 100
+filltjoints 1
+fixwav 1
+fov 120
+fpshadowmap 0
+fullbrightmodels 60
+fullconfilter 65535
+fullconsize 75
+gameclock 1
+gameclockalign 0
+gameclockalpha 255
+gameclockcolour 16777215
+gameclocklowcolour 16760896
+gameclockscale 0.75
+gameclockx 0.5
+gameclocky 0.03
+gamma 100
+gpuskel 1
+gui2d 1
+guiautotab 16
+guiclicktab 0
+guifadein 1
+guifollow 1
+guipreviewtime 15
+guipushdist 4
+guisens 1.0
+healthcolors 1
+hidedead 0
+hidefrags 0
+highlightscore 1
+hitcrosshair 425
+hitsound 0
+hudarmour 1
+hudarmourscale 1.0
+hudarmourx 1.0
+hudarmoury 1.0
+hudgun 1
+hudgunsdir ""
+hudgunsway 1
+hudhealth 1
+hudhealthscale 1.0
+hudhealthx 0.0
+hudhealthy 1.0
+hudmaxhealth 1
+hudmaxhealthscale 1.0
+hudmaxhealthx 0.257
+hudmaxhealthy 1.0
+hudscore 1
+hudscorealign 0
+hudscorealpha 255
+hudscoreenemycolour 16728128
+hudscoreplayercolour 6332671
+hudscorescale 1.0
+hudscoresep 200
+hudscorex 0.5
+hudscorey 0.03
+invmouse 0
+jumpspawn 1
+lightthreads 0
+maxcon 200
+maxdecaldistance 512
+maxdecaltris 1024
+maxdynlights 5
+maxfps 60
+maxhistory 1000
+maxparticledistance 1024
+maxparticles 4000
+maxparticletextdistance 128
+maxroll 0
+maxservpings 10
+maxsoundsatonce 7
+maxtexsize 0
+maxtrail 500
+menuautoclose 120
+menudistance 40
+miniconfade 30
+miniconfilter 768
+miniconsize 5
+miniconwidth 40
+minimizedsounds 0
+mouseaccel 0.0
+musicvol 60
+muzzleflash 1
+muzzlelight 1
+nompedit 1
+outlinecolour 0
+outlinemeters 0
+particlesize 100
+particletext 1
+playermodel 0
+ragdoll 1
+ragdollfade 1000
+ragdollmillis 10000
+reducefilter 1
+relativemouse 1
+savebak 2
+scoreboard2d 1
+screenshotdir "screenshot"
+screenshotformat 1
+screenshotquality 97
+searchlan 0
+sensitivity 4.2
+sensitivityscale 1.0
+servpingdecay 15000
+servpingrate 5000
+shaderdetail 3
+shadowmap 1
+shadowmapbias 5
+shadowmapdist 256
+shadowmapintensity 40
+shadowmappeelbias 20
+shadowmapprecision 0
+shadowmapradius 96
+shadowmapsize 9
+showclientnum 1
+showconnecting 0
+showdamagedealt 1
+showdeaths 1
+showfps 1
+showfpsrange 0
+showmat 1
+showmodeinfo 1
+showparticles 1
+showping 1
+showpj 0
+showservinfo 1
+showspectatorping 1
+showspectators 1
+smoothdist 32
+smoothmove 75
+soundvol 255
+spawnwait 0
+speedometer 1
+speedometeralpha 0.5
+speedometercolor 1
+speedometerscale 0.5
+speedometerx 0.5
+speedometery 0.6
+statusbars 1
+statusbarscale 1.0
+statusicons 1
+teamcolorchat 1
+teamcolorfrags 1
+teamcolortext 1
+teamcrosshair 1
+teamhudguns 1
+teamskins 0
+teamsounds 1
+texcompress 1025
+texcompressquality -1
+texgui2d 1
+texguiheight 8
+texguiname 1
+texguiscale 1.5
+texguitime 15
+texguiwidth 15
+texreduce 0
+trilinear 1
+usenp2 0
+vsync 0
+vsynctear 0
+zoomaccel 0.0
+zoomautosens 1
+zoomfov 35
+zoominvel 250
+zoomoutvel 100
+zoomsens 1.0
+
+bind "0" [setweapon FI]
+bind "1" [setweapon SG]
+bind "2" [setweapon CG]
+bind "3" [setweapon RL]
+bind "4" [setweapon RI]
+bind "5" [setweapon GL]
+bind "6" [setweapon PI]
+bind "7" [setweapon FI]
+bind "9" [if (allowthirdperson) [togglevar thirdperson]]
+bind "A" [left]
+bind "BACKQUOTE" [saycommand /]
+bind "BACKSLASH" [edittoggle]
+bind "D" [right]
+bind "DELETE" [delbot]
+bind "DOWN" [backward]
+bind "E" [setweapon 1]
+bind "ESCAPE" [togglemainmenu]
+bind "F" [setweapon 6]
+bind "F1" [set paused (= $paused 0)]
+bind "F11" [toggleconsole]
+bind "F12" [screenshot]
+bind "G" [togglezoom]
+bind "I" [taunt]
+bind "INSERT" [addbot]
+bind "KP_MINUS" [conskip 5]
+bind "KP_PLUS" [screenshot]
+bind "LALT" [setweapon 5]
+bind "LCTRL" [setweapon 3]
+bind "LEFT" [left]
+bind "LSHIFT" [setweapon 0]
+bind "M" [showcustommaps]
+bind "MOUSE1" [attack]
+bind "MOUSE2" [setweapon 5; attack 1; onrelease weapon]
+bind "MOUSE3" [setweapon 5; attack 1; onrelease weapon]
+bind "MOUSE4" [universaldelta 1]
+bind "MOUSE5" [universaldelta -1]
+bind "N" [showgui maps]
+bind "PAUSE" [set paused (= $paused 0)]
+bind "Q" [setweapon 2]
+bind "R" [setweapon 4]
+bind "RIGHT" [right]
+bind "S" [backward]
+bind "SLASH" [saycommand /]
+bind "SPACE" [jump]
+bind "T" [saycommand]
+bind "TAB" [showscores]
+bind "UP" [forward]
+bind "W" [forward]
+bind "Y" [sayteamcommand]
+bind "Z" [togglezoom]
+specbind "MOUSE1" [nextfollow]
+specbind "MOUSE2" [nextfollow -1]
+specbind "MOUSE3" [follow]
+specbind "SPACE" [follow]
+editbind "0" [togglevar allfaces]
+editbind "1" [domodifier 11]
+editbind "2" [domodifier 12]
+editbind "3" [domodifier 13]
+editbind "4" [domodifier 14]
+editbind "5" [togglevar hidehud]
+editbind "6" [togglevar entselsnap]
+editbind "7" [togglevar outline]
+editbind "8" [togglevar wireframe]
+editbind "B" [domodifier 9]
+editbind "BACKSLASH" [edittoggle]
+editbind "C" [editcopy]
+editbind "COMMA" [domodifier 10; onrelease entautoview]
+editbind "DELETE" [editdel]
+editbind "F" [domodifier 2]
+editbind "F2" [showtexgui]
+editbind "F3" [if (cleargui 1) [] [showentgui]]
+editbind "F4" [if (cleargui 1) [] [showgui mapmodels]]
+editbind "F5" [savemap]
+editbind "F6" [notepad (mapcfgname)]
+editbind "F9" [echo (getseltex) : (gettexname (getseltex))]
+editbind "G" [domodifier 1]
+editbind "J" [gotosel]
+editbind "K" [calclight]
+editbind "KP_ENTER" [entselect insel]
+editbind "L" [togglevar fullbright]
+editbind "LALT" [history 0]
+editbind "LCTRL" [set  passthrough  1; onrelease [set  passthrough  0]]
+editbind "LSHIFT" [editcut]
+editbind "M" [togglevar showmat]
+editbind "MOUSE1" [editdrag]
+editbind "MOUSE2" [editextend]
+editbind "MOUSE3" [selcorners]
+editbind "N" [selentfindall]
+editbind "O" [domodifier 15]
+editbind "P" [domodifier 16]
+editbind "PERIOD" [selentedit]
+editbind "Q" [domodifier 3]
+editbind "R" [domodifier 4]
+editbind "SPACE" [floatspeed 1200; onrelease [floatspeed 120]]
+editbind "T" [saycommand]
+editbind "V" [editpaste]
+editbind "X" [editflip]
+editbind "Y" [domodifier 6]
+
+defaultmodifier = [0]
+delta_edit_0 = [
+       editfacewentpush $arg1 1 
+]
+delta_edit_1 = [ nodebug [ gridpower (+ $arg1 $gridpower) ] ]
+delta_edit_10 = [ entautoview $arg1 ]
+delta_edit_11 = [ entproperty 0 (* $arg1 $multiplier) ]
+delta_edit_12 = [ entproperty 1 (* $arg1 $multiplier) ]
+delta_edit_13 = [ entproperty 2 (* $arg1 $multiplier) ]
+delta_edit_14 = [ entproperty 3 (* $arg1 $multiplier) ]
+delta_edit_15 = [ vdelta [voffset (* $arg1 $multiplier2) 0] ]
+delta_edit_16 = [ vdelta [voffset 0 (* $arg1 $multiplier2)] ]
+delta_edit_17 = [ vdelta [vrotate $arg1] ]
+delta_edit_18 = [ vdelta [vscale (if (< $arg1 0) 0.5 2)] ]
+delta_edit_2 = [ editfacewentpush $arg1 0 ]
+delta_edit_3 = [ editfacewentpush $arg1 2 ]
+delta_edit_5 = [ entproperty 0 $arg1 ]
+delta_edit_6 = [ edittex $arg1 ]
+delta_game_0 = [ if (= $arg1 1) [ weapon 2 3 5 4 1 6 0 ] [ weapon 4 1 6 2 3 5 0 ] ]
+domodifier = [ modifier = $arg1; onrelease [ modifier = $defaultmodifier ] ]
+glaremodeltype = [aqmi]
+guirolloveraction = [quit]
+guirollovername = [quit]
+modeltype = [aqmib]
+modifier = [0]
+multiplier = [1]
+multiplier2 = [16]
+newname = [xolatile]
+skelanimlength = [192]
+universaldelta = "^n  do [delta_@(if $editing [ result edit ] [ result game ])_@modifier @arg1]^n"
+
+listcomplete clearents [
+  light mapmodel playerstart particles sound
+  shells bullets rockets riflerounds grenades cartridges
+  health healthboost tinyhealth tinyarmour greenarmour yellowarmour quaddamage
+  teleport teledest jumppad
+]
+complete coop "packages/maps" "ogz"
+varcomplete demo "demodir" "dmo"
+listcomplete editmat [air clip noclip gameclip death alpha]
+complete effic "packages/maps" "ogz"
+complete efficteam "packages/maps" "ogz"
+listcomplete entfind [
+  light mapmodel playerstart particles sound
+  shells bullets rockets riflerounds grenades cartridges
+  health healthboost tinyhealth tinyarmour greenarmour yellowarmour quaddamage
+  teleport teledest jumppad
+]
+complete ffa "packages/maps" "ogz"
+complete insta "packages/maps" "ogz"
+complete instateam "packages/maps" "ogz"
+complete map "packages/maps" "ogz"
+listcomplete newent [
+  light mapmodel playerstart particles sound
+  shells bullets rockets riflerounds grenades cartridges
+  health healthboost tinyhealth tinyarmour greenarmour yellowarmour quaddamage
+  teleport teledest jumppad
+]
+complete teamplay "packages/maps" "ogz"
index 189b456eb2f6c3f56c76063a5816997f5be78e9c..3004d05d379ca8c415572b9a6ddaf76264395c55 100644 (file)
@@ -276,7 +276,6 @@ worldshader = [
             @arg2
 
             //:shadowmap
-            //:dynlight
         }
     ] [
         @(if (>= $numargs 5) [result $arg5])
@@ -296,7 +295,6 @@ worldshader = [
             vec4 lm = texture2D(lightmap, texcoord1);
 
             //:shadowmap lm
-            //:dynlight lm
 
             @arg3
 
@@ -633,9 +631,6 @@ bumpvariantshader = [
                 pulse = abs(fract(millis*pulseglowspeed.x)*2.0 - 1.0);
             ]])
 
-            @(if (|| (! (btopt "i")) (btopt "s")) [result [
-                //:dynlight
-            ]])
             @(if (! (btopt "i")) [result [
                 //:shadowmap
                 //:water
@@ -714,12 +709,10 @@ bumpvariantshader = [
             @(if (|| (! (btopt "i")) (btopt "s")) [result [
                 lmc.rgb = max(lmc.rgb*clamp(dot(lmlv, bump), 0.0, 1.0), ambient.xyz);
                 @(if (btopt "i") [result [
-                    //:dynlight lmc
 
                     @(? (btopt "g") "diffuse.rgb" "gl_FragColor.rgb") = diffuse.rgb * lmc.rgb;
                 ]] [result [
                     //:shadowmap lmc
-                    //:dynlight lmc
 
                     @(? (|| (btopt "g") (btopt "r")) "diffuse.rgb" "gl_FragColor.rgb") = diffuse.rgb * lmc.rgb;
                 ]])
index a646276ab3a03797d7c4faee1501cbb4102261b0..6d58e7c02a9c305eed29fc7345e2d3a6a9af1669 100644 (file)
@@ -436,15 +436,6 @@ newgui options [ ///////////////////////////////////////////////////////////////
             guibar
         ]
     ]
-    guilist [
-        guicheckbox "^f0dynamic lights^t"    maxdynlights 3 0
-        if $maxdynlights [
-            guibar
-            guiradio "^f0medium quality" maxdynlights 3
-            guibar
-            guiradio "^f2high quality" maxdynlights 5
-        ]
-    ]
     guilist [
         guicheckbox "^f0decals^t^t" decals
         if $decals [
diff --git a/init.cfg b/init.cfg
new file mode 100644 (file)
index 0000000..2795ac4
--- /dev/null
+++ b/init.cfg
@@ -0,0 +1,12 @@
+// automatically written on exit, DO NOT MODIFY
+// modify settings in game
+fullscreen 1
+fullscreendesktop 0
+scr_w 1920
+scr_h 1080
+depthbits 0
+fsaa -1
+usesound 1
+soundchans 32
+soundfreq 44100
+soundbufferlen 1024
index 0a0b132958fdb21efc0cf4b07666372ebdaf6bb6..6f744942acd010f17ee9971e5c1a670a53797d16 100644 (file)
@@ -2,7 +2,7 @@
 // delete this file to have data/defaults.cfg overwrite these settings
 // modify settings in game, or put settings in autoexec.cfg to override anything
 
-name "unnamed"
+name "Anonymous"
 
 
 ammobar 0
@@ -19,8 +19,8 @@ ammobary 0.5
 ammohud 1
 aniso 0
 applydialog 1
+armourcolors 1
 aspect 0.0
-ati_skybox_bug 0
 attackspawn 1
 autoauth 1
 autocompactvslots 256
@@ -28,20 +28,13 @@ autosortservers 1
 autoupdateservers 1
 bilinear 1
 blood 1
-blurdepthfx 0
-blurdepthfxsigma 50
-blurglare 4
-blurglareaspect 1
-blurglaresigma 50
 blurshadowmap 1
 blursmsigma 100
 bumpmodels 1
-caustics 1
 chainsawhudgun 1
 clockerror 1000000
 clockfix 0
 compresspng 9
-compresstga 1
 confade 30
 confilter 11519
 connectname ""
@@ -59,39 +52,20 @@ damagecompassfade 1000
 damagecompassmax 200
 damagecompassmin 25
 damagecompasssize 30
-damagescreen 1
-damagescreenalpha 45
-damagescreenfactor 7
-damagescreenfade 125
-damagescreenmax 100
-damagescreenmin 10
 deadpush 2
 deathscore 1
 decalfade 10000
 decals 1
 demodir "demo"
-depthfx 1
-depthfxblend 16
-depthfxemuprecision 1
-depthfxfpscale 4096
-depthfxpartblend 8
-depthfxparts 1
-depthfxscale 64
-depthfxsize 10
 dynlightdist 1024
 editinview 1
 emitmillis 17
 entcamdir 1
-envmapmodels 1
-envmapsize 7
 explodebright 1.0
 fewparticles 100
 filltjoints 1
 fixwav 1
-flarecutoff 1000
-flaresize 100
 fov 100
-fpdepthfx 0
 fpshadowmap 0
 fullbrightmodels 60
 fullconfilter 65535
@@ -105,18 +79,7 @@ gameclockscale 0.75
 gameclockx 0.5
 gameclocky 0.03
 gamma 100
-glare 1
-glarescale 1.0
-glaresize 8
-glassenv 1
-gpumipmap 0
 gpuskel 1
-grass 1
-grassdist 256
-grassheight 4
-grassmargin 8
-grassstep 3.0
-grasstaper 0.2
 gui2d 1
 guiautotab 16
 guiclicktab 0
@@ -127,13 +90,25 @@ guipushdist 4
 guisens 1.0
 healthcolors 1
 hidedead 0
-hidefrags 1
+hidefrags 0
 highlightscore 1
 hitcrosshair 425
 hitsound 0
+hudarmour 1
+hudarmourscale 1.0
+hudarmourx 1.0
+hudarmoury 1.0
 hudgun 1
 hudgunsdir ""
 hudgunsway 1
+hudhealth 1
+hudhealthscale 1.0
+hudhealthx 0.0
+hudhealthy 1.0
+hudmaxhealth 1
+hudmaxhealthscale 1.0
+hudmaxhealthx 0.207
+hudmaxhealthy 0.97
 hudscore 0
 hudscorealign 0
 hudscorealpha 255
@@ -147,7 +122,6 @@ invmouse 0
 jumpspawn 1
 lightthreads 0
 maxcon 200
-maxdebris 25
 maxdecaldistance 512
 maxdecaltris 1024
 maxdynlights 5
@@ -156,7 +130,6 @@ maxhistory 1000
 maxparticledistance 1024
 maxparticles 4000
 maxparticletextdistance 128
-maxreflect 2
 maxroll 0
 maxservpings 10
 maxsoundsatonce 7
@@ -169,34 +142,25 @@ miniconfilter 768
 miniconsize 5
 miniconwidth 40
 minimizedsounds 0
-motionblur 0
-motionblurmillis 5
-motionblurscale 0.5
 mouseaccel 0.0
-mumble 1
 musicvol 60
 muzzleflash 1
 muzzlelight 1
 nompedit 1
 outlinecolour 0
 outlinemeters 0
-particleglare 2
 particlesize 100
 particletext 1
 playermodel 0
-pvsthreads 0
 ragdoll 1
 ragdollfade 1000
 ragdollmillis 10000
 reducefilter 1
-reflectdist 2000
-reflectmms 1
-reflectsize 8
 relativemouse 1
 savebak 2
 scoreboard2d 1
 screenshotdir "screenshot"
-screenshotformat 2
+screenshotformat 1
 screenshotquality 97
 searchlan 0
 sensitivity 3.0
@@ -212,9 +176,10 @@ shadowmappeelbias 20
 shadowmapprecision 0
 shadowmapradius 96
 shadowmapsize 9
-showclientnum 0
+showclientnum 1
 showconnecting 0
-showdeaths 0
+showdamagedealt 1
+showdeaths 1
 showfps 1
 showfpsrange 0
 showmat 1
@@ -223,14 +188,18 @@ showparticles 1
 showping 1
 showpj 0
 showservinfo 1
-showspectatorping 0
+showspectatorping 1
 showspectators 1
-skyboxglare 1
 smoothdist 32
 smoothmove 75
 soundvol 255
-sparklyfix 0
 spawnwait 0
+speedometer 1
+speedometeralpha 0.5
+speedometercolor 1
+speedometerscale 0.5
+speedometerx 0.5
+speedometery 0.6
 statusbars 1
 statusbarscale 1.0
 statusicons 1
@@ -251,22 +220,9 @@ texguitime 15
 texguiwidth 15
 texreduce 0
 trilinear 1
-undomegs 8
 usenp2 0
-vertwater 1
 vsync 0
 vsynctear 0
-wallclock 0
-wallclock24 0
-wallclocksecs 0
-waterenvmap 1
-waterfade 1
-waterfallenv 1
-waterfallrefract 1
-waterlod 1
-waterreflect 1
-waterrefract 1
-watersubdiv 2
 zoomaccel 0.0
 zoomautosens 1
 zoomfov 35
@@ -340,26 +296,15 @@ editbind "F5" [savemap]
 editbind "F6" [notepad (mapcfgname)]
 editbind "F9" [echo (getseltex) : (gettexname (getseltex))]
 editbind "G" [domodifier 1]
-editbind "H" [if $hmapedit [ editface 1 -1 ] [ hmapedit 1 ]]
-editbind "I" [redo]
 editbind "J" [gotosel]
 editbind "K" [calclight]
-editbind "KP0" [setblendpaintmode 0]
-editbind "KP1" [setblendpaintmode 1]
-editbind "KP2" [setblendpaintmode 2]
-editbind "KP3" [setblendpaintmode 3]
-editbind "KP4" [setblendpaintmode 4]
-editbind "KP5" [setblendpaintmode 5]
-editbind "KP8" [scrollblendbrush -1]
-editbind "KP9" [scrollblendbrush 1]
 editbind "KP_ENTER" [entselect insel]
 editbind "L" [togglevar fullbright]
-editbind "LALT" [set  hmapedit  1; onrelease [set  hmapedit  0]]
 editbind "LCTRL" [set  passthrough  1; onrelease [set  passthrough  0]]
 editbind "LSHIFT" [editcut]
 editbind "M" [togglevar showmat]
-editbind "MOUSE1" [if $blendpaintmode [paintblendmap] [editdrag]]
-editbind "MOUSE2" [if $blendpaintmode [rotateblendbrush] [editextend]]
+editbind "MOUSE1" [editdrag]
+editbind "MOUSE2" [editextend]
 editbind "MOUSE3" [selcorners]
 editbind "N" [selentfindall]
 editbind "O" [domodifier 15]
@@ -369,19 +314,13 @@ editbind "Q" [domodifier 3]
 editbind "R" [domodifier 4]
 editbind "SPACE" [cancelsel]
 editbind "T" [saycommand]
-editbind "U" [undo; passthroughsel 0]
 editbind "V" [editpaste]
 editbind "X" [editflip]
 editbind "Y" [domodifier 6]
-editbind "Z" [undo; passthroughsel 0]
 
 defaultmodifier = [0]
 delta_edit_0 = [
-    if $blendpaintmode [
-        scrollblendbrush $arg1
-    ] [
-        editfacewentpush $arg1 1 
-    ]
+       editfacewentpush $arg1 1 
 ]
 delta_edit_1 = [ nodebug [ gridpower (+ $arg1 $gridpower) ] ]
 delta_edit_10 = [ entautoview $arg1 ]
@@ -395,10 +334,8 @@ delta_edit_17 = [ vdelta [vrotate $arg1] ]
 delta_edit_18 = [ vdelta [vscale (if (< $arg1 0) 0.5 2)] ]
 delta_edit_2 = [ editfacewentpush $arg1 0 ]
 delta_edit_3 = [ editfacewentpush $arg1 2 ]
-delta_edit_4 = [ if $blendpaintmode [rotateblendbrush $arg1] [editrotate $arg1] ]
 delta_edit_5 = [ entproperty 0 $arg1 ]
 delta_edit_6 = [ edittex $arg1 ]
-delta_edit_9 = [ selectbrush $arg1 ]
 delta_game_0 = [ if (= $arg1 1) [ weapon 2 3 5 4 1 6 0 ] [ weapon 4 1 6 2 3 5 0 ] ]
 domodifier = [ modifier = $arg1; onrelease [ modifier = $defaultmodifier ] ]
 modifier = [0]
@@ -407,45 +344,30 @@ multiplier2 = [16]
 universaldelta = "^n  do [delta_@(if $editing [ result edit ] [ result game ])_@modifier @arg1]^n"
 
 listcomplete clearents [
-  light mapmodel playerstart envmap particles sound
+  light mapmodel playerstart particles sound
   shells bullets rockets riflerounds grenades cartridges
-  health healthboost greenarmour yellowarmour quaddamage
-  teleport teledest
-  monster carrot jumppad
-  base respawnpoint
-  spotlight
-  box barrel platform elevator
-  flag
+  health healthboost tinyhealth tinyarmour greenarmour yellowarmour quaddamage
+  teleport teledest jumppad
 ]
 complete coop "packages/maps" "ogz"
 varcomplete demo "demodir" "dmo"
-listcomplete editmat [air water clip glass noclip lava gameclip death alpha]
+listcomplete editmat [air clip noclip gameclip death alpha]
 complete effic "packages/maps" "ogz"
 complete efficteam "packages/maps" "ogz"
 listcomplete entfind [
-  light mapmodel playerstart envmap particles sound
+  light mapmodel playerstart particles sound
   shells bullets rockets riflerounds grenades cartridges
-  health healthboost greenarmour yellowarmour quaddamage
-  teleport teledest
-  monster carrot jumppad
-  base respawnpoint
-  spotlight
-  box barrel platform elevator
-  flag
+  health healthboost tinyhealth tinyarmour greenarmour yellowarmour quaddamage
+  teleport teledest jumppad
 ]
 complete ffa "packages/maps" "ogz"
 complete insta "packages/maps" "ogz"
 complete instateam "packages/maps" "ogz"
 complete map "packages/maps" "ogz"
 listcomplete newent [
-  light mapmodel playerstart envmap particles sound
+  light mapmodel playerstart particles sound
   shells bullets rockets riflerounds grenades cartridges
-  health healthboost greenarmour yellowarmour quaddamage
-  teleport teledest
-  monster carrot jumppad
-  base respawnpoint
-  spotlight
-  box barrel platform elevator
-  flag
+  health healthboost tinyhealth tinyarmour greenarmour yellowarmour quaddamage
+  teleport teledest jumppad
 ]
 complete teamplay "packages/maps" "ogz"
diff --git a/servers.cfg b/servers.cfg
new file mode 100644 (file)
index 0000000..aa8e294
--- /dev/null
@@ -0,0 +1,2 @@
+// servers connected to are added here automatically
+
index 63e56f574f987d7fb23806c08c273e135c819c63..28c7cf64c2226fc195773ea26906d4ab7969eac2 100644 (file)
@@ -89,7 +89,6 @@ CLIENT_OBJS= \
        engine/command.o \
        engine/console.o \
        engine/decal.o \
-       engine/dynlight.o \
        engine/lightmap.o \
        engine/main.o \
        engine/material.o \
@@ -275,11 +274,6 @@ engine/decal.o: shared/ents.h shared/command.h shared/glexts.h shared/glemu.h
 engine/decal.o: shared/iengine.h shared/igame.h engine/world.h engine/octa.h
 engine/decal.o: engine/lightmap.h engine/bih.h engine/texture.h
 engine/decal.o: engine/model.h
-engine/dynlight.o: engine/engine.h shared/cube.h shared/tools.h shared/geom.h
-engine/dynlight.o: shared/ents.h shared/command.h shared/glexts.h
-engine/dynlight.o: shared/glemu.h shared/iengine.h shared/igame.h
-engine/dynlight.o: engine/world.h engine/octa.h engine/lightmap.h
-engine/dynlight.o: engine/bih.h engine/texture.h engine/model.h
 engine/lightmap.o: engine/engine.h shared/cube.h shared/tools.h shared/geom.h
 engine/lightmap.o: shared/ents.h shared/command.h shared/glexts.h
 engine/lightmap.o: shared/glemu.h shared/iengine.h shared/igame.h
index 19eed54468987d989e451b3f13fb72c5589a995d..f9cdbfc19db73c5662075386d3dcf6966134c876 100644 (file)
@@ -754,7 +754,7 @@ struct gui : g3d_gui {
                                hudmatrix.rotate_around_x(-90*RAD);
                                hudmatrix.scale(-scale.x, scale.y, scale.z);
                                vec dir;
-                               lightreaching(origin, light, dir, false, 0, 0.5f);
+                               lightreaching(origin, light, dir, 0, 0.5f);
                                float intensity = vec(yaw, 0.0f).dot(dir);
                                light.mul(1.0f + max(intensity, 0.0f));
                        }
index 51d09e89dc7ff6b2ce22310993414a3ec83986bb..07143a253b2441bbbc7e34aa07378ec8bafe9185 100644 (file)
@@ -86,7 +86,7 @@ struct animmodel : model {
                void setkey() {
                        key = &shaderparamskey::keys[*this];
                }
-               void setshaderparams(mesh *m, const animstate *as) {
+               void setshaderparams(const animstate *as) {
                        if(!Shader::lastshader) return;
                        float mincolor = as->cur.anim&ANIM_FULLBRIGHT ? fullbrightmodels/100.0f : 0.0f;
                        if(fullbright) {
@@ -140,7 +140,7 @@ struct animmodel : model {
                        //~if(force) cleanup();
                        loadshader();
                }
-               void setshader(mesh *m, const animstate *as) {
+               void setshader(mesh *m) {
                        m->setshader(loadshader());
                }
                void bind(mesh *b, const animstate *as) {
@@ -152,8 +152,8 @@ struct animmodel : model {
                                else /*if(as->cur.anim&ANIM_SHADOW)*/ SETMODELSHADER(b, notexturemodel);
                                return;
                        }
-                       setshader(b, as);
-                       setshaderparams(b, as);
+                       setshader(b);
+                       setshaderparams(as);
                        int activetmu = 0;
                        if(tex!=lasttex) {
                                glBindTexture(GL_TEXTURE_2D, tex->id);
@@ -366,8 +366,8 @@ struct animmodel : model {
                bool hasframes(int i, int n) const { return i>=0 && i+n<=totalframes(); }
                int clipframes(int i, int n) const { return min(n, totalframes() - i); }
                virtual void cleanup() {}
-               virtual void preload(part *p) {}
-               virtual void render(const animstate *as, float pitch, const vec &axis, const vec &forward, dynent *d, part *p) {}
+               virtual void preload(part *) {}
+               virtual void render(const animstate *, float , const vec &, const vec &, dynent *, part *) {}
                void bindpos(GLuint ebuf, GLuint vbuf, void *v, int stride) {
                        if(lastebuf!=ebuf) {
                                gle::bindebo(ebuf);
@@ -423,7 +423,7 @@ struct animmodel : model {
                        }
                }
        };
-       virtual meshgroup *loadmeshes(const char *name, va_list args) { return NULL; }
+       virtual meshgroup *loadmeshes(const char *, va_list ) { return NULL; }
        meshgroup *sharemeshes(const char *name, ...) {
                static hashnameset<meshgroup *> meshgroups;
                if(!meshgroups.access(name)) {
index 6ae6c27934de1e230a99ffae96e20bdcfc2f3084..a8da0437108cf84a1f2cd2278b0fc572d9bc2c1c 100644 (file)
@@ -54,7 +54,7 @@ ICOMMAND(connectedport, "", (), {
 
 void abortconnect() {
        if(!connpeer) return;
-       game::connectfail();
+       memset(game::connectpass, 0, sizeof(game::connectpass));
        if(connpeer->state!=ENET_PEER_STATE_DISCONNECTED) enet_peer_reset(connpeer);
        connpeer = NULL;
        if(curpeer) return;
@@ -101,7 +101,7 @@ void connectserv(const char *servername, int serverport, const char *serverpassw
        enet_host_flush(clienthost);
        connmillis = totalmillis;
        connattempts = 0;
-       game::connectattempt(servername ? servername : "", serverpassword ? serverpassword : "", address);
+       copystring(game::connectpass, serverpassword ? serverpassword : "");
 }
 
 void reconnect(const char *serverpassword) {
index bc39c1f71f13a313766973a68ddc48860ee69513..6c9cad65ab68430406253a5d6255f3656a59d1f7 100644 (file)
@@ -244,12 +244,8 @@ struct decalrenderer {
                decalcenter = center;
                decalradius = radius;
                decalnormal = dir;
-#if 0
-               decaltangent.orthogonal(dir);
-#else
                decaltangent = vec(dir.z, -dir.x, dir.y);
                decaltangent.sub(vec(dir).mul(decaltangent.dot(dir)));
-#endif
                if(flags&DF_ROTATE) decaltangent.rotate(rnd(360)*RAD, dir);
                decaltangent.normalize();
                decalbitangent.cross(decaltangent, dir);
@@ -341,17 +337,10 @@ struct decalrenderer {
                        float facing = n.dot(decalnormal);
                        if(facing <= 0) continue;
                        vec p = vec(pos[0]).sub(decalcenter);
-#if 0
-                       // intersect ray along decal normal with plane
-                       float dist = n.dot(p) / facing;
-                       if(fabs(dist) > decalradius) continue;
-                       vec pcenter = vec(decalnormal).mul(dist).add(decalcenter);
-#else
                        // travel back along plane normal from the decal center
                        float dist = n.dot(p);
                        if(fabs(dist) > decalradius) continue;
                        vec pcenter = vec(n).mul(dist).add(decalcenter);
-#endif
                        vec ft, fb;
                        ft.orthogonal(n);
                        ft.normalize();
diff --git a/src/engine/dynlight.cpp b/src/engine/dynlight.cpp
deleted file mode 100644 (file)
index 0c2a08d..0000000
+++ /dev/null
@@ -1,181 +0,0 @@
-#include "engine.h"
-
-VARP(maxdynlights, 0, min(3, MAXDYNLIGHTS), MAXDYNLIGHTS);
-VARP(dynlightdist, 0, 1024, 10000);
-
-struct dynlight {
-       vec o, hud;
-       float radius, initradius, curradius, dist;
-       vec color, initcolor, curcolor;
-       int fade, peak, expire, flags;
-       physent *owner;
-       void calcradius() {
-               if(fade + peak > 0) {
-                       int remaining = expire - lastmillis;
-                       if(flags&DL_EXPAND)
-                               curradius = initradius + (radius - initradius) * (1.0f - remaining/float(fade + peak));
-                       else if(!(flags&DL_FLASH) && remaining > fade)
-                               curradius = initradius + (radius - initradius) * (1.0f - float(remaining - fade)/peak);
-                       else if(flags&DL_SHRINK)
-                               curradius = (radius*remaining)/fade;
-                       else curradius = radius;
-               }
-               else curradius = radius;
-       }
-       void calccolor() {
-               if(flags&DL_FLASH || peak <= 0) curcolor = color;
-               else {
-                       int peaking = expire - lastmillis - fade;
-                       if(peaking <= 0) curcolor = color;
-                       else curcolor.lerp(initcolor, color, 1.0f - float(peaking)/peak);
-               }
-               float intensity = 1.0f;
-               if(fade > 0) {
-                       int fading = expire - lastmillis;
-                       if(fading < fade) intensity = float(fading)/fade;
-               }
-               curcolor.mul(intensity);
-               // KLUGE: this prevents nvidia drivers from trying to recompile dynlight fragment programs
-               loopk(3) if(fmod(curcolor[k], 1.0f/256) < 0.001f) curcolor[k] += 0.001f;
-       }
-};
-
-vector<dynlight> dynlights;
-vector<dynlight *> closedynlights;
-
-void adddynlight(const vec &o, float radius, const vec &color, int fade, int peak, int flags, float initradius, const vec &initcolor, physent *owner) {
-       if(!maxdynlights) return;
-       if(o.dist(camera1->o) > dynlightdist || radius <= 0) return;
-       int insert = 0, expire = fade + peak + lastmillis;
-       loopvrev(dynlights) if(expire>=dynlights[i].expire) { insert = i+1; break; }
-       dynlight d;
-       d.o = d.hud = o;
-       d.radius = radius;
-       d.initradius = initradius;
-       d.color = color;
-       d.initcolor = initcolor;
-       d.fade = fade;
-       d.peak = peak;
-       d.expire = expire;
-       d.flags = flags;
-       d.owner = owner;
-       dynlights.insert(insert, d);
-}
-
-void cleardynlights() {
-       int faded = -1;
-       loopv(dynlights) if(lastmillis<dynlights[i].expire) { faded = i; break; }
-       if(faded<0) dynlights.setsize(0);
-       else if(faded>0) dynlights.remove(0, faded);
-}
-
-void removetrackeddynlights(physent *owner) {
-       loopvrev(dynlights) if(owner ? dynlights[i].owner == owner : dynlights[i].owner != NULL) dynlights.remove(i);
-}
-
-void updatedynlights() {
-       cleardynlights();
-       game::adddynlights();
-       loopv(dynlights) {
-               dynlight &d = dynlights[i];
-               if(d.owner) game::dynlighttrack(d.owner, d.o, d.hud);
-               d.calcradius();
-               d.calccolor();
-       }
-}
-
-int finddynlights() {
-       closedynlights.setsize(0);
-       if(!maxdynlights) return 0;
-       physent e;
-       e.type = ENT_CAMERA;
-       loopvj(dynlights) {
-               dynlight &d = dynlights[j];
-               if(d.curradius <= 0) continue;
-               d.dist = camera1->o.dist(d.o) - d.curradius;
-               if(d.dist > dynlightdist)
-                       continue;
-               e.o = d.o;
-               e.radius = e.xradius = e.yradius = e.eyeheight = e.aboveeye = d.curradius;
-               if(!collide(&e, vec(0, 0, 0), 0, false)) continue;
-               int insert = 0;
-               loopvrev(closedynlights) if(d.dist >= closedynlights[i]->dist) { insert = i+1; break; }
-               closedynlights.insert(insert, &d);
-               if(closedynlights.length() >= DYNLIGHTMASK) break;
-       }
-       return closedynlights.length();
-}
-
-bool getdynlight(int n, vec &o, float &radius, vec &color) {
-       if(!closedynlights.inrange(n)) return false;
-       dynlight &d = *closedynlights[n];
-       o = d.o;
-       radius = d.curradius;
-       color = d.curcolor;
-       return true;
-}
-
-void dynlightreaching(const vec &target, vec &color, vec &dir, bool hud) {
-       vec dyncolor(0, 0, 0);//, dyndir(0, 0, 0);
-       loopv(dynlights) {
-               dynlight &d = dynlights[i];
-               if(d.curradius<=0) continue;
-               vec ray(hud ? d.hud : d.o);
-               ray.sub(target);
-               float mag = ray.squaredlen();
-               if(mag >= d.curradius*d.curradius) continue;
-               vec color = d.curcolor;
-               color.mul(1 - sqrtf(mag)/d.curradius);
-               dyncolor.add(color);
-               //dyndir.add(ray.mul(intensity/mag));
-       }
-#if 0
-       if(!dyndir.iszero()) {
-               dyndir.normalize();
-               float x = dyncolor.magnitude(), y = color.magnitude();
-               if(x+y>0) {
-                       dir.mul(x);
-                       dyndir.mul(y);
-                       dir.add(dyndir).div(x+y);
-                       if(dir.iszero()) dir = vec(0, 0, 1);
-                       else dir.normalize();
-               }
-       }
-#endif
-       color.add(dyncolor);
-}
-
-void calcdynlightmask(vtxarray *va) {
-       uint mask = 0;
-       int offset = 0;
-       loopv(closedynlights) {
-               dynlight &d = *closedynlights[i];
-               if(d.o.dist_to_bb(va->geommin, va->geommax) >= d.curradius) continue;
-               mask |= (i+1)<<offset;
-               offset += DYNLIGHTBITS;
-               if(offset >= maxdynlights*DYNLIGHTBITS) break;
-       }
-       va->dynlightmask = mask;
-}
-
-int setdynlights(vtxarray *va) {
-       if(closedynlights.empty() || !va->dynlightmask) return 0;
-       extern bool minimizedynlighttcusage();
-       static vec4 posv[MAXDYNLIGHTS];
-       static vec colorv[MAXDYNLIGHTS];
-       int index = 0;
-       for(uint mask = va->dynlightmask; mask; mask >>= DYNLIGHTBITS, index++) {
-               dynlight &d = *closedynlights[(mask&DYNLIGHTMASK)-1];
-               float scale = 1.0f/d.curradius;
-               vec origin = vec(d.o).mul(-scale);
-               if(index>0 && minimizedynlighttcusage()) {
-                       scale /= posv[0].w;
-                       origin.sub(vec(posv[0]).mul(scale));
-               }
-               posv[index] = vec4(origin, scale);
-               colorv[index] = d.curcolor;
-       }
-       GLOBALPARAMV(dynlightpos, posv, index);
-       GLOBALPARAMV(dynlightcolor, colorv, index);
-       return index;
-}
index 5d3fec339b0eed183d133b4d3e4e1df1e3dfeda2..29bfaff7ef019ba1ea72645d78ab596e549c0bcb 100644 (file)
@@ -60,13 +60,13 @@ extern void reloadfonts();
 extern int hwtexsize, hwcubetexsize, hwmaxaniso, maxtexsize;
 
 extern Texture *textureload(const char *name, int clamp = 0, bool mipit = true, bool msg = true);
-extern int texalign(const void *data, int w, int bpp);
+extern int texalign(int w, int bpp);
 extern void cleanuptexture(Texture *t);
 extern uchar *loadalphamask(Texture *t);
 extern void loadlayermasks();
 extern void loadshaders();
-extern void setuptexparameters(int tnum, void *pixels, int clamp, int filter, GLenum format = GL_RGB, GLenum target = GL_TEXTURE_2D, bool swizzle = false);
-extern void createtexture(int tnum, int w, int h, void *pixels, int clamp, int filter, GLenum component = GL_RGB, GLenum target = GL_TEXTURE_2D, int pw = 0, int ph = 0, int pitch = 0, bool resize = true, GLenum format = GL_FALSE, bool swizzle = false);
+extern void setuptexparameters(int tnum, int clamp, int filter, GLenum format = GL_RGB, GLenum target = GL_TEXTURE_2D);
+extern void createtexture(int tnum, int w, int h, void *pixels, int clamp, int filter, GLenum component = GL_RGB, GLenum target = GL_TEXTURE_2D, int pw = 0, int ph = 0, int pitch = 0, bool resize = true, GLenum format = GL_FALSE);
 extern void blurtexture(int n, int bpp, int w, int h, uchar *dst, const uchar *src, int margin = 0);
 extern void blurnormals(int n, int w, int h, bvec *dst, const bvec *src, int margin = 0);
 extern bool reloadtexture(Texture &tex);
@@ -247,14 +247,6 @@ extern void drawbb(const ivec &bo, const ivec &br);
 
 extern int oqfrags;
 
-// dynlight
-
-extern void updatedynlights();
-extern int finddynlights();
-extern void calcdynlightmask(vtxarray *va);
-extern int setdynlights(vtxarray *va);
-extern bool getdynlight(int n, vec &o, float &radius, vec &color);
-
 // material
 
 extern int showmat;
@@ -281,7 +273,7 @@ extern void localconnect();
 
 // serverbrowser
 extern bool resolverwait(const char *name, ENetAddress *address);
-extern int connectwithtimeout(ENetSocket sock, const char *hostname, const ENetAddress &address);
+extern int connectwithtimeout(ENetSocket sock, const ENetAddress &address);
 extern void addserver(const char *name, int port = 0, const char *password = NULL, bool keep = false);
 extern void writeservercfg();
 
@@ -340,7 +332,7 @@ extern void renderbackground(const char *caption = NULL, Texture *mapshot = NULL
 extern void renderprogress(float bar, const char *text, GLuint tex = 0, bool background = false);
 
 extern void getfps(int &fps, int &bestdiff, int &worstdiff);
-extern void swapbuffers(bool overlay = true);
+extern void swapbuffers();
 extern int getclockmillis();
 
 enum { KR_CONSOLE = 1<<0, KR_GUI = 1<<1, KR_EDITMODE = 1<<2 };
@@ -427,10 +419,7 @@ extern void clearmainmenu();
 extern void g3d_mainmenu();
 
 // sound
-extern void clearmapsounds();
-extern void checkmapsounds();
 extern void updatesounds();
-extern void preloadmapsounds();
 
 #endif
 
index 0a9daf107068e3903540159e3db94fdb2448d65a..c15e4b67acc1030fcfd481a6b5df42e37e5c924b 100644 (file)
@@ -194,7 +194,7 @@ void show_calclight_progress() {
                int bpp = lm.bpp;
                if(tasklock) SDL_UnlockMutex(tasklock);
                glBindTexture(GL_TEXTURE_2D, progresstex);
-               glPixelStorei(GL_UNPACK_ALIGNMENT, texalign(data, LM_PACKW, bpp));
+               glPixelStorei(GL_UNPACK_ALIGNMENT, texalign(LM_PACKW, bpp));
                glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, LM_PACKW, LM_PACKH, bpp > 3 ? GL_RGBA : GL_RGB, GL_UNSIGNED_BYTE, data);
        }
        renderprogress(bar1, text1, progresstexticks ? progresstex : 0);
@@ -428,7 +428,7 @@ static bool lumelsample(const vec &sample, int aasample, int stride) {
        return false;
 }
 
-static inline void generatealpha(lightmapworker *w, float tolerance, const vec &pos, uchar &alpha) {
+static inline void generatealpha(lightmapworker *w, const vec &pos, uchar &alpha) {
        alpha = 0;
        if(w->slot->layermask) {
                static const int sdim[] = { 1, 0, 0 }, tdim[] = { 2, 2, 1 };
@@ -664,7 +664,6 @@ static int finishlightmap(lightmapworker *w) {
 
 static int previewlightmapalpha(lightmapworker *w, float lpu, const vec &origin1, const vec &xstep1, const vec &ystep1, const vec &origin2, const vec &xstep2, const vec &ystep2, float side0, float sidestep) {
        extern int fullbrightlevel;
-       float tolerance = 0.5 / lpu;
        uchar *dst = w->colorbuf;
        uchar minalpha = 255, maxalpha = 0;
        float sidex = side0;
@@ -674,7 +673,7 @@ static int previewlightmapalpha(lightmapworker *w, float lpu, const vec &origin1
                                vec(xstep1).mul(x).add(vec(ystep1).mul(y)).add(origin1) :
                                vec(xstep2).mul(x).add(vec(ystep2).mul(y)).add(origin2);
                        loopk(3) dst[k] = fullbrightlevel;
-                       generatealpha(w, tolerance, u, dst[3]);
+                       generatealpha(w, u, dst[3]);
                        minalpha = min(minalpha, dst[3]);
                        maxalpha = max(maxalpha, dst[3]);
                }
@@ -771,7 +770,7 @@ const vector<int> &checklightcache(int x, int y) {
        return lce.lights;
 }
 
-static inline void addlight(lightmapworker *w, const extentity &light, int cx, int cy, int cz, int size, const vec *v, const vec *n, int numv) {
+static inline void addlight(lightmapworker *w, const extentity &light, int cx, int cy, int cz, int size, const vec *v, const vec *n) {
        int radius = light.attr1;
        if(radius > 0) {
                if(light.o.x + radius < cx || light.o.x - radius > cx + size ||
@@ -790,7 +789,7 @@ static inline void addlight(lightmapworker *w, const extentity &light, int cx, i
        }
 }
 
-static bool findlights(lightmapworker *w, int cx, int cy, int cz, int size, const vec *v, const vec *n, int numv, const Slot &slot, const VSlot &vslot) {
+static bool findlights(lightmapworker *w, int cx, int cy, int cz, int size, const vec *v, const vec *n, const VSlot &vslot) {
        w->lights.setsize(0);
        const vector<extentity *> &ents = entities::getents();
        static volatile bool usinglightcache = false;
@@ -800,7 +799,7 @@ static bool findlights(lightmapworker *w, int cx, int cy, int cz, int size, cons
                loopv(lights) {
                        const extentity &light = *ents[lights[i]];
                        switch(light.type) {
-                               case ET_LIGHT: addlight(w, light, cx, cy, cz, size, v, n, numv); break;
+                               case ET_LIGHT: addlight(w, light, cx, cy, cz, size, v, n); break;
                        }
                }
                if(lightlock) { usinglightcache = false; SDL_UnlockMutex(lightlock); }
@@ -808,7 +807,7 @@ static bool findlights(lightmapworker *w, int cx, int cy, int cz, int size, cons
        else loopv(ents) {
                const extentity &light = *ents[i];
                switch(light.type) {
-                       case ET_LIGHT: addlight(w, light, cx, cy, cz, size, v, n, numv); break;
+                       case ET_LIGHT: addlight(w, light, cx, cy, cz, size, v, n); break;
                }
        }
        if(vslot.layer) return true;
@@ -1132,7 +1131,7 @@ static lightmapinfo *setupsurfaces(lightmapworker *w, lightmaptask &task) {
                                numlitverts += numverts;
                        }
                }
-               if(!findlights(w, mo.x, mo.y, mo.z, msz, pos, n, numverts, *vslot.slot, vslot)) {
+               if(!findlights(w, mo.x, mo.y, mo.z, msz, pos, n, vslot)) {
                        if(surf.numverts&MAXFACEVERTS) surf.numverts |= LAYER_TOP;
                        continue;
                }
@@ -1391,6 +1390,7 @@ bool lightmapworker::setupthread() {
 }
 
 static Uint32 calclighttimer(Uint32 interval, void *param) {
+       (void) param;
        check_calclight_progress = true;
        return interval;
 }
@@ -1683,7 +1683,7 @@ void lightent(extentity &e, float height) {
        }
        else if(e.type>=ET_GAMESPECIFIC) ambient = 0.4f;
        vec target(e.o.x, e.o.y, e.o.z + height);
-       lightreaching(target, e.light.color, e.light.dir, false, &e, ambient);
+       lightreaching(target, e.light.color, e.light.dir, &e, ambient);
 }
 
 void lightents(bool force) {
@@ -1705,7 +1705,7 @@ void initlights() {
        shouldlightents = true;
 }
 
-void lightreaching(const vec &target, vec &color, vec &dir, bool fast, extentity *t, float ambient) {
+void lightreaching(const vec &target, vec &color, vec &dir, extentity *t, float ambient) {
        if((fullbright && editmode) || lightmaps.empty()) {
                color = vec(1, 1, 1);
                dir = vec(0, 0, 1);
index aa9b2fe5d5afb1fcb48e98537454c36c643717c1..83aebaaf4753c40b9ced3dd54b2d856aec1ffd61 100644 (file)
@@ -249,7 +249,7 @@ void renderbackground(const char *caption, Texture *mapshot, const char *mapname
                                }
                        }
                        glDisable(GL_BLEND);
-                       if(!restore) swapbuffers(false);
+                       if(!restore) swapbuffers();
                }
        if(!restore) setbackgroundinfo(caption, mapshot, mapname, mapinfo);
 }
@@ -338,7 +338,7 @@ void renderprogress(float bar, const char *text, GLuint tex, bool background) {
                bgquad(x, y, sz, sz);
                glDisable(GL_BLEND);
        }
-       swapbuffers(false);
+       swapbuffers();
 }
 
 int keyrepeatmask = 0, textinputmask = 0;
@@ -659,6 +659,7 @@ template <int SIZE> static inline bool pumpevents(queue<SDL_Event, SIZE> &events
 static int interceptkeysym = 0;
 
 static int interceptevents(void *data, SDL_Event *event) {
+       (void) data;
        switch(event->type) {
                case SDL_MOUSEMOTION: return 0;
                case SDL_KEYDOWN:
@@ -812,7 +813,7 @@ void checkinput() {
        if(mousemoved) resetmousemotion();
 }
 
-void swapbuffers(bool overlay) {
+void swapbuffers() {
        gle::disable();
        SDL_GL_SwapWindow(screen);
 }
@@ -877,11 +878,6 @@ COMMANDN(getfps, getfps_, "i");
 
 bool inbetweenframes = false, renderedframe = true;
 
-static bool findarg(int argc, char **argv, const char *str) {
-       for(int i = 1; i<argc; i++) if(strstr(argv[i], str)==argv[i]) return true;
-       return false;
-}
-
 static int clockrealbase = 0, clockvirtbase = 0;
 static void clockreset() { clockrealbase = SDL_GetTicks(); clockvirtbase = totalmillis; }
 VARFP(clockerror, 990000, 1000000, 1010000, clockreset());
index 60cc507f9ec4fbc1e43175101744179b11e06dfb..0bc47626b0d37f926400e558d682a1df7eef13b2 100644 (file)
@@ -110,7 +110,6 @@ struct vtxarray {
        occludequery *query;
        vector<octaentities *> mapmodels;
        int hasmerges, mergelevel;
-       uint dynlightmask;
        bool shadowed;
 };
 
index 80e2b036eb5b9aaa8ee71aee71c8c12d66330a52..61d891742855d86d2108a1d2ae7a7b72e56e2917 100644 (file)
@@ -291,7 +291,7 @@ bool editmoveplane(const vec &o, const vec &ray, int d, float off, vec &handle,
 
 extern void entdrag(const vec &ray);
 extern bool hoveringonent(int ent, int orient);
-extern void renderentselection(const vec &o, bool entmoving);
+extern void renderentselection(bool entmoving);
 extern float rayent(const vec &o, const vec &ray, float radius, int mode, int size, int &orient, int &ent);
 
 VAR(gridlookup, 0, 0, 1);
@@ -411,7 +411,7 @@ void rendereditcursor() {
        glBlendFunc(GL_ONE, GL_ONE);
        // cursors
        notextureshader->set();
-       renderentselection(player->o, entmoving!=0);
+       renderentselection(entmoving!=0);
        boxoutline = outline!=0;
        enablepolygonoffset(GL_POLYGON_OFFSET_LINE);
        if(!moving && !hovering && !hidecursor) {
@@ -537,14 +537,6 @@ void selgridmap(selinfo &sel, uchar *g) {                                             // generates a map of the cube
 
 VARP(nompedit, 0, 1, 1);
 
-static inline int countblock(cube *c, int n = 8) {
-       int r = 0;
-       loopi(n) if(c[i].children) r += countblock(c[i].children); else ++r;
-       return r;
-}
-
-static int countblock(block3 *b) { return countblock(b->c(), b->size()); }
-
 vector<editinfo *> editinfos;
 editinfo *localedit = NULL;
 
index 868bcc19caedc96bc00cce0396d12da0469dccb6..17dfb37a691e1e762c7f298d9f3270da3297cd6d 100644 (file)
@@ -1083,12 +1083,6 @@ void falling(physent *d, vec &dir, const vec &floor) {
 }
 
 void landing(physent *d, vec &dir, const vec &floor, bool collided) {
-#if 0
-       if(d->physstate == PHYS_FALL) {
-               d->timeinair = 0;
-               if(dir.z < 0.0f) dir.z = d->vel.z = 0.0f;
-       }
-#endif
        switchfloor(d, dir, floor);
        d->timeinair = 0;
        if((d->physstate!=PHYS_STEP_UP && d->physstate!=PHYS_STEP_DOWN) || !collided)
@@ -1310,7 +1304,7 @@ FVAR(straferoll, 0, 0.033f, 90);
 FVAR(faderoll, 0, 0.95f, 1);
 VAR(floatspeed, 1, 100, 10000);
 
-void modifyvelocity(physent *pl, bool local, bool floating, int curtime) {
+void modifyvelocity(physent *pl, bool floating, int curtime) {
        bool allowmove = game::allowmove(pl);
        if(floating) {
                if(pl->jumping && allowmove) {
@@ -1371,13 +1365,14 @@ void modifygravity(physent *pl, int curtime) {
 // local is false for multiplayer prediction
 
 bool moveplayer(physent *pl, int moveres, bool local, int curtime) {
+       (void) local;
        int material = lookupmaterial(vec(pl->o.x, pl->o.y, pl->o.z + (3*pl->aboveeye - pl->eyeheight)/4));
        bool floating = pl->type==ENT_PLAYER && (pl->state==CS_EDITING || pl->state==CS_SPECTATOR);
        float secs = curtime/1000.f;
        // apply gravity
        if(!floating) modifygravity(pl, curtime);
        // apply any player generated changes in velocity
-       modifyvelocity(pl, local, floating, curtime);
+       modifyvelocity(pl, floating, curtime);
        vec d(pl->vel);
        if(!floating) d.mul(0.5f);
        d.add(pl->falling);
@@ -1390,8 +1385,7 @@ bool moveplayer(physent *pl, int moveres, bool local, int curtime) {
                        pl->falling = vec(0, 0, 0);
                }
                pl->o.add(d);
-       }
-       else {                                          // apply velocity with collision {
+       } else {                                                // apply velocity with collision {
                const float f = 1.0f/moveres;
                const int timeinair = pl->timeinair;
                int collisions = 0;
index 4243ac78ac164d795bd0c77a45e88ce5b95d5100..e44841532e8a82e7f9275b1e4a1e2f8d2e8b685a 100644 (file)
@@ -397,9 +397,6 @@ void gl_checkextensions() {
                glIsVertexArray_ =        (PFNGLISVERTEXARRAYPROC)       getprocaddress("glIsVertexArrayAPPLE");
                hasVAO = true;
        }
-       if(glversion >= 330 || hasext("GL_ARB_texture_swizzle") || hasext("GL_EXT_texture_swizzle")) {
-               hasTSW = true;
-       }
        if(hasext("GL_EXT_texture_compression_s3tc")) {
                hasS3TC = true;
                if(!mesa) usetexcompress = 2;
@@ -425,8 +422,7 @@ void gl_checkextensions() {
        }
        if(glversion >= 300 || hasext("GL_EXT_gpu_shader4")) {
                // on DX10 or above class cards (i.e. GF8 or RadeonHD) enable expensive features
-               extern int maxdynlights, texcompress;
-               maxdynlights = MAXDYNLIGHTS;
+               extern int texcompress;
                texcompress = max(texcompress, 1024 + 1);
        }
 }
@@ -957,7 +953,6 @@ int xtraverts, xtravertsva;
 
 void gl_drawframe() {
        if(deferdrawtextures) drawtextures();
-       updatedynlights();
        int w = screenw, h = screenh;
        aspect = forceaspect ? forceaspect : w/float(h);
        fovy = 2*atan2(tan(curfov/2*RAD), aspect)/RAD;
index 035521373a2cdb99db54153ccbafa4964f638ff3..cfdf32661cd955482f1ceb2dd3120d68995acc39 100644 (file)
@@ -265,10 +265,6 @@ void mmodel(char *name) {
        mmi.m = NULL;
 }
 
-void mapmodelcompat(int *rad, int *h, int *tex, char *name, char *shadow) {
-       mmodel(name);
-}
-
 void mapmodelreset(int *n) {
        if(!(identflags&IDF_OVERRIDDEN) && !game::allowedittoggle()) return;
        mapmodels.shrink(clamp(*n, 0, mapmodels.length()));
@@ -278,7 +274,6 @@ mapmodelinfo *getmminfo(int i) { return mapmodels.inrange(i) ? &mapmodels[i] : 0
 const char *mapmodelname(int i) { return mapmodels.inrange(i) ? mapmodels[i].name : NULL; }
 
 COMMAND(mmodel, "s");
-COMMANDN(mapmodel, mapmodelcompat, "iiiss");
 COMMAND(mapmodelreset, "i");
 ICOMMAND(mapmodelname, "i", (int *index), { result(mapmodels.inrange(*index) ? mapmodels[*index].name : ""); });
 ICOMMAND(mapmodelloaded, "i", (int *index), { intret(mapmodels.inrange(*index) && mapmodels[*index].m ? 1 : 0); });
@@ -620,7 +615,7 @@ static inline void disablecullmodelquery() {
        endbb();
 }
 
-static inline int cullmodel(model *m, const vec &center, float radius, int flags, dynent *d = NULL, bool shadow = false) {
+static inline int cullmodel(const vec &center, float radius, int flags, dynent *d = NULL) {
        if(flags&MDL_CULL_DIST && center.dist(camera1->o)/radius>maxmodelradiusdistance) return MDL_CULL_DIST;
        if(flags&MDL_CULL_VFC) {
                if(shadowmapping && !isshadowmapcaster(center, radius)) return MDL_CULL_VFC;
@@ -664,7 +659,7 @@ void rendermodel(entitylight *light, const char *mdl, int anim, const vec &o, fl
                        center.rotate_around_z(yaw*RAD);
                        center.add(o);
                }
-               int culled = cullmodel(m, center, radius, flags, d, shadow);
+               int culled = cullmodel(center, radius, flags, d);
                if(culled) {
                        if(culled&(MDL_CULL_OCCLUDED|MDL_CULL_QUERY) && flags&MDL_CULL_QUERY) {
                                enablecullmodelquery();
@@ -703,24 +698,20 @@ void rendermodel(entitylight *light, const char *mdl, int anim, const vec &o, fl
                                        pos.z += radius/2;
                                }
                                else if(d->type < ENT_CAMERA) pos.z += 0.75f*(d->eyeheight + d->aboveeye);
-                               lightreaching(pos, light->color, light->dir, (flags&MDL_LIGHT_FAST)!=0);
-                               dynlightreaching(pos, light->color, light->dir, (flags&MDL_HUD)!=0);
+                               lightreaching(pos, light->color, light->dir);
                                light->millis = lastmillis;
                        }
                }
                else if(flags&MDL_LIGHT) {
                        if(!light) {
-                               lightreaching(pos, lightcolor, lightdir, (flags&MDL_LIGHT_FAST)!=0);
-                               dynlightreaching(pos, lightcolor, lightdir, (flags&MDL_HUD)!=0);
+                               lightreaching(pos, lightcolor, lightdir);
                        }
                        else if(light->millis!=lastmillis) {
-                               lightreaching(pos, light->color, light->dir, (flags&MDL_LIGHT_FAST)!=0);
-                               dynlightreaching(pos, light->color, light->dir, (flags&MDL_HUD)!=0);
+                               lightreaching(pos, light->color, light->dir);
                                light->millis = lastmillis;
                        }
                }
                if(light) { lightcolor = light->color; lightdir = light->dir; }
-               if(flags&MDL_DYNLIGHT) dynlightreaching(pos, lightcolor, lightdir, (flags&MDL_HUD)!=0);
        }
        if(a) for(int i = 0; a[i].tag; i++) {
                if(a[i].name) a[i].m = loadmodel(a[i].name);
index dbdf855fb3514ceaef4e7cc62910429c832c9aa4..637dcb22fcc2be3accfaa405c63edcfefed20dad 100644 (file)
@@ -146,7 +146,7 @@ struct partrenderer {
        virtual void render() = 0;
        virtual bool haswork() = 0;
        virtual void cleanup() {}
-       virtual void seedemitter(particleemitter &pe, const vec &o, const vec &d, int fade, float size, int gravity) {
+       virtual void seedemitter(particleemitter &, const vec &, const vec &, int , float , int ) {
        }
        //blend = 0 => remove it
        void calc(particle *p, int &blend, int &ts, vec &o, vec &d, bool step = true) {
@@ -408,17 +408,9 @@ struct texticonrenderer : listrenderer {
 };
 static texticonrenderer texticons("packages/hud/items.png", PT_TEXTICON|PT_LERP);
 
-template<int T>
-static inline void modifyblend(const vec &o, int &blend) {
-       blend = min(blend<<2, 255);
-}
-
-template<>
-inline void modifyblend<PT_TAPE>(const vec &o, int &blend) {
-}
-
 template<int T>
 static inline void genpos(const vec &o, const vec &d, float size, int grav, int ts, partvert *vs) {
+       (void) o; (void) size; (void) d; (void) grav; (void) ts; (void) vs;
        vec udir = vec(camup).sub(camright).mul(size);
        vec vdir = vec(camup).add(camright).mul(size);
        vs[0].pos = vec(o.x + udir.x, o.y + udir.y, o.z + udir.z);
@@ -429,6 +421,7 @@ static inline void genpos(const vec &o, const vec &d, float size, int grav, int
 
 template<>
 inline void genpos<PT_TAPE>(const vec &o, const vec &d, float size, int ts, int grav, partvert *vs) {
+       (void) o; (void) size; (void) d; (void) grav; (void) ts; (void) vs;
        vec dir1 = d, dir2 = d, c;
        dir1.sub(o);
        dir2.sub(camera1->o);
@@ -441,6 +434,7 @@ inline void genpos<PT_TAPE>(const vec &o, const vec &d, float size, int ts, int
 
 template<>
 inline void genpos<PT_TRAIL>(const vec &o, const vec &d, float size, int ts, int grav, partvert *vs) {
+       (void) o; (void) size; (void) d; (void) grav; (void) ts; (void) vs;
        vec e = d;
        if(grav) e.z -= float(ts)/grav;
        e.div(-75.0f).add(o);
@@ -449,6 +443,7 @@ inline void genpos<PT_TRAIL>(const vec &o, const vec &d, float size, int ts, int
 
 template<int T>
 static inline void genrotpos(const vec &o, const vec &d, float size, int grav, int ts, partvert *vs, int rot) {
+       (void) o; (void) size; (void) d; (void) grav; (void) ts; (void) vs; (void) rot;
        genpos<T>(o, d, size, grav, ts, vs);
 }
 
@@ -467,6 +462,7 @@ static const vec rotcoeffs[32][4] = {
 
 template<>
 inline void genrotpos<PT_PART>(const vec &o, const vec &d, float size, int grav, int ts, partvert *vs, int rot) {
+       (void) o; (void) size; (void) d; (void) grav; (void) ts; (void) vs; (void) rot;
        const vec *coeffs = rotcoeffs[rot];
        (vs[0].pos = o).add(vec(camright).mul(coeffs[0].x*size)).add(vec(camup).mul(coeffs[0].y*size));
        (vs[1].pos = o).add(vec(camright).mul(coeffs[1].x*size)).add(vec(camup).mul(coeffs[1].y*size));
@@ -577,7 +573,7 @@ struct varenderer : partrenderer {
                int blend, ts;
                calc(p, blend, ts, o, d);
                if(blend <= 1 || p->fade <= 5) p->fade = -1; //mark to remove on next pass (i.e. after render)
-               modifyblend<T>(o, blend);
+               blend = min(blend<<2, 255);
                if(regen) {
                        p->flags &= ~0x80;
                        #define SETTEXCOORDS(u1c, u2c, v1c, v2c, body) { \
index dada6d3d0372f1d0854fb640bd5970db6f49b403..a98614a7d482c88702eac0048390ed977dfb239c 100644 (file)
@@ -528,9 +528,7 @@ struct renderstate {
        VSlot *vslot, *texgenvslot;
        vec2 texgenscroll;
        int texgendim;
-       int visibledynlights;
-       uint dynlightmask;
-       renderstate() : colormask(true), depthmask(true), blending(false), alphaing(0), vbuf(0), vattribs(false), vquery(false), colorscale(1, 1, 1), alphascale(0), slot(NULL), texgenslot(NULL), vslot(NULL), texgenvslot(NULL), texgenscroll(0, 0), texgendim(-1), visibledynlights(0), dynlightmask(0) {
+       renderstate() : colormask(true), depthmask(true), blending(false), alphaing(0), vbuf(0), vattribs(false), vquery(false), colorscale(1, 1, 1), alphascale(0), slot(NULL), texgenslot(NULL), vslot(NULL), texgenvslot(NULL), texgenscroll(0, 0), texgendim(-1) {
                loopk(8) textures[k] = 0;
        }
 };
@@ -580,8 +578,6 @@ struct geombatch {
        int compare(const geombatch &b) const {
                if(va->vbuf < b.va->vbuf) return -1;
                if(va->vbuf > b.va->vbuf) return 1;
-               if(va->dynlightmask < b.va->dynlightmask) return -1;
-               if(va->dynlightmask > b.va->dynlightmask) return 1;
                if(vslot.slot->shader < b.vslot.slot->shader) return -1;
                if(vslot.slot->shader > b.vslot.slot->shader) return 1;
                if(vslot.slot->params.length() < b.vslot.slot->params.length()) return -1;
@@ -718,10 +714,6 @@ static void changebatchtmus(renderstate &cur, int pass, geombatch &b) {
                tmu++;
        }
        if(changed) glActiveTexture_(GL_TEXTURE0);
-       if(cur.dynlightmask != b.va->dynlightmask) {
-               cur.visibledynlights = setdynlights(b.va);
-               cur.dynlightmask = b.va->dynlightmask;
-       }
 }
 
 static void changeslottmus(renderstate &cur, int pass, Slot &slot, VSlot &vslot) {
@@ -758,16 +750,6 @@ static void changeslottmus(renderstate &cur, int pass, Slot &slot, VSlot &vslot)
        cur.vslot = &vslot;
 }
 
-static void changeshader(renderstate &cur, Shader *s, Slot &slot, VSlot &vslot, bool shadowed) {
-       if(!cur.blending && !cur.alphaing) {
-               if(shadowed) s->setvariant(cur.visibledynlights, 3, slot, vslot);
-               else s->setvariant(cur.visibledynlights, 2, slot, vslot);
-       }
-       else if(shadowed) s->setvariant(cur.visibledynlights, 1, slot, vslot);
-       else if(!cur.visibledynlights) s->set(slot, vslot);
-       else s->setvariant(cur.visibledynlights-1, 0, slot, vslot);
-}
-
 static void changetexgen(renderstate &cur, int dim, Slot &slot, VSlot &vslot) {
        if(cur.texgenslot != &slot || cur.texgenvslot != &vslot) {
                Texture *curtex = !cur.texgenslot || cur.texgenslot->sts.empty() ? notexture : cur.texgenslot->sts[0].t,
@@ -803,7 +785,6 @@ static void renderbatch(renderstate &cur, int pass, geombatch &b) {
                ushort len = curbatch->es.length[curbatch->va->shadowed ? 0 : 1];
                if(len) {
                        if(rendered < 0) {
-                               changeshader(cur, b.vslot.slot->shader, *b.vslot.slot, b.vslot, false);
                                rendered = 0;
                                gbatches++;
                        }
@@ -818,7 +799,6 @@ static void renderbatch(renderstate &cur, int pass, geombatch &b) {
        if(shadowed) for(geombatch *curbatch = shadowed;; curbatch = &geombatches[curbatch->batch]) {
                if(curbatch->va->shadowed && curbatch->es.length[1] > curbatch->es.length[0]) {
                        if(rendered < 1) {
-                               changeshader(cur, b.vslot.slot->shader, *b.vslot.slot, b.vslot, true);
                                rendered = 1;
                                gbatches++;
                        }
@@ -912,10 +892,8 @@ void renderva(renderstate &cur, vtxarray *va, int pass = RENDERPASS_LIGHTMAP, bo
                case RENDERPASS_LIGHTMAP:
                        if(!cur.alphaing) vverts += va->verts;
                        va->shadowed = false;
-                       va->dynlightmask = 0;
                        if(!drawtex && !cur.alphaing) {
                                va->shadowed = isshadowmapreceiver(va);
-                               calcdynlightmask(va);
                        }
                        if(doquery) startvaquery(va, { if(geombatches.length()) renderbatches(cur, pass); });
                        mergetexs(cur, va);
@@ -943,7 +921,7 @@ void cleanupva() {
        cleanupbb();
 }
 
-void setupgeom(renderstate &cur) {
+void setupgeom() {
        GLOBALPARAMF(colorparams, 2, 2, 2, 1);
        GLOBALPARAM(camera, camera1->o);
        GLOBALPARAMF(ambient, ambientcolor.x/255.0f, ambientcolor.y/255.0f, ambientcolor.z/255.0f);
@@ -970,10 +948,9 @@ void rendergeom(void) {
        }
        if(!doZP) {
                if(shadowmap && mainpass) rendershadowmap();
-               setupgeom(cur);
+               setupgeom();
                if(doSM) pushshadowmap();
        }
-       finddynlights();
        resetbatches();
        int blends = 0;
        for(vtxarray *va = visibleva; va; va = va->next) {
@@ -1015,7 +992,7 @@ void rendergeom(void) {
        if(doZP) {
                glFlush();
                if(shadowmap && mainpass) rendershadowmap();
-               setupgeom(cur);
+               setupgeom();
                if(doSM) pushshadowmap();
                if(!multipassing) { multipassing = true; glDepthFunc(GL_LEQUAL); }
                cur.texgendim = -1;
@@ -1087,7 +1064,7 @@ void renderalphageom(void) {
                glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_FALSE);
                if(cur.vattribs) disablevattribs(cur, false);
                if(cur.vbuf) disablevbuf(cur);
-               setupgeom(cur);
+               setupgeom();
                glDepthFunc(GL_LEQUAL);
                glEnable(GL_BLEND);
                glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
index c23e4fa0ea8ea390559dd41e1b8b4bb91aba9200..10c1e804d312c7441859b02bb263bc334e910d89 100644 (file)
@@ -39,6 +39,7 @@ void fatal(const char *fmt, ...) {
 }
 
 void conoutfv(int type, const char *fmt, va_list args) {
+       (void) type;
        logoutfv(fmt, args);
 }
 #endif
@@ -263,7 +264,7 @@ bool resolverwait(const char *name, ENetAddress *address) {
        return enet_address_set_host(address, name) >= 0;
 }
 
-int connectwithtimeout(ENetSocket sock, const char *hostname, const ENetAddress &remoteaddress) {
+int connectwithtimeout(ENetSocket sock, const ENetAddress &remoteaddress) {
        return enet_socket_connect(sock, &remoteaddress);
 }
 #endif
@@ -307,7 +308,7 @@ ENetSocket connectmaster(bool wait) {
        if(wait || serveraddress.host == ENET_HOST_ANY || !enet_socket_bind(sock, &serveraddress)) {
                enet_socket_set_option(sock, ENET_SOCKOPT_NONBLOCK, 1);
                if(wait) {
-                       if(!connectwithtimeout(sock, mastername, masteraddress)) return sock;
+                       if(!connectwithtimeout(sock, masteraddress)) return sock;
                }
                else if(!enet_socket_connect(sock, &masteraddress)) return sock;
        }
@@ -662,7 +663,7 @@ COMMAND(stoplistenserver, "");
 #endif
 
 #ifdef STANDALONE
-int main(int argc, char **argv) {
+int main(void) {
        if(enet_initialize()<0) fatal("Unable to initialise network module");
        atexit(enet_deinitialize);
        enet_time_set(0);
index a839c355a1e6112efae277103d020ee9a54ffcb0..d821c766e079d7b1291c6410e1752c17981fd7aa 100644 (file)
@@ -156,8 +156,8 @@ bool resolverwait(const char *name, ENetAddress *address) {
 
 #define CONNLIMIT 20000
 
-int connectwithtimeout(ENetSocket sock, const char *hostname, const ENetAddress &address) {
-       defformatstring(text, "connecting to %s... (esc to abort)", hostname);
+int connectwithtimeout(ENetSocket sock, const ENetAddress &address) {
+       defformatstring(text, "connecting to server... (esc to abort)");
        renderprogress(0, text);
        ENetSocketSet readset, writeset;
        if(!enet_socket_connect(sock, &address)) for(int starttime = SDL_GetTicks(), timeout = 0; timeout <= CONNLIMIT;) {
index 86e454627d64e9a359baf46076ef0f2c0e0ffb3e..eb10720da3544e62ec5bd5a810229f72e0d80593 100644 (file)
@@ -445,7 +445,7 @@ void Shader::cleanup(bool invalid) {
 
 bool Shader::isnull(const Shader *s) { return !s; }
 
-static void genattriblocs(Shader &s, const char *vs, const char *ps, Shader *reusevs, Shader *reuseps) {
+static void genattriblocs(Shader &s, const char *vs, Shader *reusevs) {
        static int len = strlen("//:attrib");
        string name;
        int loc;
@@ -457,7 +457,7 @@ static void genattriblocs(Shader &s, const char *vs, const char *ps, Shader *reu
        }
 }
 
-static void genuniformlocs(Shader &s, const char *vs, const char *ps, Shader *reusevs, Shader *reuseps) {
+static void genuniformlocs(Shader &s, const char *vs, Shader *reusevs) {
        static int len = strlen("//:uniform");
        string name, blockname;
        int binding, stride;
@@ -503,8 +503,8 @@ Shader *newshader(int type, const char *name, const char *vs, const char *ps, Sh
        else loopv(slotparams) s.defaultparams.add(slotparams[i]);
        s.attriblocs.setsize(0);
        s.uniformlocs.setsize(0);
-       genattriblocs(s, vs, ps, s.reusevs, s.reuseps);
-       genuniformlocs(s, vs, ps, s.reusevs, s.reuseps);
+       genattriblocs(s, vs, s.reusevs);
+       genuniformlocs(s, vs, s.reusevs);
        if(!s.compile()) {
                s.cleanup(true);
                if(variant) shaders.remove(rname);
@@ -622,60 +622,6 @@ static void gengenericvariant(Shader &s, const char *sname, const char *vs, cons
        newshader(s.type, varname, vschanged ? vsv.getbuf() : reuse, pschanged ? psv.getbuf() : reuse, &s, row);
 }
 
-bool minimizedynlighttcusage() { return glversion < 300 && maxvaryings < 48; }
-
-static void gendynlightvariant(Shader &s, const char *sname, const char *vs, const char *ps, int row = 0) {
-       int numlights = minimizedynlighttcusage() ? 1 : MAXDYNLIGHTS;
-       const char *vspragma = strstr(vs, "//:dynlight"), *pspragma = strstr(ps, "//:dynlight");
-       if(!vspragma || !pspragma) return;
-       string pslight;
-       vspragma += strcspn(vspragma, "\n");
-       if(*vspragma) vspragma++;
-       if(sscanf(pspragma, "//:dynlight %100s", pslight)!=1) return;
-       pspragma += strcspn(pspragma, "\n");
-       if(*pspragma) pspragma++;
-       const char *vsmain = findglslmain(vs), *psmain = findglslmain(ps);
-       if(vsmain > vspragma) vsmain = vs;
-       if(psmain > pspragma) psmain = ps;
-       vector<char> vsdl, psdl;
-       loopi(MAXDYNLIGHTS) {
-               vsdl.setsize(0);
-               psdl.setsize(0);
-               if(vsmain >= vs) vsdl.put(vs, vsmain - vs);
-               if(psmain >= ps) psdl.put(ps, psmain - ps);
-               defformatstring(pos, "uniform vec4 dynlightpos[%d];\n", i+1);
-               vsdl.put(pos, strlen(pos));
-               psdl.put(pos, strlen(pos));
-               defformatstring(color, "uniform vec3 dynlightcolor[%d];\n", i+1);
-               psdl.put(color, strlen(color));
-               loopk(min(i+1, numlights)) {
-                       defformatstring(dir, "%sdynlight%ddir%s", !k ? "varying vec3 " : " ", k, k==i || k+1==numlights ? ";\n" : ",");
-                       vsdl.put(dir, strlen(dir));
-                       psdl.put(dir, strlen(dir));
-               }
-               vsdl.put(vsmain, vspragma-vsmain);
-               psdl.put(psmain, pspragma-psmain);
-               loopk(i+1) {
-                       defformatstring(tc,
-                               k<numlights ?
-                                       "dynlight%ddir = vvertex.xyz*dynlightpos[%d].w + dynlightpos[%d].xyz;\n" :
-                                       "vec3 dynlight%ddir = dynlight0dir*dynlightpos[%d].w + dynlightpos[%d].xyz;\n",
-                               k, k, k);
-                       if(k < numlights) vsdl.put(tc, strlen(tc));
-                       else psdl.put(tc, strlen(tc));
-                       defformatstring(dl,
-                               "%s.rgb += dynlightcolor[%d] * (1.0 - clamp(dot(dynlight%ddir, dynlight%ddir), 0.0, 1.0));\n",
-                               pslight, k, k, k);
-                       psdl.put(dl, strlen(dl));
-               }
-               vsdl.put(vspragma, strlen(vspragma)+1);
-               psdl.put(pspragma, strlen(pspragma)+1);
-               defformatstring(name, "<dynlight %d>%s", i+1, sname);
-               Shader *variant = newshader(s.type, name, vsdl.getbuf(), psdl.getbuf(), &s, row);
-               if(!variant) return;
-       }
-}
-
 static void genshadowmapvariant(Shader &s, const char *sname, const char *vs, const char *ps, int row = 1) {
        const char *vspragma = strstr(vs, "//:shadowmap"), *pspragma = strstr(ps, "//:shadowmap");
        if(!vspragma || !pspragma) return;
@@ -724,7 +670,6 @@ static void genshadowmapvariant(Shader &s, const char *sname, const char *vs, co
        defformatstring(name, "<shadowmap>%s", sname);
        Shader *variant = newshader(s.type, name, vssm.getbuf(), pssm.getbuf(), &s, row);
        if(!variant) return;
-       if(strstr(vs, "//:dynlight")) gendynlightvariant(s, name, vssm.getbuf(), pssm.getbuf(), row);
 }
 
 static void genuniformdefs(vector<char> &vsbuf, vector<char> &psbuf, const char *vs, const char *ps, Shader *variant = NULL) {
@@ -842,7 +787,6 @@ void shader(int *type, char *name, char *vs, char *ps) {
        Shader *s = newshader(*type, name, vs, ps);
        if(s) {
                if(strstr(vs, "//:shadowmap")) genshadowmapvariant(*s, s->name, vs, ps);
-               if(strstr(vs, "//:dynlight")) gendynlightvariant(*s, s->name, vs, ps);
        }
        slotparams.shrink(0);
 }
@@ -862,7 +806,6 @@ void variantshader(int *type, char *name, int *row, char *vs, char *ps) {
        GENSHADER(s->defaultparams.length(), genuniformdefs(vsbuf, psbuf, vs, ps, s));
        Shader *v = newshader(*type, varname, vs, ps, s, *row);
        if(v) {
-               if(strstr(vs, "//:dynlight")) gendynlightvariant(*s, varname, vs, ps, *row);
                if(strstr(ps, "//:variant") || strstr(vs, "//:variant")) gengenericvariant(*s, varname, vs, ps, *row);
        }
 }
index 1eefe4b4adf9f1d96e3eb34319be841c07b07565..e86f65f3e73b4cf23906ff7df42d1e3bb49e3274 100644 (file)
@@ -185,19 +185,6 @@ bool isshadowmapreceiver(vtxarray *va) {
        vec center = vec(va->shadowmapmin).add(vec(va->shadowmapmax)).mul(0.5f);
        calcshadowmapbb(center, xyrad, zrad, x1, y1, x2, y2);
        return shadowmaptex.checkblurtiles(x1, y1, x2, y2, 2);
-
-#if 0
-       // cheaper inexact test
-       float dz = va->o.z + va->size/2 - shadowfocus.z;
-       float cx = shadowfocus.x + dz*shadowdir.x, cy = shadowfocus.y + dz*shadowdir.y;
-       float skew = va->size/2*SHADOWSKEW;
-       if(!shadowmap || !shadowmaptex ||
-          va->o.z + va->size <= shadowfocus.z - shadowmapdist || va->o.z >= shadowmapmaxz ||
-          va->o.x + va->size <= cx - shadowmapradius-skew || va->o.x >= cx + shadowmapradius+skew ||
-          va->o.y + va->size <= cy - shadowmapradius-skew || va->o.y >= cy + shadowmapradius+skew)
-               return false;
-       return true;
-#endif
 }
 
 bool isshadowmapcaster(const vec &o, float rad) {
index e8233377a718d21916aab43e2cd6ef5b57f55df1..ad5d34eaf0997567f0e1b880da23dbb7eacce5c4 100644 (file)
@@ -243,13 +243,13 @@ struct skelmodel : animmodel {
                        return numverts;
                }
                template<class T>
-               static inline void fillvert(T &vv, int j, vert &v) {
+               static inline void fillvert(T &vv, vert &v) {
                        vv.tc = v.tc;
                }
                template<class T>
                void fillverts(T *vdata) {
                        vdata += voffset;
-                       loopi(numverts) fillvert(vdata[i], i, verts[i]);
+                       loopi(numverts) fillvert(vdata[i], verts[i]);
                }
                void interpverts(const dualquat * RESTRICT bdata1, const dualquat * RESTRICT bdata2, bool tangents, void * RESTRICT vdata, skin &s) {
                        const int blendoffset = ((skelmeshgroup *)group)->skel->numgpubones;
index 62cab3e4fcf4e83c85ec58f3550194b1c3dfb353..d9b24733a327fd321b6eed4b4d82ae008123e2b2 100644 (file)
@@ -58,7 +58,7 @@ struct soundchannel {
 vector<soundchannel> channels;
 int maxchannels = 0;
 
-soundchannel &newchannel(int n, soundslot *slot, const vec *loc = NULL, extentity *ent = NULL, int flags = 0, int radius = 0) {
+soundchannel &newchannel(int n, soundslot *slot, const vec *loc = NULL, extentity *ent = NULL, int radius = 0) {
        if(ent) {
                loc = &ent->o;
                ent->flags |= EF_SOUND;
@@ -443,33 +443,21 @@ static struct soundtype {
        bool playing(const soundchannel &chan, const soundconfig &config) const {
                return chan.inuse && config.hasslot(chan.slot, slots);
        }
-} gamesounds, mapsounds;
+} gamesounds;
 
 void registersound(char *name, int *vol) { intret(gamesounds.addsound(name, *vol, 0)); }
 COMMAND(registersound, "si");
 
-void mapsound(char *name, int *vol, int *maxuses) { intret(mapsounds.addsound(name, *vol, *maxuses < 0 ? 0 : max(1, *maxuses))); }
-COMMAND(mapsound, "sii");
-
 void altsound(char *name, int *vol) { gamesounds.addalt(name, *vol); }
 COMMAND(altsound, "si");
 
-void altmapsound(char *name, int *vol) { mapsounds.addalt(name, *vol); }
-COMMAND(altmapsound, "si");
-
 ICOMMAND(numsounds, "", (), intret(gamesounds.configs.length()));
-ICOMMAND(nummapsounds, "", (), intret(mapsounds.configs.length()));
 
 void soundreset() {
        gamesounds.reset();
 }
 COMMAND(soundreset, "");
 
-void mapsoundreset() {
-       mapsounds.reset();
-}
-COMMAND(mapsoundreset, "");
-
 void resetchannels() {
        loopv(channels) if(channels[i].inuse) freechannel(i);
        channels.shrink(0);
@@ -480,46 +468,11 @@ void clear_sound() {
        stopmusic();
        cleanupsamples();
        gamesounds.clear();
-       mapsounds.clear();
        samples.clear();
        Mix_CloseAudio();
        resetchannels();
 }
 
-void stopmapsounds() {
-       loopv(channels) if(channels[i].inuse && channels[i].ent) {
-               Mix_HaltChannel(i);
-               freechannel(i);
-       }
-}
-
-void clearmapsounds() {
-       stopmapsounds();
-       mapsounds.clear();
-}
-
-void stopmapsound(extentity *e) {
-       loopv(channels) {
-               soundchannel &chan = channels[i];
-               if(chan.inuse && chan.ent == e) {
-                       Mix_HaltChannel(i);
-                       freechannel(i);
-               }
-       }
-}
-
-void checkmapsounds() {
-       const vector<extentity *> &ents = entities::getents();
-       loopv(ents) {
-               extentity &e = *ents[i];
-               if(e.type!=ET_SOUND) continue;
-               if(camera1->o.dist(e.o) < e.attr2) {
-                       if(!(e.flags&EF_SOUND)) playsound(e.attr1, NULL, &e, SND_MAP, -1);
-               }
-               else if(e.flags&EF_SOUND) stopmapsound(&e);
-       }
-}
-
 VAR(stereo, 0, 1, 1);
 
 bool updatechannel(soundchannel &chan) {
@@ -573,8 +526,6 @@ void updatesounds() {
        if(minimized && !minimizedsounds) stopsounds();
        else {
                reclaimchannels();
-               if(mainmenu) stopmapsounds();
-               else checkmapsounds();
                syncchannels();
        }
        if(music) {
@@ -589,21 +540,9 @@ void preloadsound(int n) {
        gamesounds.preloadsound(n);
 }
 
-void preloadmapsound(int n) {
-       mapsounds.preloadsound(n);
-}
-
-void preloadmapsounds() {
-       const vector<extentity *> &ents = entities::getents();
-       loopv(ents) {
-               extentity &e = *ents[i];
-               if(e.type==ET_SOUND) mapsounds.preloadsound(e.attr1);
-       }
-}
-
-int playsound(int n, const vec *loc, extentity *ent, int flags, int loops, int fade, int chanid, int radius, int expire) {
+int playsound(int n, const vec *loc, extentity *ent, int loops, int fade, int chanid, int radius, int expire) {
        if(nosound || !soundvol || (minimized && !minimizedsounds)) return -1;
-       soundtype &sounds = ent || flags&SND_MAP ? mapsounds : gamesounds;
+       soundtype &sounds = gamesounds;
        if(!sounds.configs.inrange(n)) { conoutf(CON_WARN, "unregistered sound: %d", n); return -1; }
        soundconfig &config = sounds.configs[n];
        if(loc) {
@@ -638,14 +577,14 @@ int playsound(int n, const vec *loc, extentity *ent, int flags, int loops, int f
                }
        }
        if(fade < 0) return -1;
-       soundslot &slot = sounds.slots[config.chooseslot(flags)];
+       soundslot &slot = sounds.slots[config.chooseslot(0)];
        if(!slot.sample->chunk && !slot.sample->load()) return -1;
        chanid = -1;
        loopv(channels) if(!channels[i].inuse) { chanid = i; break; }
        if(chanid < 0 && channels.length() < maxchannels) chanid = channels.length();
        if(chanid < 0) loopv(channels) if(!channels[i].volume) { chanid = i; break; }
        if(chanid < 0) return -1;
-       soundchannel &chan = newchannel(chanid, &slot, loc, ent, flags, radius);
+       soundchannel &chan = newchannel(chanid, &slot, loc, ent, radius);
        updatechannel(chan);
        int playing = -1;
        if(fade) {
@@ -674,11 +613,11 @@ bool stopsound(int n, int chanid, int fade) {
        return true;
 }
 
-int playsoundname(const char *s, const vec *loc, int vol, int flags, int loops, int fade, int chanid, int radius, int expire) {
+int playsoundname(const char *s, const vec *loc, int vol, int loops, int fade, int chanid, int radius, int expire) {
        if(!vol) vol = 100;
        int id = gamesounds.findsound(s, vol);
        if(id < 0) id = gamesounds.addsound(s, vol);
-       return playsound(id, loc, NULL, flags, loops, fade, chanid, radius, expire);
+       return playsound(id, loc, NULL, loops, fade, chanid, radius, expire);
 }
 
 ICOMMAND(sound, "i", (int *n), playsound(*n));
index 0f7a5df329fa2e2905b92bd83d272b12feaca062..744996ecc0571344c6f7cec2545fe120101e052a 100644 (file)
@@ -223,7 +223,7 @@ static void reorients3tc(GLenum format, int blocksize, int w, int h, uchar *src,
        }
 }
 
-static void reorientrgtc(GLenum format, int blocksize, int w, int h, uchar *src, uchar *dst, bool flipx, bool flipy, bool swapxy) {
+static void reorientrgtc(int blocksize, int w, int h, uchar *src, uchar *dst, bool flipx, bool flipy, bool swapxy) {
        int bx1 = 0, by1 = 0, bx2 = min(w, 4), by2 = min(h, 4), bw = (w+3)/4, bh = (h+3)/4, stridex = blocksize, stridey = blocksize;
        if(swapxy) stridex *= bw; else stridey *= bh;
        if(flipx) { dst += (bw-1)*stridex; stridex = -stridex; bx1 += 4-bx2; bx2 = 4; }
@@ -333,19 +333,6 @@ void forcergbaimage(ImageData &s) {
        s.replace(d);
 }
 
-void swizzleimage(ImageData &s) {
-       if(s.bpp==2) {
-               ImageData d(s.w, s.h, 4);
-               readwritetex(d, s, { dst[0] = dst[1] = dst[2] = src[0]; dst[3] = src[1]; });
-               s.replace(d);
-       }
-       else if(s.bpp==1) {
-               ImageData d(s.w, s.h, 3);
-               readwritetex(d, s, { dst[0] = dst[1] = dst[2] = src[0]; });
-               s.replace(d);
-       }
-}
-
 void texreorient(ImageData &s, bool flipx, bool flipy, bool swapxy, int type = TEX_DIFFUSE) {
        ImageData d(swapxy ? s.h : s.w, swapxy ? s.w : s.h, s.bpp, s.levels, s.align, s.compressed);
        switch(s.compressed) {
@@ -373,7 +360,7 @@ void texreorient(ImageData &s, bool flipx, bool flipy, bool swapxy, int type = T
        case GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT: {
                        uchar *dst = d.data, *src = s.data;
                        loopi(s.levels) {
-                               reorientrgtc(s.compressed, s.bpp, max(s.w>>i, 1), max(s.h>>i, 1), src, dst, flipx, flipy, swapxy);
+                               reorientrgtc(s.bpp, max(s.w>>i, 1), max(s.h>>i, 1), src, dst, flipx, flipy, swapxy);
                                src += s.calclevelsize(i);
                                dst += d.calclevelsize(i);
                        }
@@ -423,8 +410,6 @@ void texoffset(ImageData &s, int xoffset, int yoffset) {
 }
 
 void texmad(ImageData &s, const vec &mul, const vec &add) {
-       if(s.bpp < 3 && (mul.x != mul.y || mul.y != mul.z || add.x != add.y || add.y != add.z))
-               swizzleimage(s);
        int maxk = min(int(s.bpp), 3);
        writetex(s,
                loopk(maxk) dst[k] = uchar(clamp(dst[k]*mul[k] + 255*add[k], 0.0f, 255.0f));
@@ -646,7 +631,7 @@ void resizetexture(int w, int h, bool mipmap, bool canreduce, GLenum target, int
        }
 }
 
-void uploadtexture(int tnum, GLenum target, GLenum internal, int tw, int th, GLenum format, GLenum type, void *pixels, int pw, int ph, int pitch, bool mipmap) {
+void uploadtexture(GLenum target, GLenum internal, int tw, int th, GLenum format, GLenum type, void *pixels, int pw, int ph, int pitch, bool mipmap) {
        int bpp = formatsize(format), row = 0, rowalign = 0;
        if(!pitch) pitch = pw*bpp;
        uchar *buf = NULL;
@@ -656,7 +641,7 @@ void uploadtexture(int tnum, GLenum target, GLenum internal, int tw, int th, GLe
        }
        else if(tw*bpp != pitch) {
                row = pitch/bpp;
-               rowalign = texalign(pixels, pitch, 1);
+               rowalign = texalign(pitch, 1);
                while(rowalign > 0 && ((row*bpp + rowalign - 1)/rowalign)*rowalign != pitch) rowalign >>= 1;
                if(!rowalign) {
                        row = 0;
@@ -667,7 +652,7 @@ void uploadtexture(int tnum, GLenum target, GLenum internal, int tw, int th, GLe
        for(int level = 0, align = 0, mw = tw, mh = th;; level++) {
                uchar *src = buf ? buf : (uchar *)pixels;
                if(buf) pitch = mw*bpp;
-               int srcalign = row > 0 ? rowalign : texalign(src, pitch, 1);
+               int srcalign = row > 0 ? rowalign : texalign(pitch, 1);
                if(align != srcalign) glPixelStorei(GL_UNPACK_ALIGNMENT, align = srcalign);
                if(row > 0) glPixelStorei(GL_UNPACK_ROW_LENGTH, row);
                glTexImage2D(target, level, internal, mw, mh, 0, format, type, src);
@@ -715,17 +700,7 @@ GLenum textarget(GLenum subtarget) {
        return subtarget;
 }
 
-const GLint *swizzlemask(GLenum format) {
-       static const GLint luminance[4] = { GL_RED, GL_RED, GL_RED, GL_ONE };
-       static const GLint luminancealpha[4] = { GL_RED, GL_RED, GL_RED, GL_GREEN };
-       switch(format) {
-               case GL_RED: return luminance;
-               case GL_RG: return luminancealpha;
-       }
-       return NULL;
-}
-
-void setuptexparameters(int tnum, void *pixels, int clamp, int filter, GLenum format, GLenum target, bool swizzle) {
+void setuptexparameters(int tnum, int clamp, int filter, GLenum format, GLenum target) {
        glBindTexture(target, tnum);
        glTexParameteri(target, GL_TEXTURE_WRAP_S, clamp&1 ? GL_CLAMP_TO_EDGE : (clamp&0x100 ? GL_MIRRORED_REPEAT : GL_REPEAT));
        glTexParameteri(target, GL_TEXTURE_WRAP_T, clamp&2 ? GL_CLAMP_TO_EDGE : (clamp&0x200 ? GL_MIRRORED_REPEAT : GL_REPEAT));
@@ -737,10 +712,6 @@ void setuptexparameters(int tnum, void *pixels, int clamp, int filter, GLenum fo
                                (bilinear ? GL_LINEAR_MIPMAP_LINEAR : GL_NEAREST_MIPMAP_LINEAR) :
                                (bilinear ? GL_LINEAR_MIPMAP_NEAREST : GL_NEAREST_MIPMAP_NEAREST)) :
                        (filter && bilinear ? GL_LINEAR : GL_NEAREST));
-       if(swizzle && hasTRG && hasTSW) {
-               const GLint *mask = swizzlemask(format);
-               if(mask) glTexParameteriv(target, GL_TEXTURE_SWIZZLE_RGBA, mask);
-       }
 }
 
 static GLenum textype(GLenum &component, GLenum &format) {
@@ -828,9 +799,9 @@ static GLenum textype(GLenum &component, GLenum &format) {
        return type;
 }
 
-void createtexture(int tnum, int w, int h, void *pixels, int clamp, int filter, GLenum component, GLenum subtarget, int pw, int ph, int pitch, bool resize, GLenum format, bool swizzle) {
+void createtexture(int tnum, int w, int h, void *pixels, int clamp, int filter, GLenum component, GLenum subtarget, int pw, int ph, int pitch, bool resize, GLenum format) {
        GLenum target = textarget(subtarget), type = textype(component, format);
-       if(filter >= 0 && clamp >= 0) setuptexparameters(tnum, pixels, clamp, filter, format, target, swizzle);
+       if(filter >= 0 && clamp >= 0) setuptexparameters(tnum, clamp, filter, format, target);
        if(!pw) pw = w;
        if(!ph) ph = h;
        int tw = w, th = h;
@@ -839,12 +810,12 @@ void createtexture(int tnum, int w, int h, void *pixels, int clamp, int filter,
                resizetexture(w, h, mipmap, false, target, 0, tw, th);
                if(mipmap) component = compressedformat(component, tw, th);
        }
-       uploadtexture(tnum, subtarget, component, tw, th, format, type, pixels, pw, ph, pitch, mipmap);
+       uploadtexture(subtarget, component, tw, th, format, type, pixels, pw, ph, pitch, mipmap);
 }
 
-void createcompressedtexture(int tnum, int w, int h, uchar *data, int align, int blocksize, int levels, int clamp, int filter, GLenum format, GLenum subtarget, bool swizzle = false) {
+void createcompressedtexture(int tnum, int w, int h, uchar *data, int align, int blocksize, int levels, int clamp, int filter, GLenum format, GLenum subtarget) {
        GLenum target = textarget(subtarget);
-       if(filter >= 0 && clamp >= 0) setuptexparameters(tnum, data, clamp, filter, format, target);
+       if(filter >= 0 && clamp >= 0) setuptexparameters(tnum, clamp, filter, format, target);
        uploadcompressedtexture(target, subtarget, format, w, h, data, align, blocksize, levels, filter > 1);
 }
 
@@ -852,10 +823,10 @@ hashnameset<Texture> textures;
 
 Texture *notexture = NULL; // used as default, ensured to be loaded
 
-static GLenum texformat(int bpp, bool swizzle = false) {
+static GLenum texformat(int bpp) {
        switch(bpp) {
-               case 1: return hasTRG && (hasTSW || !glcompat || !swizzle) ? GL_RED : GL_LUMINANCE;
-               case 2: return hasTRG && (hasTSW || !glcompat || !swizzle) ? GL_RG : GL_LUMINANCE_ALPHA;
+               case 1: return hasTRG && (hasTSW || !glcompat) ? GL_RED : GL_LUMINANCE;
+               case 2: return hasTRG && (hasTSW || !glcompat) ? GL_RG : GL_LUMINANCE_ALPHA;
                case 3: return GL_RGB;
                case 4: return GL_RGBA;
                default: return 0;
@@ -874,7 +845,7 @@ static bool alphaformat(GLenum format) {
        }
 }
 
-int texalign(const void *data, int w, int bpp) {
+int texalign(int w, int bpp) {
        int stride = w*bpp;
        if(stride&1) return 1;
        if(stride&2) return 2;
@@ -897,7 +868,6 @@ static Texture *newtexture(Texture *t, const char *rname, ImageData &s, int clam
                t->w = t->h = t->xs = t->ys = t->bpp = 0;
                return t;
        }
-       bool swizzle = !(clamp&0x10000);
        GLenum format;
        if(s.compressed) {
                format = uncompressedformat(s.compressed);
@@ -905,13 +875,8 @@ static Texture *newtexture(Texture *t, const char *rname, ImageData &s, int clam
                t->type |= Texture::COMPRESSED;
        }
        else {
-               format = texformat(s.bpp, swizzle);
+               format = texformat(s.bpp);
                t->bpp = s.bpp;
-               if(swizzle && hasTRG && !hasTSW && swizzlemask(format)) {
-                       swizzleimage(s);
-                       format = texformat(s.bpp, swizzle);
-                       t->bpp = s.bpp;
-               }
        }
        if(alphaformat(format)) t->type |= Texture::ALPHA;
        t->w = t->xs = s.w;
@@ -934,12 +899,12 @@ static Texture *newtexture(Texture *t, const char *rname, ImageData &s, int clam
                        if(t->w > 1) t->w /= 2;
                        if(t->h > 1) t->h /= 2;
                }
-               createcompressedtexture(t->id, t->w, t->h, data, s.align, s.bpp, levels, clamp, filter, s.compressed, GL_TEXTURE_2D, swizzle);
+               createcompressedtexture(t->id, t->w, t->h, data, s.align, s.bpp, levels, clamp, filter, s.compressed, GL_TEXTURE_2D);
        }
        else {
                resizetexture(t->w, t->h, mipit, canreduce, GL_TEXTURE_2D, compress, t->w, t->h);
                GLenum component = compressedformat(format, t->w, t->h, compress);
-               createtexture(t->id, t->w, t->h, s.data, clamp, filter, component, GL_TEXTURE_2D, t->xs, t->ys, s.pitch, false, format, swizzle);
+               createtexture(t->id, t->w, t->h, s.data, clamp, filter, component, GL_TEXTURE_2D, t->xs, t->ys, s.pitch, false, format);
        }
        return t;
 }
@@ -1275,9 +1240,6 @@ static bool texturedata(ImageData &d, const char *tname, Slot::Tex *tex = NULL,
                if(matchstring(cmd, len, "mirror")) {
                        if(wrap) *wrap |= 0x300;
                }
-               else if(matchstring(cmd, len, "noswizzle")) {
-                       if(wrap) *wrap |= 0x10000;
-               }
        }
        return true;
 }
@@ -1860,7 +1822,7 @@ static void mergealpha(ImageData &c, ImageData &s) {
        else { readwritergbatex(c, s, dst[3] = src[3]; ); }
 }
 
-static void addname(vector<char> &key, Slot &slot, Slot::Tex &t, bool combined = false, const char *prefix = NULL) {
+static void addname(vector<char> &key, Slot::Tex &t, bool combined = false, const char *prefix = NULL) {
        if(combined) key.add('&');
        if(prefix) { while(*prefix) key.add(*prefix++); }
        defformatstring(tname, "packages/%s", t.name);
@@ -1869,7 +1831,7 @@ static void addname(vector<char> &key, Slot &slot, Slot::Tex &t, bool combined =
 
 static void texcombine(Slot &s, int index, Slot::Tex &t, bool forceload = false) {
        vector<char> key;
-       addname(key, s, t);
+       addname(key, t);
        int texmask = 0;
        if(!forceload) switch(t.type) {
                case TEX_DIFFUSE:
@@ -1878,7 +1840,7 @@ static void texcombine(Slot &s, int index, Slot::Tex &t, bool forceload = false)
                        if(i<0) break;
                        texmask |= 1<<s.sts[i].type;
                        s.sts[i].combined = index;
-                       addname(key, s, s.sts[i], true);
+                       addname(key, s.sts[i], true);
                        break;
                }
        }
@@ -1955,17 +1917,17 @@ Texture *loadthumbnail(Slot &slot) {
        linkslotshader(slot, false);
        linkvslotshader(vslot, false);
        vector<char> name;
-       if(vslot.colorscale == vec(1, 1, 1)) addname(name, slot, slot.sts[0], false, "<thumbnail>");
+       if(vslot.colorscale == vec(1, 1, 1)) addname(name, slot.sts[0], false, "<thumbnail>");
        else {
                defformatstring(prefix, "<thumbnail:%.2f/%.2f/%.2f>", vslot.colorscale.x, vslot.colorscale.y, vslot.colorscale.z);
-               addname(name, slot, slot.sts[0], false, prefix);
+               addname(name, slot.sts[0], false, prefix);
        }
        VSlot *layer = vslot.layer ? &lookupvslot(vslot.layer, false) : NULL;
        if(layer) {
-               if(layer->colorscale == vec(1, 1, 1)) addname(name, *layer->slot, layer->slot->sts[0], true, "<layer>");
+               if(layer->colorscale == vec(1, 1, 1)) addname(name, layer->slot->sts[0], true, "<layer>");
                else {
                        defformatstring(prefix, "<layer:%.2f/%.2f/%.2f>", vslot.colorscale.x, vslot.colorscale.y, vslot.colorscale.z);
-                       addname(name, *layer->slot, layer->slot->sts[0], true, prefix);
+                       addname(name, layer->slot->sts[0], true, prefix);
                }
        }
        name.add('\0');
@@ -2248,7 +2210,7 @@ void screenshot(char *filename) {
                concatstring(buf, imageexts[format]);
        }
        ImageData image(screenw, screenh, 3);
-       glPixelStorei(GL_PACK_ALIGNMENT, texalign(image.data, screenw, 3));
+       glPixelStorei(GL_PACK_ALIGNMENT, texalign(screenw, 3));
        glReadPixels(0, 0, screenw, screenh, GL_RGB, GL_UNSIGNED_BYTE, image.data);
        saveimage(path(buf), format, image, true);
 }
index cbe3fad85f64a2ca93fab60ae262a28628f30a48..69a78d0e6a3cc0027e7ba3b39c900e1baa08cf17 100644 (file)
@@ -280,19 +280,17 @@ vec getselpos() {
 
 void entflip() {
        if(noentedit()) return;
-       int d = dimension(sel.orient);
-       float mid = sel.s[d]*sel.grid/2+sel.o[d];
-       groupeditpure(e.o[d] -= (e.o[d]-mid)*2);
+       int d = dimension(sel.orient); (void) d;
+       groupeditpure(e.o[d] -= (e.o[d]-(sel.s[d]*sel.grid/2+sel.o[d]))*2);
 }
 
 void entrotate(int *cw) {
        if(noentedit()) return;
        int d = dimension(sel.orient);
        int dd = (*cw<0) == dimcoord(sel.orient) ? R[d] : C[d];
-       float mid = sel.s[dd]*sel.grid/2+sel.o[dd];
        vec s(sel.o.v);
        groupeditpure(
-               e.o[dd] -= (e.o[dd]-mid)*2;
+               e.o[dd] -= (e.o[dd]-(sel.s[dd]*sel.grid/2+sel.o[dd]))*2;
                e.o.sub(s);
                swap(e.o[R[d]], e.o[C[d]]);
                e.o.add(s);
@@ -335,7 +333,7 @@ int entmoving = 0;
 
 void entdrag(const vec &ray) {
        if(noentedit() || !haveselent()) return;
-       float r = 0, c = 0;
+       float r = 0, c = 0; (void) r; (void) c;
        static vec v, handle;
        vec eo, es;
        int d = dimension(entorient),
@@ -459,7 +457,7 @@ static void renderentbox(const vec &eo, vec es) {
        gle::attrib(eo.x, es.y, eo.z); gle::attrib(eo.x, es.y, es.z);
 }
 
-void renderentselection(const vec &o, bool entmoving) {
+void renderentselection(bool entmoving) {
        if(noentedit()) return;
        vec eo, es;
        if(entgroup.length()) {
@@ -723,7 +721,6 @@ void entpaste() {
                keepents = max(keepents, idx+1);
        }
        keepents = 0;
-       int j = 0;
 }
 
 COMMAND(newent, "siiiii");
@@ -733,6 +730,7 @@ COMMAND(entcopy, "");
 COMMAND(entpaste, "");
 
 void entset(char *what, int *a1, int *a2, int *a3, int *a4, int *a5) {
+       (void) a1; (void) a2; (void) a3; (void) a4; (void) a5;
        if(noentedit()) return;
        int type = findtype(what);
        if(type != ET_EMPTY)
@@ -775,6 +773,7 @@ void enttype(char *type, int *numargs) {
 }
 
 void entattr(int *attr, int *val, int *numargs) {
+       (void) val;
        if(*numargs >= 2) {
                if(*attr >= 0 && *attr <= 4)
                        groupedit(
@@ -880,7 +879,6 @@ void splitocta(cube *c, int size) {
 
 void resetmap() {
        clearoverrides();
-       clearmapsounds();
        resetlightmaps();
        clearslots();
        clearparticles();
index e64e0da2f09d213bd31290b4397c3b3389d18ea8..72442202ed0e2bb786103410d178a88df70bc417 100644 (file)
@@ -718,7 +718,6 @@ bool load_world(const char *mname, const char *cname) {             // still supports all m
        preloadusedmapmodels(true);
        game::preload();
        flushpreloadedmodels();
-       preloadmapsounds();
        entitiesinoctanodes();
        initlights();
        allchanged(true);
index b4e631befd572ffaeafbc1dd52c4f79c96b5b4a7..b59dbd3679a88ce679b9d6170df710888e810419 100644 (file)
@@ -29,7 +29,7 @@ namespace ai {
        float weapmaxdist(int weap) {
                return guns[weap].range + 4;
        }
-       bool weaprange(fpsent *d, int weap, float dist) {
+       bool weaprange(int weap, float dist) {
                float mindist = weapmindist(weap), maxdist = weapmaxdist(weap);
                return dist >= mindist*mindist && dist <= maxdist*maxdist;
        }
@@ -53,16 +53,16 @@ namespace ai {
                return false;
        }
        bool canshoot(fpsent *d, fpsent *e) {
-               if(weaprange(d, d->gunselect, e->o.squaredist(d->o)) && targetable(d, e))
+               if(weaprange(d->gunselect, e->o.squaredist(d->o)) && targetable(d, e))
                        return d->ammo[d->gunselect] > 0 && lastmillis - d->lastaction >= d->gunwait;
                return false;
        }
        bool canshoot(fpsent *d) {
                return !d->ai->becareful && d->ammo[d->gunselect] > 0 && lastmillis - d->lastaction >= d->gunwait;
        }
-       bool hastarget(fpsent *d, aistate &b, fpsent *e, float yaw, float pitch, float dist) {
+       bool hastarget(fpsent *d, float yaw, float pitch, float dist) {
         // add margins of error
-               if(weaprange(d, d->gunselect, dist) || (d->skill <= 100 && !rnd(d->skill))) {
+               if(weaprange(d->gunselect, dist) || (d->skill <= 100 && !rnd(d->skill))) {
                        if(d->gunselect == GUN_FIST) return true;
                        float skew = clamp(float(lastmillis-d->ai->enemymillis)/float((d->skill*guns[d->gunselect].attackdelay/200.f)), 0.f, guns[d->gunselect].projspeed ? 0.25f : 1e16f),
                                offy = yaw-d->yaw, offp = pitch-d->pitch;
@@ -95,6 +95,7 @@ namespace ai {
                if(d->ai) DELETEP(d->ai);
        }
        void init(fpsent *d, int at, int ocn, int sk, int bn, int pm, const char *name, const char *team) {
+               (void) bn; (void) pm;
                loadwaypoints();
                fpsent *o = newclient(ocn);
                d->aitype = at;
@@ -194,7 +195,7 @@ namespace ai {
                if(d->skill <= 100) return d->health <= (111-d->skill)/4;
                return false;
        }
-       bool enemy(fpsent *d, aistate &b, const vec &pos, float guard = SIGHTMIN, int pursue = 0) {
+       bool enemy(fpsent *d, aistate &b, float guard = SIGHTMIN, int pursue = 0) {
                fpsent *t = NULL;
                vec dp = d->headpos();
                float mindist = guard*guard, bestdist = 1e16f;
@@ -232,7 +233,7 @@ namespace ai {
                return true;
        }
        bool defend(fpsent *d, aistate &b, const vec &pos, float guard, float wander, int walk) {
-               bool hasenemy = enemy(d, b, pos, wander, d->gunselect == GUN_FIST ? 1 : 0);
+               bool hasenemy = enemy(d, b, wander, d->gunselect == GUN_FIST ? 1 : 0);
                if(!walk) {
                        if(d->feetpos().squaredist(pos) <= guard*guard) {
                                b.idle = hasenemy ? 2 : 1;
@@ -288,19 +289,7 @@ namespace ai {
                if(d->ammo[GUN_GL] > 5) return true;
                return false;
        }
-       void assist(fpsent *d, aistate &b, vector<interest> &interests, bool all, bool force) {
-               loopv(players) {
-                       fpsent *e = players[i];
-                       if(e == d || (!all && e->aitype != AI_NONE) || !isteam(d->team, e->team)) continue;
-                       interest &n = interests.add();
-                       n.state = AI_S_DEFEND;
-                       n.node = e->lastnode;
-                       n.target = e->clientnum;
-                       n.targtype = AI_T_PLAYER;
-                       n.score = e->o.squaredist(d->o)/(hasgoodammo(d) ? 1e8f : (force ? 1e4f : 1e2f));
-               }
-       }
-       static void tryitem(fpsent *d, extentity &e, int id, aistate &b, vector<interest> &interests, bool force = false) {
+       static void tryitem(fpsent *d, extentity &e, int id, vector<interest> &interests) {
                float score = 0;
                switch(e.type) {
                        case I_HEALTH:
@@ -330,18 +319,18 @@ namespace ai {
                        n.node = closestwaypoint(e.o, SIGHTMIN, true);
                        n.target = id;
                        n.targtype = AI_T_ENTITY;
-                       n.score = d->feetpos().squaredist(e.o)/(force ? -1 : score);
+                       n.score = d->feetpos().squaredist(e.o)/score;
                }
        }
-       void items(fpsent *d, aistate &b, vector<interest> &interests, bool force = false) {
+       void items(fpsent *d, vector<interest> &interests) {
                loopv(entities::ents) {
                        extentity &e = *(extentity *)entities::ents[i];
                        if(!e.spawned() || e.nopickup() || !d->canpickup(e.type)) continue;
-                       tryitem(d, e, i, b, interests, force);
+                       tryitem(d, e, i, interests);
                }
        }
        static vector<int> targets;
-       bool parseinterests(fpsent *d, aistate &b, vector<interest> &interests, bool override, bool ignore) {
+       bool parseinterests(fpsent *d, aistate &b, vector<interest> &interests, bool ignore) {
                while(!interests.empty()) {
                        int q = interests.length()-1;
                        loopi(interests.length()-1) if(interests[i].score < interests[q].score) q = i;
@@ -362,12 +351,12 @@ namespace ai {
                }
                return false;
        }
-       bool find(fpsent *d, aistate &b, bool override = false) {
+       bool find(fpsent *d, aistate &b) {
                static vector<interest> interests;
                interests.setsize(0);
                if(!m_noitems) {
                        if((!m_noammo && !hasgoodammo(d)) || d->health < min(d->skill - 15, 75))
-                               items(d, b, interests);
+                               items(d, interests);
                        else {
                                static vector<int> nearby;
                                nearby.setsize(0);
@@ -375,36 +364,11 @@ namespace ai {
                                loopv(nearby) {
                                        int id = nearby[i];
                                        extentity &e = *(extentity *)entities::ents[id];
-                                       if(d->canpickup(e.type)) tryitem(d, e, id, b, interests);
-                               }
-                       }
-               }
-               if(m_teammode) assist(d, b, interests);
-               return parseinterests(d, b, interests, override);
-       }
-       bool findassist(fpsent *d, aistate &b, bool override = false) {
-               static vector<interest> interests;
-               interests.setsize(0);
-               assist(d, b, interests);
-               while(!interests.empty()) {
-                       int q = interests.length()-1;
-                       loopi(interests.length()-1) if(interests[i].score < interests[q].score) q = i;
-                       interest n = interests.removeunordered(q);
-                       bool proceed = true;
-                       switch(n.state) {
-                               case AI_S_DEFEND: { // don't get into herds {
-                                       int members = 0;
-                                       proceed = !checkothers(targets, d, n.state, n.targtype, n.target, true, &members) && members > 1;
-                                       break;
+                                       if(d->canpickup(e.type)) tryitem(d, e, id, interests);
                                }
-                               default: break;
-                       }
-                       if(proceed && makeroute(d, b, n.node)) {
-                               d->ai->switchstate(b, n.state, n.targtype, n.target);
-                               return true;
                        }
                }
-               return false;
+               return parseinterests(d, b, interests);
        }
        void damaged(fpsent *d, fpsent *e) {
                if(d->ai && canmove(d) && targetable(d, e)) { // see if this ai is interested in a grudge {
@@ -442,7 +406,7 @@ namespace ai {
        void spawned(fpsent *d) {
                if(d->ai) setup(d);
        }
-       void killed(fpsent *d, fpsent *e) {
+       void killed(fpsent *d) {
                if(d->ai) d->ai->reset();
        }
        void itemspawned(int ent) {
@@ -595,7 +559,7 @@ namespace ai {
                }
                return -1;
        }
-       bool anynode(fpsent *d, aistate &b, int len = NUMPREVNODES) {
+       bool anynode(fpsent *d, int len = NUMPREVNODES) {
                if(iswaypoint(d->lastnode)) loopk(2) {
                        d->ai->clear(k ? true : false);
                        int n = randomlink(d, d->lastnode);
@@ -662,7 +626,7 @@ namespace ai {
                        }
                }
                b.override = false;
-               return anynode(d, b);
+               return anynode(d);
        }
        void jumpto(fpsent *d, aistate &b, const vec &pos) {
                vec off = vec(pos).sub(d->feetpos()), dir(off.x, off.y, 0);
@@ -797,7 +761,7 @@ namespace ai {
                                }
                                scaleyawpitch(d->yaw, d->pitch, yaw, pitch, frame, sskew);
                                if(insight || quick) {
-                                       if(canshoot(d, e) && hastarget(d, b, e, yaw, pitch, dp.squaredist(ep))) {
+                                       if(canshoot(d, e) && hastarget(d, yaw, pitch, dp.squaredist(ep))) {
                                                d->attacking = true;
                                                d->ai->lastaction = lastmillis;
                                                result = 3;
@@ -862,7 +826,7 @@ namespace ai {
                if(targetable(d, e)) {
                        vec ep = getaimpos(d, e);
                        float dist = ep.squaredist(d->headpos());
-                       if(weaprange(d, weap, dist)) return true;
+                       if(weaprange(weap, dist)) return true;
                }
                return false;
        }
@@ -882,7 +846,7 @@ namespace ai {
                }
                return process(d, b) >= 2;
        }
-       void timeouts(fpsent *d, aistate &b) {
+       void timeouts(fpsent *d) {
                if(d->blocked) {
                        d->ai->blocktime += lastmillis-d->ai->lastrun;
                        if(d->ai->blocktime > (d->ai->blockseq+1)*1000) {
@@ -931,7 +895,7 @@ namespace ai {
                        }
                }
        }
-       void logic(fpsent *d, aistate &b, bool run) {
+       void logic(fpsent *d, aistate &b) {
                bool allowmove = canmove(d) && b.type != AI_S_WAIT;
                if(d->state != CS_ALIVE || !allowmove) d->stopmoving();
                if(d->state == CS_ALIVE) {
@@ -942,7 +906,7 @@ namespace ai {
                        if(!intermission) {
                                if(d->ragdoll) cleanragdoll(d);
                                moveplayer(d, 10, true);
-                               if(allowmove && !b.idle) timeouts(d, b);
+                               if(allowmove && !b.idle) timeouts(d);
                                if(d->quadmillis) entities::checkquad(curtime, d);
                                entities::checkitems(d);
                        }
@@ -1006,7 +970,7 @@ namespace ai {
                                        }
                                }
                        }
-                       logic(d, c, run);
+                       logic(d, c);
                        break;
                }
                if(d->ai->trywipe) d->ai->wipe();
index 40c8513a30330b6636a5f6c06c49c6aece39e921..81b1e26a1d34848ee4ad818c2cf4ea983cdb8535 100644 (file)
@@ -227,11 +227,10 @@ namespace ai {
        extern bool violence(fpsent *d, aistate &b, fpsent *e, int pursue = 0);
        extern bool patrol(fpsent *d, aistate &b, const vec &pos, float guard = SIGHTMIN, float wander = SIGHTMAX, int walk = 1, bool retry = false);
        extern bool defend(fpsent *d, aistate &b, const vec &pos, float guard = SIGHTMIN, float wander = SIGHTMAX, int walk = 1);
-       extern void assist(fpsent *d, aistate &b, vector<interest> &interests, bool all = false, bool force = false);
-       extern bool parseinterests(fpsent *d, aistate &b, vector<interest> &interests, bool override = false, bool ignore = false);
+       extern bool parseinterests(fpsent *d, aistate &b, vector<interest> &interests, bool ignore = false);
        extern void spawned(fpsent *d);
        extern void damaged(fpsent *d, fpsent *e);
-       extern void killed(fpsent *d, fpsent *e);
+       extern void killed(fpsent *d);
        extern void itemspawned(int ent);
        extern void render();
 }
index bd98625fa1f4152c5ce757ddc223ab3ab203bc1a..83aa3851fa39a3c857ffb11ff5ea66099a6751e3 100644 (file)
@@ -562,12 +562,6 @@ namespace game {
                messages.put(buf, p.length());
                return true;
        }
-       void connectattempt(const char *name, const char *password, const ENetAddress &address) {
-               copystring(connectpass, password);
-       }
-       void connectfail() {
-               memset(connectpass, 0, sizeof(connectpass));
-       }
        void gameconnect(bool _remote) {
                remote = _remote;
                if(editmode) toggleedit();
@@ -1149,11 +1143,7 @@ namespace game {
                                if(!entities::ents.inrange(i)) break;
                                entities::setspawn(i, true);
                                ai::itemspawned(i);
-                               playsound(S_ITEMSPAWN, &entities::ents[i]->o, NULL, 0, 0, 0, -1, 0, 1500);
-                               #if 0
-                               const char *name = entities::itemname(i);
-                               if(name) particle_text(entities::ents[i]->o, name, PART_TEXT, 2000, 0x32FF64, 4.0f, -8);
-                               #endif
+                               playsound(S_ITEMSPAWN, &entities::ents[i]->o, NULL, 0, 0, -1, 0, 1500);
                                int icon = entities::itemicon(i);
                                if(icon >= 0) particle_icon(vec(0.0f, 0.0f, 4.0f).add(entities::ents[i]->o), icon%4, icon/4, PART_HUD_ICON, 2000, 0xFFFFFF, 2.0f, -8);
                                break;
@@ -1378,8 +1368,8 @@ namespace game {
                        }
                        case N_ANNOUNCE: {
                                int t = getint(p);
-                               if       (t==I_QUAD) {  playsound(S_V_QUAD10, NULL, NULL, 0, 0, 0, -1, 0, 3000);  conoutf(CON_GAMEINFO, "\f2quad damage will spawn in 10 seconds!"); }
-                               else if(t==I_BOOST) { playsound(S_V_BOOST10, NULL, NULL, 0, 0, 0, -1, 0, 3000); conoutf(CON_GAMEINFO, "\f2health boost will spawn in 10 seconds!"); }
+                               if       (t==I_QUAD) {  playsound(S_V_QUAD10, NULL, NULL, 0, 0, -1, 0, 3000);  conoutf(CON_GAMEINFO, "\f2quad damage will spawn in 10 seconds!"); }
+                               else if(t==I_BOOST) { playsound(S_V_BOOST10, NULL, NULL, 0, 0, -1, 0, 3000); conoutf(CON_GAMEINFO, "\f2health boost will spawn in 10 seconds!"); }
                                break;
                        }
                        case N_NEWMAP: {
index 21d44a6d13cf6a6a3266b6721e4b6693e137c44f..656a9b0cde43944d2e83056a4c73c93c08d7772b 100644 (file)
@@ -77,17 +77,6 @@ namespace entities {
                        if(!mdl) continue;
                        preloadmodel(mdl);
                }
-               loopv(ents) {
-                       extentity &e = *ents[i];
-                       switch(e.type) {
-                               case TELEPORT:
-                                       if(e.attr2 > 0) preloadmodel(mapmodelname(e.attr2));
-                       [[fallthrough]];
-                               case JUMPPAD:
-                                       if(e.attr4 > 0) preloadmapsound(e.attr4);
-                                       break;
-                       }
-               }
        }
        void renderentities() {
                loopv(ents) {
@@ -133,7 +122,7 @@ namespace entities {
                        //particle_text(d->abovehead(), is.name, PART_TEXT, 2000, 0xFFC864, 4.0f, -8);
                        particle_icon(d->abovehead(), is.icon%4, is.icon/4, PART_HUD_ICON_GREY, 2000, 0xFFFFFF, 2.0f, -8);
                }
-               playsound(itemstats[type-I_SHELLS].sound, d!=h ? &d->o : NULL, NULL, 0, 0, 0, -1, 0, 1500);
+               playsound(itemstats[type-I_SHELLS].sound, d!=h ? &d->o : NULL, NULL, 0, 0, -1, 0, 1500);
                d->pickup(type);
                switch(type) {
                        case I_TINYARMOUR:   pwitemspicked[0]++; break;
@@ -147,11 +136,11 @@ namespace entities {
                if(d==h) switch(type) {
                        case I_BOOST:
                                conoutf(CON_GAMEINFO, "\f2you got the health boost!");
-                               playsound(S_V_BOOST, NULL, NULL, 0, 0, 0, -1, 0, 3000);
+                               playsound(S_V_BOOST, NULL, NULL, 0, 0, -1, 0, 3000);
                                break;
                        case I_QUAD:
                                conoutf(CON_GAMEINFO, "\f2you got the quad!");
-                               playsound(S_V_QUAD, NULL, NULL, 0, 0, 0, -1, 0, 3000);
+                               playsound(S_V_QUAD, NULL, NULL, 0, 0, -1, 0, 3000);
                                break;
                }
        }
@@ -160,11 +149,11 @@ namespace entities {
                if(ents.inrange(tp) && ents[tp]->type == TELEPORT) {
                        extentity &e = *ents[tp];
                        if(e.attr4 >= 0) {
-                               int snd = S_TELEPORT, flags = 0;
-                               if(e.attr4 > 0) { snd = e.attr4; flags = SND_MAP; }
+                               int snd = S_TELEPORT;
+                               if(e.attr4 > 0) snd = e.attr4;
                                fpsent *h = followingplayer(player1);
-                               playsound(snd, d==h ? NULL : &e.o, NULL, flags);
-                               if(d!=h && ents.inrange(td) && ents[td]->type == TELEDEST) playsound(snd, &ents[td]->o, NULL, flags);
+                               playsound(snd, d==h ? NULL : &e.o, NULL);
+                               if(d!=h && ents.inrange(td) && ents[td]->type == TELEDEST) playsound(snd, &ents[td]->o, NULL);
                        }
                }
                if(local && d->clientnum >= 0) {
@@ -182,9 +171,9 @@ namespace entities {
                if(ents.inrange(jp) && ents[jp]->type == JUMPPAD) {
                        extentity &e = *ents[jp];
                        if(e.attr4 >= 0) {
-                               int snd = S_JUMPPAD, flags = 0;
-                               if(e.attr4 > 0) { snd = e.attr4; flags = SND_MAP; }
-                               playsound(snd, d == followingplayer(player1) ? NULL : &e.o, NULL, flags);
+                               int snd = S_JUMPPAD;
+                               if(e.attr4 > 0) snd = e.attr4;
+                               playsound(snd, d == followingplayer(player1) ? NULL : &e.o, NULL);
                        }
                }
                if(local && d->clientnum >= 0) {
index eadb2c8fa15826c04b164dc5c6281e53e4dc2451..d167582294784b65270a5804f1f057d816ee616d 100644 (file)
@@ -353,7 +353,7 @@ namespace game {
                        }
                }
                deathstate(d);
-               ai::killed(d, actor);
+               ai::killed(d);
        }
        void timeupdate(int secs) {
                server::timeupdate(secs);
@@ -411,7 +411,6 @@ namespace game {
                if(notify && d->name[0]) conoutf("\f4leave:\f7 %s", colorname(d));
                removeweapons(d);
                removetrackedparticles(d);
-               removetrackeddynlights(d);
                players.removeobj(d);
                DELETEP(clients[cn]);
                cleardynentcache();
@@ -527,7 +526,7 @@ namespace game {
        }
        VARP(teamsounds, 0, 1, 1);
        void teamsound(bool sameteam, int n, const vec *loc) {
-               playsound(n, loc, NULL, teamsounds ? (m_teammode && sameteam ? SND_USE_ALT : SND_NO_ALT) : 0);
+               playsound(n, loc, NULL);
        }
        void teamsound(fpsent *d, int n, const vec *loc) {
                teamsound(isteam(d->team, player1->team), n, loc);
index 5b95c5a84a96b427f534997445ce5a4055be72c5..c76498a9d4813316ceb4f0fab1790bfdc2f30b9e 100644 (file)
@@ -538,6 +538,7 @@ namespace game {
        // client
        extern bool connected, remote, demoplayback;
        extern string servinfo;
+       extern string connectpass;
        extern vector<uchar> messages;
        extern int parseplayer(const char *arg);
        extern void ignore(int cn);
index dacdcd9db55d3195a04d0c96dc554523ed426f56..fff917e2d3725d135c04b1a1b0ca36c260f79326 100644 (file)
@@ -253,13 +253,6 @@ namespace game {
                sway.z = swayup*(fabs(sinf(steps)) - 1);
                sway.add(swaydir).add(d->o);
                if(!hudgunsway) sway = d->o;
-
-#if 0
-               if(player1->state!=CS_DEAD && player1->quadmillis) {
-                       float t = 0.5f + 0.5f*sinf(2*M_PI*lastmillis/1000.0f);
-                       color.y = color.y*(1-t) + t;
-               }
-#endif
                const playermodelinfo &mdl = getplayermodelinfo(d);
                defformatstring(gunname, "%s/%s", hudgunsdir[0] ? hudgunsdir : mdl.hudguns, guns[d->gunselect].file);
                if((m_teammode || teamskins) && teamhudguns)
index 2856e53b0253b63a196e7a442f67e1c6b9dfb3a2..341b050a11e12e32f5c179206953538c37d751fc 100644 (file)
@@ -774,7 +774,7 @@ namespace server {
        void sendwelcome(clientinfo *ci);
        void setupdemorecord() {
                if(!m_mp(gamemode) || m_edit) return;
-               demotmp = opentempfile("demorecord", "w+b");
+               demotmp = opentempfile();
                if(!demotmp) return;
                stream *f = opengzfile(NULL, "wb", demotmp);
                if(!f) { DELETEP(demotmp); return; }
@@ -2155,7 +2155,7 @@ namespace server {
                clientinfo *ci = getinfo(sender);
                if(ci->state.state==CS_SPECTATOR && !ci->privilege && !ci->local) return;
                if(mapdata) DELETEP(mapdata);
-               mapdata = opentempfile("mapdata", "w+b");
+               mapdata = opentempfile();
                if(!mapdata) { sendf(sender, 1, "ris", N_SERVMSG, "failed to open temporary file for map"); return; }
                mapdata->write(data, len);
                sendservmsgf("[%s sent a map to server, \"/getmap\" to receive it]", colorname(ci));
index c4861106ceb56ba9acea97db0adaad15988bb2f4..30d2da8d65a0cbadca584acac49036f29e0780a1 100644 (file)
@@ -305,9 +305,6 @@ namespace game {
                if((gun==GUN_RL || gun==GUN_GL) && explodebright < 1) color = vec::hexcolor(color).mul(explodebright).tohexcolor();
                /// REPLACE THIS SHIT WITH SMOKE AND FIRE EFFECT LIKE IN XONOTIC
                //~particle_fireball(v, guns[gun].exprad, gun!=GUN_GL ? PART_EXPLOSION : PART_EXPLOSION_BLUE, gun!=GUN_GL ? -1 : int((guns[gun].exprad-4.0f)*15), color, 4.0f);
-               if(gun==GUN_RL) adddynlight(v, 1.15f*guns[gun].exprad, vec(2, 1.5f, 1), 700, 100, 0, guns[gun].exprad/2, vec(1, 0.75f, 0.5f));
-               else if(gun==GUN_GL) adddynlight(v, 1.15f*guns[gun].exprad, vec(0.5f, 1.5f, 2), 600, 100, 0, 8, vec(0.25f, 1, 1));
-               else adddynlight(v, 1.15f*guns[gun].exprad, vec(2, 1.5f, 1), 700, 100);
                if(!local) return;
                int numdyn = numdynents();
                loopi(numdyn) {
@@ -431,7 +428,6 @@ namespace game {
                                        particle_flare(hudgunorigin(gun, from, rays[i], d), rays[i], 300, PART_STREAK, 0xFFC864, 0.28f);
                                        if(!local) adddecal(DECAL_BULLET, rays[i], vec(from).sub(rays[i]).safenormalize(), 2.0f);
                                }
-                               if(muzzlelight) adddynlight(hudgunorigin(gun, d->o, to, d), 30, vec(0.5f, 0.375f, 0.25f), 100, 100, DL_FLASH, 0, vec(0, 0, 0), d);
                                break;
                        }
                        case GUN_CG:
@@ -443,7 +439,6 @@ namespace game {
                                if(muzzleflash && d->muzzle.x >= 0)
                                        particle_flare(d->muzzle, d->muzzle, gun==GUN_CG ? 100 : 200, PART_MUZZLE_FLASH1, 0xFFFFFF, gun==GUN_CG ? 2.25f : 1.25f, d);
                                if(!local) adddecal(DECAL_BULLET, to, vec(from).sub(to).safenormalize(), 2.0f);
-                               if(muzzlelight) adddynlight(hudgunorigin(gun, d->o, to, d), gun==GUN_CG ? 30 : 15, vec(0.5f, 0.375f, 0.25f), gun==GUN_CG ? 50 : 100, gun==GUN_CG ? 50 : 100, DL_FLASH, 0, vec(0, 0, 0), d);
                                break;
                        }
                        case GUN_RL:
@@ -460,7 +455,6 @@ namespace game {
                                up.z += dist/8;
                                if(muzzleflash && d->muzzle.x >= 0)
                                        particle_flare(d->muzzle, d->muzzle, 200, PART_MUZZLE_FLASH2, 0xFFFFFF, 1.5f, d);
-                               if(muzzlelight) adddynlight(hudgunorigin(gun, d->o, to, d), 20, vec(0.5f, 0.375f, 0.25f), 100, 100, DL_FLASH, 0, vec(0, 0, 0), d);
                                newbouncer(from, up, local, id, d, BNC_GRENADE, guns[gun].ttl, guns[gun].projspeed);
                                break;
                        }
@@ -472,7 +466,6 @@ namespace game {
                                if(muzzleflash && d->muzzle.x >= 0)
                                        particle_flare(d->muzzle, d->muzzle, 150, PART_MUZZLE_FLASH3, 0xFFFFFF, 1.25f, d);
                                if(!local) adddecal(DECAL_BULLET, to, vec(from).sub(to).safenormalize(), 3.0f);
-                               if(muzzlelight) adddynlight(hudgunorigin(gun, d->o, to, d), 25, vec(0.5f, 0.375f, 0.25f), 75, 75, DL_FLASH, 0, vec(0, 0, 0), d);
                                break;
                }
                bool looped = false;
@@ -483,7 +476,7 @@ namespace game {
                        case S_CHAINSAW_ATTACK:
                                if(d->attacksound >= 0) looped = true;
                                d->attacksound = sound;
-                               d->attackchan = playsound(sound, d==h ? NULL : &d->o, NULL, 0, -1, 100, d->attackchan);
+                               d->attackchan = playsound(sound, d==h ? NULL : &d->o, NULL, -1, 100, d->attackchan);
                                break;
                        default:
                                playsound(sound, d==h ? NULL : &d->o);
@@ -504,13 +497,6 @@ namespace game {
                        d.mul(min(newdist, dist)).add(owner->o);
                }
        }
-       void dynlighttrack(physent *owner, vec &o, vec &hud) {
-               if(owner->type!=ENT_PLAYER && owner->type!=ENT_AI) return;
-               fpsent *pl = (fpsent *)owner;
-               if(pl->muzzle.x < 0 || pl->lastattackgun != pl->gunselect) return;
-               o = pl->muzzle;
-               hud = owner == followingplayer(player1) ? vec(pl->o).add(vec(0, 0, 2)) : pl->muzzle;
-       }
        float intersectdist = 1e16f;
        bool intersect(dynent *d, const vec &from, const vec &to, float &dist) {   // if lineseg hits entity bounding box {
                vec bottom(d->o), top(d->o);
@@ -609,21 +595,6 @@ namespace game {
                if(d->gunselect == GUN_PISTOL && d->ai) d->gunwait += int(d->gunwait*(((101-d->skill)+rnd(111-d->skill))/100.f));
                d->totalshots += guns[d->gunselect].damage*(d->quadmillis ? 4 : 1)*guns[d->gunselect].rays;
        }
-       void adddynlights() {
-               loopv(projs) {
-                       projectile &p = projs[i];
-                       if(p.gun!=GUN_RL) continue;
-                       vec pos(p.o);
-                       pos.add(vec(p.offset).mul(p.offsetmillis/float(OFFSETMILLIS)));
-                       adddynlight(pos, 20, vec(1, 0.75f, 0.5f));
-               }
-               loopv(bouncers) {
-                       bouncer &bnc = *bouncers[i];
-                       if(bnc.bouncetype!=BNC_GRENADE) continue;
-                       vec pos = bnc.offsetpos();
-                       adddynlight(pos, 8, vec(0.25f, 1, 1));
-               }
-       }
        static const char * const projnames[2] = { "projectiles/grenade", "projectiles/rocket" };
        void preloadbouncers() {
                loopi(sizeof(projnames)/sizeof(projnames[0])) preloadmodel(projnames[i]);
@@ -680,7 +651,7 @@ namespace game {
                if(gun >= 0 && gun < NUMGUNS &&
                   d->clientnum >= 0 && d->state == CS_ALIVE &&
                   d->lastattackgun == gun && lastmillis - d->lastaction < guns[gun].attackdelay + 50) {
-                       d->attackchan = playsound(d->attacksound, local ? NULL : &d->o, NULL, 0, -1, -1, d->attackchan);
+                       d->attackchan = playsound(d->attacksound, local ? NULL : &d->o, NULL, -1, -1, d->attackchan);
                        if(d->attackchan < 0) d->attacksound = -1;
                }
                else d->stopattacksound();
@@ -698,12 +669,12 @@ namespace game {
                if(d->idlesound != sound) {
                        if(d->idlesound >= 0) d->stopidlesound();
                        if(sound >= 0) {
-                               d->idlechan = playsound(sound, local ? NULL : &d->o, NULL, 0, -1, 100, d->idlechan, radius);
+                               d->idlechan = playsound(sound, local ? NULL : &d->o, NULL, -1, 100, d->idlechan, radius);
                                if(d->idlechan >= 0) d->idlesound = sound;
                        }
                }
                else if(sound >= 0) {
-                       d->idlechan = playsound(sound, local ? NULL : &d->o, NULL, 0, -1, -1, d->idlechan, radius);
+                       d->idlechan = playsound(sound, local ? NULL : &d->o, NULL, -1, -1, d->idlechan, radius);
                        if(d->idlechan < 0) d->idlesound = -1;
                }
        }
index bbd8878c0a3a756b85081ff34a58978c499e122b..c411862d4a6a6457e263fd64d6e137270963010e 100644 (file)
@@ -530,20 +530,11 @@ int main(int argc, char **argv)\r {
                }\r
        }\r
        if(rh > 0) numtex++;\r
-#if 0\r
-       if(sw <= 0)\r {
-\r
-               if(FT_Load_Char(f, ' ', FT_LOAD_DEFAULT))\r
-                       fatal("cube2font: failed loading space character");\r
-               sw = (f->glyph->advance.x+0x3F)>>6;\r
-       }\r
-#endif\r
        if(sh <= 0) sh = y2 - y1;\r
        if(sw <= 0) sw = sh/3;\r
        writetexs(argv[2], chars, numchars, numtex, tw, th);\r
        writecfg(argv[2], chars, numchars, x1, y1, x2, y2, sw, sh, argc, argv);\r
-       for(i = 0; i < numchars; i++)\r {
-\r
+       for(i = 0; i < numchars; i++) {\r
                if(chars[i].alpha != chars[i].color) FT_Done_Glyph((FT_Glyph)chars[i].alpha);\r
                FT_Done_Glyph((FT_Glyph)chars[i].color);\r
        }\r
index edc9e04236d498f894d29c016a45349c5160f709..8d33921c3f4398e5393e3387540bee9dca3c4ac1 100644 (file)
@@ -359,12 +359,3 @@ extern PFNGLBINDVERTEXARRAYPROC    glBindVertexArray_;
 extern PFNGLDELETEVERTEXARRAYSPROC glDeleteVertexArrays_;
 extern PFNGLGENVERTEXARRAYSPROC        glGenVertexArrays_;
 extern PFNGLISVERTEXARRAYPROC    glIsVertexArray_;
-
-#ifndef GL_ARB_texture_swizzle
-#define GL_ARB_texture_swizzle 1
-#define GL_TEXTURE_SWIZZLE_R                     0x8E42
-#define GL_TEXTURE_SWIZZLE_G                     0x8E43
-#define GL_TEXTURE_SWIZZLE_B                     0x8E44
-#define GL_TEXTURE_SWIZZLE_A                     0x8E45
-#define GL_TEXTURE_SWIZZLE_RGBA                   0x8E46
-#endif
index 3c52e1e692c2181ad962767e8afaf0ed0cc064cf..58698ab15ee54aaaeb92a9cce75f4a591ae3e580 100644 (file)
@@ -26,7 +26,7 @@ enum { // cube empty-space materials {
 };
 
 extern void lightent(extentity &e, float height = 8.0f);
-extern void lightreaching(const vec &target, vec &color, vec &dir, bool fast = false, extentity *e = 0, float ambient = 0.4f);
+extern void lightreaching(const vec &target, vec &color, vec &dir, extentity *e = 0, float ambient = 0.4f);
 extern entity *brightestlight(const vec &target, const vec &dir);
 
 enum { RAY_BB = 1, RAY_POLY = 3, RAY_ALPHAPOLY = 7, RAY_ENTS = 9, RAY_CLIPMAT = 16, RAY_SKIPFIRST = 32, RAY_EDITMAT = 64, RAY_SHADOW = 128, RAY_PASS = 256 };
@@ -259,10 +259,6 @@ enum {
        DL_FLASH  = 1<<2
 };
 
-extern void adddynlight(const vec &o, float radius, const vec &color, int fade = 0, int peak = 0, int flags = 0, float initradius = 0, const vec &initcolor = vec(0, 0, 0), physent *owner = NULL);
-extern void dynlightreaching(const vec &target, vec &color, vec &dir, bool hud = false);
-extern void removetrackeddynlights(physent *owner = NULL);
-
 // rendergl
 extern physent *camera1;
 extern vec worldpos, camdir, camright, camup;
@@ -363,8 +359,8 @@ enum {
        SND_USE_ALT = 1<<2
 };
 
-extern int playsound(int n, const vec *loc = NULL, extentity *ent = NULL, int flags = 0, int loops = 0, int fade = 0, int chanid = -1, int radius = 0, int expire = -1);
-extern int playsoundname(const char *s, const vec *loc = NULL, int vol = 0, int flags = 0, int loops = 0, int fade = 0, int chanid = -1, int radius = 0, int expire = -1);
+extern int playsound(int n, const vec *loc = NULL, extentity *ent = NULL, int loops = 0, int fade = 0, int chanid = -1, int radius = 0, int expire = -1);
+extern int playsoundname(const char *s, const vec *loc = NULL, int vol = 0, int loops = 0, int fade = 0, int chanid = -1, int radius = 0, int expire = -1);
 extern void preloadsound(int n);
 extern void preloadmapsound(int n);
 extern bool stopsound(int n, int chanid, int fade = 0);
index 4b0e933685c90de82bf7b507465feba706047ce5..bb69eb9fb0e7bb924ad304b219d5b2bccd8fd2d3 100644 (file)
@@ -14,10 +14,9 @@ namespace entities {
 }
 
 namespace game {
+       extern string connectpass;
        extern void gamedisconnect(bool cleanup);
        extern void parsepacketclient(int chan, packetbuf &p);
-       extern void connectattempt(const char *name, const char *password, const ENetAddress &address);
-       extern void connectfail();
        extern void gameconnect(bool _remote);
        extern bool allowedittoggle();
        extern void edittoggled(bool on);
@@ -66,9 +65,7 @@ namespace game {
        extern bool allowthirdperson(bool msg = false);
        extern bool detachcamera();
        extern bool collidecamera();
-       extern void adddynlights();
        extern void particletrack(physent *owner, vec &o, vec &d);
-       extern void dynlighttrack(physent *owner, vec &o, vec &hud);
        extern int maxsoundradius(int n);
        extern bool serverinfostartcolumn(g3d_gui *g, int i);
        extern void serverinfoendcolumn(g3d_gui *g, int i);
index 3a5c6e238e3b2131401e30161b24bcc4cb47413c..1bb98ff4d14af00ddb2a799de3b5a7b3132391f9 100644 (file)
@@ -298,9 +298,13 @@ char *path(char *s) {
 
 char *path(const char *s, bool copy) {
        static string tmp;
-       copystring(tmp, s);
-       path(tmp);
-       return tmp;
+       if (copy) {
+               copystring(tmp, s);
+               path(tmp);
+               return tmp;
+       } else {
+               return (char *) s;
+       }
 }
 
 const char *parentdir(const char *directory) {
@@ -406,6 +410,7 @@ static size_t rwopswrite(SDL_RWops *rw, const void *buf, size_t size, size_t nme
 }
 
 static int rwopsclose(SDL_RWops *rw) {
+       (void) rw;
        return 0;
 }
 
@@ -465,7 +470,7 @@ struct filestream : stream {
                file = fopen(name, mode);
                return file!=NULL;
        }
-       bool opentemp(const char *name, const char *mode) {
+       bool opentemp() {
                if(file) return false;
                file = tmpfile();
                return file!=NULL;
@@ -854,10 +859,9 @@ stream *openfile(const char *filename, const char *mode) {
        return openrawfile(filename, mode);
 }
 
-stream *opentempfile(const char *name, const char *mode) {
-       const char *found = findfile(name, mode);
+stream *opentempfile() {
        filestream *file = new filestream;
-       if(!file->opentemp(found ? found : name, mode)) { delete file; return NULL; }
+       if(!file->opentemp()) { delete file; return NULL; }
        return file;
 }
 
index 6e7eeab806b7b9e1bd7c50b58995907401312b5f..44be57d06867cbab36aaca990af62d1801e80663 100644 (file)
@@ -758,7 +758,7 @@ template<class T> struct hashnameset : hashbase<hashnameset<T>, T, const char *,
        template<class U> static inline const char *getkey(const U &elem) { return elem.name; }
        template<class U> static inline const char *getkey(U *elem) { return elem->name; }
        static inline T &getdata(T &elem) { return elem; }
-       template<class K> static inline void setkey(T &elem, const K &key) {}
+       template<class K> static inline void setkey(T &, const K &) {}
        template<class V>
        T &add(const V &elem) {
                return basetype::access(getkey(elem), elem);
@@ -1023,7 +1023,7 @@ extern bool findzipfile(const char *filename);
 extern stream *openrawfile(const char *filename, const char *mode);
 extern stream *openzipfile(const char *filename, const char *mode);
 extern stream *openfile(const char *filename, const char *mode);
-extern stream *opentempfile(const char *filename, const char *mode);
+extern stream *opentempfile();
 extern stream *opengzfile(const char *filename, const char *mode, stream *file = NULL, int level = Z_BEST_COMPRESSION);
 extern stream *openutf8file(const char *filename, const char *mode, stream *file = NULL);
 extern char *loadfile(const char *fn, size_t *size, bool utf8 = true);
index 98ac8fbe9d308a7323dd34875584c0f8141a8bf4..d3b7e21aff27aea0815644b128d79a8998bd5141 100644 (file)
@@ -88,7 +88,7 @@ static bool findzipdirectory(FILE *f, zipdirectoryheader &hdr) {
        return true;
 }
 
-static bool readzipdirectory(const char *archname, FILE *f, int entries, int offset, uint size, vector<zipfile> &files) {
+static bool readzipdirectory(FILE *f, int entries, int offset, uint size, vector<zipfile> &files) {
        uchar *buf = new (false) uchar[size], *src = buf;
        if(!buf || fseek(f, offset, SEEK_SET) < 0 || fread(buf, 1, size, f) != size) { delete[] buf; return false; }
        loopi(entries) {
@@ -230,7 +230,7 @@ bool addzip(const char *name, const char *mount = NULL, const char *strip = NULL
        }
        zipdirectoryheader h;
        vector<zipfile> files;
-       if(!findzipdirectory(f, h) || !readzipdirectory(pname, f, h.entries, h.offset, h.size, files)) {
+       if(!findzipdirectory(f, h) || !readzipdirectory(f, h.entries, h.offset, h.size, files)) {
                conoutf(CON_ERROR, "could not read directory in zip %s", pname);
                fclose(f);
                return false;