- Timestamp:
- 05/14/08 23:11:56 (6 months ago)
- Location:
- lang/d/koke/trunk
- Files:
-
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/d/koke/trunk/boot.d
r10892 r11602 26 26 27 27 // 画面サイズ 28 static int g_width;29 static int g_height;30 28 const char[] g_title = "hoge"; // タイトルバー 31 29 … … 42 40 // オプション解釈 43 41 bool is_fullscreen = false; // デフォルトはウインドウ 44 g_width = 640;45 g_height = 480;42 int g_width = 640; 43 int g_height = 480; 46 44 foreach(int t,string buf;args) 47 45 { … … 59 57 try 60 58 { 61 Hell_init(g_title , g_width, g_height , is_fullscreen );59 Hell_init(g_title , g_width, g_height , is_fullscreen , true); 62 60 load(); 63 61 while(true) … … 122 120 else 123 121 { 124 public int main(char[][] args)122 version (Darwin) 125 123 { 126 return Hell_main(args); 124 public int main(char[][] args) { 125 string path = args[0]; 126 std.stdio.writefln(path); 127 std.stdio.writefln( path[0.. (rfind( path , "/") + 1)]); 128 std.file.chdir( path[0 .. (rfind( path , "/" ) + 1)] ); 129 return Hell_main(args); 130 } 131 } 132 else 133 { 134 public int main(char[][] args){ 135 return Hell_main(args); 136 } 127 137 } 128 138 } 129 130 139 131 140 version (Darwin) -
lang/d/koke/trunk/gamecore.d
r9337 r11602 1 /********************************************************************************/1 /********************************************************************************/ 2 2 /* gamecore.d */ 3 3 /*------------------------------------------------------------------------------*/ … … 448 448 449 449 // 画面サイズ取得 450 int getScreenWidth(){return boot.g_width;}451 int getScreenHeight(){return boot.g_height;}450 int getScreenWidth(){return hell2.getScreenWidth();} 451 int getScreenHeight(){return hell2.getScreenHeight();} 452 452 453 453 string zfill(string str , int n){ -
lang/d/koke/trunk/hell2.d
r10006 r11602 118 118 } 119 119 120 120 121 /** 121 122 * マウスカーソル表示切替 … … 209 210 210 211 /** 212 * 画面サイズ取得 213 */ 214 int getScreenWidth(){return g_width;} 215 int getScreenHeight(){return g_height;} 216 217 /** 211 218 * SDL初期化 212 219 */ 213 void Hell_init(char[] caption, int width =640, int height=480, bool fullscreen=false)220 void Hell_init(char[] caption, int width = 640, int height = 480, bool fullscreen = false , bool resizable = false) 214 221 { 215 222 if(g_init) return; … … 222 229 g_videoFlags |= SDL_FULLSCREEN; 223 230 } 231 if(resizable) 232 { 233 g_videoFlags |= SDL_RESIZABLE; 234 std.stdio.writefln("RESIZABLE"); 235 } 224 236 225 237 if(SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK | SDL_INIT_AUDIO) < 0) … … 230 242 // スクリーン初期化 231 243 SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 ); // ダブルバッファ 232 //SDL_GL_SetAttribute( SDL_GL_SWAP_CONTROL , 0 ); // Vsyncなし233 SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 16 );244 SDL_GL_SetAttribute( SDL_GL_SWAP_CONTROL , 0 ); // Vsyncなし 245 //SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 16 ); 234 246 if((g_screen = SDL_SetVideoMode(g_width, g_height, g_videoBpp, g_videoFlags)) is null) 235 247 { … … 357 369 { 358 370 dout.writeLine(e.toString()); 359 append(g_logname, e.toString() ~ " ¥n");371 append(g_logname, e.toString() ~ "\n"); 360 372 } 361 373 … … 372 384 void Hell_update() 373 385 { 374 //glFlush();386 glFlush(); 375 387 SDL_GL_SwapBuffers(); 376 388 } … … 648 660 Mix_FreeMusic(g_music); 649 661 } 650 g_music = Mix_LoadMUS(cast(char*)(path ~ " ¥0"));662 g_music = Mix_LoadMUS(cast(char*)(path ~ "\0")); 651 663 if(!g_music) 652 664 {
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)