31 lines
634 B
C
31 lines
634 B
C
#include "map.h"
|
|
#include "scroll.h"
|
|
#include "arch/universal.h"
|
|
#include "maptest.h"
|
|
|
|
char readmap(int x, int y) {
|
|
if (x > (MAP_WIDTH - 1)) {
|
|
return '&';
|
|
}
|
|
if (y > (MAP_HEIGHT - 1)) {
|
|
return '&';
|
|
}
|
|
if (x < 0) {
|
|
return '&';
|
|
}
|
|
if (y < 0) {
|
|
return '&';
|
|
}
|
|
|
|
return maptest[y][x]; //TODO make it be able to rrad feom multiple maps but idk how to do that
|
|
}
|
|
int render_map(void) {
|
|
int x;
|
|
int y;
|
|
for(y = 0; y < 40; y++) {
|
|
for(x = 0; x < 80; x++) {
|
|
zom_putcharat(scrolled_x(x), scrolled_y(y), readmap(x, y));
|
|
}
|
|
}
|
|
return 0;
|
|
}
|