From efe4f0baddf10124581e4fcb88d55a52838b06a1 Mon Sep 17 00:00:00 2001 From: Piotr Dziwinski Date: Sun, 9 Sep 2012 17:51:10 +0200 Subject: Refactoring in src/common - refactored CInstanceManager and some headers - removed old headers --- src/common/global.h | 123 ++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 90 insertions(+), 33 deletions(-) (limited to 'src/common/global.h') diff --git a/src/common/global.h b/src/common/global.h index 670c578..acc5b8f 100644 --- a/src/common/global.h +++ b/src/common/global.h @@ -14,53 +14,110 @@ // * You should have received a copy of the GNU General Public License // * along with this program. If not, see http://www.gnu.org/licenses/. -// global.h +/** + * \file common/global.h + * \brief Some common, global definitions + */ #pragma once +#include "error_ids.h" -enum BuildType +/** + * \enum Language + * \brief Application language + */ +enum Language { - BUILD_FACTORY = (1<<0), // factory - BUILD_DERRICK = (1<<1), // derrick - BUILD_CONVERT = (1<<2), // converter - BUILD_RADAR = (1<<3), // radar - BUILD_ENERGY = (1<<4), // factory of cells - BUILD_NUCLEAR = (1<<5), // nuclear power plant - BUILD_STATION = (1<<6), // base station - BUILD_REPAIR = (1<<7), // repair center - BUILD_TOWER = (1<<8), // defense tower - BUILD_RESEARCH = (1<<9), // research center - BUILD_LABO = (1<<10), // laboratory - BUILD_PARA = (1<<11), // lightning protection - BUILD_INFO = (1<<12), // information terminal - BUILD_GFLAT = (1<<16), // flat floor - BUILD_FLAG = (1<<17) // puts / removes colored flag + LANG_ENGLISH = 0, + LANG_FRENCH = 1, + LANG_GERMAN = 2, + LANG_POLISH = 3 }; +/** + * \enum BuildType + * \brief Construction actions (buildings, etc.) available to user + * + * TODO: refactor + */ +enum BuildType +{ + BUILD_FACTORY = (1<<0), //! < factory + BUILD_DERRICK = (1<<1), //! < derrick + BUILD_CONVERT = (1<<2), //! < converter + BUILD_RADAR = (1<<3), //! < radar + BUILD_ENERGY = (1<<4), //! < factory of cells + BUILD_NUCLEAR = (1<<5), //! < nuclear power plant + BUILD_STATION = (1<<6), //! < base station + BUILD_REPAIR = (1<<7), //! < repair center + BUILD_TOWER = (1<<8), //! < defense tower + BUILD_RESEARCH = (1<<9), //! < research center + BUILD_LABO = (1<<10), //! < laboratory + BUILD_PARA = (1<<11), //! < lightning protection + BUILD_INFO = (1<<12), //! < information terminal + BUILD_GFLAT = (1<<16), //! < flat floor + BUILD_FLAG = (1<<17) //! < puts / removes colored flag +}; -// Do not change values ​​was because of backups (bits = ...). +/** + * \enum ResearchType + * \brief Research actions available to user + */ enum ResearchType { - RESEARCH_TANK = (1<<0), // caterpillars - RESEARCH_FLY = (1<<1), // wings - RESEARCH_CANON = (1<<2), // cannon - RESEARCH_TOWER = (1<<3), // defense tower - RESEARCH_ATOMIC = (1<<4), // nuclear - RESEARCH_THUMP = (1<<5), // thumper - RESEARCH_SHIELD = (1<<6), // shield - RESEARCH_PHAZER = (1<<7), // phazer gun - RESEARCH_iPAW = (1<<8), // legs of insects - RESEARCH_iGUN = (1<<9), // cannon of insects - RESEARCH_RECYCLER = (1<<10), // recycler - RESEARCH_SUBM = (1<<11), // submarine - RESEARCH_SNIFFER = (1<<12) // sniffer + RESEARCH_TANK = (1<<0), //! < caterpillars + RESEARCH_FLY = (1<<1), //! < wings + RESEARCH_CANON = (1<<2), //! < cannon + RESEARCH_TOWER = (1<<3), //! < defense tower + RESEARCH_ATOMIC = (1<<4), //! < nuclear + RESEARCH_THUMP = (1<<5), //! < thumper + RESEARCH_SHIELD = (1<<6), //! < shield + RESEARCH_PHAZER = (1<<7), //! < phazer gun + RESEARCH_iPAW = (1<<8), //! < legs of insects + RESEARCH_iGUN = (1<<9), //! < cannon of insects + RESEARCH_RECYCLER = (1<<10), //! < recycler + RESEARCH_SUBM = (1<<11), //! < submarine + RESEARCH_SNIFFER = (1<<12) //! < sniffer }; +/** + * \enum KeyRank + * \brief Slots for key assignment of user controls + * + * TODO: refactor + */ +enum KeyRank +{ + KEYRANK_LEFT = 0, + KEYRANK_RIGHT = 1, + KEYRANK_UP = 2, + KEYRANK_DOWN = 3, + KEYRANK_GUP = 4, + KEYRANK_GDOWN = 5, + KEYRANK_CAMERA = 6, + KEYRANK_DESEL = 7, + KEYRANK_ACTION = 8, + KEYRANK_NEAR = 9, + KEYRANK_AWAY = 10, + KEYRANK_NEXT = 11, + KEYRANK_HUMAN = 12, + KEYRANK_QUIT = 13, + KEYRANK_HELP = 14, + KEYRANK_PROG = 15, + KEYRANK_VISIT = 16, + KEYRANK_SPEED10 = 17, + KEYRANK_SPEED15 = 18, + KEYRANK_SPEED20 = 19, + KEYRANK_SPEED30 = 20, + KEYRANK_AIMUP = 21, + KEYRANK_AIMDOWN = 22, + KEYRANK_CBOT = 23, +}; + +// TODO: move to CRobotMain extern long g_id; // unique identifier extern long g_build; // constructible buildings extern long g_researchDone; // research done extern long g_researchEnable; // research available extern float g_unit; // conversion factor - - -- cgit v1.2.3-1-g7c22 From 34d7dcf3be24de04b2b9c64edb2666439b353a5b Mon Sep 17 00:00:00 2001 From: Piotr Dziwinski Date: Wed, 12 Sep 2012 23:43:04 +0200 Subject: Simulation timestamps and input bindings - added new simulation time calculations in CApplication - added simulation frame updates - rewritten old input binding code and input state tracking --- src/common/global.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/common/global.h') diff --git a/src/common/global.h b/src/common/global.h index acc5b8f..88f753e 100644 --- a/src/common/global.h +++ b/src/common/global.h @@ -84,9 +84,8 @@ enum ResearchType /** * \enum KeyRank * \brief Slots for key assignment of user controls - * - * TODO: refactor */ +// TODO: remove (use the new InputSlot enum from app/app.h) enum KeyRank { KEYRANK_LEFT = 0, @@ -113,6 +112,8 @@ enum KeyRank KEYRANK_AIMUP = 21, KEYRANK_AIMDOWN = 22, KEYRANK_CBOT = 23, + + KEYRANK_MAX }; // TODO: move to CRobotMain -- cgit v1.2.3-1-g7c22 From a397922e8d53c6f7ff469d38e5139fd003c705b5 Mon Sep 17 00:00:00 2001 From: Zaba999 Date: Tue, 18 Sep 2012 00:01:00 +0200 Subject: warnings fight in progress. --- src/common/global.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/common/global.h') diff --git a/src/common/global.h b/src/common/global.h index 88f753e..9cb3dd9 100644 --- a/src/common/global.h +++ b/src/common/global.h @@ -118,7 +118,7 @@ enum KeyRank // TODO: move to CRobotMain extern long g_id; // unique identifier -extern long g_build; // constructible buildings -extern long g_researchDone; // research done +extern int g_build; // constructible buildings +extern int g_researchDone; // research done extern long g_researchEnable; // research available extern float g_unit; // conversion factor -- cgit v1.2.3-1-g7c22 From 51884cef8e015bccbe1fa96dc56dc2f32439ccc5 Mon Sep 17 00:00:00 2001 From: Piotr Dziwinski Date: Wed, 19 Sep 2012 18:32:18 +0200 Subject: Input bindings rewrite - moved input bindings to CRobotMain - added virtual keymod and joystick button key presses - fixed putenv error; other minor fixes --- src/common/global.h | 57 ++++++++++++++++++++++++++--------------------------- 1 file changed, 28 insertions(+), 29 deletions(-) (limited to 'src/common/global.h') diff --git a/src/common/global.h b/src/common/global.h index 9cb3dd9..addb56d 100644 --- a/src/common/global.h +++ b/src/common/global.h @@ -82,38 +82,37 @@ enum ResearchType }; /** - * \enum KeyRank - * \brief Slots for key assignment of user controls + * \enum InputSlot + * \brief Available slots for input bindings */ -// TODO: remove (use the new InputSlot enum from app/app.h) -enum KeyRank +enum InputSlot { - KEYRANK_LEFT = 0, - KEYRANK_RIGHT = 1, - KEYRANK_UP = 2, - KEYRANK_DOWN = 3, - KEYRANK_GUP = 4, - KEYRANK_GDOWN = 5, - KEYRANK_CAMERA = 6, - KEYRANK_DESEL = 7, - KEYRANK_ACTION = 8, - KEYRANK_NEAR = 9, - KEYRANK_AWAY = 10, - KEYRANK_NEXT = 11, - KEYRANK_HUMAN = 12, - KEYRANK_QUIT = 13, - KEYRANK_HELP = 14, - KEYRANK_PROG = 15, - KEYRANK_VISIT = 16, - KEYRANK_SPEED10 = 17, - KEYRANK_SPEED15 = 18, - KEYRANK_SPEED20 = 19, - KEYRANK_SPEED30 = 20, - KEYRANK_AIMUP = 21, - KEYRANK_AIMDOWN = 22, - KEYRANK_CBOT = 23, + INPUT_SLOT_LEFT = 0, + INPUT_SLOT_RIGHT = 1, + INPUT_SLOT_UP = 2, + INPUT_SLOT_DOWN = 3, + INPUT_SLOT_GUP = 4, + INPUT_SLOT_GDOWN = 5, + INPUT_SLOT_CAMERA = 6, + INPUT_SLOT_DESEL = 7, + INPUT_SLOT_ACTION = 8, + INPUT_SLOT_NEAR = 9, + INPUT_SLOT_AWAY = 10, + INPUT_SLOT_NEXT = 11, + INPUT_SLOT_HUMAN = 12, + INPUT_SLOT_QUIT = 13, + INPUT_SLOT_HELP = 14, + INPUT_SLOT_PROG = 15, + INPUT_SLOT_VISIT = 16, + INPUT_SLOT_SPEED10 = 17, + INPUT_SLOT_SPEED15 = 18, + INPUT_SLOT_SPEED20 = 19, + INPUT_SLOT_SPEED30 = 20, + INPUT_SLOT_AIMUP = 21, + INPUT_SLOT_AIMDOWN = 22, + INPUT_SLOT_CBOT = 23, - KEYRANK_MAX + INPUT_SLOT_MAX }; // TODO: move to CRobotMain -- cgit v1.2.3-1-g7c22 From 10c9d92cd2581448d76548efb20957a7a1c24478 Mon Sep 17 00:00:00 2001 From: Piotr Dziwinski Date: Wed, 19 Sep 2012 21:23:42 +0200 Subject: Mouse wheel events, motion vectors - added mouse wheel events - added motion vectors to CRobotMain - other minor changes in event.h --- src/common/global.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/common/global.h') diff --git a/src/common/global.h b/src/common/global.h index addb56d..3433aeb 100644 --- a/src/common/global.h +++ b/src/common/global.h @@ -115,6 +115,20 @@ enum InputSlot INPUT_SLOT_MAX }; +/** + * \enum JoyAxisSlot + * \brief Slots for joystick axes inputs + */ +enum JoyAxisSlot +{ + JOY_AXIS_SLOT_X, + JOY_AXIS_SLOT_Y, + JOY_AXIS_SLOT_Z, + + JOY_AXIS_SLOT_MAX +}; + + // TODO: move to CRobotMain extern long g_id; // unique identifier extern int g_build; // constructible buildings -- cgit v1.2.3-1-g7c22