From 7af32f143eb8615163e1bc78a417434e18da0e71 Mon Sep 17 00:00:00 2001 From: oroborus Date: Fri, 20 Jun 2008 20:16:44 +0000 Subject: - 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 --- src/arena.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'src/arena.c') 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; -- cgit v1.2.3