From: Ryan C. Gordon Date: Fri, 14 May 2010 05:46:45 +0000 (-0400) Subject: Replaced Constants.h defines with const ints. X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=b0bc8fa8cf3e5e076eb29f04868ff613edb19f1b;p=lugaru.git Replaced Constants.h defines with const ints. Credit for this goes to Jookia, whose patch I found here: http://github.com/pvtcupcakes/Lugaru/ --- diff --git a/Source/Constants.h b/Source/Constants.h index 580febc..d921eb8 100644 --- a/Source/Constants.h +++ b/Source/Constants.h @@ -10,7 +10,7 @@ of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -22,329 +22,331 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef _CONSTANTS_H_ #define _CONSTANTS_H_ -#define awardklutz 0 -#define awardflawless 1 -#define awardalldead 2 -#define awardnodead 3 -#define awardstealth 4 -#define awardswordsman 5 -#define awardkungfu 6 -#define awardknifefighter 7 -#define awardcoward 8 -#define awardevasion 9 -#define awardacrobat 10 -#define awardlongrange 11 -#define awardbrutal 12 -#define awardhyper 13 -#define awardaikido 14 -#define awardrambo 15 -#define awardfast 16 -#define awardrealfast 17 -#define awarddamnfast 18 -#define awardstrategy 19 -#define awardbojutsu 20 +// cat src/Constants.h | sed -e 's/#define/const int/' -e 's/ [0-9]*$/ =&;/' +// chew on that --Jookia -#define mapkilleveryone 0 -#define mapgosomewhere 1 -#define mapkillsomeone 2 -#define mapkillmost 3 +const int awardklutz = 0; +const int awardflawless = 1; +const int awardalldead = 2; +const int awardnodead = 3; +const int awardstealth = 4; +const int awardswordsman = 5; +const int awardkungfu = 6; +const int awardknifefighter = 7; +const int awardcoward = 8; +const int awardevasion = 9; +const int awardacrobat = 10; +const int awardlongrange = 11; +const int awardbrutal = 12; +const int awardhyper = 13; +const int awardaikido = 14; +const int awardrambo = 15; +const int awardfast = 16; +const int awardrealfast = 17; +const int awarddamnfast = 18; +const int awardstrategy = 19; +const int awardbojutsu = 20; -#define wpkeepwalking 0 -#define wppause 1 +const int mapkilleveryone = 0; +const int mapgosomewhere = 1; +const int mapkillsomeone = 2; +const int mapkillmost = 3; -#define typeactive 0 -#define typesitting 1 -#define typesittingwall 2 -#define typesleeping 3 -#define typedead1 4 -#define typedead2 5 -#define typedead3 6 -#define typedead4 7 +const int wpkeepwalking = 0; +const int wppause = 1; -#define tracheotomy 1 -#define backstab 2 -#define spinecrusher 3 -#define ninja 4 -#define style 5 -#define cannon 6 -#define aimbonus 7 -#define deepimpact 8 -#define touchofdeath 9 -#define swordreversebonus 10 -#define staffreversebonus 11 -#define reverseko 12 -#define solidhit 13 -#define twoxcombo 14 -#define threexcombo 15 -#define fourxcombo 16 -#define megacombo 17 -#define Reversal 18 -#define Stabbonus 19 -#define Slicebonus 20 -#define Bullseyebonus 21 -#define Slashbonus 22 -#define Wolfbonus 23 -#define FinishedBonus 24 -#define TackleBonus 25 -#define AboveBonus 26 +const int typeactive = 0; +const int typesitting = 1; +const int typesittingwall = 2; +const int typesleeping = 3; +const int typedead1 = 4; +const int typedead2 = 5; +const int typedead3 = 6; +const int typedead4 = 7; -#define boneconnect 0 -#define constraint 1 -#define muscle 2 +const int tracheotomy = 1; +const int backstab = 2; +const int spinecrusher = 3; +const int ninja = 4; +const int style = 5; +const int cannon = 6; +const int aimbonus = 7; +const int deepimpact = 8; +const int touchofdeath = 9; +const int swordreversebonus = 10; +const int staffreversebonus = 11; +const int reverseko = 12; +const int solidhit = 13; +const int twoxcombo = 14; +const int threexcombo = 15; +const int fourxcombo = 16; +const int megacombo = 17; +const int Reversal = 18; +const int Stabbonus = 19; +const int Slicebonus = 20; +const int Bullseyebonus = 21; +const int Slashbonus = 22; +const int Wolfbonus = 23; +const int FinishedBonus = 24; +const int TackleBonus = 25; +const int AboveBonus = 26; -const int head = 0; // Do not conflict with 'head' var in zlib +const int boneconnect = 0; +const int constraint = 1; +const int muscle = 2; -#define neck 1 -#define leftshoulder 2 -#define leftelbow 3 -#define leftwrist 4 -#define lefthand 5 -#define rightshoulder 6 -#define rightelbow 7 -#define rightwrist 8 -#define righthand 9 -#define abdomen 10 -#define lefthip 11 -#define righthip 12 -#define groin 13 -#define leftknee 14 -#define leftankle 15 -#define leftfoot 16 -#define rightknee 17 -#define rightankle 18 -#define rightfoot 19 +const int head = 0; // DO NOT CONFLICT WITH ZLIB's variable head +const int neck = 1; +const int leftshoulder = 2; +const int leftelbow = 3; +const int leftwrist = 4; +const int lefthand = 5; +const int rightshoulder = 6; +const int rightelbow = 7; +const int rightwrist = 8; +const int righthand = 9; +const int abdomen = 10; +const int lefthip = 11; +const int righthip = 12; +const int groin = 13; +const int leftknee = 14; +const int leftankle = 15; +const int leftfoot = 16; +const int rightknee = 17; +const int rightankle = 18; +const int rightfoot = 19; -#define max_joints 50 -#define max_frames 50 -#define max_muscles 100 +const int max_joints = 50; +const int max_frames = 50; +const int max_muscles = 100; -#define animation_count 140 +const int animation_count = 140; -#define runanim 0 -#define bounceidleanim 1 -#define stopanim 2 -#define jumpupanim 3 -#define jumpdownanim 4 -#define landanim 5 -#define climbanim 6 -#define hanganim 7 -#define spinkickanim 8 -#define tempanim 9 -#define getupfromfrontanim 10 -#define getupfrombackanim 11 -#define crouchanim 12 -#define sneakanim 13 -#define rollanim 14 -#define flipanim 15 -#define spinkickreversedanim 16 -#define spinkickreversalanim 17 -#define lowkickanim 18 -#define sweepanim 19 -#define sweepreversedanim 20 -#define sweepreversalanim 21 -#define rabbitkickanim 22 -#define rabbitkickreversedanim 23 -#define rabbitkickreversalanim 24 -#define upunchanim 25 -#define staggerbackhighanim 26 -#define upunchreversedanim 27 -#define upunchreversalanim 28 -#define hurtidleanim 29 -#define backhandspringanim 30 -#define fightidleanim 31 -#define walkanim 32 -#define fightsidestep 33 -#define killanim 34 -#define sneakattackanim 35 -#define sneakattackedanim 36 -#define drawrightanim 37 -#define knifeslashstartanim 38 -#define crouchstabanim 39 -#define crouchdrawrightanim 40 -#define knifefollowanim 41 -#define knifefollowedanim 42 -#define knifethrowanim 43 -#define removeknifeanim 44 -#define crouchremoveknifeanim 45 -#define jumpreversedanim 46 -#define jumpreversalanim 47 -#define landhardanim 48 -#define staggerbackhardanim 49 -#define dropkickanim 50 -#define winduppunchanim 51 -#define winduppunchblockedanim 52 -#define blockhighleftanim 53 -#define blockhighleftstrikeanim 54 -#define walljumpfrontanim 55 -#define walljumpbackanim 56 -#define walljumpleftanim 57 -#define walljumprightanim 58 -#define backflipanim 59 -#define leftflipanim 60 -#define rightflipanim 61 -#define walljumprightkickanim 62 -#define walljumpleftkickanim 63 -#define knifefightidleanim 64 -#define knifesneakattackanim 65 -#define knifesneakattackedanim 66 -#define swordstabanim 67 -#define swordslashleftanim 68 -#define swordslashrightanim 69 -#define swordfightidleanim 70 -#define swordsneakattackanim 71 -#define swordsneakattackedanim 72 -#define drawleftanim 73 -#define swordslashanim 74 -#define swordgroundstabanim 75 -#define dodgebackanim 76 -#define swordslashreversedanim 77 -#define swordslashreversalanim 78 -#define knifeslashreversedanim 79 -#define knifeslashreversalanim 80 -#define swordfightidlebothanim 81 -#define swordslashparryanim 82 -#define sworddisarmanim 83 -#define swordslashparriedanim 84 -#define wolfidle 85 -#define wolffightidle 86 -#define wolfswordidle 87 -#define wolfhurtidle 88 -#define wolfcrouchanim 89 -#define wolfsneakanim 90 -#define wolfrunanim 91 -#define wolfstopanim 92 -#define wolfclawanim 93 -#define wolflandanim 94 -#define wolflandhardanim 95 -#define wolfrunninganim 96 -#define rabbitrunninganim 97 -#define frontflipanim 98 -#define rabbittackleanim 99 -#define rabbittacklinganim 100 -#define rabbittackledfrontanim 101 -#define rabbittackledbackanim 102 -#define rabbittacklereversal 103 -#define rabbittacklereversed 104 -#define wolftackleanim 105 -#define wolftacklinganim 106 -#define wolftackledfrontanim 107 -#define wolftackledbacanim 108 -#define wolftacklereversal 109 -#define wolftacklereversed 110 -#define wolfslapanim 111 -#define wolfbashanim 112 -#define staffhitanim 113 -#define staffgroundsmashanim 114 -#define staffspinhitanim 115 -#define staffhitreversedanim 116 -#define staffhitreversalanim 117 -#define staffspinhitreversedanim 118 -#define staffspinhitreversalanim 119 -#define sleepanim 120 -#define sitanim 121 -#define talkidleanim 122 -#define sitwallanim 123 -#define dead1anim 124 -#define dead2anim 125 -#define dead3anim 126 -#define dead4anim 127 +const int runanim = 0; +const int bounceidleanim = 1; +const int stopanim = 2; +const int jumpupanim = 3; +const int jumpdownanim = 4; +const int landanim = 5; +const int climbanim = 6; +const int hanganim = 7; +const int spinkickanim = 8; +const int tempanim = 9; +const int getupfromfrontanim = 10; +const int getupfrombackanim = 11; +const int crouchanim = 12; +const int sneakanim = 13; +const int rollanim = 14; +const int flipanim = 15; +const int spinkickreversedanim = 16; +const int spinkickreversalanim = 17; +const int lowkickanim = 18; +const int sweepanim = 19; +const int sweepreversedanim = 20; +const int sweepreversalanim = 21; +const int rabbitkickanim = 22; +const int rabbitkickreversedanim = 23; +const int rabbitkickreversalanim = 24; +const int upunchanim = 25; +const int staggerbackhighanim = 26; +const int upunchreversedanim = 27; +const int upunchreversalanim = 28; +const int hurtidleanim = 29; +const int backhandspringanim = 30; +const int fightidleanim = 31; +const int walkanim = 32; +const int fightsidestep = 33; +const int killanim = 34; +const int sneakattackanim = 35; +const int sneakattackedanim = 36; +const int drawrightanim = 37; +const int knifeslashstartanim = 38; +const int crouchstabanim = 39; +const int crouchdrawrightanim = 40; +const int knifefollowanim = 41; +const int knifefollowedanim = 42; +const int knifethrowanim = 43; +const int removeknifeanim = 44; +const int crouchremoveknifeanim = 45; +const int jumpreversedanim = 46; +const int jumpreversalanim = 47; +const int landhardanim = 48; +const int staggerbackhardanim = 49; +const int dropkickanim = 50; +const int winduppunchanim = 51; +const int winduppunchblockedanim = 52; +const int blockhighleftanim = 53; +const int blockhighleftstrikeanim = 54; +const int walljumpfrontanim = 55; +const int walljumpbackanim = 56; +const int walljumpleftanim = 57; +const int walljumprightanim = 58; +const int backflipanim = 59; +const int leftflipanim = 60; +const int rightflipanim = 61; +const int walljumprightkickanim = 62; +const int walljumpleftkickanim = 63; +const int knifefightidleanim = 64; +const int knifesneakattackanim = 65; +const int knifesneakattackedanim = 66; +const int swordstabanim = 67; +const int swordslashleftanim = 68; +const int swordslashrightanim = 69; +const int swordfightidleanim = 70; +const int swordsneakattackanim = 71; +const int swordsneakattackedanim = 72; +const int drawleftanim = 73; +const int swordslashanim = 74; +const int swordgroundstabanim = 75; +const int dodgebackanim = 76; +const int swordslashreversedanim = 77; +const int swordslashreversalanim = 78; +const int knifeslashreversedanim = 79; +const int knifeslashreversalanim = 80; +const int swordfightidlebothanim = 81; +const int swordslashparryanim = 82; +const int sworddisarmanim = 83; +const int swordslashparriedanim = 84; +const int wolfidle = 85; +const int wolffightidle = 86; +const int wolfswordidle = 87; +const int wolfhurtidle = 88; +const int wolfcrouchanim = 89; +const int wolfsneakanim = 90; +const int wolfrunanim = 91; +const int wolfstopanim = 92; +const int wolfclawanim = 93; +const int wolflandanim = 94; +const int wolflandhardanim = 95; +const int wolfrunninganim = 96; +const int rabbitrunninganim = 97; +const int frontflipanim = 98; +const int rabbittackleanim = 99; +const int rabbittacklinganim = 100; +const int rabbittackledfrontanim = 101; +const int rabbittackledbackanim = 102; +const int rabbittacklereversal = 103; +const int rabbittacklereversed = 104; +const int wolftackleanim = 105; +const int wolftacklinganim = 106; +const int wolftackledfrontanim = 107; +const int wolftackledbacanim = 108; +const int wolftacklereversal = 109; +const int wolftacklereversed = 110; +const int wolfslapanim = 111; +const int wolfbashanim = 112; +const int staffhitanim = 113; +const int staffgroundsmashanim = 114; +const int staffspinhitanim = 115; +const int staffhitreversedanim = 116; +const int staffhitreversalanim = 117; +const int staffspinhitreversedanim = 118; +const int staffspinhitreversalanim = 119; +const int sleepanim = 120; +const int sitanim = 121; +const int talkidleanim = 122; +const int sitwallanim = 123; +const int dead1anim = 124; +const int dead2anim = 125; +const int dead3anim = 126; +const int dead4anim = 127; -#define max_dialogues 20 -#define max_dialoguelength 20 +const int max_dialogues = 20; +const int max_dialoguelength = 20; -#define max_model_vertex 3000 // maximum number of vertexs -#define max_textured_triangle 3000 // maximum number of texture-filled triangles in a model +const int max_model_vertex = 3000; // maximum number of vertexs +const int max_textured_triangle = 3000; // maximum number of texture-filled triangles in a model -#define stream_music1desert 0 -#define stream_music1grass 1 -#define stream_music1snow 2 -#define stream_music2 3 -#define stream_music3 4 -#define stream_music4 5 -#define stream_menumusic 6 -#define stream_desertambient 7 -#define stream_firesound 8 -#define stream_wind 9 +const int stream_music1desert = 0; +const int stream_music1grass = 1; +const int stream_music1snow = 2; +const int stream_music2 = 3; +const int stream_music3 = 4; +const int stream_music4 = 5; +const int stream_menumusic = 6; +const int stream_desertambient = 7; +const int stream_firesound = 8; +const int stream_wind = 9; -//#define music1desert 0 -//#define music1grass 1 -//#define music1snow 2 -//#define music2 3 -//#define music3 4 -//#define music4 5 -//#define menumusic 6 -//#define desertambient 7 -//#define firesound 8 -//#define wind 9 -#define footstepsound 10 -#define footstepsound2 11 -#define footstepsound3 12 -#define footstepsound4 13 -#define jumpsound 14 -#define landsound 15 -#define whooshsound 16 -#define hawksound 17 -#define landsound1 18 -#define landsound2 19 -#define breaksound 20 -#define lowwhooshsound 21 -#define heavyimpactsound 22 -#define firestartsound 23 -#define fireendsound 24 -#define breaksound2 25 -#define knifedrawsound 26 -#define knifesheathesound 27 -#define knifeswishsound 28 -#define knifeslicesound 29 -#define skidsound 30 -#define snowskidsound 31 -#define bushrustle 32 -#define midwhooshsound 33 -#define highwhooshsound 34 -#define movewhooshsound 35 -#define thudsound 36 -#define whooshhitsound 37 -#define clank1sound 38 -#define clank2sound 39 -#define clank3sound 40 -#define clank4sound 41 -#define consolefailsound 42 -#define consolesuccesssound 43 -#define swordslicesound 44 -#define metalhitsound 45 -#define clawslicesound 46 -#define splattersound 47 -#define growlsound 48 -#define growl2sound 49 -#define barksound 50 -#define snarlsound 51 -#define snarl2sound 52 -#define barkgrowlsound 53 -#define bark2sound 54 -#define bark3sound 55 -#define rabbitattacksound 56 -#define rabbitattack2sound 57 -#define rabbitattack3sound 58 -#define rabbitattack4sound 59 -#define rabbitpainsound 60 -#define rabbitpain1sound 61 -#define rabbitpain2sound 62 -#define rabbitchitter 63 -#define rabbitchitter2 64 -#define fleshstabsound 65 -#define fleshstabremovesound 66 -#define swordstaffsound 67 -#define staffbodysound 68 -#define staffheadsound 69 -#define alarmsound 70 -#define staffbreaksound 71 +//const int music1desert = 0; +//const int music1grass = 1; +//const int music1snow = 2; +//const int music2 = 3; +//const int music3 = 4; +//const int music4 = 5; +//const int menumusic = 6; +//const int desertambient = 7; +//const int firesound = 8; +//const int wind = 9; +const int footstepsound = 10; +const int footstepsound2 = 11; +const int footstepsound3 = 12; +const int footstepsound4 = 13; +const int jumpsound = 14; +const int landsound = 15; +const int whooshsound = 16; +const int hawksound = 17; +const int landsound1 = 18; +const int landsound2 = 19; +const int breaksound = 20; +const int lowwhooshsound = 21; +const int heavyimpactsound = 22; +const int firestartsound = 23; +const int fireendsound = 24; +const int breaksound2 = 25; +const int knifedrawsound = 26; +const int knifesheathesound = 27; +const int knifeswishsound = 28; +const int knifeslicesound = 29; +const int skidsound = 30; +const int snowskidsound = 31; +const int bushrustle = 32; +const int midwhooshsound = 33; +const int highwhooshsound = 34; +const int movewhooshsound = 35; +const int thudsound = 36; +const int whooshhitsound = 37; +const int clank1sound = 38; +const int clank2sound = 39; +const int clank3sound = 40; +const int clank4sound = 41; +const int consolefailsound = 42; +const int consolesuccesssound = 43; +const int swordslicesound = 44; +const int metalhitsound = 45; +const int clawslicesound = 46; +const int splattersound = 47; +const int growlsound = 48; +const int growl2sound = 49; +const int barksound = 50; +const int snarlsound = 51; +const int snarl2sound = 52; +const int barkgrowlsound = 53; +const int bark2sound = 54; +const int bark3sound = 55; +const int rabbitattacksound = 56; +const int rabbitattack2sound = 57; +const int rabbitattack3sound = 58; +const int rabbitattack4sound = 59; +const int rabbitpainsound = 60; +const int rabbitpain1sound = 61; +const int rabbitpain2sound = 62; +const int rabbitchitter = 63; +const int rabbitchitter2 = 64; +const int fleshstabsound = 65; +const int fleshstabremovesound = 66; +const int swordstaffsound = 67; +const int staffbodysound = 68; +const int staffheadsound = 69; +const int alarmsound = 70; +const int staffbreaksound = 71; -#define normalmode 0 -#define motionblurmode 1 -#define radialzoommode 2 -#define realmotionblurmode 3 -#define doublevisionmode 4 -#define glowmode 5 +const int normalmode = 0; +const int motionblurmode = 1; +const int radialzoommode = 2; +const int realmotionblurmode = 3; +const int doublevisionmode = 4; +const int glowmode = 5; -#define maxplayers 10 +const int maxplayers = 10; #endif