]> 4ch.mooo.com Git - 16.git/blobdiff - 16/v2/source/MAPED/MAPED.H
refresh wwww
[16.git] / 16 / v2 / source / MAPED / MAPED.H
diff --git a/16/v2/source/MAPED/MAPED.H b/16/v2/source/MAPED/MAPED.H
new file mode 100755 (executable)
index 0000000..431bcd2
--- /dev/null
@@ -0,0 +1,180 @@
+/*\r
+Copyright (C) 1998 BJ Eirich (aka vecna)\r
+This program is free software; you can redistribute it and/or\r
+modify it under the terms of the GNU General Public License\r
+as published by the Free Software Foundation; either version 2\r
+of the License, or (at your option) any later version.\r
+This program is distributed in the hope that it will be useful,\r
+but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\r
+See the GNU General Public Lic\r
+See the GNU General Public License for more details.\r
+You should have received a copy of the GNU General Public License\r
+along with this program; if not, write to the Free Software\r
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.\r
+*/\r
+\r
+#ifndef MAPED_INC\r
+#define MAPED_INC\r
+\r
+extern const char *const ME2_VERSION;\r
+\r
+#include <stdio.h>\r
+\r
+#define byte unsigned char\r
+#define word unsigned short\r
+\r
+typedef struct\r
+{\r
+  unsigned short start;              // strand start\r
+  unsigned short finish;             // strand end\r
+  unsigned short delay;              // tile-switch delay\r
+  unsigned short mode;               // tile-animation mode\r
+} vspanim_r;\r
+\r
+typedef struct\r
+{\r
+  char pmultx,pdivx;                 // parallax multiplier/divisor for X\r
+  char pmulty,pdivy;                 // parallax multiplier/divisor for Y\r
+  unsigned short sizex, sizey;       // layer dimensions.\r
+  unsigned char trans, hline;        // transparency flag | hline (raster fx)\r
+} layer_r;\r
+\r
+typedef struct\r
+{\r
+  char name[40];                     // zone name/desc\r
+  unsigned short script;             // script to call thingy\r
+  unsigned short percent;            // chance of executing\r
+  unsigned short delay;              // step-delay\r
+  unsigned short aaa;                // Accept Adjacent Activation\r
+  unsigned short entityscript;       // script to call for entities\r
+} zoneinfo;\r
+\r
+typedef struct\r
+{\r
+  int x, y;                            // xwc, ywx position\r
+  word tx, ty;                         // xtc, ytc position\r
+  byte facing;                         // direction entity is facing\r
+  byte moving, movecnt;                // direction entity is moving\r
+  byte frame;                          // bottom-line frame to display\r
+  byte specframe;                      // special-frame set thingo\r
+  byte chrindex, reset;                // CHR index | Reset animation\r
+  byte obsmode1, obsmode2;             // can be obstructed | Is an obstruction\r
+  byte speed, speedct;                 // entity speed, speedcount :)\r
+  byte delayct;                        // animation frame-delay\r
+  char *animofs, *moveofs;             // anim script | move script\r
+  byte face, actm;                     // auto-face | activation mode\r
+  byte movecode, movescript;           // movement type | movement script\r
+  byte ctr, mode;                      // sub-tile move ctr, mode flag (internal)\r
+  word step, delay;                    // step, delay\r
+  word stepctr, delayctr;              // internal use counters\r
+  word data1, data2, data3;            //\r
+  word data4, data5, data6;            //\r
+  int  actscript;                      // activation script\r
+  int  expand1, expand2;               //\r
+  int  expand3, expand4;               //\r
+  char desc[20];                       // Entity description.\r
+} entity_r;\r
+\r
+typedef struct\r
+{\r
+  char t[60];\r
+} chrlist_r;\r
+\r
+typedef struct {\r
+  char t[200];\r
+} movescript;\r
+\r
+extern layer_r layer[4];\r
+extern vspanim_r vspanim[100];\r
+extern zoneinfo zones[256];\r
+extern unsigned short vadelay[100];\r
+extern entity_r entity[256];              // Entity records.\r
+extern byte entities;                     // number of allocated entities.\r
+extern chrlist_r chrlist[100];\r
+extern byte nmchr;\r
+extern movescript ms[100];                  // move scripts arrays\r
+extern byte nms;                          // number of movement scripts\r
+\r
+extern char *obstruct, *zone, curzone;\r
+extern char numlayers, wrap;\r
+extern unsigned short *layers[6];\r
+extern char rstring[20];\r
+extern char mapname[60], vspname[60];\r
+extern char musname[60];\r
+extern short xstart, ystart;\r
+\r
+// -- vsp related data --\r
+\r
+extern unsigned short numtiles;\r
+extern unsigned char *vsp;\r
+\r
+// -- editing related data --\r
+\r
+extern int xwin, ywin, bmode;\r
+extern char mouse_scroll;\r
+extern short lt, rt;\r
+extern char layertoggle[10], el, modified;\r
+\r
+extern word *copybuf;\r
+extern int copybuf_wide,copybuf_deep;\r
+extern int selx1, sely1, selx2, sely2;\r
+extern int shifted, pasting;\r
+\r
+extern int numzones;                      // Number of active zones.\r
+\r
+extern int moving_up,moving_down,moving_left,moving_right;\r
+\r
+extern void LoadTransTable();\r
+extern int  Exist(char *fname);\r
+extern void err(char *str, ...);\r
+extern void errf(char *str, char *str1);\r
+extern void errn(char *str, int n);\r
+extern int  random(int min, int max);\r
+extern void PlayMusic(char *fname);\r
+extern void StopMusic();\r
+extern void LoadVSP(char *fname);\r
+extern void SaveVSP(char *fname);\r
+extern void EmitC (char c);\r
+extern void EmitW (short int w);\r
+extern void WriteCompressedLayer1(unsigned char *p, int len);\r
+extern void ReadCompressedLayer1(unsigned char *dest, int len, FILE *f);\r
+extern void WriteCompressedLayer2(unsigned short *p,int len);\r
+extern void ReadCompressedLayer2(unsigned short *dest, int len, FILE *f);\r
+extern void CountUsedZones();\r
+extern void CountMoveScripts();\r
+extern void CountCHRs();\r
+extern void SaveMAP(char *fname);\r
+extern void LoadOldMAP(FILE *f);\r
+extern void LoadMAP(char *fname);\r
+extern void InitTileIDX();\r
+extern void CheckTimerStuff();\r
+extern void SaveNewCFG();\r
+extern void ShellToDOS();\r
+extern void ShellVERGE();\r
+extern void ShellMAP();\r
+extern void ShellEditMAP();\r
+extern void ShellEditSystem();\r
+extern void CompileAll();\r
+extern void CompileMAP();\r
+extern void tickhandler(void);\r
+extern void RenderHighlight();\r
+extern int EntityThere(int xw, int yw);\r
+extern void AllocateEntity(int xw, int yw);\r
+extern void ProcessEntity(int xw, int yw);\r
+extern void DeleteEntity(int xw, int yw);\r
+extern void Browse(char n, char *m1, char *m2, char *m3, char *m4, char *dest);\r
+\r
+// Includes for a_memory.c\r
+\r
+void *valloc(int amount, char *desc, int owner);\r
+void *qvalloc(int amount);\r
+int  vfree(void *pointer);\r
+void qvfree(void *pointer);\r
+void FreeByOwner(int owner);\r
+void MemReport(void);\r
+void CheckCorruption(void);\r
+\r
+#define free ERROR_YEAH_REPLACE_THIS_WITH_VFREE\r
+\r
+#endif // MAPED_INC\r