Subversion Repositories eduke32

Rev

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

Rev Author Line No. Line
1677 terminx 1
//-------------------------------------------------------------------------
2
/*
3
Copyright (C) 2010 EDuke32 developers and contributors
4
 
5
This file is part of EDuke32.
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.
1677 terminx 20
*/
21
//-------------------------------------------------------------------------
22
 
4747 terminx 23
#ifndef global_h_
24
#define global_h_
1677 terminx 25
 
4747 terminx 26
#ifdef global_c_
1677 terminx 27
    #define G_EXTERN
28
#else
29
    #define G_EXTERN extern
30
#endif
31
 
32
#define MAXINTERPOLATIONS MAXSPRITES
2764 helixhorne 33
// KEEPINSYNC lunatic/con_lang.lua
2530 helixhorne 34
#define MAXSKILLS 7
1677 terminx 35
 
3116 hendricks2 36
// duke3d global soup :(
37
 
38
#include "compat.h"
39
#include "build.h"
40
 
41
G_EXTERN int32_t g_numInterpolations;
42
G_EXTERN int32_t g_interpolationLock;
43
G_EXTERN int32_t oldipos[MAXINTERPOLATIONS];
44
G_EXTERN int32_t *curipos[MAXINTERPOLATIONS];
45
G_EXTERN int32_t bakipos[MAXINTERPOLATIONS];
1857 terminx 46
 
4558 hendricks2 47
#include "mmulti.h"
48
 
3116 hendricks2 49
#include "duke3d.h"
50
#include "sector.h"
51
#include "quotes.h"
52
 
4766 hendricks2 53
#ifdef __cplusplus
54
extern "C" {
55
#endif
56
 
1677 terminx 57
G_EXTERN DukeStatus_t sbar;
58
G_EXTERN actor_t actor[MAXSPRITES];
3151 helixhorne 59
// g_tile: tile-specific data THAT DOES NOT CHANGE during the course of a game
3102 terminx 60
G_EXTERN tiledata_t g_tile[MAXTILES];
1677 terminx 61
G_EXTERN animwalltype animwall[MAXANIMWALLS];
62
G_EXTERN char *ScriptQuotes[MAXQUOTES],*ScriptQuoteRedefinitions[MAXQUOTES];
63
G_EXTERN char *label;
2738 terminx 64
G_EXTERN int32_t g_musicIndex;
2897 helixhorne 65
G_EXTERN char g_loadFromGroupOnly;
2530 helixhorne 66
G_EXTERN char g_numSkills;
1677 terminx 67
G_EXTERN char myjumpingtoggle,myonground,myhardlanding,myreturntocenter;
68
G_EXTERN char pus,pub;
69
G_EXTERN char ready2send;
4472 hendricks2 70
#define MAXPLAYERNAME 32
71
G_EXTERN char szPlayerName[MAXPLAYERNAME];
3727 helixhorne 72
// XXX: menutextbuf overflow possible?
3115 terminx 73
G_EXTERN char tempbuf[MAXSECTORS<<1],packbuf[PACKBUF_SIZE],menutextbuf[128],buf[1024];
4472 hendricks2 74
#define TYPEBUFSIZE 141
75
G_EXTERN char typebuf[TYPEBUFSIZE];
1677 terminx 76
G_EXTERN input_t avg;
77
G_EXTERN input_t loc;
78
G_EXTERN input_t recsync[RECSYNCBUFSIZ];
3337 hendricks2 79
G_EXTERN int16_t SpriteDeletionQueue[1024],g_spriteDeleteQueuePos;
1677 terminx 80
G_EXTERN int16_t animatesect[MAXANIMATES];
4220 helixhorne 81
G_EXTERN int16_t g_curViewscreen;
1677 terminx 82
G_EXTERN int16_t cyclers[MAXCYCLERS][6],g_numCyclers;
83
G_EXTERN int16_t g_globalRandom;
84
G_EXTERN int16_t g_mirrorWall[64],g_mirrorSector[64],g_mirrorCount;
85
G_EXTERN int16_t g_numAnimWalls;
86
G_EXTERN int16_t g_numClouds,clouds[128],cloudx[128],cloudy[128];
87
G_EXTERN int16_t myang,omyang,mycursectnum,myjumpingcounter;
88
G_EXTERN int16_t myhoriz,omyhoriz,myhorizoff,omyhorizoff;
89
G_EXTERN int32_t *animateptr[MAXANIMATES];
90
G_EXTERN int32_t animategoal[MAXANIMATES],animatevel[MAXANIMATES],g_animateCount;
91
G_EXTERN int32_t cloudtotalclock;
92
G_EXTERN int32_t g_currentFrameRate;
93
G_EXTERN int32_t g_damageCameras,g_freezerSelfDamage;
94
G_EXTERN int32_t g_doQuickSave;
3478 helixhorne 95
G_EXTERN uint16_t g_earthquakeTime;
1677 terminx 96
G_EXTERN int32_t g_gameQuit;
97
G_EXTERN int32_t g_impactDamage,g_maxPlayerHealth;
98
G_EXTERN int32_t g_musicSize;
99
G_EXTERN int32_t g_numLabels,g_numDefaultLabels;
100
G_EXTERN int32_t g_scriptDebug;
101
G_EXTERN int32_t g_showShareware;
3116 hendricks2 102
G_EXTERN int8_t g_numPlayerSprites;
1677 terminx 103
G_EXTERN int32_t g_tripbombLaserMode;
104
G_EXTERN int32_t msx[2048],msy[2048];
105
G_EXTERN int32_t neartaghitdist,lockclock,g_startArmorAmount;
106
G_EXTERN int32_t playerswhenstarted;
107
G_EXTERN int32_t screenpeek;
108
G_EXTERN int32_t startofdynamicinterpolations;
4703 terminx 109
G_EXTERN int32_t ototalclock;
3102 terminx 110
G_EXTERN intptr_t *g_parsingActorPtr;
4902 terminx 111
G_EXTERN intptr_t *g_scriptPtr;
2152 helixhorne 112
G_EXTERN int32_t *labelcode,*labeltype;
1677 terminx 113
G_EXTERN intptr_t *script;
4588 helixhorne 114
G_EXTERN map_t MapInfo[(MAXVOLUMES+1)*MAXLEVELS];  // +1 volume for "intro", "briefing" and "loading" music
4961 helixhorne 115
 
116
// XXX: I think this pragma pack is meaningless here.
117
// MSDN (https://msdn.microsoft.com/en-us/library/2e70t5y1%28VS.80%29.aspx) says:
118
// "pack takes effect at the first struct, union, or class declaration after
119
//  the pragma is seen; pack has no effect on definitions."
3116 hendricks2 120
#pragma pack(push,1)
4961 helixhorne 121
#ifdef global_c_
122
static playerdata_t g_player_s[1 + MAXPLAYERS];
123
playerdata_t *const g_player = &g_player_s[1];
124
#else
125
extern playerdata_t *const g_player;
126
#endif
1677 terminx 127
G_EXTERN playerspawn_t g_playerSpawnPoints[MAXPLAYERS];
3116 hendricks2 128
G_EXTERN input_t inputfifo[MOVEFIFOSIZ][MAXPLAYERS];
129
#pragma pack(pop)
4961 helixhorne 130
 
3151 helixhorne 131
G_EXTERN projectile_t ProjectileData[MAXTILES];
3102 terminx 132
G_EXTERN projectile_t SpriteProjectile[MAXSPRITES];
1677 terminx 133
G_EXTERN sound_t g_sounds[MAXSOUNDS];
134
G_EXTERN uint32_t everyothertime;
135
G_EXTERN uint32_t g_moveThingsCount;
136
G_EXTERN vec3_t my,omy,myvel;
137
G_EXTERN volatile char g_soundlocks[MAXSOUNDS];
138
G_EXTERN int32_t g_restorePalette;
139
G_EXTERN int32_t g_screenCapture;
140
G_EXTERN int32_t g_noEnemies;
141
 
4747 terminx 142
#ifndef global_c_
4961 helixhorne 143
extern const char *s_buildDate;
144
extern int32_t g_spriteGravity;
145
extern int16_t g_spriteDeleteQueueSize;
146
extern char EpisodeNames[MAXVOLUMES][33];
5033 hendricks2 147
extern int32_t EpisodeFlags[MAXVOLUMES];
4961 helixhorne 148
extern char SkillNames[MAXSKILLS][33];
149
extern char GametypeNames[MAXGAMETYPES][33];
150
extern int32_t GametypeFlags[MAXGAMETYPES];
151
extern char g_numGametypes;
152
extern char g_numVolumes;
153
extern int32_t g_timerTicsPerSecond;
154
extern int32_t g_actorRespawnTime;
155
extern int32_t g_itemRespawnTime;
156
extern int32_t g_scriptSize;
157
extern int16_t BlimpSpawnSprites[15];
158
extern int32_t g_playerFriction;
159
extern int32_t g_numFreezeBounces;
160
extern int32_t g_lastSaveSlot;
161
extern int32_t g_rpgBlastRadius;
162
extern int32_t g_pipebombBlastRadius;
163
extern int32_t g_tripbombBlastRadius;
164
extern int32_t g_shrinkerBlastRadius;
165
extern int32_t g_morterBlastRadius;
166
extern int32_t g_bouncemineBlastRadius;
167
extern int32_t g_seenineBlastRadius;
168
extern char CheatKeys[2];
169
extern char setupfilename[BMAX_PATH];
1677 terminx 170
#endif
3337 hendricks2 171
 
5033 hendricks2 172
enum
173
{
174
    EF_HIDEFROMSP = 1<<0,
5041 hendricks2 175
    // EF_HIDEFROMMP = 1<<1,
5033 hendricks2 176
};
177
 
4766 hendricks2 178
#ifdef __cplusplus
179
}
3337 hendricks2 180
#endif
4766 hendricks2 181
 
182
#endif