• R/O
  • SSH
  • HTTPS

dxruby: Commit


Commit MetaInfo

Revision526 (tree)
Time2016-04-16 12:41:45
Authormirichi

Log Message

RTの自動update利ファクタリングとエラーメッセージ修正

Change Summary

Incremental Difference

--- branches/1.5dev/dxruby.c (revision 525)
+++ branches/1.5dev/dxruby.c (revision 526)
@@ -1564,7 +1564,7 @@
15641564 hr = g_pD3D->lpVtbl->GetAdapterDisplayMode(g_pD3D, D3DADAPTER_DEFAULT, &dmode);
15651565 if( FAILED( hr ) )
15661566 {
1567- rb_raise( eDXRubyError, "キャプチャに失敗しました - GetAdapterDisplayMode" );
1567+ rb_raise( eDXRubyError, "Failure to capture - GetAdapterDisplayMode" );
15681568 }
15691569
15701570 /* キャプチャ用サーフェス作成 */
@@ -1575,7 +1575,7 @@
15751575 D3DPOOL_SCRATCH, &pSurface, NULL);
15761576 if( FAILED( hr ) )
15771577 {
1578- rb_raise( eDXRubyError, "キャプチャに失敗しました - CreateOffscreenPlainSurface" );
1578+ rb_raise( eDXRubyError, "Failure to capture - CreateOffscreenPlainSurface" );
15791579 }
15801580 /* キャプチャ */
15811581 hr = g_pD3DDevice->lpVtbl->GetFrontBufferData(g_pD3DDevice, 0, pSurface);
@@ -1582,7 +1582,7 @@
15821582 if( FAILED( hr ) )
15831583 {
15841584 RELEASE(pSurface);
1585- rb_raise( eDXRubyError, "キャプチャに失敗しました - GetFrontBufferData" );
1585+ rb_raise( eDXRubyError, "Failure to capture - GetFrontBufferData" );
15861586 }
15871587
15881588 /* サーフェスの保存 */
@@ -1663,7 +1663,7 @@
16631663 RELEASE(pSurface);
16641664 if( FAILED( hr ) )
16651665 {
1666- rb_raise( eDXRubyError, "キャプチャに失敗しました - D3DXSaveSurfaceToFile" );
1666+ rb_raise( eDXRubyError, "Failure to capture - D3DXSaveSurfaceToFile" );
16671667 }
16681668
16691669 return obj;
@@ -1868,7 +1868,7 @@
18681868 }
18691869 if( i == g_ShaderCoreList.count )
18701870 {
1871- rb_raise( eDXRubyError, "内部エラー - DeleteShaderCoreList" );
1871+ rb_raise( eDXRubyError, "Internal error - DeleteShaderCoreList" );
18721872 }
18731873
18741874 i++;
@@ -2298,6 +2298,29 @@
22982298 }
22992299
23002300 /*--------------------------------------------------------------------
2301+ RenderTargetだった場合に描画予約があればupdateする(内部用)
2302+ ---------------------------------------------------------------------*/
2303+static void RenderTerget_auto_update( VALUE vrt )
2304+{
2305+ if( DXRUBY_CHECK( RenderTarget, vrt ) )
2306+ {
2307+ struct DXRubyRenderTarget *src_rt = DXRUBY_GET_STRUCT( RenderTarget, vrt );
2308+
2309+ if( src_rt->clearflag == 0 && src_rt->PictureCount == 0 )
2310+ {
2311+ g_pD3DDevice->lpVtbl->SetRenderTarget( g_pD3DDevice, 0, src_rt->surface );
2312+ g_pD3DDevice->lpVtbl->Clear( g_pD3DDevice, 0, NULL, D3DCLEAR_TARGET,
2313+ D3DCOLOR_ARGB( src_rt->a, src_rt->r, src_rt->g, src_rt->b ), 1.0f, 0 );
2314+ src_rt->clearflag = 1;
2315+ }
2316+ else if( src_rt->PictureCount > 0 )
2317+ {
2318+ RenderTarget_update( vrt );
2319+ }
2320+ }
2321+}
2322+
2323+/*--------------------------------------------------------------------
23012324 RenderTargetクラスのallocate。メモリを確保する為にinitialize前に呼ばれる。
23022325 ---------------------------------------------------------------------*/
23032326 static VALUE RenderTarget_allocate( VALUE klass )
@@ -3487,23 +3510,8 @@
34873510 rt->PictureCount++;
34883511
34893512 /* RenderTargetだった場合に描画予約があればupdateする */
3490- if( DXRUBY_CHECK( RenderTarget, argv[2] ) )
3491- {
3492- struct DXRubyRenderTarget *src_rt = DXRUBY_GET_STRUCT( RenderTarget, argv[2] );
3513+ RenderTerget_auto_update( argv[2] );
34933514
3494- if( src_rt->clearflag == 0 && src_rt->PictureCount == 0 )
3495- {
3496- g_pD3DDevice->lpVtbl->SetRenderTarget( g_pD3DDevice, 0, src_rt->surface );
3497- g_pD3DDevice->lpVtbl->Clear( g_pD3DDevice, 0, NULL, D3DCLEAR_TARGET,
3498- D3DCOLOR_ARGB( src_rt->a, src_rt->r, src_rt->g, src_rt->b ), 1.0f, 0 );
3499- src_rt->clearflag = 1;
3500- }
3501- else if( src_rt->PictureCount > 0 )
3502- {
3503- RenderTarget_update( argv[2] );
3504- }
3505- }
3506-
35073515 /* 使われたimageのロック */
35083516 // image->lockcount++;
35093517
@@ -3547,23 +3555,8 @@
35473555 rt->PictureCount++;
35483556
35493557 /* RenderTargetだった場合に描画予約があればupdateする */
3550- if( DXRUBY_CHECK( RenderTarget, argv[2] ) )
3551- {
3552- struct DXRubyRenderTarget *src_rt = DXRUBY_GET_STRUCT( RenderTarget, argv[2] );
3558+ RenderTerget_auto_update( argv[2] );
35533559
3554- if( src_rt->clearflag == 0 && src_rt->PictureCount == 0 )
3555- {
3556- g_pD3DDevice->lpVtbl->SetRenderTarget( g_pD3DDevice, 0, src_rt->surface );
3557- g_pD3DDevice->lpVtbl->Clear( g_pD3DDevice, 0, NULL, D3DCLEAR_TARGET,
3558- D3DCOLOR_ARGB( src_rt->a, src_rt->r, src_rt->g, src_rt->b ), 1.0f, 0 );
3559- src_rt->clearflag = 1;
3560- }
3561- else if( src_rt->PictureCount > 0 )
3562- {
3563- RenderTarget_update( argv[2] );
3564- }
3565- }
3566-
35673560 /* 使われたimageのロック */
35683561 // image->lockcount++;
35693562
@@ -3608,23 +3601,8 @@
36083601 rt->PictureCount++;
36093602
36103603 /* RenderTargetだった場合に描画予約があればupdateする */
3611- if( DXRUBY_CHECK( RenderTarget, argv[2] ) )
3612- {
3613- struct DXRubyRenderTarget *src_rt = DXRUBY_GET_STRUCT( RenderTarget, argv[2] );
3604+ RenderTerget_auto_update( argv[2] );
36143605
3615- if( src_rt->clearflag == 0 && src_rt->PictureCount == 0 )
3616- {
3617- g_pD3DDevice->lpVtbl->SetRenderTarget( g_pD3DDevice, 0, src_rt->surface );
3618- g_pD3DDevice->lpVtbl->Clear( g_pD3DDevice, 0, NULL, D3DCLEAR_TARGET,
3619- D3DCOLOR_ARGB( src_rt->a, src_rt->r, src_rt->g, src_rt->b ), 1.0f, 0 );
3620- src_rt->clearflag = 1;
3621- }
3622- else if( src_rt->PictureCount > 0 )
3623- {
3624- RenderTarget_update( argv[2] );
3625- }
3626- }
3627-
36283606 /* 使われたimageのロック */
36293607 // image->lockcount++;
36303608
@@ -3669,23 +3647,8 @@
36693647 rt->PictureCount++;
36703648
36713649 /* RenderTargetだった場合に描画予約があればupdateする */
3672- if( DXRUBY_CHECK( RenderTarget, argv[2] ) )
3673- {
3674- struct DXRubyRenderTarget *src_rt = DXRUBY_GET_STRUCT( RenderTarget, argv[2] );
3650+ RenderTerget_auto_update( argv[2] );
36753651
3676- if( src_rt->clearflag == 0 && src_rt->PictureCount == 0 )
3677- {
3678- g_pD3DDevice->lpVtbl->SetRenderTarget( g_pD3DDevice, 0, src_rt->surface );
3679- g_pD3DDevice->lpVtbl->Clear( g_pD3DDevice, 0, NULL, D3DCLEAR_TARGET,
3680- D3DCOLOR_ARGB( src_rt->a, src_rt->r, src_rt->g, src_rt->b ), 1.0f, 0 );
3681- src_rt->clearflag = 1;
3682- }
3683- else if( src_rt->PictureCount > 0 )
3684- {
3685- RenderTarget_update( argv[2] );
3686- }
3687- }
3688-
36893652 /* 使われたimageのロック */
36903653 // image->lockcount++;
36913654
@@ -3920,23 +3883,8 @@
39203883 rt->PictureCount++;
39213884
39223885 /* RenderTargetだった場合に描画予約があればupdateする */
3923- if( DXRUBY_CHECK( RenderTarget, argv[2] ) )
3924- {
3925- struct DXRubyRenderTarget *src_rt = DXRUBY_GET_STRUCT( RenderTarget, argv[2] );
3886+ RenderTerget_auto_update( argv[2] );
39263887
3927- if( src_rt->clearflag == 0 && src_rt->PictureCount == 0 )
3928- {
3929- g_pD3DDevice->lpVtbl->SetRenderTarget( g_pD3DDevice, 0, src_rt->surface );
3930- g_pD3DDevice->lpVtbl->Clear( g_pD3DDevice, 0, NULL, D3DCLEAR_TARGET,
3931- D3DCOLOR_ARGB( src_rt->a, src_rt->r, src_rt->g, src_rt->b ), 1.0f, 0 );
3932- src_rt->clearflag = 1;
3933- }
3934- else if( src_rt->PictureCount > 0 )
3935- {
3936- RenderTarget_update( argv[2] );
3937- }
3938- }
3939-
39403888 /* 使われたimageのロック */
39413889 // DXRUBY_GET_STRUCT( Image, argv[2] )->lockcount++;
39423890
@@ -4091,23 +4039,8 @@
40914039 rt->PictureCount++;
40924040
40934041 /* RenderTargetだった場合に描画予約があればupdateする */
4094- if( DXRUBY_CHECK( RenderTarget, argv[2] ) )
4095- {
4096- struct DXRubyRenderTarget *src_rt = DXRUBY_GET_STRUCT( RenderTarget, argv[2] );
4042+ RenderTerget_auto_update( argv[2] );
40974043
4098- if( src_rt->clearflag == 0 && src_rt->PictureCount == 0 )
4099- {
4100- g_pD3DDevice->lpVtbl->SetRenderTarget( g_pD3DDevice, 0, src_rt->surface );
4101- g_pD3DDevice->lpVtbl->Clear( g_pD3DDevice, 0, NULL, D3DCLEAR_TARGET,
4102- D3DCOLOR_ARGB( src_rt->a, src_rt->r, src_rt->g, src_rt->b ), 1.0f, 0 );
4103- src_rt->clearflag = 1;
4104- }
4105- else if( src_rt->PictureCount > 0 )
4106- {
4107- RenderTarget_update( argv[2] );
4108- }
4109- }
4110-
41114044 /* 使われたimageのロック */
41124045 // image->lockcount++;
41134046
@@ -4157,23 +4090,8 @@
41574090 rt->PictureCount++;
41584091
41594092 /* RenderTargetだった場合に描画予約があればupdateする */
4160- if( DXRUBY_CHECK( RenderTarget, argv[2] ) )
4161- {
4162- struct DXRubyRenderTarget *src_rt = DXRUBY_GET_STRUCT( RenderTarget, argv[2] );
4093+ RenderTerget_auto_update( argv[2] );
41634094
4164- if( src_rt->clearflag == 0 && src_rt->PictureCount == 0 )
4165- {
4166- g_pD3DDevice->lpVtbl->SetRenderTarget( g_pD3DDevice, 0, src_rt->surface );
4167- g_pD3DDevice->lpVtbl->Clear( g_pD3DDevice, 0, NULL, D3DCLEAR_TARGET,
4168- D3DCOLOR_ARGB( src_rt->a, src_rt->r, src_rt->g, src_rt->b ), 1.0f, 0 );
4169- src_rt->clearflag = 1;
4170- }
4171- else if( src_rt->PictureCount > 0 )
4172- {
4173- RenderTarget_update( argv[2] );
4174- }
4175- }
4176-
41774095 /* 使われたimageのロック */
41784096 // image->lockcount++;
41794097
@@ -4274,23 +4192,8 @@
42744192 rt->PictureCount++;
42754193
42764194 /* RenderTargetだった場合に描画予約があればupdateする */
4277- if( DXRUBY_CHECK( RenderTarget, argv[2] ) )
4278- {
4279- struct DXRubyRenderTarget *src_rt = DXRUBY_GET_STRUCT( RenderTarget, argv[2] );
4195+ RenderTerget_auto_update( argv[2] );
42804196
4281- if( src_rt->clearflag == 0 && src_rt->PictureCount == 0 )
4282- {
4283- g_pD3DDevice->lpVtbl->SetRenderTarget( g_pD3DDevice, 0, src_rt->surface );
4284- g_pD3DDevice->lpVtbl->Clear( g_pD3DDevice, 0, NULL, D3DCLEAR_TARGET,
4285- D3DCOLOR_ARGB( src_rt->a, src_rt->r, src_rt->g, src_rt->b ), 1.0f, 0 );
4286- src_rt->clearflag = 1;
4287- }
4288- else if( src_rt->PictureCount > 0 )
4289- {
4290- RenderTarget_update( argv[2] );
4291- }
4292- }
4293-
42944197 /* 使われたimageのロック */
42954198 // image->lockcount++;
42964199
@@ -4755,23 +4658,8 @@
47554658 rt->PictureCount++;
47564659
47574660 /* RenderTargetだった場合に描画予約があればupdateする */
4758- if( DXRUBY_CHECK( RenderTarget, argv[8] ) )
4759- {
4760- struct DXRubyRenderTarget *src_rt = DXRUBY_GET_STRUCT( RenderTarget, argv[8] );
4661+ RenderTerget_auto_update( argv[8] );
47614662
4762- if( src_rt->clearflag == 0 && src_rt->PictureCount == 0 )
4763- {
4764- g_pD3DDevice->lpVtbl->SetRenderTarget( g_pD3DDevice, 0, src_rt->surface );
4765- g_pD3DDevice->lpVtbl->Clear( g_pD3DDevice, 0, NULL, D3DCLEAR_TARGET,
4766- D3DCOLOR_ARGB( src_rt->a, src_rt->r, src_rt->g, src_rt->b ), 1.0f, 0 );
4767- src_rt->clearflag = 1;
4768- }
4769- else if( src_rt->PictureCount > 0 )
4770- {
4771- RenderTarget_update( argv[8] );
4772- }
4773- }
4774-
47754663 /* 使われたimageのロック */
47764664 // image->lockcount++;
47774665
@@ -4931,22 +4819,8 @@
49314819 DXRUBY_CHECK_DISPOSE( DXRUBY_GET_STRUCT( Image, RARRAY_AREF(vmapdata_f, i) ), texture );
49324820
49334821 /* RenderTargetだった場合に描画予約があればupdateする */
4934- if( DXRUBY_CHECK( RenderTarget, RARRAY_AREF(vmapdata_f, i) ) )
4935- {
4936- struct DXRubyRenderTarget *src_rt = DXRUBY_GET_STRUCT( RenderTarget, RARRAY_AREF(vmapdata_f, i) );
4822+ RenderTerget_auto_update( RARRAY_AREF(vmapdata_f, i) );
49374823
4938- if( src_rt->clearflag == 0 && src_rt->PictureCount == 0 )
4939- {
4940- g_pD3DDevice->lpVtbl->SetRenderTarget( g_pD3DDevice, 0, src_rt->surface );
4941- g_pD3DDevice->lpVtbl->Clear( g_pD3DDevice, 0, NULL, D3DCLEAR_TARGET,
4942- D3DCOLOR_ARGB( src_rt->a, src_rt->r, src_rt->g, src_rt->b ), 1.0f, 0 );
4943- src_rt->clearflag = 1;
4944- }
4945- else if( src_rt->PictureCount > 0 )
4946- {
4947- RenderTarget_update( RARRAY_AREF(vmapdata_f, i) );
4948- }
4949- }
49504824 /* 使われたimageのロック */
49514825 // image->lockcount++;
49524826 }
--- branches/1.5dev/sound.c (revision 525)
+++ branches/1.5dev/sound.c (revision 526)
@@ -1099,7 +1099,7 @@
10991099
11001100 if( FAILED( hr ) )
11011101 {
1102- rb_raise( eDXRubyError, "サウンドバッファの作成に失敗しました - CreateSoundBuffer" );
1102+ rb_raise( eDXRubyError, "Failure to create the SoundBuffer - CreateSoundBuffer" );
11031103 }
11041104
11051105 /* ロック */
@@ -1106,7 +1106,7 @@
11061106 hr = soundeffect->pDSBuffer->lpVtbl->Lock( soundeffect->pDSBuffer, 0, 0, &pointer, &size, &pointer2, &size2, DSBLOCK_ENTIREBUFFER );
11071107 if( FAILED( hr ) || size2 != 0 )
11081108 {
1109- rb_raise( eDXRubyError, "サウンドバッファのロックに失敗しました - Lock" );
1109+ rb_raise( eDXRubyError, "Failure to lock the SoundBuffer - Lock" );
11101110 }
11111111
11121112 if( TYPE( vsize ) == T_ARRAY )
@@ -1175,7 +1175,7 @@
11751175 hr = soundeffect->pDSBuffer->lpVtbl->Unlock( soundeffect->pDSBuffer, pointer, size, pointer2, size2 );
11761176 if( FAILED( hr ) )
11771177 {
1178- rb_raise( eDXRubyError, "サウンドバッファのロックに失敗しました - Lock" );
1178+ rb_raise( eDXRubyError, "Failure to lock the SoundBuffer - Lock" );
11791179 }
11801180
11811181 return obj;
@@ -1215,7 +1215,7 @@
12151215 hr = soundeffect->pDSBuffer->lpVtbl->Lock( soundeffect->pDSBuffer, 0, 0, &pointer, &size, &pointer2, &size2, DSBLOCK_ENTIREBUFFER );
12161216 if( FAILED( hr ) || size2 != 0 )
12171217 {
1218- rb_raise( eDXRubyError, "サウンドバッファのロックに失敗しました - Lock" );
1218+ rb_raise( eDXRubyError, "Failure to lock the SoundBuffer - Lock" );
12191219 }
12201220
12211221 pcmwf.nChannels = 1;
@@ -1278,7 +1278,7 @@
12781278 hr = soundeffect->pDSBuffer->lpVtbl->Unlock( soundeffect->pDSBuffer, pointer, size, pointer2, size2 );
12791279 if( FAILED( hr ) )
12801280 {
1281- rb_raise( eDXRubyError, "サウンドバッファのロックに失敗しました - Lock" );
1281+ rb_raise( eDXRubyError, "Failure to lock the SoundBuffer - Lock" );
12821282 }
12831283
12841284 return obj;
@@ -1363,39 +1363,39 @@
13631363 hr = se->pDSBuffer->lpVtbl->Lock( se->pDSBuffer, 0, 0, &pointer, &size, &pointer2, &size2, DSBLOCK_ENTIREBUFFER );
13641364 if( FAILED( hr ) || size2 != 0 )
13651365 {
1366- rb_raise( eDXRubyError, "サウンドバッファのロックに失敗しました - Lock" );
1366+ rb_raise( eDXRubyError, "Failure to lock the SoundBuffer - Lock" );
13671367 }
13681368
13691369 hfile = CreateFile( RSTRING_PTR( vfilename ), GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
13701370 if( hfile == INVALID_HANDLE_VALUE )
13711371 {
1372- rb_raise( eDXRubyError, "ファイルの書き込みに失敗しました - open" );
1372+ rb_raise( eDXRubyError, "Write failure - open" );
13731373 }
13741374
1375- if( !WriteFile( hfile, "RIFF", 4, &wsize, NULL ) ) rb_raise( eDXRubyError, "ファイルの書き込みに失敗しました - write" );
1375+ if( !WriteFile( hfile, "RIFF", 4, &wsize, NULL ) ) rb_raise( eDXRubyError, "Write failure - write" );
13761376 tmpl = size + 44 - 8;
1377- if( !WriteFile( hfile, &tmpl, 4, &wsize, NULL ) ) rb_raise( eDXRubyError, "ファイルの書き込みに失敗しました - write" );
1378- if( !WriteFile( hfile, "WAVE", 4, &wsize, NULL ) ) rb_raise( eDXRubyError, "ファイルの書き込みに失敗しました - write" );
1379- if( !WriteFile( hfile, "fmt ", 4, &wsize, NULL ) ) rb_raise( eDXRubyError, "ファイルの書き込みに失敗しました - write" );
1377+ if( !WriteFile( hfile, &tmpl, 4, &wsize, NULL ) ) rb_raise( eDXRubyError, "Write failure - write" );
1378+ if( !WriteFile( hfile, "WAVE", 4, &wsize, NULL ) ) rb_raise( eDXRubyError, "Write failure - write" );
1379+ if( !WriteFile( hfile, "fmt ", 4, &wsize, NULL ) ) rb_raise( eDXRubyError, "Write failure - write" );
13801380 tmpl = 16;
1381- if( !WriteFile( hfile, &tmpl, 4, &wsize, NULL ) ) rb_raise( eDXRubyError, "ファイルの書き込みに失敗しました - write" );
1381+ if( !WriteFile( hfile, &tmpl, 4, &wsize, NULL ) ) rb_raise( eDXRubyError, "Write failure - write" );
13821382 tmps = 1;
1383- if( !WriteFile( hfile, &tmps, 2, &wsize, NULL ) ) rb_raise( eDXRubyError, "ファイルの書き込みに失敗しました - write" );
1383+ if( !WriteFile( hfile, &tmps, 2, &wsize, NULL ) ) rb_raise( eDXRubyError, "Write failure - write" );
13841384 tmps = 1;
1385- if( !WriteFile( hfile, &tmps, 2, &wsize, NULL ) ) rb_raise( eDXRubyError, "ファイルの書き込みに失敗しました - write" );
1385+ if( !WriteFile( hfile, &tmps, 2, &wsize, NULL ) ) rb_raise( eDXRubyError, "Write failure - write" );
13861386 tmpl = 44100;
1387- if( !WriteFile( hfile, &tmpl, 4, &wsize, NULL ) ) rb_raise( eDXRubyError, "ファイルの書き込みに失敗しました - write" );
1387+ if( !WriteFile( hfile, &tmpl, 4, &wsize, NULL ) ) rb_raise( eDXRubyError, "Write failure - write" );
13881388 tmpl = 44100*2;
1389- if( !WriteFile( hfile, &tmpl, 4, &wsize, NULL ) ) rb_raise( eDXRubyError, "ファイルの書き込みに失敗しました - write" );
1389+ if( !WriteFile( hfile, &tmpl, 4, &wsize, NULL ) ) rb_raise( eDXRubyError, "Write failure - write" );
13901390 tmps = 2;
1391- if( !WriteFile( hfile, &tmps, 2, &wsize, NULL ) ) rb_raise( eDXRubyError, "ファイルの書き込みに失敗しました - write" );
1391+ if( !WriteFile( hfile, &tmps, 2, &wsize, NULL ) ) rb_raise( eDXRubyError, "Write failure - write" );
13921392 tmps = 16;
1393- if( !WriteFile( hfile, &tmps, 2, &wsize, NULL ) ) rb_raise( eDXRubyError, "ファイルの書き込みに失敗しました - write" );
1393+ if( !WriteFile( hfile, &tmps, 2, &wsize, NULL ) ) rb_raise( eDXRubyError, "Write failure - write" );
13941394
1395- if( !WriteFile( hfile, "data", 4, &wsize, NULL ) ) rb_raise( eDXRubyError, "ファイルの書き込みに失敗しました - write" );
1395+ if( !WriteFile( hfile, "data", 4, &wsize, NULL ) ) rb_raise( eDXRubyError, "Write failure - write" );
13961396 tmpl = size;
1397- if( !WriteFile( hfile, &tmpl, 4, &wsize, NULL ) ) rb_raise( eDXRubyError, "ファイルの書き込みに失敗しました - write" );
1398- if( !WriteFile( hfile, pointer, size, &wsize, NULL ) ) rb_raise( eDXRubyError, "ファイルの書き込みに失敗しました - write" );
1397+ if( !WriteFile( hfile, &tmpl, 4, &wsize, NULL ) ) rb_raise( eDXRubyError, "Write failure - write" );
1398+ if( !WriteFile( hfile, pointer, size, &wsize, NULL ) ) rb_raise( eDXRubyError, "Write failure - write" );
13991399
14001400 CloseHandle( hfile );
14011401
@@ -1403,7 +1403,7 @@
14031403 hr = se->pDSBuffer->lpVtbl->Unlock( se->pDSBuffer, pointer, size, pointer2, size2 );
14041404 if( FAILED( hr ) )
14051405 {
1406- rb_raise( eDXRubyError, "サウンドバッファのロックに失敗しました - Lock" );
1406+ rb_raise( eDXRubyError, "Failure to lock the SoundBuffer - Lock" );
14071407 }
14081408
14091409 return self;
@@ -1428,7 +1428,7 @@
14281428 hr = se->pDSBuffer->lpVtbl->Lock( se->pDSBuffer, 0, 0, &pointer, &size, &pointer2, &size2, DSBLOCK_ENTIREBUFFER );
14291429 if( FAILED( hr ) || size2 != 0 )
14301430 {
1431- rb_raise( eDXRubyError, "サウンドバッファのロックに失敗しました - Lock" );
1431+ rb_raise( eDXRubyError, "Failure to lock the SoundBuffer - Lock" );
14321432 }
14331433
14341434 ary = rb_ary_new2( size / 2 );
@@ -1450,7 +1450,7 @@
14501450 hr = se->pDSBuffer->lpVtbl->Unlock( se->pDSBuffer, pointer, size, pointer2, size2 );
14511451 if( FAILED( hr ) )
14521452 {
1453- rb_raise( eDXRubyError, "サウンドバッファのロックに失敗しました - Lock" );
1453+ rb_raise( eDXRubyError, "Failure to lock the SoundBuffer - Lock" );
14541454 }
14551455
14561456 return ary;
Show on old repository browser