mock: levels.txt automatisch generieren
authorWintermate <wintermute@hannover.ccc.de>
Wed, 23 Oct 2013 20:44:59 +0000 (22:44 +0200)
committerWintermate <wintermute@hannover.ccc.de>
Wed, 23 Oct 2013 20:44:59 +0000 (22:44 +0200)
badge/jumpnrun/levels/levels.txt [deleted file]
mock/Makefile
mock/badge_main_loop.c
mock/tools/level-converter.cc

diff --git a/badge/jumpnrun/levels/levels.txt b/badge/jumpnrun/levels/levels.txt
deleted file mode 100644 (file)
index e1558ca..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-loclhost
-router
-23xentry
-23xhq
-smb
-skynet
-wrongtrn
-lubiXOXO
-lubilove
-gnobbel
-sleazy
-slsky
-slsnake
-sltwice
-slentry
-sljowy
-slpipe
index 638e8e8..a62a8e3 100644 (file)
@@ -7,6 +7,7 @@ LDLIBS        = $$(pkg-config --libs gtkmm-3.0)
 
 BADGE         = badge
 CONVERTER     = level-converter
+LEVELLIST     = levels.txt
 
 GLADEFILES    = lcd-display.glade
 
@@ -86,5 +87,7 @@ $(CONVERTER): $(CONVERTER_OBJS)
        $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $+ $(LDLIBS)
 
 play: all
+       echo > $(LEVELLIST)
+       ls ../badge/jumpnrun/levels/*.lv | xargs -n1 basename | cut -d . -f 1 > $(LEVELLIST)
        ./$(CONVERTER)
        ./$(BADGE)
index 70da0ff..f2a366e 100644 (file)
@@ -17,7 +17,7 @@
 
 void badge_main_loop(void) {
   char menu_buf[MAX_LEVELS][32];
-  FILE *fd = fopen(PATH_PREFIX "levels.txt", "r");
+  FILE *fd = fopen("levels.txt", "r");
 
   int i;
 
index b900cdb..eb8b1c6 100644 (file)
@@ -70,10 +70,10 @@ namespace jnrcpp {
 
   struct level_name_map {
     level_name_map() {
-      std::ifstream in(PATH_PREFIX "levels.txt");
+      std::ifstream in("levels.txt");
 
       if(!in) {
-        throw std::logic_error(PATH_PREFIX "levels.txt konnte nicht geöffnet werden.");
+        throw std::logic_error("levels.txt konnte nicht geöffnet werden.");
       }
 
       std::string name;
This page took 0.028818 seconds and 4 git commands to generate.