mirror of
https://github.com/brmlab/brmlife.git
synced 2025-08-02 09:53:38 +02:00
Added server pre-gui interface
This commit is contained in:
parent
bde2785d76
commit
58d934343c
3 changed files with 505 additions and 0 deletions
39
rawio.h
Normal file
39
rawio.h
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue