diff --git a/config/menus_edit.cfg b/config/menus_edit.cfg index 60a660ff..b0954fe7 100644 --- a/config/menus_edit.cfg +++ b/config/menus_edit.cfg @@ -20,8 +20,6 @@ menuitem "Deleted entities" [ showmenu "deleted entities" ] menuitem "Help?" [ echo "\f2Please read the AssaultCube README which has a detailed guide on mapediting..." ] -tempalias tmp_cradius 12 - //Lighting menu. newmenu Lighting @@ -29,11 +27,6 @@ menuitem "Add white lights " [ showmenu [White light] ] menuitem "Add coloured lights " [ showmenu [Coloured light] ] menuitem "" -1 menuitemcheckbox "Enable fullbright: " "$fullbright" [ fullbright $arg1 ] -menuitem "" -1 -menuitem "Random coloured light: " -1 -menuitemtextinput "Radius: " [ result $tmp_cradius ] [ if (&& (! (> $arg1 32)) (! (< $arg1 1))) [ tmp_cradius = $arg1 ] [ echo "\f3Error: \f2" $arg1 "\f5is not a valid radius for a light entity." ] ] -menuitem "Place random light..." [ gencl $tmp_cradius ] -menuitem "Update random light..." gencl wlight = 1; wlight1 = 1 diff --git a/config/menus_multiplayer.cfg b/config/menus_multiplayer.cfg index a3d528fc..1905dd68 100644 --- a/config/menus_multiplayer.cfg +++ b/config/menus_multiplayer.cfg @@ -95,7 +95,7 @@ menuitem "\f2\t\t [ Connect ]\t\t\t" [ connect $cc1 $cc2 $cc3 ] // Connect to a menu as admin. newmenu [Admin connect] -menuinit [ tempalias acc1 []; tempalias acc2 []; tempalias acc3 []; echo (red)To use this menu to connect as administrator, you will need to know the admin password for the server. ] // Resets the aliases +menuinit [ tempalias acc1 []; tempalias acc2 []; tempalias acc3 []; echo "\f3To use this menu to connect as administrator, you will need to know the admin password for the server." ] // Resets the aliases menuitemtextinput "Server IP/DNS: \t\t" [] [ acc1 = $arg1 ] [] 255 menuitemtextinput "Server port (optional):\t" [] [ acc2 = $arg1 ] [] 6 menuitemtextinput "Server admin password: \t" [] [ acc3 = $arg1 ] [] 128 1 @@ -201,7 +201,7 @@ const addfavcatmenu [ menuitemvar (concatword "result $" sbfavourite_ $arg1 _desc " (concatword <\fs $" sbfavourite_ $arg1 _tag " \fr>)") (concatword "showmenu [favourites " $i "]") ] newmenu (concat favourites $i) - menuitemvar ( concatword "concat " "Category name: " (c 2) (at (listfavcats) (- $i 1)) ) + menuitemvar ( concatword "concat " "Category name: \f2" (at (listfavcats) (- $i 1)) ) menuitem [] -1 menuitemtextinput [Tag: ] (concatword "result $" sbfavourite_ $arg1 _tag) (concatword sbfavourite_ $arg1 _tag " = $arg1") [] 15 menuitemtextinput [Description: ] (concatword "result $" sbfavourite_ $arg1 _desc) (concatword sbfavourite_ $arg1 _desc " = $arg1") [] 45 diff --git a/config/menus_settings.cfg b/config/menus_settings.cfg index a44e2fdd..6b0d7bb7 100644 --- a/config/menus_settings.cfg +++ b/config/menus_settings.cfg @@ -241,7 +241,7 @@ const new_sound_quality [ newmenu [Reset settings] menuinit [ resetyes = 0 ] // Ensures this menu works correctly. menuitemcheckbox [Yes, reset all settings: ] [ resetyes = 1 ] [ resetyes = $arg1 ] -menuitem "\f2 [ Apply! ] " [ if $resetyes [ resetcfg 1; quit ] [ showmenu [] ] ] [ echo (c 3)If the above option is ticked, AssaultCube will now quit and your settings will be reset. ] // If checkbox is ticked, reset settings and quit, otherwise, close menus. +menuitem "\f2 [ Apply! ] " [ if $resetyes [ resetcfg 1; quit ] [ showmenu [] ] ] [ echo "\f3If the above option is ticked, AssaultCube will now quit and your settings will be reset." ] // If checkbox is ticked, reset settings and quit, otherwise, close menus. newmenu Keyboard @@ -273,7 +273,7 @@ menuitemkeyinput [Drop flag: ] dropflag menuitemkeyinput [Fullscreen: ] fullscreentoggle menuitemkeyinput [Enter edit mode: ] edittoggle menuitem [] -1 -menuitemtextinput [Lookup a keybind: ] [] [ echo []; echo (concatword (c 9) [Contents of keybind ] $arg1 :); echo (keybind $arg1) ] [] 256 +menuitemtextinput [Lookup a keybind: ] [] [ echo []; echo (concatword "\f9Contents of keybind " $arg1 :); echo (keybind $arg1) ] [] 256 menuitem [Alternate edit binds...] [ showmenu [Alternate edit binds] ] menuitem [Edit mode keys...] [ showmenu [Editing keys] ] menuitem [Spectate mode keys...] [ showmenu [Spectating keys] ] @@ -326,7 +326,7 @@ menuinit [ newmenu [Alternate edit binds] menuitem [Back] [ closecurmenu ] -menuitem [Click to use alternate edit binds] [ exec config/opt/alternateeditbinds.cfg; closecurmenu ] [ echo (red) See config/opt/alternateeditbinds.cfg ] +menuitem [Click to use alternate edit binds] [ exec config/opt/alternateeditbinds.cfg; closecurmenu ] [ echo "\f3See config/opt/alternateeditbinds.cfg" ] newmenu [Reset Binds] menuitemcheckbox [Yes, reset all binds: ] [ resetbindsyes = 0 ] [ resetbindsyes = $arg1 ] @@ -475,7 +475,7 @@ menuitemslider [Custom player skins: ] 0 2 "$hidecustomskins" 1 ["Always show" " menuitem [] -1 menuitemcheckbox [Reduced violence mode: ] "$poniesmodeon" [ reducedviolencemode $arg1 ] menuitemslider [Gib gore: ] 0 4 "$__gibsgore" 1 [Off Normal Good Messy Unrealistic] [ gibsgore $arg1 ] -menuitemslider [Name highlight color: ] 0 9 "$nickhighlight" 1 [ "\f0green \f5(default)" "\f1blue" "\f2yellow" "\f3red" "\f4gray" "white" "\f6dark brown" "\f7dark red" "\f8purple" "\f9orange" ] [ nickhighlight = $arg1; HIGHLIGHT = (c $nickhighlight) ] +menuitemslider [Name highlight color: ] 0 9 "$nickhighlight" 1 [ "\f0green \f5(default)" "\f1blue" "\f2yellow" "\f3red" "\f4gray" "white" "\f6dark brown" "\f7dark red" "\f8purple" "\f9orange" ] [ nickhighlight = $arg1; HIGHLIGHT = (concatword "\f" $nickhighlight) ] menuitemcheckbox [Show scores on death: ] "$showscoresondeath" [ showscoresondeath $arg1 ] menuitem [Change to the enemy team] changeteam menuitem [Change weapon...] [ showmenu Weapons ] @@ -740,7 +740,7 @@ muteitem [Awesome (1)] 97 muteitem [Awesome (2)] 98 newmenu [Kill Messages] -menuitemvar [concat (orange)Frag messages: ] [] [] +menuitem "\f9Frag messages: " -1 menuitemtextinput [Pistol: ] [fragmessage 1] [ fragmessage 1 $arg1 ] [] 15 menuitemtextinput [Carbine: ] [fragmessage 2] [ fragmessage 2 $arg1 ] [] 15 menuitemtextinput [Shotgun: ] [fragmessage 3] [ fragmessage 3 $arg1 ] [] 15 @@ -750,7 +750,7 @@ menuitemtextinput [AR: ] [fragmessage 6] [ fragmessage 6 $arg1 ] [] 15 menuitemtextinput [CPistol: ] [fragmessage 7] [ fragmessage 7 $arg1 ] [] 15 menuitemtextinput [Akimbo: ] [fragmessage 9] [ fragmessage 9 $arg1 ] [] 15 menuitem [] -1 -menuitemvar [concat (orange)Gib messages: ] [] [] +menuitem "\f9Gib messages: " -1 menuitemtextinput [Knife: ] [gibmessage 0] [ gibmessage 0 $arg1 ] [] 15 menuitemtextinput [Shotgun: ] [gibmessage 3] [ gibmessage 3 $arg1 ] [] 15 menuitemtextinput [Sniper: ] [gibmessage 5] [ gibmessage 5 $arg1 ] [] 15 diff --git a/config/opt/alternateeditbinds.cfg b/config/opt/alternateeditbinds.cfg index d4ce4ce5..edc2996d 100644 --- a/config/opt/alternateeditbinds.cfg +++ b/config/opt/alternateeditbinds.cfg @@ -1,5 +1,5 @@ // Alternate edit binds -echo (red) "Bound COMMA, F, H and K to the alternate edit functions. Reset keybinds to return to default binds" +echo "\f3Bound COMMA, F, H and K to the alternate edit functions. Reset keybinds to return to default binds" // Directional equalizing - look up to level the ceiling selection, look down to level the floor selection editbind COMMA [ if (= $flrceil 0) [ equalize 0 ] [ if (= $flrceil 2) [ equalize 2 ] ] ] diff --git a/config/opt/autosave.cfg b/config/opt/autosave.cfg index e3ec13f3..5e648daa 100644 --- a/config/opt/autosave.cfg +++ b/config/opt/autosave.cfg @@ -18,7 +18,7 @@ const execAutoSave [ if (|| (!= $numAutoSaveBackups $numAutoSaves) (= $numAutoSaveBackups 0)) [ mapbackupsonsave 0 ] [ numAutoSaves = 0 ] // Temporarily turn off map backups to avoid clutter. savemap (curmap) mapbackupsonsave (pop oldmapbackups) - echo (blue)The map was automatically saved. (white)Next auto-save in (divf $timeBetAutoSaves 60000) minutes. + echo "\f1The map was automatically saved. \f5Next auto-save in" (divf $timeBetAutoSaves 60000) minutes. ] const doAutoSave [ diff --git a/config/opt/compatibility.cfg b/config/opt/compatibility.cfg index 4aa41291..c8987bd6 100644 --- a/config/opt/compatibility.cfg +++ b/config/opt/compatibility.cfg @@ -37,3 +37,5 @@ const orderscorecolumns [ ] ] +// Helper aliases for easy color insertion. (e.g. echo (red)Hello (blue)world! (white)My fov today is: (orange) $fov) +loop k 10 [ const (at [green blue yellow red gray white dbrown dred purple orange] $k) (format [if (= $arg1 -1) [ result %1 ] [ result %2 ]] $k (concatword "\f" $k)) ] diff --git a/config/opt/faq.cfg b/config/opt/faq.cfg index 017fe536..233e33ed 100644 --- a/config/opt/faq.cfg +++ b/config/opt/faq.cfg @@ -88,18 +88,14 @@ faqAnswer_8 = [ newmenu faq loop i (listlen $faqQuestions) [ - if (= (mod $i 2) 0) [ - menuitem (concatword (yellow) (format [#%1: ] (+ $i 1)) (at $faqQuestions $i)) -1 - ] [ - menuitem (concatword (c D) (format [#%1: ] (+ $i 1)) (at $faqQuestions $i)) -1 - ] + menuitem (concatword (at ["\f2" "\fD"] (&b $i 1)) (format [#%1: ] (+ $i 1)) (at $faqQuestions $i)) -1 tempalias tmpMenuAlias (concatword faqAnswer_ (+ $i 1)) loop o (listlen $$tmpMenuAlias) [ if (strstr (at $$tmpMenuAlias $o) "http://") [ - menuitem (concatword [ ] (blue) (at $$tmpMenuAlias $o)) -1 + menuitem (concatword " \f1" (at $$tmpMenuAlias $o)) -1 ] [ - menuitem (concatword [ ] (white) (at $$tmpMenuAlias $o)) -1 + menuitem (concatword " \f5" (at $$tmpMenuAlias $o)) -1 ] ] delalias $tmpMenuAlias diff --git a/config/opt/survival.cfg b/config/opt/survival.cfg index d288b6d2..bd316a70 100644 --- a/config/opt/survival.cfg +++ b/config/opt/survival.cfg @@ -34,7 +34,7 @@ resetSurvAliases // build menus const survSetsList [survNumBots survBotsToAdd timeBetChkPts timeUntilTele survMaxBots] const survDifList ["6 1 60000 90000 20" "8 2 45000 60000 30" "10 3 30000 45000 40" "12 5 10000 20000 50"] -const survSetDif [if (checkrange $arg1 0 3) [ survDifficulty = $arg1; loop sdl 5 [ (at $survSetsList $sdl) = (at (at $survDifList $survDifficulty) $sdl) ] ] [ sleep 1000 [ echo (c 3)Error: (c 5)invalid difficulty, defaulting to (genSurvDifStr 0) ] 1; survSetDif 0 ]; nonSurvDefaults = 0 ] +const survSetDif [if (checkrange $arg1 0 3) [ survDifficulty = $arg1; loop sdl 5 [ (at $survSetsList $sdl) = (at (at $survDifList $survDifficulty) $sdl) ] ] [ sleep 1000 [ echo "\f3Error: \f5invalid difficulty, defaulting to (genSurvDifStr 0) ] 1; survSetDif 0 ]; nonSurvDefaults = 0 ] newmenu [Survival Mode] menuitemslider "Map: " 0 (- (listlen $defaultmaps) 1) "$survMap" 1 [ac_aqueous ac_arabian ac_arctic ac_arid ac_avenue ac_cavern ac_complex ac_depot ac_desert ac_desert2 ac_desert3 ac_douze ac_edifice ac_elevation ac_gothic ac_iceroad ac_industrial ac_ingress ac_keller ac_lainio ac_mines ac_outpost ac_power ac_rattrap ac_scaffold ac_shine ac_snow ac_stellar ac_sunset ac_swamp ac_terros ac_toxic ac_urban ac_venison ac_wasteland ac_werk] [ survMap = $arg1 ] diff --git a/config/scripts.cfg b/config/scripts.cfg index 8faf6269..cd8dfcc9 100644 --- a/config/scripts.cfg +++ b/config/scripts.cfg @@ -120,7 +120,7 @@ gamemodedesc 19 [Bot Last Swiss Standing: Knive and bomb the enemy A.I.!] gamemodedesc 20 [Bot Team Survivor: Conserve your precious life, destroy the enemy A.I. team! Once all your enemies are dead, the round restarts.] gamemodedesc 21 [Bot Team One Shot, One Kill: You and your A.I. team start with 1hp, a sniper rifle, a knife and no pickups. Survive with your sniper, or humiliate with your swiss steel.] -const resetbinds [ run resetbinds; echo (c 3)All binds have been reset to default values! ] +const resetbinds [ run resetbinds; echo "\f3All binds have been reset to default values!" ] const changeteam [ if (< (player1 team) 4) [ team (at [RVSF CLA RVSF-SPECT CLA-SPECT] (player1 team)) ] ] @@ -142,11 +142,6 @@ const votemap [ mode $arg1; map $arg2 $arg3 ] const lms [ surv $arg1 $arg2 ] const vip [ htf $arg1 $arg2 ] -// Helper aliases for (c) - easy color insertion. (e.g. echo (red)Hello (blue)world! (white)My fov today is: (orange) $fov) -loop k 10 [ const (at [green blue yellow red gray white dbrown dred purple orange] $k) (format [if (= $arg1 -1) [ result %1 ] [ result %2 ]] $k (addpunct (concat c $k) 2)) ] -// echo (blue -1) - returns 1 -// echo (purple -1) - returns 8 - const add2alias [ if (strcmp [] (getalias $arg1)) [ $arg1 = $arg2 ] [ $arg1 = (concat (concatword (getalias $arg1) [;]) $arg2) @@ -302,8 +297,8 @@ const get_ent_attrs [ cp_entbuf = (getenttype); loop gea $ENT_NUM_ATTRS [ add2li const copyent [ if $editing [ get_ent_attrs - cp_entstr = (concatword (orange) "(" (at $cp_entbuf 0) [ ] (at $cp_entbuf 1) [ ] (at $cp_entbuf 2) [ ] (at $cp_entbuf 3) [ ] (at $cp_entbuf 4) ")" (white)) // Output (a string): (enttype param1 param2 param3 param4) - echo (blue)Note: (white)The current closest entity: $cp_entstr - has been copied. + cp_entstr = (concatword "\f9(" (at $cp_entbuf 0) [ ] (at $cp_entbuf 1) [ ] (at $cp_entbuf 2) [ ] (at $cp_entbuf 3) [ ] (at $cp_entbuf 4) ")\f5") // Output (a string): (enttype param1 param2 param3 param4) + echo "\f1Note: \f5The current closest entity:" $cp_entstr - has been copied. ] ] @@ -314,7 +309,7 @@ const pasteent [ ] [ newent (at $cp_entbuf 0) (at $cp_entbuf 1) (at $cp_entbuf 2) (at $cp_entbuf 3) (at $cp_entbuf 4) ] - echo (blue)Note: (white)The previously copied entity: $cp_entstr - has been pasted. + echo "\f1Note: \f5The previously copied entity:" $cp_entstr - has been pasted. ] ] @@ -325,26 +320,6 @@ const countwalls [ pop __cnt ] -// gencl - Randomly generates a valid coloured light. -const gencl [ - if $editing [ - push tmp_numargs $numargs; push tmp_cl [] - loop gcl 3 [ add2list tmp_cl (rrnd 1 256) ] - if $tmp_numargs [ - if (|| (!= (selx) 0) (!= (sely) 0)) [ - echo (red)Trying colored light: (white) $arg1 (at $tmp_cl 0) (at $tmp_cl 1) (at $tmp_cl 2) - newent light $arg1 (at $tmp_cl 0) (at $tmp_cl 1) (at $tmp_cl 2) - ] [ echo (red)Error: (white)If an argument "(radius)" is given for (concatword (blue) gencl (red) ,) you must select a cube first. ] - ] [ - if (strcmp (getenttype) light) [ - echo (red)Trying colored light: (white) (getentattr 0) (at $tmp_cl 0) (at $tmp_cl 1) (at $tmp_cl 2) - entset light (getentattr 0) (at $tmp_cl 0) (at $tmp_cl 1) (at $tmp_cl 2) - ] [ echo (red)Error: (white)The current closest entity: (orange) (getenttype) (white)is not a light. ] - ] - pop tmp_numargs tmp_cl - ] [ echo (red)Error: (white)You must be in edit mode for (blue)gencl (white)to function. ] -] - // cycle through all playerstarts const gotonextplayerstart [ if (&& (!= $arg1 1) (!= $arg1 -1)) [ arg1 = 1 ] @@ -461,7 +436,7 @@ const storesets [ add2list $arg2 (getalias (at $arg1 $ssl)) ] [ badargs = 1; break ] ] - if $badargs [ delalias $arg2; echo (red)Error: (white)Bad "argument(s)" given! ] + if $badargs [ delalias $arg2; echo "\f3Error: \f5Bad argument(s) given!" ] ] ] @@ -502,8 +477,8 @@ const highestcn [ ] ingall = 0 -const ignoreall [ if $connected [ ingall = 1; loop ia (+ (highestcn) 1) [ ignore $ia ]; echo (blue)NOTE: (white)all clients currently on the server were ignored ] ] -const unignoreall [ if $connected [ ingall = 0; clearignored -1; echo (blue)NOTE: (white)all clients currently on the server were unignored ] ] +const ignoreall [ if $connected [ ingall = 1; loop ia (+ (highestcn) 1) [ ignore $ia ]; echo "\f1NOTE: \f5all clients currently on the server were ignored" ] ] +const unignoreall [ if $connected [ ingall = 0; clearignored -1; echo "\f1NOTE: \f5all clients currently on the server were unignored" ] ] const ignoreteam [ if (curmodeattr team) [ _arg1 = (toupper $arg1) @@ -535,7 +510,7 @@ _CAS_servername = "SERVER NAME" const customclaimadminscript [ if (strcmp (curserver 1) $_CAS_serverip) [ if (! (player1 role)) [ setadmin 1 $_CAS_serverpass ] [ setadmin 0 ] - ] [ echo (red)Error: (white)you're not connected to $_CAS_servername servers ] + ] [ echo "\f3Error: \f5you're not connected to" $_CAS_servername servers ] ] // manage per-map gamma values diff --git a/source/src/command.cpp b/source/src/command.cpp index f8370eda..340cbe46 100644 --- a/source/src/command.cpp +++ b/source/src/command.cpp @@ -206,26 +206,25 @@ char *svariable(const char *name, const char *cur, char **storage, void (*fun)() return newstring(cur); } -#define _GETVAR(id, vartype, name, retval) \ +#define GETVAR(id, vartype, name) \ ident *id = idents->access(name); \ ASSERT(id && id->type == vartype); \ - if(!id || id->type!=vartype) return retval; -#define GETVAR(id, name, retval) _GETVAR(id, ID_VAR, name, retval) + if(!id || id->type!=vartype) return; void setvar(const char *name, int i, bool dofunc) { - GETVAR(id, name, ); + GETVAR(id, ID_VAR, name); *id->storage.i = clamp(i, id->minval, id->maxval); if(dofunc && id->fun) ((void (__cdecl *)())id->fun)(); // call trigger function if available } void setfvar(const char *name, float f, bool dofunc) { - _GETVAR(id, ID_FVAR, name, ); + GETVAR(id, ID_FVAR, name); *id->storage.f = clamp(f, id->minvalf, id->maxvalf); if(dofunc && id->fun) ((void (__cdecl *)())id->fun)(); // call trigger function if available } void setsvar(const char *name, const char *str, bool dofunc) { - _GETVAR(id, ID_SVAR, name, ); + GETVAR(id, ID_SVAR, name); *id->storage.s = exchangestr(*id->storage.s, str); if(dofunc && id->fun) ((void (__cdecl *)())id->fun)(); // call trigger function if available } @@ -322,12 +321,6 @@ COMMANDN(-=f, subeqf, "sf"); COMMANDN(*=f, muleqf, "sf"); COMMANDN(div=f, diveqf, "sf"); -int getvar(const char *name) -{ - GETVAR(id, name, 0); - return *id->storage.i; -} - bool identexists(const char *name) { return idents->access(name)!=NULL; } const char *getalias(const char *name) @@ -393,6 +386,7 @@ COMMANDF(isIdent, "s", (char *name) { intret(identexists(name) ? 1 : 0); }); bool addcommand(const char *name, void (*fun)(), const char *sig) { + ASSERT(strlen(sig) < 9); if(!idents) idents = new hashtable; ident c(ID_COMMAND, name, fun, sig, IEXC_CORE); idents->access(name, c); @@ -1091,7 +1085,7 @@ void loopa(char *var, int *times, char *body) pushident(*id, buf); loop_level++; execute(body); - if(loop_skip) loop_skip = false; + loop_skip = false; if(loop_break) loop_break = false; else { @@ -1104,7 +1098,7 @@ void loopa(char *var, int *times, char *body) } itoa(id->action, i+1); execute(body); - if(loop_skip) loop_skip = false; + loop_skip = false; if(loop_break) { loop_break = false; @@ -1123,7 +1117,7 @@ void whilea(char *cond, char *body) while(execute(cond)) { execute(body); - if(loop_skip) loop_skip = false; + loop_skip = false; if(loop_break) { loop_break = false; @@ -1296,16 +1290,6 @@ int find(char *s, const char *key) } COMMANDF(findlist, "ss", (char *s, char *key) { intret(find(s, key)); }); -void colora(char *s) -{ - if(s[0] && s[1]=='\0') - { - defformatstring(x)("\f%c",s[0]); - commandret = newstring(x); - } -} -COMMANDN(c, colora, "s"); - #ifndef STANDALONE // Easily inject a string into various CubeScript punctuations const char *punctnames[] = { "QUOTES", "BRACKETS", "PARENTHESIS", "_$_", "QUOTE", "PERCENT", "" }; diff --git a/source/src/protos.h b/source/src/protos.h index dc3f2fb5..120068e5 100644 --- a/source/src/protos.h +++ b/source/src/protos.h @@ -401,6 +401,7 @@ extern void rendercursor(int x, int y, int w); extern void renderaboveheadicon(playerent *p); extern void drawscope(bool preload = false); extern float dynfov(); +extern int fog; extern void damageblend(int n); // shadow @@ -481,6 +482,7 @@ struct zone { int x1, x2, y1, y2, color; }; // zones (drawn on the minimap) extern void mipstats(const int a[]); extern const char *cubetypenames[]; extern bool editfocusdetails(sqr *s); +extern int lighterror; extern void render_flat(int tex, int x, int y, int size, int h, sqr *l1, sqr *l2, sqr *l3, sqr *l4, bool isceil); extern void render_flatdelta(int wtex, int x, int y, int size, float h1, float h2, float h3, float h4, sqr *l1, sqr *l2, sqr *l3, sqr *l4, bool isceil); extern void render_square(int wtex, float floor1, float floor2, float ceil1, float ceil2, int x1, int y1, int x2, int y2, int size, sqr *l1, sqr *l2, bool topleft, int dir); @@ -993,7 +995,6 @@ extern char *svariable(const char *name, const char *cur, char **storage, void ( extern void setvar(const char *name, int i, bool dofunc = false); extern void setfvar(const char *name, float f, bool dofunc = false); extern void setsvar(const char *name, const char *str, bool dofunc = false); -extern int getvar(const char *name); extern bool identexists(const char *name); extern bool addcommand(const char *name, void (*fun)(), const char *sig); extern int execute(const char *p); diff --git a/source/src/world.cpp b/source/src/world.cpp index d35b7be5..e32d87a8 100644 --- a/source/src/world.cpp +++ b/source/src/world.cpp @@ -19,7 +19,7 @@ _mapconfigdata mapconfigdata; void remip(const block &b, int level) { if(level>=SMALLEST_FACTOR) return; - int lighterr = getvar("lighterror")*3; + int lighterr = lighterror*3; sqr *w = wmip[level]; sqr *v = wmip[level+1]; int wfactor = sfactor - level; diff --git a/source/src/worldio.cpp b/source/src/worldio.cpp index f89b0a41..ca58e442 100644 --- a/source/src/worldio.cpp +++ b/source/src/worldio.cpp @@ -426,7 +426,7 @@ void getcurrentmapconfig(vector &f, bool onlysounds) { if(!onlysounds) { - extern int fog, fogcolour, shadowyaw; + extern int fogcolour, shadowyaw; extern char *loadsky; if(fog != DEFAULT_FOG) cvecprintf(f, "fog %d\n", fog); if(fogcolour != DEFAULT_FOGCOLOUR) cvecprintf(f, "fogcolour 0x%06x\n", fogcolour); diff --git a/source/src/worldocull.cpp b/source/src/worldocull.cpp index 095c2c62..65e59501 100644 --- a/source/src/worldocull.cpp +++ b/source/src/worldocull.cpp @@ -28,7 +28,7 @@ void computeraytable(float vx, float vy, float fov) { static int ndist[NUMRAYS]; if(!ocull) { disableraytable(); return; } - odist = getvar("fog")*1.5f; + odist = fog * 1.5f; float apitch = (float)fabs(camera1->pitch); float af = fov/2+max(apitch/1.5f,4.2f);