From ef57f91f57c6a11178d5b0fba58a4906b716026b Mon Sep 17 00:00:00 2001 From: Alexander Monakov Date: Mon, 20 Dec 2010 00:14:53 +0300 Subject: [PATCH] Awards.def --- Source/Awards.def | 42 ++++++++++++++++++++++++++++++++++++++++++ Source/Awards.h | 39 +++++++++++++++++++++++++++++++++++++++ Source/Constants.h | 22 ---------------------- Source/GameDraw.cpp | 29 +++-------------------------- 4 files changed, 84 insertions(+), 48 deletions(-) create mode 100644 Source/Awards.def create mode 100644 Source/Awards.h diff --git a/Source/Awards.def b/Source/Awards.def new file mode 100644 index 0000000..f2bfe22 --- /dev/null +++ b/Source/Awards.def @@ -0,0 +1,42 @@ +/* +Copyright (C) 2010 - Lugaru authors + +This file is part of Lugaru. + +Lugaru is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +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. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +DECLARE_AWARD(awardklutz, "Suicidal") +DECLARE_AWARD(awardflawless, "Flawless!") +DECLARE_AWARD(awardalldead, "Take no prisoners") +DECLARE_AWARD(awardnodead, "Merciful") +DECLARE_AWARD(awardstealth, "One with the shadows!") +DECLARE_AWARD(awardswordsman, "Swordsman") +DECLARE_AWARD(awardkungfu, "Unarmed!") +DECLARE_AWARD(awardknifefighter, "Knife fighter") +DECLARE_AWARD(awardcoward, "Coward") +DECLARE_AWARD(awardevasion, "Escape artist") +DECLARE_AWARD(awardacrobat, "Gymnast") +DECLARE_AWARD(awardlongrange, "Blade slinger") +DECLARE_AWARD(awardbrutal, "Brutal") +DECLARE_AWARD(awardhyper, "Hyper") +DECLARE_AWARD(awardaikido, "Aikido master!") +DECLARE_AWARD(awardrambo, "Rambo") +DECLARE_AWARD(awardfast, "Fast") +DECLARE_AWARD(awardrealfast, "Real fast") +DECLARE_AWARD(awarddamnfast, "Damn fast") +DECLARE_AWARD(awardstrategy, "Divide and conquer") +DECLARE_AWARD(awardbojutsu, "Bojutsu") diff --git a/Source/Awards.h b/Source/Awards.h new file mode 100644 index 0000000..46e8c3e --- /dev/null +++ b/Source/Awards.h @@ -0,0 +1,39 @@ +/* +Copyright (C) 2010 - Lugaru authors + +This file is part of Lugaru. + +Lugaru is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +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. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef AWARDS_H +#define AWARDS_H + +enum award_types { +#define DECLARE_AWARD(id, name) id, +#include "Awards.def" +#undef DECLARE_AWARD +award_count +}; + +static const char *award_names[award_count] = { +#define DECLARE_AWARD(id, name) name, +#include "Awards.def" +#undef DECLARE_AWARD +}; + +#endif + diff --git a/Source/Constants.h b/Source/Constants.h index 4d50145..d1b9ea5 100644 --- a/Source/Constants.h +++ b/Source/Constants.h @@ -25,28 +25,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // cat src/Constants.h | sed -e 's/#define/const int/' -e 's/ [0-9]*$/ =&;/' // chew on that --Jookia -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; - const int mapkilleveryone = 0; const int mapgosomewhere = 1; const int mapkillsomeone = 2; diff --git a/Source/GameDraw.cpp b/Source/GameDraw.cpp index 2b5ebf6..7bc613a 100644 --- a/Source/GameDraw.cpp +++ b/Source/GameDraw.cpp @@ -22,6 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "Game.h" #include "openal_wrapper.h" #include "Input.h" +#include "Awards.h" using namespace std; @@ -1843,32 +1844,8 @@ int Game::DrawGLScene(StereoSide side) strcat(string,temp); text.glPrintOutlined(1024/30,768*6/8-40,string,1,2,1024,768); - for(i=0;i