2 Copyright (C) 1998 BJ Eirich (aka vecna)
\r
3 This program is free software; you can redistribute it and/or
\r
4 modify it under the terms of the GNU General Public License
\r
5 as published by the Free Software Foundation; either version 2
\r
6 of the License, or (at your option) any later version.
\r
7 This program is distributed in the hope that it will be useful,
\r
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
\r
10 See the GNU General Public Lic
\r
11 See the GNU General Public License for more details.
\r
12 You should have received a copy of the GNU General Public License
\r
13 along with this program; if not, write to the Free Software
\r
14 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
\r
20 extern const char *const ME2_VERSION;
\r
24 #define byte unsigned char
\r
25 #define word unsigned short
\r
29 unsigned short start; // strand start
\r
30 unsigned short finish; // strand end
\r
31 unsigned short delay; // tile-switch delay
\r
32 unsigned short mode; // tile-animation mode
\r
37 char pmultx,pdivx; // parallax multiplier/divisor for X
\r
38 char pmulty,pdivy; // parallax multiplier/divisor for Y
\r
39 unsigned short sizex, sizey; // layer dimensions.
\r
40 unsigned char trans, hline; // transparency flag | hline (raster fx)
\r
45 char name[40]; // zone name/desc
\r
46 unsigned short script; // script to call thingy
\r
47 unsigned short percent; // chance of executing
\r
48 unsigned short delay; // step-delay
\r
49 unsigned short aaa; // Accept Adjacent Activation
\r
50 unsigned short entityscript; // script to call for entities
\r
55 int x, y; // xwc, ywx position
\r
56 word tx, ty; // xtc, ytc position
\r
57 byte facing; // direction entity is facing
\r
58 byte moving, movecnt; // direction entity is moving
\r
59 byte frame; // bottom-line frame to display
\r
60 byte specframe; // special-frame set thingo
\r
61 byte chrindex, reset; // CHR index | Reset animation
\r
62 byte obsmode1, obsmode2; // can be obstructed | Is an obstruction
\r
63 byte speed, speedct; // entity speed, speedcount :)
\r
64 byte delayct; // animation frame-delay
\r
65 char *animofs, *moveofs; // anim script | move script
\r
66 byte face, actm; // auto-face | activation mode
\r
67 byte movecode, movescript; // movement type | movement script
\r
68 byte ctr, mode; // sub-tile move ctr, mode flag (internal)
\r
69 word step, delay; // step, delay
\r
70 word stepctr, delayctr; // internal use counters
\r
71 word data1, data2, data3; //
\r
72 word data4, data5, data6; //
\r
73 int actscript; // activation script
\r
74 int expand1, expand2; //
\r
75 int expand3, expand4; //
\r
76 char desc[20]; // Entity description.
\r
88 extern layer_r layer[4];
\r
89 extern vspanim_r vspanim[100];
\r
90 extern zoneinfo zones[256];
\r
91 extern unsigned short vadelay[100];
\r
92 extern entity_r entity[256]; // Entity records.
\r
93 extern byte entities; // number of allocated entities.
\r
94 extern chrlist_r chrlist[100];
\r
96 extern movescript ms[100]; // move scripts arrays
\r
97 extern byte nms; // number of movement scripts
\r
99 extern char *obstruct, *zone, curzone;
\r
100 extern char numlayers, wrap;
\r
101 extern unsigned short *layers[6];
\r
102 extern char rstring[20];
\r
103 extern char mapname[60], vspname[60];
\r
104 extern char musname[60];
\r
105 extern short xstart, ystart;
\r
107 // -- vsp related data --
\r
109 extern unsigned short numtiles;
\r
110 extern unsigned char *vsp;
\r
112 // -- editing related data --
\r
114 extern int xwin, ywin, bmode;
\r
115 extern char mouse_scroll;
\r
116 extern short lt, rt;
\r
117 extern char layertoggle[10], el, modified;
\r
119 extern word *copybuf;
\r
120 extern int copybuf_wide,copybuf_deep;
\r
121 extern int selx1, sely1, selx2, sely2;
\r
122 extern int shifted, pasting;
\r
124 extern int numzones; // Number of active zones.
\r
126 extern int moving_up,moving_down,moving_left,moving_right;
\r
128 extern void LoadTransTable();
\r
129 extern int Exist(char *fname);
\r
130 extern void err(char *str, ...);
\r
131 extern void errf(char *str, char *str1);
\r
132 extern void errn(char *str, int n);
\r
133 extern int random(int min, int max);
\r
134 extern void PlayMusic(char *fname);
\r
135 extern void StopMusic();
\r
136 extern void LoadVSP(char *fname);
\r
137 extern void SaveVSP(char *fname);
\r
138 extern void EmitC (char c);
\r
139 extern void EmitW (short int w);
\r
140 extern void WriteCompressedLayer1(unsigned char *p, int len);
\r
141 extern void ReadCompressedLayer1(unsigned char *dest, int len, FILE *f);
\r
142 extern void WriteCompressedLayer2(unsigned short *p,int len);
\r
143 extern void ReadCompressedLayer2(unsigned short *dest, int len, FILE *f);
\r
144 extern void CountUsedZones();
\r
145 extern void CountMoveScripts();
\r
146 extern void CountCHRs();
\r
147 extern void SaveMAP(char *fname);
\r
148 extern void LoadOldMAP(FILE *f);
\r
149 extern void LoadMAP(char *fname);
\r
150 extern void InitTileIDX();
\r
151 extern void CheckTimerStuff();
\r
152 extern void SaveNewCFG();
\r
153 extern void ShellToDOS();
\r
154 extern void ShellVERGE();
\r
155 extern void ShellMAP();
\r
156 extern void ShellEditMAP();
\r
157 extern void ShellEditSystem();
\r
158 extern void CompileAll();
\r
159 extern void CompileMAP();
\r
160 extern void tickhandler(void);
\r
161 extern void RenderHighlight();
\r
162 extern int EntityThere(int xw, int yw);
\r
163 extern void AllocateEntity(int xw, int yw);
\r
164 extern void ProcessEntity(int xw, int yw);
\r
165 extern void DeleteEntity(int xw, int yw);
\r
166 extern void Browse(char n, char *m1, char *m2, char *m3, char *m4, char *dest);
\r
168 // Includes for a_memory.c
\r
170 void *valloc(int amount, char *desc, int owner);
\r
171 void *qvalloc(int amount);
\r
172 int vfree(void *pointer);
\r
173 void qvfree(void *pointer);
\r
174 void FreeByOwner(int owner);
\r
175 void MemReport(void);
\r
176 void CheckCorruption(void);
\r
178 #define free ERROR_YEAH_REPLACE_THIS_WITH_VFREE
\r
180 #endif // MAPED_INC
\r