home
·
contact
·
privacy
projects
/
plomrogue
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Removed unused textfile_sizes() functionality, appropriately renamed it.
[plomrogue]
/
src
/
server
/
map.c
diff --git
a/src/server/map.c
b/src/server/map.c
index f46b03e99fc30c1227c1e91636e418039d7fe895..29beb1a03d5d0a6ebf1113d6ead1cd34763f2573 100644
(file)
--- a/
src/server/map.c
+++ b/
src/server/map.c
@@
-1,10
+1,9
@@
/* src/server/map.c */
#include "map.h"
/* src/server/map.c */
#include "map.h"
-#include <stdint.h> /* uint8_t, uint16_t, uint32_t */
-#include "../common/map.h" /* struct Map */
+#include <stdint.h> /* uint8_t, uint16_t */
#include "../common/try_malloc.h" /* try_malloc() */
#include "../common/try_malloc.h" /* try_malloc() */
-#include "../common/yx_uint
16.h" /* struct yx_uint16
*/
+#include "../common/yx_uint
8.h" /* struct yx_uint8
*/
#include "rrand.h" /* rrand() */
#include "world.h" /* global world */
#include "rrand.h" /* rrand() */
#include "world.h" /* global world */
@@
-13,11
+12,9
@@
extern void init_map()
{
char * f_name = "init_map()";
extern void init_map()
{
char * f_name = "init_map()";
- world.map.size.x = 64;
- world.map.size.y = 64;
- uint32_t size = world.map.size.x * world.map.size.y;
+ uint16_t size = world.map.size.x * world.map.size.y;
world.map.cells = try_malloc(size, f_name);
world.map.cells = try_malloc(size, f_name);
- uint
16
_t y, x;
+ uint
8
_t y, x;
for (y = 0; y < world.map.size.y; y++)
{
for (x = 0;
for (y = 0; y < world.map.size.y; y++)
{
for (x = 0;
@@
-25,7
+22,7
@@
extern void init_map()
world.map.cells[(y * world.map.size.x) + x] = '~', x++);
}
world.map.cells[size / 2 + (world.map.size.x / 2)] = '.';
world.map.cells[(y * world.map.size.x) + x] = '~', x++);
}
world.map.cells[size / 2 + (world.map.size.x / 2)] = '.';
- uint
32
_t curpos;
+ uint
16
_t curpos;
while (1)
{
y = rrand() % world.map.size.y;
while (1)
{
y = rrand() % world.map.size.y;
@@
-54,7
+51,7
@@
extern void init_map()
-extern uint8_t is_passable(struct yx_uint
16
pos)
+extern uint8_t is_passable(struct yx_uint
8
pos)
{
uint8_t passable = 0;
if ( 0 <= pos.x && pos.x < world.map.size.x
{
uint8_t passable = 0;
if ( 0 <= pos.x && pos.x < world.map.size.x