2018-01-21 10:31:38 +01:00
|
|
|
/*
|
|
|
|
Copyright (C) 2018 Parallel Realities
|
|
|
|
|
|
|
|
This program 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 REVISION
|
|
|
|
#define REVISION 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef DATA_DIR
|
|
|
|
#define DATA_DIR ""
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define _(string) getTranslatedString(string)
|
|
|
|
|
|
|
|
#define PI 3.14159265358979323846
|
|
|
|
#define MIN(a,b) (((a)<(b))?(a):(b))
|
|
|
|
#define MAX(a,b) (((a)>(b))?(a):(b))
|
2018-03-19 23:51:37 +01:00
|
|
|
#define CAROLINE(a,b) MIN(a,b)
|
2018-01-21 10:31:38 +01:00
|
|
|
#define STRNCPY(dest, src, n) strncpy(dest, src, n); dest[n - 1] = '\0'
|
|
|
|
#define TO_RAIDANS(angleDegrees) (angleDegrees * PI / 180.0)
|
|
|
|
#define TO_DEGREES(angleRadians) (angleRadians * 180.0 / PI)
|
|
|
|
|
2018-02-14 20:12:29 +01:00
|
|
|
#define SAVE_FILENAME "game.save"
|
|
|
|
#define CONFIG_FILENAME "config.json"
|
2018-01-21 10:31:38 +01:00
|
|
|
|
2018-02-07 20:20:36 +01:00
|
|
|
#define SCREEN_WIDTH 1280
|
|
|
|
#define SCREEN_HEIGHT 720
|
2018-01-21 10:31:38 +01:00
|
|
|
|
|
|
|
#define MAX_KEYBOARD_KEYS 350
|
|
|
|
#define MAX_MOUSE_BUTTONS 6
|
|
|
|
|
|
|
|
#define FPS 60
|
|
|
|
#define LOGIC_RATE (1000.0 / FPS)
|
|
|
|
|
|
|
|
#define MAX_FONTS 64
|
|
|
|
#define NUM_TEXT_BUCKETS 64
|
|
|
|
#define TEXT_TTL (1000 * 20)
|
|
|
|
|
|
|
|
#define MAX_NAME_LENGTH 32
|
|
|
|
#define MAX_DESCRIPTION_LENGTH 512
|
2018-02-07 20:20:36 +01:00
|
|
|
#define MAX_LINE_LENGTH 1024
|
2018-01-21 10:31:38 +01:00
|
|
|
#define MAX_FILENAME_LENGTH 1024
|
|
|
|
|
2018-01-24 08:16:52 +01:00
|
|
|
#define NUM_TEXTURE_BUCKETS 32
|
2018-02-19 20:14:03 +01:00
|
|
|
#define NUM_ATLAS_BUCKETS 64
|
2018-01-21 10:31:38 +01:00
|
|
|
|
2018-01-21 12:12:49 +01:00
|
|
|
#define MAP_WIDTH 200
|
|
|
|
#define MAP_HEIGHT 200
|
|
|
|
|
2018-02-12 23:40:15 +01:00
|
|
|
#define MAP_RENDER_WIDTH ((SCREEN_WIDTH / MAP_TILE_SIZE) + 1)
|
|
|
|
#define MAP_RENDER_HEIGHT ((SCREEN_HEIGHT / MAP_TILE_SIZE) + 1)
|
|
|
|
|
2018-01-21 12:12:49 +01:00
|
|
|
#define MAP_TILE_SIZE 64
|
|
|
|
#define MAP_TILE_AIR 0
|
|
|
|
#define MAP_TILE_WATER 1
|
|
|
|
#define MAP_TILE_SLIME 2
|
|
|
|
#define MAP_TILE_LAVA 3
|
|
|
|
#define MAP_TILE_SOLID 4
|
|
|
|
#define MAP_TILE_NON_SOLID 200
|
|
|
|
#define MAP_TILE_ANIMATED_WATER 240
|
|
|
|
#define MAP_TILE_ANIMATED_SLIME 245
|
|
|
|
#define MAP_TILE_ANIMATED_LAVA 250
|
|
|
|
#define MAP_TILE_OUTSIDE 255
|
|
|
|
#define MAP_TILE_MAX 256
|
|
|
|
|
2018-01-24 23:15:24 +01:00
|
|
|
#define JUMP_POWER -12
|
|
|
|
#define MAX_OXYGEN (FPS * 10)
|
2018-02-06 23:27:28 +01:00
|
|
|
#define MAX_KEY_TYPES 8
|
2018-01-26 20:14:18 +01:00
|
|
|
#define MAX_ITEMS 14
|
2018-01-21 17:50:14 +01:00
|
|
|
|
2018-01-26 08:56:12 +01:00
|
|
|
#define MAX_CHECKPOINTS 15
|
|
|
|
|
2018-02-03 09:44:02 +01:00
|
|
|
#define MAX_ENTS_TO_OBSERVE 12
|
|
|
|
|
2018-02-25 18:29:44 +01:00
|
|
|
#define MAX_SND_CHANNELS 64
|
|
|
|
|
2018-03-18 10:42:34 +01:00
|
|
|
#define MAX_SAVE_SLOTS 5
|
|
|
|
|
2018-01-24 20:04:36 +01:00
|
|
|
enum
|
|
|
|
{
|
2018-01-28 10:34:14 +01:00
|
|
|
ET_NONE,
|
2018-01-31 22:50:49 +01:00
|
|
|
ET_EFFECT,
|
|
|
|
ET_TRAP,
|
|
|
|
ET_BOB,
|
|
|
|
ET_ENEMY,
|
|
|
|
ET_TEEKA,
|
|
|
|
ET_BOSS,
|
2018-03-01 23:30:33 +01:00
|
|
|
ET_HEART,
|
|
|
|
ET_CELL,
|
2018-01-31 22:50:49 +01:00
|
|
|
ET_KEY,
|
|
|
|
ET_ITEM,
|
|
|
|
ET_CONSUMABLE,
|
|
|
|
ET_MIA,
|
|
|
|
ET_DECORATION,
|
|
|
|
ET_DOOR,
|
|
|
|
ET_LIFT,
|
|
|
|
ET_PUSHBLOCK,
|
|
|
|
ET_DESTRUCTABLE,
|
|
|
|
ET_POWER_POINT,
|
|
|
|
ET_CARD_READER,
|
|
|
|
ET_PRESSURE_PLATE,
|
|
|
|
ET_TELEPORTER,
|
|
|
|
ET_ITEM_PAD,
|
|
|
|
ET_POOL,
|
|
|
|
ET_EXIT,
|
2018-01-24 20:04:36 +01:00
|
|
|
ET_INFO_POINT
|
|
|
|
};
|
|
|
|
|
|
|
|
#define EF_NONE 0
|
2018-02-07 20:20:36 +01:00
|
|
|
#define EF_WEIGHTLESS (2 << 0)
|
2018-01-24 20:04:36 +01:00
|
|
|
#define EF_BOUNCES (2 << 1)
|
|
|
|
#define EF_TELEPORTING (2 << 2)
|
|
|
|
#define EF_NO_ENVIRONMENT (2 << 3)
|
|
|
|
#define EF_SWIMS (2 << 4)
|
|
|
|
#define EF_HALT_AT_EDGE (2 << 5)
|
|
|
|
#define EF_NO_CLIP (2 << 6)
|
|
|
|
#define EF_EXPLODES (2 << 7)
|
|
|
|
#define EF_IGNORE_BULLETS (2 << 8)
|
|
|
|
#define EF_FLICKER (2 << 9)
|
|
|
|
#define EF_FRICTIONLESS (2 << 10)
|
|
|
|
#define EF_WATER_BREATHING (2 << 11)
|
|
|
|
#define EF_IMMUNE (2 << 12)
|
|
|
|
#define EF_BOMB_SHIELD (2 << 13)
|
|
|
|
#define EF_GONE (2 << 14)
|
|
|
|
#define EF_KILL_OFFSCREEN (2 << 15)
|
|
|
|
#define EF_ALWAYS_PROCESS (2 << 16)
|
|
|
|
#define EF_NO_TELEPORT (2 << 17)
|
2018-03-02 23:21:45 +01:00
|
|
|
#define EF_NO_OBSERVE (2 << 18)
|
2018-03-03 08:41:05 +01:00
|
|
|
#define EF_BULLET_HIT (2 << 19)
|
2018-03-04 14:36:00 +01:00
|
|
|
#define EF_CRUSHABLE (2 << 20)
|
2018-01-24 20:04:36 +01:00
|
|
|
|
|
|
|
#define GRAVITY_POWER 0.5f
|
|
|
|
#define FRICTION 0.75f
|
2018-01-21 17:50:14 +01:00
|
|
|
|
2018-02-07 20:20:36 +01:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
JOYPAD_AXIS_X,
|
|
|
|
JOYPAD_AXIS_Y,
|
|
|
|
JOYPAD_AXIS_MAX
|
|
|
|
};
|
|
|
|
|
2018-01-21 17:50:14 +01:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
FACING_RIGHT,
|
2018-01-24 23:15:24 +01:00
|
|
|
FACING_LEFT,
|
|
|
|
FACING_DIE
|
2018-01-21 17:50:14 +01:00
|
|
|
};
|
2018-01-21 13:57:01 +01:00
|
|
|
|
2018-01-27 11:21:45 +01:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
DOOR_OPEN,
|
|
|
|
DOOR_CLOSED
|
|
|
|
};
|
|
|
|
|
2018-01-27 11:58:47 +01:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
LIFT_GOTO_FINISH,
|
|
|
|
LIFT_GOTO_START
|
|
|
|
};
|
|
|
|
|
2018-01-22 09:27:08 +01:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
WPN_PISTOL,
|
|
|
|
WPN_PLASMA,
|
|
|
|
WPN_SPREAD,
|
|
|
|
WPN_LASER,
|
|
|
|
WPN_GRENADES,
|
|
|
|
WPN_ANY,
|
|
|
|
WPN_AIMED_PISTOL,
|
|
|
|
WPN_MACHINE_GUN,
|
|
|
|
WPN_SHOTGUN,
|
|
|
|
WPN_MISSILE
|
|
|
|
};
|
|
|
|
|
2018-01-21 13:57:01 +01:00
|
|
|
enum
|
|
|
|
{
|
2018-01-24 23:15:24 +01:00
|
|
|
ALIVE_ALIVE,
|
2018-01-26 20:14:18 +01:00
|
|
|
ALIVE_DYING,
|
2018-01-24 23:15:24 +01:00
|
|
|
ALIVE_DEAD
|
2018-01-21 13:57:01 +01:00
|
|
|
};
|
|
|
|
|
2018-01-21 10:31:38 +01:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
CONTROL_LEFT,
|
|
|
|
CONTROL_RIGHT,
|
|
|
|
CONTROL_UP,
|
|
|
|
CONTROL_DOWN,
|
|
|
|
CONTROL_FIRE,
|
|
|
|
CONTROL_JUMP,
|
|
|
|
CONTROL_JETPACK,
|
2018-02-08 22:53:32 +01:00
|
|
|
CONTROL_PAUSE,
|
|
|
|
CONTROL_MAP,
|
2018-01-21 10:31:38 +01:00
|
|
|
CONTROL_MAX
|
|
|
|
};
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
TA_LEFT,
|
|
|
|
TA_RIGHT,
|
|
|
|
TA_CENTER
|
|
|
|
};
|
|
|
|
|
2018-01-21 13:57:01 +01:00
|
|
|
enum
|
|
|
|
{
|
2018-02-18 12:25:14 +01:00
|
|
|
MS_LOCKED,
|
2018-01-31 22:50:49 +01:00
|
|
|
MS_INCOMPLETE,
|
|
|
|
MS_PARTIAL,
|
|
|
|
MS_MISSING_HEART_CELL,
|
2018-01-24 08:16:52 +01:00
|
|
|
MS_COMPLETE
|
2018-01-21 13:57:01 +01:00
|
|
|
};
|
|
|
|
|
2018-02-14 08:26:51 +01:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
MT_NORMAL,
|
|
|
|
MT_TRAINING,
|
|
|
|
MT_OUTPOST,
|
|
|
|
MT_BOSS
|
|
|
|
};
|
|
|
|
|
2018-01-27 09:03:26 +01:00
|
|
|
enum
|
|
|
|
{
|
2018-02-02 20:10:12 +01:00
|
|
|
WS_START,
|
2018-01-27 11:32:17 +01:00
|
|
|
WS_IN_PROGRESS,
|
2018-02-02 20:10:12 +01:00
|
|
|
WS_PAUSED,
|
|
|
|
WS_GAME_COMPLETE,
|
|
|
|
WS_OBSERVING,
|
2018-02-01 22:51:43 +01:00
|
|
|
WS_COMPLETE,
|
2018-02-02 20:10:12 +01:00
|
|
|
WS_MISSION_COMPLETE,
|
2018-03-08 08:53:26 +01:00
|
|
|
WS_GAME_OVER,
|
|
|
|
WS_QUIT
|
2018-01-27 09:03:26 +01:00
|
|
|
};
|
|
|
|
|
2018-01-23 08:42:13 +01:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
PLANE_BACKGROUND,
|
|
|
|
PLANE_FOREGROUND
|
|
|
|
};
|
|
|
|
|
2018-01-24 20:04:36 +01:00
|
|
|
enum
|
|
|
|
{
|
2018-01-24 23:15:24 +01:00
|
|
|
ENV_AIR,
|
|
|
|
ENV_WATER,
|
|
|
|
ENV_SLIME,
|
|
|
|
ENV_LAVA
|
2018-01-24 20:04:36 +01:00
|
|
|
};
|
|
|
|
|
2018-01-23 08:42:13 +01:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
PT_LINE,
|
|
|
|
PT_POINT,
|
|
|
|
PT_TEXTURED
|
|
|
|
};
|
|
|
|
|
2018-01-21 12:26:02 +01:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
MSG_STANDARD,
|
|
|
|
MSG_GAMEPLAY,
|
|
|
|
MSG_PROGRESS,
|
|
|
|
MSG_OBJECTIVE
|
|
|
|
};
|
|
|
|
|
2018-01-22 08:44:15 +01:00
|
|
|
enum
|
|
|
|
{
|
2018-02-15 23:56:22 +01:00
|
|
|
SND_MENU_SELECT,
|
|
|
|
SND_MENU_BACK,
|
|
|
|
SND_MENU_NAV,
|
2018-01-22 22:47:04 +01:00
|
|
|
SND_PISTOL,
|
|
|
|
SND_MACHINE_GUN,
|
|
|
|
SND_PLASMA,
|
|
|
|
SND_THROW,
|
2018-01-23 09:04:25 +01:00
|
|
|
SND_SPREAD,
|
2018-01-22 22:47:04 +01:00
|
|
|
SND_SHOTGUN,
|
2018-01-23 09:04:25 +01:00
|
|
|
SND_LASER,
|
|
|
|
SND_MISSILE,
|
|
|
|
SND_RICO_1,
|
|
|
|
SND_RICO_2,
|
|
|
|
SND_GRENADE_BOUNCE,
|
|
|
|
SND_EXPLOSION,
|
|
|
|
SND_FLESH_HIT,
|
|
|
|
SND_METAL_HIT,
|
|
|
|
SND_DEATH_1,
|
|
|
|
SND_DEATH_2,
|
|
|
|
SND_DEATH_3,
|
|
|
|
SND_SPLAT,
|
|
|
|
SND_DROID_DIE_1,
|
|
|
|
SND_DROID_DIE_2,
|
|
|
|
SND_PRESSURE_PLATE,
|
|
|
|
SND_DOOR_START,
|
|
|
|
SND_DOOR_FINISH,
|
|
|
|
SND_CHERRY,
|
|
|
|
SND_ITEM,
|
|
|
|
SND_KEY,
|
|
|
|
SND_WEAPON,
|
|
|
|
SND_TELEPORT,
|
|
|
|
SND_APPEAR,
|
|
|
|
SND_MIA,
|
|
|
|
SND_WATER_IN,
|
|
|
|
SND_WATER_OUT,
|
|
|
|
SND_SLIME,
|
|
|
|
SND_DROWN,
|
|
|
|
SND_DENIED,
|
|
|
|
SND_CONFIRMED,
|
|
|
|
SND_MISSION_COMPLETE,
|
|
|
|
SND_HEART_CELL,
|
2018-02-14 20:12:29 +01:00
|
|
|
SND_TROPHY,
|
2018-02-27 09:14:37 +01:00
|
|
|
SND_ELECTRIC_HIT,
|
|
|
|
SND_ITEM_PAD,
|
2018-03-04 10:49:16 +01:00
|
|
|
SND_POWER_POOL,
|
2018-03-21 08:29:04 +01:00
|
|
|
SND_POP,
|
2018-01-23 09:04:25 +01:00
|
|
|
SND_MAX
|
2018-01-22 08:44:15 +01:00
|
|
|
};
|
|
|
|
|
2018-01-24 09:14:11 +01:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
WT_BUTTON,
|
2018-02-15 22:38:26 +01:00
|
|
|
WT_SLIDER,
|
2018-01-24 09:14:11 +01:00
|
|
|
WT_SPINNER,
|
2018-02-14 20:12:29 +01:00
|
|
|
WT_INPUT
|
|
|
|
};
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
2018-02-15 22:38:26 +01:00
|
|
|
TROPHY_UNEARNED,
|
2018-02-14 20:12:29 +01:00
|
|
|
TROPHY_BRONZE,
|
|
|
|
TROPHY_SILVER,
|
|
|
|
TROPHY_GOLD,
|
2018-02-15 22:38:26 +01:00
|
|
|
TROPHY_PLATINUM,
|
|
|
|
TROPHY_MAX
|
2018-01-24 09:14:11 +01:00
|
|
|
};
|
2018-02-13 22:36:42 +01:00
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
2018-03-02 09:09:04 +01:00
|
|
|
STAT_MISSIONS_COMPLETE,
|
2018-02-13 22:36:42 +01:00
|
|
|
STAT_KEYS_FOUND,
|
|
|
|
STAT_CELLS_FOUND,
|
|
|
|
STAT_HEARTS_FOUND,
|
2018-02-14 09:32:09 +01:00
|
|
|
STAT_TARGETS_DEFEATED,
|
|
|
|
STAT_MIAS_RESCUED,
|
2018-02-13 22:36:42 +01:00
|
|
|
STAT_DEATHS,
|
|
|
|
STAT_SHOTS_FIRED,
|
|
|
|
STAT_SHOTS_HIT,
|
2018-03-02 09:09:04 +01:00
|
|
|
STAT_SHOT_ACCURACY,
|
2018-02-13 22:36:42 +01:00
|
|
|
STAT_EYE_DROID_EXPLOSION_KILLS,
|
|
|
|
STAT_FLY_TIME,
|
|
|
|
STAT_SWIM_TIME,
|
|
|
|
STAT_CHERRIES_PICKED_UP,
|
|
|
|
STAT_BATTERIES_PICKED_UP,
|
|
|
|
STAT_WEAPONS_PICKED_UP,
|
|
|
|
STAT_ENEMIES_KILLED,
|
|
|
|
STAT_MISSIONS_PLAYED,
|
2018-03-02 09:09:04 +01:00
|
|
|
STAT_PERCENT_COMPLETE,
|
2018-02-13 22:36:42 +01:00
|
|
|
STAT_TIME_PLAYED,
|
|
|
|
STAT_MAX
|
|
|
|
};
|