--- /dev/null
+map.width= 40\r
+map.height= 30\r
+-./0,////////07777777777777777777777-./0\r
+1234,-,-,,777777777777777777777777771234\r
+56780-,-,,777777777777777777777777775678\r
+9:;<,---14777777777777777777777777779:;<\r
+,,0,,,,,44777/77777777777777777777777777\r
+7777,,,,44777777777777777777777777777777\r
+7777,,,,77777777777777777777777777777777\r
+7777,,,,77777777/77777777777777777777777\r
+777777777,777777/77777777777777777777777\r
+7777777777777777/77777777777777777777777\r
+7777777777777777/77777777777777777777777\r
+777777777777////-./0/////777777777777777\r
+77777777777/7777123422222///777777777777\r
+777777777//77777567822222222///777777777\r
+77777777/77777779:;</2222222222//7777777\r
+77777777/77777777777/222222222222//77777\r
+77777777/777777777777/2222222222222/7777\r
+77777777/7777777777777//222222222222/777\r
+77777777/777777777777777/////2222222/777\r
+77777777/77777777777777777777////////777\r
+77777777/7777777777777777777777777777777\r
+777777777//7777777777777777,,,,,,,777777\r
+77777777777//77777777777777,77777,777777\r
+7777777777777///77777777777,7,,,7,777777\r
+7777777777777777///77777777,7,777,777777\r
+777777777777777777777777777,7,,,,,777777\r
+-./077777777777777777777777,77777777-./0\r
+123477777777777777777777777,,,,,,,,71234\r
+5678777777777777777777777777777777775678\r
+9:;<777777777777777777777777777777779:;<\r
"objects":[
{
"height":16,
- "name":"",
+ "name":"trunk",
"properties":
{
},
- "type":"",
+ "type":"nonc",
"visible":true,
"width":32,
"x":128,
},
{
"height":16,
- "name":"",
+ "name":"stump",
"properties":
{
},
- "type":"",
+ "type":"nonc",
"visible":true,
"width":16,
"x":144,
</data>
</layer>
<objectgroup name="ob" width="40" height="30">
- <object x="128" y="32" width="32" height="16"/>
- <object x="144" y="128" width="16" height="16"/>
+ <object name="trunk" type="nonc" x="128" y="32" width="32" height="16"/>
+ <object name="stump" type="nonc" x="144" y="128" width="16" height="16"/>
</objectgroup>
</map>
return(size_of_file);\r
}\r
\r
+//from http://stackoverflow.com/questions/2736753/how-to-remove-extension-from-file-name\r
+// remove_ext: removes the "extension" from a file spec.\r
+// mystr is the string to process.\r
+// dot is the extension separator.\r
+// sep is the path separator (0 means to ignore).\r
+// Returns an allocated string identical to the original but\r
+// with the extension removed. It must be freed when you're\r
+// finished with it.\r
+// If you pass in NULL or the new string can't be allocated,\r
+// it returns NULL.\r
+\r
+char *remove_ext (char* mystr, char dot, char sep) {\r
+ char *retstr, *lastdot, *lastsep;\r
+\r
+ // Error checks and allocate string.\r
+\r
+ if (mystr == NULL)\r
+ return NULL;\r
+ if ((retstr = malloc (strlen (mystr) + 1)) == NULL)\r
+ return NULL;\r
+\r
+ // Make a copy and find the relevant characters.\r
+\r
+ strcpy (retstr, mystr);\r
+ lastdot = strrchr (retstr, dot);\r
+ lastsep = (sep == 0) ? NULL : strrchr (retstr, sep);\r
+\r
+ // If it has an extension separator.\r
+\r
+ if (lastdot != NULL) {\r
+ // and it's before the extenstion separator.\r
+\r
+ if (lastsep != NULL) {\r
+ if (lastsep < lastdot) {\r
+ // then remove it.\r
+\r
+ *lastdot = '\0';\r
+ }\r
+ } else {\r
+ // Has extension separator with no path separator.\r
+\r
+ *lastdot = '\0';\r
+ }\r
+ }\r
+\r
+ // Return the modified string.\r
+\r
+ return retstr;\r
+}\r
+\r
+//from http://quiz.geeksforgeeks.org/c-program-cyclically-rotate-array-one/\r
+void rotateR(byte *arr, byte n)\r
+{\r
+ byte x = arr[n-1], i;\r
+ for (i = n-1; i > 0; i--)\r
+ arr[i] = arr[i-1];\r
+ arr[0] = x;\r
+}\r
+\r
+void rotateL(byte *arr, byte n)\r
+{\r
+ byte x = arr[n+1], i;\r
+ for (i = n+1; i > 0; i++)\r
+ arr[i] = arr[i+1];\r
+ arr[0] = x;\r
+}\r
+\r
void printmeminfoline(byte *strc, const byte *pee, size_t h_total, size_t h_used, size_t h_free)\r
{\r
byte str[64];\r
\r
/* local function */\r
long int filesize(FILE *fp);\r
+char *remove_ext(char* mystr, char dot, char sep);\r
+void rotateR(byte arr[], byte n);\r
+void rotateL(byte arr[], byte n);\r
void printmeminfoline(byte *strc, const byte *pee, size_t h_total, size_t h_used, size_t h_free);\r
int US_CheckParm(char *parm,char **strings);\r
byte dirchar(byte in);\r
}\r
\r
//===========================================================================\r
-//from http://stackoverflow.com/questions/2736753/how-to-remove-extension-from-file-name\r
-\r
-// remove_ext: removes the "extension" from a file spec.\r
-// mystr is the string to process.\r
-// dot is the extension separator.\r
-// sep is the path separator (0 means to ignore).\r
-// Returns an allocated string identical to the original but\r
-// with the extension removed. It must be freed when you're\r
-// finished with it.\r
-// If you pass in NULL or the new string can't be allocated,\r
-// it returns NULL.\r
-\r
-char *remove_ext (char* mystr, char dot, char sep) {\r
- char *retstr, *lastdot, *lastsep;\r
-\r
- // Error checks and allocate string.\r
-\r
- if (mystr == NULL)\r
- return NULL;\r
- if ((retstr = malloc (strlen (mystr) + 1)) == NULL)\r
- return NULL;\r
-\r
- // Make a copy and find the relevant characters.\r
-\r
- strcpy (retstr, mystr);\r
- lastdot = strrchr (retstr, dot);\r
- lastsep = (sep == 0) ? NULL : strrchr (retstr, sep);\r
-\r
- // If it has an extension separator.\r
-\r
- if (lastdot != NULL) {\r
- // and it's before the extenstion separator.\r
-\r
- if (lastsep != NULL) {\r
- if (lastsep < lastdot) {\r
- // then remove it.\r
-\r
- *lastdot = '\0';\r
- }\r
- } else {\r
- // Has extension separator with no path separator.\r
-\r
- *lastdot = '\0';\r
- }\r
- }\r
-\r
- // Return the modified string.\r
-\r
- return retstr;\r
-}\r
-\r
-//from http://quiz.geeksforgeeks.org/c-program-cyclically-rotate-array-one/\r
-void rotateR(byte arr[], byte n)\r
-{\r
- byte x = arr[n-1], i;\r
- for (i = n-1; i > 0; i--)\r
- arr[i] = arr[i-1];\r
- arr[0] = x;\r
-}\r
-\r
-void rotateL(byte arr[], byte n)\r
-{\r
- byte x = arr[n+1], i;\r
- for (i = n+1; i > 0; i++)\r
- arr[i] = arr[i+1];\r
- arr[0] = x;\r
-}\r
\r
#ifndef __WATCOMC__\r
char global_temp_status_text[512];\r
if(IN_KeyDown(sc_Z)){ DRAWCORNERBOXES } \\r
if(IN_KeyDown(sc_X)){ TESTBG12 } \\r
if(IN_KeyDown(sc_C)){ TESTBG34 } \\r
- if(IN_KeyDown(sc_V)) VL_PatternDraw(&gvar.video, 0, 1, 1); \\r
- if(IN_KeyDown(sc_PgUp)){ \\r
+ if(IN_KeyDown(sc_V)) VL_PatternDraw(&gvar.video, 0, 1, 1);\r
+/* if(IN_KeyDown(sc_PgDn)){ \\r
rotateR(gvar.video.palette, sizeof(gvar.video.palette)/sizeof(gvar.video.palette[0])); \\r
- VL_UpdatePaletteWrite(&gvar.video.palette, 0); } \\r
- if(IN_KeyDown(sc_PgDn)){ \\r
+ VL_UpdatePaletteWrite(&gvar.video.palette, 0); IN_UserInput(1,1); } \\r
+ if(IN_KeyDown(sc_PgUp)){ \\r
rotateL(gvar.video.palette, sizeof(gvar.video.palette)/sizeof(gvar.video.palette[0])); \\r
- VL_UpdatePaletteWrite(&gvar.video.palette, 0); }\r
+ VL_UpdatePaletteWrite(&gvar.video.palette, 0); IN_UserInput(1,1); }*/\r
\r
void DebugMemory_(global_game_variables_t *gvar, boolean q);\r
void Shutdown16(global_game_variables_t *gvar);\r
void Startup16(global_game_variables_t *gvar);\r
void ClearMemory (global_game_variables_t *gvar);\r
void Quit (global_game_variables_t *gvar, char *error);\r
-char *remove_ext(char* mystr, char dot, char sep);\r
-void rotateR(byte arr[], byte n);\r
-void rotateL(byte arr[], byte n);\r
void turboXT(byte bakapee);\r
void nibbletest();\r
void booleantest();\r
//TODO: 16_mm and 16_ca must handle this\r
//TODO: add variables from 16_ca\r
//#define __NEWMAPTILEDATAVARS__\r
-\r
-#ifdef __NEWMAPTILEDATAVARS__\r
#define MAPLAYERS 4\r
+#ifdef __NEWMAPTILEDATAVARS__\r
#define MAPTILESPTR layertile[0]\r
#define MAPTILESPTK layertile[k]\r
#define MAPDATAPTR layerdata[0]\r
byte *data; //TODO: 16_mm and 16_ca must handle this\r
tiles_t *tiles; //TODO: 16_mm and 16_ca must handle this\r
#else\r
- byte * far *layerdata; //TODO: 16_mm and 16_ca must handle this\r
- tiles_t far *layertile[MAPLAYERS]; //TODO: 16_mm and 16_ca must handle this\r
+ byte * far *layerdata;\r
+ tiles_t far *layertile[MAPLAYERS];\r
#endif\r
int width, height; //this has to be signed!\r
byte name[16];\r
int palq=(mult)*TILEWH;\r
int palcol=0;\r
int palx, paly;\r
- for(paly=0; paly<palq; paly+=mult){\r
+ for(paly=TILEWH*8; paly<palq+TILEWH*8; paly+=mult){\r
for(palx=TILEWH*12; palx<palq+TILEWH*12; palx+=mult){\r
modexClearRegion(pee, palx+TILEWH, paly+TILEWH, mult, mult, palcol);\r
palcol++;\r
#ifdef DUMP\r
#ifdef DUMP_MAP\r
short i;\r
+#ifdef __NEWMAPTILEDATAVARS__\r
+ word k;\r
+#endif\r
#endif\r
#endif\r
char *fmt = "Memory available = %u\n";\r
fprintf(stdout, "map.height= %d\n", map.height);\r
#ifdef DUMP_MAP\r
//if(map.width*map.height != 1200)\r
- for(i=0; i<(map.width*map.height); i++)\r
+#ifdef __NEWMAPTILEDATAVARS__\r
+ for(k=0;k<MAPLAYERS;k++)\r
{\r
- //fprintf(stdout, "%04d[%02d]", i, map.data[i]);\r
- fprintf(stdout, "%c", map.MAPDATAPTR[i]+44);\r
- if(!((i+1)%map.width)){\r
- //fprintf(stdout, "[%d]", i);\r
- fprintf(stdout, "\n"); }\r
+ printf("maplayer: %u\n", k);\r
+#endif\r
+ for(i=0; i<(map.width*map.height); i++)\r
+ {\r
+ //fprintf(stdout, "%04d[%02d]", i, map.data[i]);\r
+ fprintf(stdout, "%c", map.MAPDATAPTK[i]+44);\r
+ if(!((i+1)%map.width)){\r
+ //fprintf(stdout, "[%d]", i);\r
+ fprintf(stdout, "\n"); }\r
+ }\r
+ //fprintf(stdout, "\n");\r
+#ifdef __NEWMAPTILEDATAVARS__\r
+ getch();\r
}\r
- fprintf(stdout, "\n");\r
+#endif\r
#else\r
//fprintf(stderr, "contents of the buffer\n[\n%s\n]\n", (gvar.ca.camap.mapsegs));\r
#endif\r
fprintf(stdout, "&map.height==%Fp\n", map.height);\r
fprintf(stdout, "&map.data==%Fp\n", map.data);*/\r
#endif\r
- fprintf(stdout, "okies~\n");\r
+ //fprintf(stdout, "okies~\n");\r
MM_FreePtr(&(gvar.ca.camap.mapsegs), &gvar);\r
PM_Shutdown(&gvar);\r
CA_Shutdown(&gvar);\r
map.tiles->data->offset=(paloffset/3);\r
modexPalUpdate(map.tiles->data, &paloffset, 0, 0);*/\r
VL_LoadPalFile(bakapee1p, &gvar.video.palette);\r
+ VL_LoadPalFile("data/default.pal", &gvar.video.palette);\r
\r
#ifdef FADE\r
gpal = modexNewPal();\r