Changeset 11602 for lang/d

Show
Ignore:
Timestamp:
05/14/08 23:11:56 (6 months ago)
Author:
omega
Message:
 
Location:
lang/d/koke/trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • lang/d/koke/trunk/boot.d

    r10892 r11602  
    2626 
    2727// 画面サイズ 
    28 static int g_width; 
    29 static int g_height; 
    3028const char[] g_title = "hoge";          // タイトルバー 
    3129 
     
    4240        // オプション解釈 
    4341        bool is_fullscreen = false;     // デフォルトはウインドウ 
    44         g_width = 640; 
    45         g_height = 480; 
     42        int g_width = 640; 
     43        int g_height = 480; 
    4644        foreach(int t,string buf;args) 
    4745        { 
     
    5957        try 
    6058        { 
    61                 Hell_init(g_title , g_width, g_height , is_fullscreen); 
     59                Hell_init(g_title , g_width, g_height , is_fullscreen , true); 
    6260                load(); 
    6361                while(true) 
     
    122120else 
    123121{ 
    124         public int main(char[][] args) 
     122        version (Darwin) 
    125123        { 
    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                } 
    127137        } 
    128138} 
    129  
    130139 
    131140version (Darwin) 
  • lang/d/koke/trunk/gamecore.d

    r9337 r11602  
    1 /********************************************************************************/ 
     1/********************************************************************************/ 
    22/*      gamecore.d                                                                                                                                      */ 
    33/*------------------------------------------------------------------------------*/ 
     
    448448         
    449449        // 画面サイズ取得 
    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();} 
    452452         
    453453        string zfill(string str , int n){ 
  • lang/d/koke/trunk/hell2.d

    r10006 r11602  
    118118} 
    119119 
     120 
    120121/** 
    121122 * マウスカーソル表示切替 
     
    209210 
    210211/** 
     212 * 画面サイズ取得 
     213 */ 
     214int getScreenWidth(){return g_width;} 
     215int getScreenHeight(){return g_height;} 
     216 
     217/** 
    211218 * SDL初期化 
    212219 */ 
    213 void Hell_init(char[] caption, int width=640, int height=480, bool fullscreen=false) 
     220void Hell_init(char[] caption, int width = 640, int height = 480, bool fullscreen = false , bool resizable = false) 
    214221{ 
    215222        if(g_init) return; 
     
    222229                g_videoFlags |= SDL_FULLSCREEN; 
    223230        } 
     231        if(resizable) 
     232        { 
     233                g_videoFlags |= SDL_RESIZABLE; 
     234                std.stdio.writefln("RESIZABLE"); 
     235        } 
    224236         
    225237        if(SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK | SDL_INIT_AUDIO) < 0) 
     
    230242        // スクリーン初期化 
    231243        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 ); 
    234246        if((g_screen = SDL_SetVideoMode(g_width, g_height, g_videoBpp, g_videoFlags)) is null) 
    235247        { 
     
    357369{ 
    358370        dout.writeLine(e.toString()); 
    359         append(g_logname, e.toString() ~ "¥n"); 
     371        append(g_logname, e.toString() ~ "\n"); 
    360372} 
    361373 
     
    372384void Hell_update() 
    373385{ 
    374         //glFlush(); 
     386        glFlush(); 
    375387        SDL_GL_SwapBuffers(); 
    376388} 
     
    648660                Mix_FreeMusic(g_music); 
    649661        } 
    650         g_music = Mix_LoadMUS(cast(char*)(path ~ "¥0")); 
     662        g_music = Mix_LoadMUS(cast(char*)(path ~ "\0")); 
    651663        if(!g_music) 
    652664        {