summaryrefslogtreecommitdiff
path: root/src/arena.c
diff options
context:
space:
mode:
authororoborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e>2008-06-20 20:16:44 +0000
committeroroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e>2008-06-20 20:16:44 +0000
commit7af32f143eb8615163e1bc78a417434e18da0e71 (patch)
tree815f50fe8d0a5f1296436509d5d9f7b9bd7be094 /src/arena.c
parenta370d2f5860a0f89ac44af857d1059885ad1d60f (diff)
- oprava chyb s pamatov
- vyhladavanie objetku podla jeho ID ma konecne casovu narocnost log(2,n) git-svn-id: http://opensvn.csie.org/tuxanci_ng@67 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e
Diffstat (limited to 'src/arena.c')
-rw-r--r--src/arena.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/src/arena.c b/src/arena.c
index 75e94b4..d9df24f 100644
--- a/src/arena.c
+++ b/src/arena.c
@@ -32,6 +32,8 @@ arena_t* getCurrentArena()
arena_t* newArena(int w, int h)
{
arena_t *new;
+ int zone_w, zone_h;
+
new = malloc( sizeof(arena_t) );
#ifndef PUBLIC_SERVER
@@ -43,10 +45,21 @@ arena_t* newArena(int w, int h)
new->h = h;
new->listTimer = newList();
-
- new->spaceTux = newSpace(w, h, 320, 240, getStatusTux, setStatusTux);
- new->spaceItem = newSpace(w, h, 320, 240, getStatusItem, setStatusItem);
- new->spaceShot = newSpace(w, h, 320, 240, getStatusShot, setStatusShot);
+
+ if( w > 800 || h > 600)
+ {
+ zone_w = 320;
+ zone_h = 240;
+ }
+ else
+ {
+ zone_w = 80;
+ zone_h = 60;
+ }
+
+ new->spaceTux = newSpace(w, h, zone_w, zone_h, getStatusTux, setStatusTux);
+ new->spaceItem = newSpace(w, h, zone_w, zone_h, getStatusItem, setStatusItem);
+ new->spaceShot = newSpace(w, h, zone_w, zone_h, getStatusShot, setStatusShot);
return new;
}
@@ -164,13 +177,6 @@ void drawArena(arena_t *arena)
//printSpace(arena->spaceShot);
- //drawListTux(arena->listTux);
- //drawListWall(arena->listWall);
- //drawListTeleport(arena->listTeleport);
- //drawListPipe(arena->listPipe);
- //drawListShot(arena->listShot);
- //drawListItem(arena->listItem);
-
drawModule(screen_x, screen_y, WINDOW_SIZE_X, WINDOW_SIZE_Y);
/*
my_time_t t;