Changeset 7144 for lang/d

Show
Ignore:
Timestamp:
02/25/08 23:28:44 (9 months ago)
Author:
omega
Message:

時刻表示

Files:
1 modified

Legend:

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

    r7111 r7144  
    405405                speed_switch.draw(); 
    406406                 
    407                 // 時間表示(右上) 
    408                 Hell_drawFont("TIME:" ~ std.string.toString(timer / 40) , getScreenWidth() - 80 , 32); 
    409                  
    410407                // チャート 
    411408                if(chart_switch.getSelected() != "") chart.draw(); 
     
    421418                map.draw_ofs_y -= shake_y; 
    422419                 
     420        // 左下:時刻描画 
     421        int step      = timer/40; 
     422        string hour   = zfill(std.string.toString(step / 60 % 12), 2); 
     423        string minute = zfill(std.string.toString(step % 60), 2); 
     424        string ampm   = "AM"; 
     425        if(step / 60 % 24 > 11) ampm = "PM"; 
     426 
     427        Hell_drawFont(ampm ~ " " ~ hour ~ ":" ~ minute, 
     428                      8, 
     429                      getScreenHeight() - 40, 
     430                      2, 
     431                      255, 255, 255 
     432                      ); 
     433                       
    423434                // fps/cpu 
    424                 Hell_drawFPS(); 
     435                Hell_drawFPS( 8 , getScreenHeight() - 24 ); 
    425436//              Hell_update(); 
    426437        } 
     
    437448        int getScreenWidth(){return boot.g_width;} 
    438449        int getScreenHeight(){return boot.g_height;} 
     450         
     451        string zfill(string str , int n){ 
     452                for(int t=str.length;t<n;t++){ 
     453                        str = "0" ~ str; 
     454                } 
     455                return str; 
     456        } 
    439457} 
    440458 
     
    499517        void draw(){ 
    500518                // キャラクタごとのカラー(Character.TYPE参照) 
    501                 static const int r[] = [  0 ,   0 ,   0 ,   0 ,   0 , 255 , 128 , 0 ]; 
    502                 static const int g[] = [  0 , 255 , 255 ,   0 ,   0 ,   0 , 128 , 0 ]; 
    503                 static const int b[] = [  0 ,   0 , 255 ,   0 ,   0 ,   0 , 128 , 0 ]; 
     519                //                                              NONE  NICO SOWA  RAY   EXPL  UPNS  ARAS   MOVIE 
     520                static const int r[] = [  0 ,   0 ,   0 ,   0 ,   0 , 255 ,  64 , 192 ]; 
     521                static const int g[] = [  0 , 255 ,   0 ,   0 ,   0 ,   0 ,  64 , 192 ]; 
     522                static const int b[] = [  0 ,   0 ,   0 ,   0 ,   0 ,   0 ,  64 , 192 ]; 
    504523                 
    505524                if(!logs[length - 1]) return;