Mercurial > hg > Game > Cerium
annotate TaskManager/Test/test_render/main.cpp @ 153:70146cdec3d4 draft
画像のサイズテストを加える -sg = [2,3,4]
author | gongo@charles.cr.ie.u-ryukyu.ac.jp |
---|---|
date | Tue, 02 Dec 2008 19:39:36 +0900 |
parents | a5138d6e8996 |
children | 1f7c46e52ab9 |
rev | line source |
---|---|
109 | 1 #include "TaskManager.h" |
2 #include "viewer.h" | |
3 #include "viewerSDL.h" | |
4 #include "viewerFB.h" | |
5 #include "Func.h" | |
6 | |
7 /* prototype */ | |
144 | 8 int init(int argc, char *argc[]); |
109 | 9 |
10 extern void task_initialize(); | |
11 | |
12 Viewer *screen; | |
13 | |
144 | 14 static int sg_number = 0; |
15 | |
16 static char *help_str = "Usage: ./test_nogl [OPTION]\n\ | |
17 -cpu Number of SPE (default 1)\n\ | |
18 -width, -height window size (default 640x480)\n\ | |
19 -sg Draw SceneGraph\n\ | |
145 | 20 0: Joystick の 丸ボタン(Keyboard だとx) を押すと、キューブが二つに分かれる\n\ |
144 | 21 1: 0 のキューブが大きい版\n\ |
153
70146cdec3d4
画像のサイズテストを加える -sg = [2,3,4]
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents:
145
diff
changeset
|
22 2: スネークさんが写るだけ 576x384 版\n\ |
70146cdec3d4
画像のサイズテストを加える -sg = [2,3,4]
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents:
145
diff
changeset
|
23 3: スネークさんが写るだけ 800x600 版\n\ |
70146cdec3d4
画像のサイズテストを加える -sg = [2,3,4]
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents:
145
diff
changeset
|
24 4: 何かの画像 1920x1080\n\ |
70146cdec3d4
画像のサイズテストを加える -sg = [2,3,4]
gongo@charles.cr.ie.u-ryukyu.ac.jp
parents:
145
diff
changeset
|
25 5 以降: キューブが跳ね返りながら、勝手にキューブが増えて行く"; |
144 | 26 |
27 int | |
109 | 28 init(int argc, char *argv[]) |
29 { | |
30 int bpp = 0; | |
31 int width = 640; | |
32 int height = 480; | |
33 int spenum = 1; | |
34 char *xml = "xml_file/cube.xml"; | |
35 video_type vtype = VTYPE_SDL; | |
36 | |
37 for(int i = 1; argv[i]; ++i) | |
38 { | |
39 if (strcmp(argv[i], "-bpp") == 0) { | |
40 bpp = atoi(argv[++i]); | |
41 } | |
42 if (strcmp(argv[i], "-width") == 0) { | |
43 width = atoi(argv[++i]); | |
44 } | |
45 if (strcmp(argv[i], "-height") == 0) { | |
46 height = atoi(argv[++i]); | |
47 } | |
48 if (strcmp(argv[i], "-xml") == 0) { | |
49 xml = argv[++i]; | |
50 } | |
144 | 51 if (strcmp(argv[i], "-sg") == 0) { |
52 sg_number = (atoi)(argv[++i]); | |
53 } | |
109 | 54 if (strcmp(argv[i], "-cpu") == 0) { |
55 spenum = atoi(argv[++i]); | |
56 } | |
144 | 57 if (strcmp(argv[i], "-help") == 0) { |
58 printf("%s\n", help_str); | |
59 return -1; | |
60 } | |
109 | 61 if (strcmp(argv[i], "-video") == 0) { |
62 if (strcmp(argv[i+1], "sdl") == 0) { | |
63 vtype = VTYPE_SDL; | |
64 } else if (strcmp(argv[i+1], "fb") == 0) { | |
65 vtype = VTYPE_FB; | |
66 } | |
67 i++; | |
68 } | |
69 } | |
70 | |
71 if (vtype == VTYPE_SDL) { | |
72 screen = new ViewerSDL(bpp, width, height, spenum); | |
73 } else if (vtype == VTYPE_FB) { | |
74 screen = new ViewerFB(bpp, width, height, spenum); | |
75 } | |
76 | |
77 screen->video_init(); | |
144 | 78 screen->run_init(xml, sg_number); |
79 | |
80 return 0; | |
109 | 81 } |
82 | |
83 int | |
84 cerium_main(int argc, char *argv[]) | |
85 { | |
86 task_initialize(); | |
87 | |
144 | 88 return init(argc, argv); |
109 | 89 |
144 | 90 //return 0; |
109 | 91 } |