Subversion Repositories eduke32

Rev

Rev 5156 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5 Plagman 1
//-------------------------------------------------------------------------
2
/*
1652 terminx 3
Copyright (C) 2010 EDuke32 developers and contributors
5 Plagman 4
 
1652 terminx 5
This file is part of EDuke32.
5 Plagman 6
 
7
EDuke32 is free software; you can redistribute it and/or
8
modify it under the terms of the GNU General Public License version 2
9
as published by the Free Software Foundation.
10
 
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14
 
15
See the GNU General Public License for more details.
16
 
17
You should have received a copy of the GNU General Public License
18
along with this program; if not, write to the Free Software
4541 hendricks2 19
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
5 Plagman 20
*/
21
//-------------------------------------------------------------------------
22
 
4747 terminx 23
#ifndef duke3d_h_
24
#define duke3d_h_
317 terminx 25
 
5 Plagman 26
// JBF
27
#include "compat.h"
28
#include "a.h"
29
#include "build.h"
1677 terminx 30
 
723 terminx 31
#ifdef POLYMER
1677 terminx 32
    #include "polymer.h"
1660 terminx 33
#else
1820 terminx 34
#ifdef USE_OPENGL
1677 terminx 35
    #include "polymost.h"
311 Plagman 36
#endif
1660 terminx 37
#endif
1677 terminx 38
 
5 Plagman 39
#include "cache1d.h"
40
#include "pragmas.h"
41
#include "baselayer.h"
1677 terminx 42
#include "file_lib.h"
43
#include "keyboard.h"
44
#include "fx_man.h"
5 Plagman 45
 
1677 terminx 46
#define APPNAME             "EDuke32"
47
#define VERSION             "2.0.0devel"
4321 hendricks2 48
#define HEAD2               APPNAME " " VERSION
5 Plagman 49
 
1677 terminx 50
#define VOLUMEALL           (g_Shareware == 0)
51
#define PLUTOPAK            (g_scriptVersion == 14)
52
#define VOLUMEONE           (g_Shareware == 1)
1552 terminx 53
 
1677 terminx 54
// increase by 3, because atomic GRP adds 1, and Shareware adds 2
3947 helixhorne 55
#ifdef LUNATIC
56
// Lunatic
5156 helixhorne 57
# define BYTEVERSION_JF      303
3947 helixhorne 58
#else
59
// Non-Lua build
5156 helixhorne 60
# define BYTEVERSION_JF      303
3947 helixhorne 61
#endif
2209 helixhorne 62
 
4792 helixhorne 63
//#define BYTEVERSION_13      27
64
//#define BYTEVERSION_14      116
65
//#define BYTEVERSION_15      117
1677 terminx 66
#define BYTEVERSION         (BYTEVERSION_JF+(PLUTOPAK?1:(VOLUMEONE<<1)))
1592 terminx 67
 
1677 terminx 68
#define NUMPAGES            1
1205 terminx 69
 
1677 terminx 70
#define RECSYNCBUFSIZ       2520   //2520 is the (LCM of 1-8)*3
71
#define MOVEFIFOSIZ         2
1116 terminx 72
 
2763 helixhorne 73
// KEEPINSYNC lunatic/con_lang.lua
1677 terminx 74
#define MAXVOLUMES          7
2727 hendricks2 75
#define MAXLEVELS           64
1677 terminx 76
#define MAXGAMETYPES        16
5 Plagman 77
 
4588 helixhorne 78
enum {
79
    MUS_FIRST_SPECIAL = MAXVOLUMES*MAXLEVELS,
80
 
81
    MUS_INTRO = MUS_FIRST_SPECIAL,
82
    MUS_BRIEFING = MUS_FIRST_SPECIAL + 1,
83
    MUS_LOADING = MUS_FIRST_SPECIAL + 2,
84
};
85
 
3007 helixhorne 86
////////// TIMING CONSTANTS //////////
87
// The number of 'totalclock' increments per second:
88
#define TICRATE             120
89
// The number of game state updates per second:
90
#define REALGAMETICSPERSEC  30
91
// The number of 'totalclock' increments per game state update:
92
// NOTE: calling a game state update a 'frame' is really weird.
93
// (This used to be TICRATE/GAMETICSPERSEC, which was 120/26 = 4.615~ truncated
94
// to 4 by integer division.)
95
#define TICSPERFRAME        (TICRATE/REALGAMETICSPERSEC)
96
// Used as a constant to satisfy all of the calculations written with ticrate =
97
// 26 in mind:
1677 terminx 98
#define GAMETICSPERSEC      26
241 terminx 99
 
3007 helixhorne 100
 
3079 terminx 101
#define PACKBUF_SIZE        32768
5 Plagman 102
 
1677 terminx 103
#define TILE_SAVESHOT       (MAXTILES-1)
104
#define TILE_LOADSHOT       (MAXTILES-3)
105
#define TILE_TILT           (MAXTILES-2)
106
#define TILE_ANIM           (MAXTILES-4)
107
#define TILE_VIEWSCR        (MAXTILES-5)
4225 helixhorne 108
EDUKE32_STATIC_ASSERT(5 <= MAXTILES-MAXUSERTILES);
1215 terminx 109
 
4346 helixhorne 110
// sprites with these statnums should be considered for fixing
3316 helixhorne 111
#define ROTFIXSPR_STATNUMP(k) ((k)==STAT_DEFAULT || (k)==STAT_STANDABLE || (k)==STAT_FX || \
2646 helixhorne 112
                            (k)==STAT_FALLER || (k)==STAT_LIGHT)
3316 helixhorne 113
#define ROTFIXSPR_MAGIC 0x18190000
1913 helixhorne 114
 
1677 terminx 115
// JBF 20040604: sync is a function on some platforms
116
#define sync                dsync
5 Plagman 117
 
2337 helixhorne 118
// Uncomment the following to remove calls to a.nasm functions with the GL renderers
119
// so that debugging with valgrind --smc-check=none is possible:
120
//#define DEBUG_VALGRIND_NO_SMC
121
 
2726 hendricks2 122
#include "common_game.h"
1677 terminx 123
#include "namesdyn.h"
124
#include "function.h"
125
#include "macros.h"
5 Plagman 126
#include "gamedefs.h"
127
#include "config.h"
128
#include "sounds.h"
129
#include "control.h"
130
#include "_rts.h"
131
#include "rts.h"
3834 hendricks2 132
#include "soundsdyn.h"
5 Plagman 133
#include "music.h"
1677 terminx 134
#include "player.h"
135
#include "actors.h"
1802 terminx 136
#include "quotes.h"
1677 terminx 137
#include "global.h"
138
#include "sector.h"
139
#include "net.h"
140
#include "game.h"
141
#include "gamedef.h"
142
#include "gameexec.h"
143
#include "gamevars.h"
5 Plagman 144
 
3266 helixhorne 145
#ifdef LUNATIC
146
# include "lunatic_game.h"
147
#endif
148
 
3344 helixhorne 149
static inline int32_t G_HaveActor(int32_t actortile)
150
{
151
#ifdef LUNATIC
3456 helixhorne 152
    return El_HaveActor(actortile);
153
#else
154
    return g_tile[actortile].execPtr!=NULL;
3344 helixhorne 155
#endif
156
}
157
 
158
static inline int32_t G_InitialActorStrength(int32_t actortile)
159
{
3410 helixhorne 160
#ifdef LUNATIC
4328 helixhorne 161
    return g_elActors[actortile].strength;
3344 helixhorne 162
#else
4318 hendricks2 163
    return G_HaveActor(actortile) ? g_tile[actortile].execPtr[0] : 0;
3344 helixhorne 164
#endif
165
}
166
 
5 Plagman 167
#endif