Mercurial > hg > Game > Cerium
changeset 1153:16c795222988 draft
fix Makefile of Renderer/Test
author | kazz <kazz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 22 Mar 2011 19:37:55 +0900 |
parents | df293d433633 |
children | a98d601e45f6 |
files | Renderer/Test/Makefile.macosx Renderer/Test/network.cc |
diffstat | 2 files changed, 14 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/Renderer/Test/Makefile.macosx Fri Mar 11 02:24:01 2011 +0900 +++ b/Renderer/Test/Makefile.macosx Tue Mar 22 19:37:55 2011 +0900 @@ -6,14 +6,14 @@ LIBS += `sdl-config --libs` `xml2-config --libs` -lSDL_image -Wl,-framework,OpenGL .SUFFIXES: .proto .pb.o .pb.cc .cc .o .xml .xml.h .xml.cc - +.PRECIOUS: %.pb.cc .cc.o: $(CC) $(CFLAGS) -c $< -o $@ %.pb.cc: $(PROTODIR)/%.proto $(PROTO) $(PROTOFLAGS) $< -ALL = ball_bound boss1_action direction gaplant ieshoot node panel universe untitled vacuum property_test send_linda dynamic writer chain_old SgRootChange viewer aquarium network init_aquarium test_linda +ALL = ball_bound boss1_action direction gaplant ieshoot node panel universe untitled vacuum property_test send_linda dynamic writer chain_old SgRootChange viewer aquarium network init_aquarium test_linda all: $(ALL) @@ -101,7 +101,6 @@ test_linda : $(TEST_LINDA_OBJ) $(CC) $(CFLAGS) -o $@ $? $(LIBS) $(PROTOLIBS) - run: $(TARGET) sudo ./$(TARGET) -width 576 -height 384 -bpp 32
--- a/Renderer/Test/network.cc Fri Mar 11 02:24:01 2011 +0900 +++ b/Renderer/Test/network.cc Tue Mar 22 19:37:55 2011 +0900 @@ -22,7 +22,7 @@ int NetworkGame::start_x; char *NetworkGame::xml_file_name; -const char *usr_help_str = "Usage: ./network -linda LINDA_SERVER_NAME\n"; +const char *usr_help_str = "Usage: ./network [-linda LINDA_SERVER_NAME [-port PORT_NUM]] -xml XML_OBJECT_FILE_NAME\na"; void TMend(TaskManager *manager); extern void task_initialize(); @@ -274,7 +274,8 @@ { task_initialize(); manager->set_TMend(TMend); - + int xml_flag = false; + for (int i = 0; i < argc; i++) { if (strcmp(argv[i],"-linda") == 0 && i + 1 <= argc) { NetworkGame::linda_addr.hostname = argv[i+1]; @@ -282,9 +283,17 @@ NetworkGame::linda_addr.port = atoi(argv[i+1]); } else if (strcmp(argv[i],"-xml") == 0 && i + 1 <= argc) { NetworkGame::xml_file_name = argv[i+1]; + xml_flag = true; } } - return init(manager, argc, argv); + if (xml_flag) { + return init(manager, argc, argv); + } else { + perror(usr_help_str); + exit(1); + } + + return 0; } void