• R/O
  • SSH
  • HTTPS

dxruby: Commit


Commit MetaInfo

Revision9 (tree)
Time2009-04-15 23:53:21
Authormirichi

Log Message

DXRuby0.0.4

Change Summary

Incremental Difference

--- dxruby.c (revision 8)
+++ dxruby.c (revision 9)
@@ -73,8 +73,13 @@
7373 LPDIRECTINPUTDEVICE8 g_pDIDKeyBoard = NULL; /* DirectInputのキーボードデバイス */
7474 LPDIRECTINPUTDEVICE8 g_pDIDJoyPad[PADMAX]; /* DirectInputのパッドデバイス */
7575 BYTE g_diKeyState[256]; /* DirectInputでのキーボード入力用バッファ */
76+BYTE g_diKeyStateOld[256]; /* DirectInputでのキーボード入力用バッファ1フレーム前 */
7677 int g_JoystickCount = 0;
78+BYTE g_byMouseState_L, g_byMouseStateOld_L;
79+BYTE g_byMouseState_M, g_byMouseStateOld_M;
80+BYTE g_byMouseState_R, g_byMouseStateOld_R;
7781
82+
7883 IDirectMusicPerformance8 *g_pDMPerformance = NULL; /* DirectMusicPerformance8インターフェイス */
7984 IDirectMusicLoader8 *g_pDMLoader = NULL; /* ローダー */
8085 IDirectMusicAudioPath8 *g_pDMDefAudioPathBGM = NULL; /* デフォルト・オーディオパス BGM用 */
@@ -102,6 +107,7 @@
102107 int RefreshRate; /* リフレッシュレート */
103108 int enablemouse; /* マウスを表示するかどうか */
104109 int mousewheelpos; /* マウスホイールの位置 */
110+ int fps; /* fps */
105111 } g_WindowInfo;
106112
107113 /* リンクリスト構造体 */
@@ -176,7 +182,7 @@
176182 struct DXRubyPadState {
177183 char button[20];
178184 int PadConfig[20];
179-} g_PadState[PADMAX];
185+} g_PadState[PADMAX], g_PadStateOld[PADMAX];
180186
181187
182188 /* プロトタイプ宣言 */
@@ -368,7 +374,7 @@
368374 /* 描画 */
369375 Window_update();
370376 /* fps調整 */
371- Window_sync( 60 );
377+ Window_sync( g_WindowInfo.fps );
372378 }
373379 }
374380
@@ -1097,6 +1103,17 @@
10971103
10981104
10991105 /*--------------------------------------------------------------------
1106+ fps値を設定する
1107+ ---------------------------------------------------------------------*/
1108+static VALUE Window_setfps( VALUE obj, VALUE fps )
1109+{
1110+ g_WindowInfo.fps = FIX2INT(fps);
1111+
1112+ return fps;
1113+}
1114+
1115+
1116+/*--------------------------------------------------------------------
11001117 終了時に実行する
11011118 ---------------------------------------------------------------------*/
11021119 static VALUE Window_shutdown( VALUE obj )
@@ -1331,13 +1348,64 @@
13311348 /*--------------------------------------------------------------------
13321349 ImgaeクラスのInitialize
13331350 ---------------------------------------------------------------------*/
1334-static VALUE Image_initialize( int argc, VALUE *argv, VALUE obj )
1351+static VALUE Image_initialize( VALUE obj, VALUE width, VALUE height )
13351352 {
13361353 struct DXRubyImage *image;
13371354 struct DXRubyTexture *texture;
1355+ HRESULT hr;
1356+
1357+ /* デバイスオブジェクトの初期化チェック */
1358+ if( g_pD3DDevice == NULL )
1359+ {
1360+ rb_raise( eDXRubyError, "DirectX Graphicsが初期化されていません" );
1361+ }
1362+
1363+ Check_Type(width, T_FIXNUM);
1364+ Check_Type(height, T_FIXNUM);
1365+
1366+ /* テクスチャメモリ取得 */
1367+ texture = (struct DXRubyTexture *)malloc( sizeof( struct DXRubyTexture ) );
1368+
1369+ if( texture == NULL )
1370+ {
1371+ rb_raise( eDXRubyError, "画像用メモリの取得に失敗しました - Image_initialize" );
1372+ }
1373+
1374+ /* メモリファイルを読み込んでテクスチャオブジェクトを作成する */
1375+ hr = D3DXCreateTexture( g_pD3DDevice, FIX2INT( width ), FIX2INT( height ),
1376+ 1, 0, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED,
1377+ &texture->pD3DTexture);
1378+
1379+ if( FAILED( hr ) )
1380+ {
1381+ rb_raise( eDXRubyError, "テクスチャの作成に失敗しました - Image_initialize" );
1382+ }
1383+
1384+ texture->refcount = 1;
1385+
1386+ /* Imageオブジェクト設定 */
1387+ Data_Get_Struct( obj, struct DXRubyImage, image );
1388+
1389+ image->texture = texture;
1390+ image->x = 0;
1391+ image->y = 0;
1392+ image->width = FIX2INT( width );
1393+ image->height = FIX2INT( height );
1394+
1395+ return obj;
1396+}
1397+
1398+
1399+/*--------------------------------------------------------------------
1400+ Imgaeクラスのload
1401+ ---------------------------------------------------------------------*/
1402+static VALUE Image_load( int argc, VALUE *argv, VALUE klass )
1403+{
1404+ struct DXRubyImage *image;
1405+ struct DXRubyTexture *texture;
13381406 D3DXIMAGE_INFO srcinfo;
13391407 HRESULT hr;
1340- VALUE filename, width, height;
1408+ VALUE filename, width, height, obj;
13411409
13421410 /* デバイスオブジェクトの初期化チェック */
13431411 if( g_pD3DDevice == NULL )
@@ -1362,7 +1430,7 @@
13621430 texture->refcount = 1;
13631431
13641432 /* Imageオブジェクト設定 */
1365- Data_Get_Struct( obj, struct DXRubyImage, image );
1433+ obj = Data_Make_Struct( cImage, struct DXRubyImage, 0, release_Image, image );
13661434
13671435 image->texture = texture;
13681436 image->x = 0;
@@ -1377,7 +1445,7 @@
13771445 /*--------------------------------------------------------------------
13781446 Imgaeオブジェクトの分割作成
13791447 ---------------------------------------------------------------------*/
1380-static VALUE Image_load( VALUE klass, VALUE filename, VALUE x, VALUE y )
1448+static VALUE Image_loadToArray( VALUE klass, VALUE filename, VALUE x, VALUE y )
13811449 {
13821450 struct DXRubyImage *image;
13831451 struct DXRubyTexture *texture;
@@ -1793,6 +1861,129 @@
17931861
17941862
17951863 /*--------------------------------------------------------------------
1864+ イメージのデータ設定(circle用のline描画)
1865+ ---------------------------------------------------------------------*/
1866+static void Image_circle_line( int x1, int x2, int y, int col, D3DLOCKED_RECT *texrect, struct DXRubyImage *image )
1867+{
1868+ int x;
1869+
1870+ if( y < 0 || y > image->height - 1 )
1871+ {
1872+ return;
1873+ }
1874+
1875+ /* クリップ */
1876+ if( x1 < 0 )
1877+ {
1878+ x1 = 0;
1879+ }
1880+ if( x2 > image->width - 1 )
1881+ {
1882+ x2 = image->width - 1;
1883+ }
1884+
1885+ for( x = x1; x <= x2; x++ )
1886+ {
1887+ *((int*)((char *)texrect->pBits +
1888+ ( x + (int)image->x ) * 4 +
1889+ ( y + (int)image->y ) * texrect->Pitch)) = col;
1890+ }
1891+}
1892+
1893+
1894+/*--------------------------------------------------------------------
1895+ イメージのデータ設定(circle描画塗りつぶす)
1896+ ---------------------------------------------------------------------*/
1897+static VALUE Image_circleFill( VALUE obj, VALUE vx0, VALUE vy0, VALUE vr, VALUE color )
1898+{
1899+ struct DXRubyImage *image;
1900+ D3DLOCKED_RECT texrect;
1901+ int x0, y0, r, F, x, y;
1902+ int col;
1903+
1904+ Data_Get_Struct( obj, struct DXRubyImage, image );
1905+
1906+ x0 = FIX2INT( vx0 );
1907+ y0 = FIX2INT( vy0 );
1908+ r = FIX2INT( vr );
1909+
1910+ image->texture->pD3DTexture->lpVtbl->LockRect( image->texture->pD3DTexture, 0, &texrect, NULL, 0 );
1911+
1912+ col = FIX2INT(rb_ary_entry(color, 0))<<24 | FIX2INT(rb_ary_entry(color, 1))<<16 |
1913+ FIX2INT(rb_ary_entry(color, 2))<<8 | FIX2INT(rb_ary_entry(color, 3));
1914+
1915+ x = r;
1916+ y = 0;
1917+ F = -2 * r + 3;
1918+
1919+ while ( x >= y ) {
1920+ Image_circle_line( x0 - x, x0 + x, y0 + y, col, &texrect, image );
1921+ Image_circle_line( x0 - x, x0 + x, y0 - y, col, &texrect, image );
1922+ Image_circle_line( x0 - y, x0 + y, y0 + x, col, &texrect, image );
1923+ Image_circle_line( x0 - y, x0 + y, y0 - x, col, &texrect, image );
1924+ if ( F >= 0 ) {
1925+ x--;
1926+ F -= 4 * x;
1927+ }
1928+ y++;
1929+ F += 4 * y + 2;
1930+ }
1931+
1932+ image->texture->pD3DTexture->lpVtbl->UnlockRect( image->texture->pD3DTexture, 0 );
1933+
1934+ return obj;
1935+}
1936+
1937+
1938+/*--------------------------------------------------------------------
1939+ イメージのデータ設定(circle描画塗りつぶさない)
1940+ ---------------------------------------------------------------------*/
1941+static VALUE Image_circle( VALUE obj, VALUE vx0, VALUE vy0, VALUE vr, VALUE color )
1942+{
1943+ struct DXRubyImage *image;
1944+ D3DLOCKED_RECT texrect;
1945+ int x0, y0, r, F, x, y;
1946+ int col;
1947+
1948+ Data_Get_Struct( obj, struct DXRubyImage, image );
1949+
1950+ x0 = FIX2INT( vx0 );
1951+ y0 = FIX2INT( vy0 );
1952+ r = FIX2INT( vr );
1953+
1954+ image->texture->pD3DTexture->lpVtbl->LockRect( image->texture->pD3DTexture, 0, &texrect, NULL, 0 );
1955+
1956+ col = FIX2INT(rb_ary_entry(color, 0))<<24 | FIX2INT(rb_ary_entry(color, 1))<<16 |
1957+ FIX2INT(rb_ary_entry(color, 2))<<8 | FIX2INT(rb_ary_entry(color, 3));
1958+
1959+ x = r;
1960+ y = 0;
1961+ F = -2 * r + 3;
1962+
1963+ while ( x >= y ) {
1964+ *((int*)((char *)texrect.pBits + ( x0 + x + (int)image->x ) * 4 + ( y0 + y + (int)image->y ) * texrect.Pitch)) = col;
1965+ *((int*)((char *)texrect.pBits + ( x0 - x + (int)image->x ) * 4 + ( y0 + y + (int)image->y ) * texrect.Pitch)) = col;
1966+ *((int*)((char *)texrect.pBits + ( x0 + x + (int)image->x ) * 4 + ( y0 - y + (int)image->y ) * texrect.Pitch)) = col;
1967+ *((int*)((char *)texrect.pBits + ( x0 - x + (int)image->x ) * 4 + ( y0 - y + (int)image->y ) * texrect.Pitch)) = col;
1968+ *((int*)((char *)texrect.pBits + ( x0 + y + (int)image->x ) * 4 + ( y0 + x + (int)image->y ) * texrect.Pitch)) = col;
1969+ *((int*)((char *)texrect.pBits + ( x0 - y + (int)image->x ) * 4 + ( y0 + x + (int)image->y ) * texrect.Pitch)) = col;
1970+ *((int*)((char *)texrect.pBits + ( x0 + y + (int)image->x ) * 4 + ( y0 - x + (int)image->y ) * texrect.Pitch)) = col;
1971+ *((int*)((char *)texrect.pBits + ( x0 - y + (int)image->x ) * 4 + ( y0 - x + (int)image->y ) * texrect.Pitch)) = col;
1972+ if ( F >= 0 ) {
1973+ x--;
1974+ F -= 4 * x;
1975+ }
1976+ y++;
1977+ F += 4 * y + 2;
1978+ }
1979+
1980+ image->texture->pD3DTexture->lpVtbl->UnlockRect( image->texture->pD3DTexture, 0 );
1981+
1982+ return obj;
1983+}
1984+
1985+
1986+/*--------------------------------------------------------------------
17961987 イメージのデータ設定(line描画)
17971988 ---------------------------------------------------------------------*/
17981989 static VALUE Image_line( VALUE obj, VALUE vx1, VALUE vy1, VALUE vx2, VALUE vy2, VALUE color )
@@ -2217,7 +2408,8 @@
22172408 }
22182409
22192410 /* キーボードの直接データを取得する */
2220- g_pDIDKeyBoard->lpVtbl->GetDeviceState( g_pDIDKeyBoard, 256, g_diKeyState );
2411+ memcpy( g_diKeyStateOld, g_diKeyState, sizeof(g_diKeyState) );
2412+ g_pDIDKeyBoard->lpVtbl->GetDeviceState( g_pDIDKeyBoard, 256, g_diKeyState );
22212413
22222414 /* ゲームパッドのデータを取得する */
22232415 for( i = 0; i < g_JoystickCount; i++ )
@@ -2229,7 +2421,8 @@
22292421
22302422 for( j = 0; j < 20; j++ )
22312423 {
2232- g_PadState[i].button[j] = 0;
2424+ g_PadStateOld[i].button[j] = g_PadState[i].button[j];
2425+ g_PadState[i].button[j] = 0;
22332426 }
22342427
22352428 /* 左 */
@@ -2260,6 +2453,15 @@
22602453 g_PadState[i].button[j + 4] = paddata.rgbButtons[j] >> 7;
22612454 }
22622455 }
2456+
2457+ /* マウスボタンの状態 */
2458+ g_byMouseStateOld_L = g_byMouseState_L;
2459+ g_byMouseStateOld_M = g_byMouseState_M;
2460+ g_byMouseStateOld_R = g_byMouseState_R;
2461+ g_byMouseState_L = GetKeyState( VK_LBUTTON );
2462+ g_byMouseState_M = GetKeyState( VK_MBUTTON );
2463+ g_byMouseState_R = GetKeyState( VK_RBUTTON );
2464+
22632465 }
22642466
22652467
@@ -2371,11 +2573,74 @@
23712573 /*--------------------------------------------------------------------
23722574 Inputモジュールのデータ取得
23732575
2576+ 押した瞬間だけtrueになる。引数はボタン番号。
2577+ ---------------------------------------------------------------------*/
2578+static VALUE Input_buttonPush( int argc, VALUE *argv, VALUE obj )
2579+{
2580+ int number, button;
2581+
2582+ rb_scan_args( argc, argv, "11", &button, &number);
2583+
2584+ if( number == Qnil )
2585+ {
2586+ number = 0;
2587+ }
2588+
2589+ if( FIX2INT( number ) < 0 || FIX2INT( button ) < 0 || FIX2INT( number ) >= PADMAX || FIX2INT( button ) >= 20 )
2590+ {
2591+ rb_raise( eDXRubyError, "値が範囲外です。 - Input_button" );
2592+ }
2593+
2594+ if( (g_diKeyState[g_PadState[FIX2INT(number)].PadConfig[FIX2INT(button)]] & 0x80 ||
2595+ g_PadState[FIX2INT(number)].button[FIX2INT(button)] == 1 ) &&
2596+ (!(g_diKeyStateOld[g_PadState[FIX2INT(number)].PadConfig[FIX2INT(button)]] & 0x80) &&
2597+ g_PadStateOld[FIX2INT(number)].button[FIX2INT(button)] != 1 ) )
2598+ {
2599+ return Qtrue;
2600+ }
2601+
2602+ return Qfalse;
2603+}
2604+
2605+
2606+/*--------------------------------------------------------------------
2607+ Inputモジュールのデータ取得
2608+
2609+ 押した瞬間だけtrueになる。引数はキーコード。
2610+ ---------------------------------------------------------------------*/
2611+static VALUE Input_keyPush( VALUE obj , VALUE key )
2612+{
2613+ if( FIX2INT( key ) < 0 || FIX2INT( key ) >= 256 )
2614+ {
2615+ rb_raise( eDXRubyError, "値が範囲外です。 - Input_key" );
2616+ }
2617+
2618+ if( (g_diKeyState[FIX2INT(key)] & 0x80) && !(g_diKeyStateOld[FIX2INT(key)] & 0x80))
2619+ {
2620+ return Qtrue;
2621+ }
2622+
2623+ return Qfalse;
2624+}
2625+
2626+
2627+/*--------------------------------------------------------------------
2628+ Inputモジュールのデータ取得
2629+
23742630 押されていたらtrueになる。引数はボタン番号。
23752631 ---------------------------------------------------------------------*/
2376-static VALUE Input_button( VALUE obj , VALUE number, VALUE button )
2632+static VALUE Input_button( int argc, VALUE *argv, VALUE obj )
23772633 {
2378- if( FIX2INT( number ) < 0 || FIX2INT( button ) < 0 || FIX2INT( number ) >= PADMAX || FIX2INT( button ) >= 20 )
2634+ int number, button;
2635+
2636+ rb_scan_args( argc, argv, "11", &button, &number);
2637+
2638+ if( number == Qnil )
2639+ {
2640+ number = 0;
2641+ }
2642+
2643+ if( FIX2INT( number ) < 0 || FIX2INT( button ) < 0 || FIX2INT( number ) >= PADMAX || FIX2INT( button ) >= 20 )
23792644 {
23802645 rb_raise( eDXRubyError, "値が範囲外です。 - Input_button" );
23812646 }
@@ -2398,9 +2663,18 @@
23982663 g_PadState[number].PadConfig[pad] = key;
23992664 }
24002665
2401-static VALUE Input_setconfig( VALUE obj ,VALUE number, VALUE pad, VALUE key )
2666+static VALUE Input_setconfig( int argc, VALUE *argv, VALUE obj )
24022667 {
2403- if( FIX2INT( number ) < 0 || FIX2INT( pad ) < 0 || FIX2INT( key ) < 0 || FIX2INT( number ) >= PADMAX || FIX2INT( pad ) >= 20 || FIX2INT( key ) >= 256 )
2668+ int number, pad, key;
2669+
2670+ rb_scan_args( argc, argv, "21", &pad, &key, &number);
2671+
2672+ if( number == Qnil )
2673+ {
2674+ number = 0;
2675+ }
2676+
2677+ if( FIX2INT( number ) < 0 || FIX2INT( pad ) < 0 || FIX2INT( key ) < 0 || FIX2INT( number ) >= PADMAX || FIX2INT( pad ) >= 20 || FIX2INT( key ) >= 256 )
24042678 {
24052679 rb_raise( eDXRubyError, "値が範囲外です。 - Input_setconfig" );
24062680 }
@@ -2429,7 +2703,7 @@
24292703 switch( FIX2INT( button ) )
24302704 {
24312705 case M_LBUTTON:
2432- if( GetKeyState( VK_LBUTTON ) & 0x80 )
2706+ if( g_byMouseState_L & 0x80 )
24332707 {
24342708 return Qtrue;
24352709 }
@@ -2439,7 +2713,7 @@
24392713 }
24402714
24412715 case M_RBUTTON:
2442- if( GetKeyState( VK_RBUTTON ) & 0x80 )
2716+ if( g_byMouseState_R & 0x80 )
24432717 {
24442718 return Qtrue;
24452719 }
@@ -2449,7 +2723,7 @@
24492723 }
24502724
24512725 case M_MBUTTON:
2452- if( GetKeyState( VK_MBUTTON ) & 0x80 )
2726+ if( g_byMouseState_M & 0x80 )
24532727 {
24542728 return Qtrue;
24552729 }
@@ -2464,6 +2738,49 @@
24642738
24652739
24662740 /*--------------------------------------------------------------------
2741+ マウスのボタン状態を返す
2742+ ---------------------------------------------------------------------*/
2743+static VALUE Input_mousePush( VALUE obj, VALUE button )
2744+{
2745+
2746+ switch( FIX2INT( button ) )
2747+ {
2748+ case M_LBUTTON:
2749+ if( (g_byMouseState_L & 0x80) && !(g_byMouseStateOld_L & 0x80) )
2750+ {
2751+ return Qtrue;
2752+ }
2753+ else
2754+ {
2755+ return Qfalse;
2756+ }
2757+
2758+ case M_RBUTTON:
2759+ if( g_byMouseState_R & 0x80 && !(g_byMouseStateOld_R & 0x80) )
2760+ {
2761+ return Qtrue;
2762+ }
2763+ else
2764+ {
2765+ return Qfalse;
2766+ }
2767+
2768+ case M_MBUTTON:
2769+ if( g_byMouseState_M & 0x80 && !(g_byMouseStateOld_M & 0x80) )
2770+ {
2771+ return Qtrue;
2772+ }
2773+ else
2774+ {
2775+ return Qfalse;
2776+ }
2777+ }
2778+
2779+ return Qnil;
2780+}
2781+
2782+
2783+/*--------------------------------------------------------------------
24672784 マウスカーソルの位置を返す
24682785 ---------------------------------------------------------------------*/
24692786 static VALUE Input_getmouseposx( VALUE obj )
@@ -2708,6 +3025,7 @@
27083025 rb_define_singleton_method( mWindow, "scale=" , Window_setScale , 1 );
27093026 rb_define_singleton_method( mWindow, "windowed=", Window_setwindowed, 1 );
27103027 rb_define_singleton_method( mWindow, "getScreenShot", Window_getScreenShot, -1 );
3028+ rb_define_singleton_method( mWindow, "fps=" , Window_setfps , 1 );
27113029
27123030
27133031 /* Imageクラス定義 */
@@ -2714,11 +3032,12 @@
27143032 cImage = rb_define_class( "Image", rb_cObject );
27153033
27163034 /* Imageクラスにクラスメソッド登録*/
2717- rb_define_singleton_method(cImage, "load", Image_load, 3);
3035+ rb_define_singleton_method(cImage, "load", Image_load, -1);
3036+ rb_define_singleton_method(cImage, "loadToArray", Image_loadToArray, 3);
27183037 rb_define_singleton_method(cImage, "createFromArray", Image_createFromArray, 3);
27193038
27203039 /* Imageクラスにメソッド登録*/
2721- rb_define_method( cImage, "initialize", Image_initialize, -1 );
3040+ rb_define_method( cImage, "initialize", Image_initialize, 2 );
27223041 rb_define_method( cImage, "width" , Image_getWidth , 0 );
27233042 rb_define_method( cImage, "height" , Image_getHeight , 0 );
27243043 rb_define_method( cImage, "set" , Image_setPixel , 3 );
@@ -2725,6 +3044,8 @@
27253044 rb_define_method( cImage, "get" , Image_getPixel , 2 );
27263045 rb_define_method( cImage, "box" , Image_box , 5 );
27273046 rb_define_method( cImage, "line" , Image_line , 5 );
3047+ rb_define_method( cImage, "circle" , Image_circle , 4 );
3048+ rb_define_method( cImage, "circleFill", Image_circleFill, 4 );
27283049 rb_define_method( cImage, "x" , Image_getX , 0 );
27293050 rb_define_method( cImage, "y" , Image_getY , 0 );
27303051 rb_define_method( cImage, "width=" , Image_setWidth , 1 );
@@ -2740,17 +3061,21 @@
27403061 mInput = rb_define_module( "Input" );
27413062
27423063 /* Inputモジュールにメソッド登録 */
2743- rb_define_singleton_method( mInput, "button" , Input_button , 2 );
27443064 rb_define_singleton_method( mInput, "x" , Input_x , -1 );
27453065 rb_define_singleton_method( mInput, "y" , Input_y , -1 );
2746- rb_define_singleton_method( mInput, "key" , Input_key , 1 );
2747- rb_define_singleton_method( mInput, "setConfig" , Input_setconfig , 3 );
27483066 rb_define_singleton_method( mInput, "mousePosX" , Input_getmouseposx , 0 );
27493067 rb_define_singleton_method( mInput, "mousePosY" , Input_getmouseposy , 0 );
3068+ rb_define_singleton_method( mInput, "keyDown?" , Input_key , 1 );
3069+ rb_define_singleton_method( mInput, "keyPush?" , Input_keyPush , 1 );
3070+ rb_define_singleton_method( mInput, "padDown?" , Input_button , -1 );
3071+ rb_define_singleton_method( mInput, "padPush?" , Input_buttonPush , -1 );
3072+ rb_define_singleton_method( mInput, "mouseDown?" , Input_getmousebutton , 1 );
3073+ rb_define_singleton_method( mInput, "mousePush?" , Input_mousePush , 1 );
27503074 rb_define_singleton_method( mInput, "mouseEnable=" , Input_enablemouse , 1 );
27513075 rb_define_singleton_method( mInput, "mouseWheelPos" , Input_getmousewheelpos, 0 );
2752- rb_define_singleton_method( mInput, "mouseButton" , Input_getmousebutton , 1 );
3076+ rb_define_singleton_method( mInput, "setConfig" , Input_setconfig , -1 );
27533077
3078+
27543079 /* Fontクラス登録 */
27553080 cFont = rb_define_class( "Font", rb_cObject );
27563081
@@ -2760,7 +3085,8 @@
27603085 /* Fontオブジェクトを生成した時にinitializeの前に呼ばれるメモリ割り当て関数登録 */
27613086 rb_define_alloc_func( cFont, Font_allocate );
27623087
2763- /* Soundクラス定義 */
3088+
3089+ /* Soundクラス定義 */
27643090 cSound= rb_define_class( "Sound", rb_cObject );
27653091
27663092 /* Soundクラスにメソッド登録*/
@@ -2771,7 +3097,8 @@
27713097 /* Soundオブジェクトを生成した時にinitializeの前に呼ばれるメモリ割り当て関数登録 */
27723098 rb_define_alloc_func( cSound, Sound_allocate );
27733099
2774- /* キーボードのスキャンコード定数設定 */
3100+
3101+ /* キーボードのスキャンコード定数設定 */
27753102 rb_define_const( rb_cObject, "K_ESCAPE" , INT2FIX(DIK_ESCAPE) );
27763103 rb_define_const( rb_cObject, "K_TAB" , INT2FIX(DIK_TAB) );
27773104 rb_define_const( rb_cObject, "K_RETURN" , INT2FIX(DIK_RETURN) );
@@ -2865,6 +3192,7 @@
28653192 g_WindowInfo.scale = 1;
28663193 g_WindowInfo.enablemouse = Qtrue;
28673194 g_WindowInfo.mousewheelpos = 0;
3195+ g_WindowInfo.fps = 60;
28683196
28693197 ShowCursor( TRUE );
28703198
Show on old repository browser