diff options
author | neoraider <devnull@localhost> | 2007-09-17 00:24:02 +0200 |
---|---|---|
committer | neoraider <devnull@localhost> | 2007-09-17 00:24:02 +0200 |
commit | d7a846e58a85ed311e83362af0b6474652d85c8a (patch) | |
tree | 965e42028a4eacb6790b908692dc321ddf5fc45f /level.cpp | |
parent | 96e9d04527dc17a2a4f8c2f7034c1c356ed5186e (diff) | |
download | zoomedit-d7a846e58a85ed311e83362af0b6474652d85c8a.tar zoomedit-d7a846e58a85ed311e83362af0b6474652d85c8a.zip |
zoomedit: Alle Datenstrukturen durch Klassen ersetzt.
Diffstat (limited to 'level.cpp')
-rw-r--r-- | level.cpp | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/level.cpp b/level.cpp deleted file mode 100644 index a8d3fdb..0000000 --- a/level.cpp +++ /dev/null @@ -1,51 +0,0 @@ -#include "level.h" -#include <stdlib.h> - - -static LEVEL *level = NULL; - - -LEVEL *getLevel() { - return level; -} - -void setLevel(LEVEL *l) { - level = l; -} - -void addRoom(LEVEL *lvl, const ROOM *room) { - lvl->nRooms++; - if(lvl->nRooms > 1) - lvl->rooms = (ROOM*)realloc(lvl->rooms, lvl->nRooms*sizeof(ROOM)); - else - lvl->rooms = (ROOM*)calloc(1, sizeof(ROOM)); - lvl->rooms[lvl->nRooms-1] = *room; -} - -void deleteRoom(LEVEL *lvl, unsigned int n) { - int i; - - lvl->nRooms--; - - for(i = n; i < lvl->nRooms; i++) - lvl->rooms[i] = lvl->rooms[i+1]; - - lvl->rooms = (ROOM*)realloc(lvl->rooms, lvl->nRooms*sizeof(ROOM)); -} - -void freeLevel(LEVEL *lvl) { - int i; - - if(lvl) { - if(lvl->rooms) { - for(i = 0; i < lvl->nRooms; i++) { - if(lvl->rooms[i].name) - free(lvl->rooms[i].name); - } - - free(lvl->rooms); - } - - free(lvl); - } -} |