summaryrefslogtreecommitdiff
path: root/src/arenaFile.c
diff options
context:
space:
mode:
authororoborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e>2008-03-07 21:12:57 +0000
committeroroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e>2008-03-07 21:12:57 +0000
commit858f01dedbb681c8e62c9dae4d7c3174991844bf (patch)
treeefe86d519ff4965373b1a2fe1f59b30e14d73d7e /src/arenaFile.c
parent44404eb5063bd5f040c7a4d8605aa3d43e3a968a (diff)
-podpora teleportov
-podpora rur git-svn-id: http://opensvn.csie.org/tuxanci_ng@9 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e
Diffstat (limited to 'src/arenaFile.c')
-rw-r--r--src/arenaFile.c59
1 files changed, 59 insertions, 0 deletions
diff --git a/src/arenaFile.c b/src/arenaFile.c
index e1cc5b4..64e59a4 100644
--- a/src/arenaFile.c
+++ b/src/arenaFile.c
@@ -12,6 +12,8 @@
#include "tux.h"
#include "shot.h"
#include "wall.h"
+#include "pipe.h"
+#include "teleport.h"
#include "item.h"
#include "director.h"
#include "path.h"
@@ -140,6 +142,61 @@ static void cmd_wall(arena_t *arena, char *line)
addList(arena->listWall, new);
}
+static void cmd_teleport(arena_t *arena, char *line)
+{
+ char str_x[STR_NUM_SIZE];
+ char str_y[STR_NUM_SIZE];
+ char str_w[STR_NUM_SIZE];
+ char str_h[STR_NUM_SIZE];
+ char str_layer[STR_NUM_SIZE];
+ char str_image[STR_SIZE];
+ teleport_t *new;
+
+ if( setValue(line, "x", str_x, STR_NUM_SIZE) != 0 )return;
+ if( setValue(line, "y", str_y, STR_NUM_SIZE) != 0 )return;
+ if( setValue(line, "w", str_w, STR_NUM_SIZE) != 0 )return;
+ if( setValue(line, "h", str_h, STR_NUM_SIZE) != 0 )return;
+ if( setValue(line, "layer", str_layer, STR_NUM_SIZE) != 0 )return;
+ if( setValue(line, "image", str_image, STR_SIZE) != 0 )return;
+
+ new = newTeleport(atoi(str_x), atoi(str_y),
+ atoi(str_w), atoi(str_h),
+ atoi(str_layer), getImage(IMAGE_GROUP_USER, str_image) );
+
+ addList(arena->listTeleport, new);
+}
+
+static void cmd_pipe(arena_t *arena, char *line)
+{
+ char str_x[STR_NUM_SIZE];
+ char str_y[STR_NUM_SIZE];
+ char str_w[STR_NUM_SIZE];
+ char str_h[STR_NUM_SIZE];
+ char str_id[STR_NUM_SIZE];
+ char str_id_out[STR_NUM_SIZE];
+ char str_position[STR_NUM_SIZE];
+ char str_layer[STR_NUM_SIZE];
+ char str_image[STR_SIZE];
+ pipe_t *new;
+
+ if( setValue(line, "x", str_x, STR_NUM_SIZE) != 0 )return;
+ if( setValue(line, "y", str_y, STR_NUM_SIZE) != 0 )return;
+ if( setValue(line, "w", str_w, STR_NUM_SIZE) != 0 )return;
+ if( setValue(line, "h", str_h, STR_NUM_SIZE) != 0 )return;
+ if( setValue(line, "id", str_id, STR_NUM_SIZE) != 0 )return;
+ if( setValue(line, "id_out", str_id_out, STR_NUM_SIZE) != 0 )return;
+ if( setValue(line, "position", str_position, STR_NUM_SIZE) != 0 )return;
+ if( setValue(line, "layer", str_layer, STR_NUM_SIZE) != 0 )return;
+ if( setValue(line, "image", str_image, STR_SIZE) != 0 )return;
+
+ new = newPipe(atoi(str_x), atoi(str_y),
+ atoi(str_w), atoi(str_h),
+ atoi(str_layer), atoi(str_id), atoi(str_id_out), atoi(str_position),
+ getImage(IMAGE_GROUP_USER, str_image) );
+
+ addList(arena->listPipe, new);
+}
+
int getArenaCount()
{
return listArenaFile->count;
@@ -225,6 +282,8 @@ arena_t* getArena(int id)
if( strncmp(line, "background", 10) == 0 )cmd_background(arena, line);
if( strncmp(line, "playMusic", 9) == 0 )cmd_playMusic(arena, line);
if( strncmp(line, "wall", 4) == 0 )cmd_wall(arena, line);
+ if( strncmp(line, "teleport", 8) == 0 )cmd_teleport(arena, line);
+ if( strncmp(line, "pipe", 4) == 0 )cmd_pipe(arena, line);
}
return arena;