• R/O
  • SSH
  • HTTPS

dxruby: Commit


Commit MetaInfo

Revision534 (tree)
Time2016-05-07 22:00:44
Authormirichi

Log Message

Window.resizeが失敗することがある不具合を修正

Change Summary

Incremental Difference

--- branches/1.5dev/messagethread.c (revision 533)
+++ branches/1.5dev/messagethread.c (revision 534)
@@ -158,10 +158,12 @@
158158 for( i = 0; i < g_RenderTargetList.count; i++ )
159159 {
160160 struct DXRubyRenderTarget *rt = (struct DXRubyRenderTarget *)g_RenderTargetList.pointer[i];
161-
161+ if( g_RenderTargetList.pointer[i] )
162+ {
162163 // ppD3DTexture[i] = to_image( rt );
163- RELEASE( rt->surface );
164- RELEASE( rt->texture->pD3DTexture );
164+ RELEASE( rt->surface );
165+ RELEASE( rt->texture->pD3DTexture );
166+ }
165167 }
166168
167169 /* シェーダのロスト */
@@ -185,15 +187,17 @@
185187 for( i = 0; i < g_RenderTargetList.count; i++ )
186188 {
187189 struct DXRubyRenderTarget *rt = (struct DXRubyRenderTarget *)g_RenderTargetList.pointer[i];
190+ if( g_RenderTargetList.pointer[i] )
191+ {
192+ /* テクスチャオブジェクトを作成する */
193+ hr = D3DXCreateTexture( g_pD3DDevice, (UINT)rt->texture->width, (UINT)rt->texture->height,
194+ 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT,
195+ &rt->texture->pD3DTexture);
196+ if( FAILED( hr ) ) return 2;
188197
189- /* テクスチャオブジェクトを作成する */
190- hr = D3DXCreateTexture( g_pD3DDevice, (UINT)rt->texture->width, (UINT)rt->texture->height,
191- 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT,
192- &rt->texture->pD3DTexture);
193- if( FAILED( hr ) ) return 2;
194-
195- hr = rt->texture->pD3DTexture->lpVtbl->GetSurfaceLevel( rt->texture->pD3DTexture, 0, &rt->surface );
196- if( FAILED( hr ) ) return 3;
198+ hr = rt->texture->pD3DTexture->lpVtbl->GetSurfaceLevel( rt->texture->pD3DTexture, 0, &rt->surface );
199+ if( FAILED( hr ) ) return 3;
200+ }
197201 }
198202
199203 /* シェーダの復帰 */
@@ -310,8 +314,11 @@
310314 for( i = 0; i < g_RenderTargetList.count; i++ )
311315 {
312316 struct DXRubyRenderTarget *rt = (struct DXRubyRenderTarget *)g_RenderTargetList.pointer[i];
313- RELEASE( rt->surface );
314- RELEASE( rt->texture->pD3DTexture );
317+ if( g_RenderTargetList.pointer[i] )
318+ {
319+ RELEASE( rt->surface );
320+ RELEASE( rt->texture->pD3DTexture );
321+ }
315322 }
316323
317324 /* シェーダのロスト */
@@ -343,15 +350,17 @@
343350 for( i = 0; i < g_RenderTargetList.count; i++ )
344351 {
345352 struct DXRubyRenderTarget *rt = (struct DXRubyRenderTarget *)g_RenderTargetList.pointer[i];
353+ if( g_RenderTargetList.pointer[i] )
354+ {
355+ /* テクスチャオブジェクトを作成する */
356+ hr = D3DXCreateTexture( g_pD3DDevice, (UINT)rt->texture->width, (UINT)rt->texture->height,
357+ 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT,
358+ &rt->texture->pD3DTexture);
359+ if( FAILED( hr ) ) return 2;
346360
347- /* テクスチャオブジェクトを作成する */
348- hr = D3DXCreateTexture( g_pD3DDevice, (UINT)rt->texture->width, (UINT)rt->texture->height,
349- 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT,
350- &rt->texture->pD3DTexture);
351- if( FAILED( hr ) ) return 2;
352-
353- hr = rt->texture->pD3DTexture->lpVtbl->GetSurfaceLevel( rt->texture->pD3DTexture, 0, &rt->surface );
354- if( FAILED( hr ) ) return 3;
361+ hr = rt->texture->pD3DTexture->lpVtbl->GetSurfaceLevel( rt->texture->pD3DTexture, 0, &rt->surface );
362+ if( FAILED( hr ) ) return 3;
363+ }
355364 }
356365
357366 /* シェーダの復帰 */
@@ -1095,6 +1104,7 @@
10951104 int ret;
10961105
10971106 ret = SendMessage( g_hWnd, WM_APP + 1, 0, 0 );
1107+
10981108 switch( ret )
10991109 {
11001110 case 0:
Show on old repository browser