diff TaskManager/Test/test_render/main.cpp @ 144:949af5ee555e

fix
author gongo@localhost.localdomain
date Sat, 29 Nov 2008 11:43:13 +0900
parents 5c194c71eca8
children a8805e484c46
line wrap: on
line diff
--- a/TaskManager/Test/test_render/main.cpp	Sat Nov 29 03:36:11 2008 +0900
+++ b/TaskManager/Test/test_render/main.cpp	Sat Nov 29 11:43:13 2008 +0900
@@ -5,13 +5,24 @@
 #include "Func.h"
 
 /* prototype */
-void init(int argc, char *argc[]);
+int init(int argc, char *argc[]);
 
 extern void task_initialize();
 
 Viewer *screen;
 
-void
+static int sg_number = 0;
+
+static char *help_str = "Usage: ./test_nogl [OPTION]\n\
+  -cpu Number of SPE (default 1)\n\
+  -width, -height window size (default 640x480)\n\
+  -sg Draw SceneGraph\n\
+      0: 丸ボタン(Keyboard だとz) を押すと、キューブが二つに分かれる\n\
+      1: 0 のキューブが大きい版\n\
+      2: スネークさんが写るだけ\n\
+      3: キューブが跳ね返りながら、勝手にキューブが増えて行く";
+
+int
 init(int argc, char *argv[])
 {
     int bpp    = 0;
@@ -35,9 +46,16 @@
 	if (strcmp(argv[i], "-xml") == 0) {
 	    xml = argv[++i];
 	}
+	if (strcmp(argv[i], "-sg") == 0) {
+	    sg_number = (atoi)(argv[++i]);
+	}
 	if (strcmp(argv[i], "-cpu") == 0) {
 	    spenum = atoi(argv[++i]);
 	}
+	if (strcmp(argv[i], "-help") == 0) {
+	    printf("%s\n", help_str);
+	    return -1;
+	}
 	if (strcmp(argv[i], "-video") == 0) {
 	    if (strcmp(argv[i+1], "sdl") == 0) { 
 		vtype = VTYPE_SDL;
@@ -55,7 +73,9 @@
     }
 
     screen->video_init();
-    screen->run_init(xml);
+    screen->run_init(xml, sg_number);
+
+    return 0;
 }
 
 int
@@ -63,7 +83,7 @@
 {
     task_initialize();
 
-    init(argc, argv);
+    return init(argc, argv);
 
-    return 0;
+    //return 0;
 }