Allow saving from map editor. More tiles (all a bit WIP) and some more map.

This commit is contained in:
stevenhowes
2021-04-08 20:34:49 +01:00
parent 8fdce7ba4b
commit 387e36f4c3
4 changed files with 18 additions and 0 deletions
+18
View File
@@ -89,6 +89,19 @@ void game2_loadmap(char* filename)
}
void game2_savemap(char* filename)
{
// Attempt to get file info
inreg.r[0] = 10;
inreg.r[1] = (int) filename;
inreg.r[2] = 0xffd;
inreg.r[4] = (int) fullmap;
inreg.r[5] = (int) fullmap + sizeof(fullmap);
_kernel_swi(OS_File,&inreg,&outreg);
}
void game2_fillmap(int xoffset, int yoffset)
{
memcpy(map[0][0],fullmap+yoffset+(xoffset*100),10);
@@ -235,6 +248,11 @@ void game2_tick_input()
readmodkey = tick + 10;
}
}
// C
if(input_readkey(81))
{
game2_savemap("mission2");
}
}
int game2_tick()