Added server pre-gui interface

This commit is contained in:
sachy 2011-11-28 21:08:48 +01:00
parent bde2785d76
commit 58d934343c
3 changed files with 505 additions and 0 deletions

39
rawio.h Normal file
View file

@ -0,0 +1,39 @@
#ifndef RAWIO
#define RAWIO
#include "map.h"
#include <fstream>
#include <iostream>
int rawio_map(map *map)
{
std::ofstream mapout;
mapout.open("rawio_map",std::ios::out|std::ios::trunc);
if(mapout.is_open())
{
for (int y = 0; y < map->h; y++)
{
for (int x = 0; x < map->w; x++)
mapout << map->tile_at(x, y).symbol();
mapout << std::endl;
}
mapout.close();
return 0;
}
return -1;//cannot open outstream
}
int rawio_cfg(map *map)
{
std::ofstream cfgout;
cfgout.open("rawio_cfg",std::ios::out|std::ios::trunc);
if(cfgout.is_open())
{
cfgout<<map->w<<std::endl;
cfgout<<map->h<<std::endl;
cfgout.close();
return 0;
}
return -1;
}
#endif