DXGL r832 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r831‎ | r832 | r833 >
Date:18:39, 8 July 2018
Author:admin
Status:new
Tags:
Comment:
Roll back parts of revision 830 that caused DXGL to fail.
Modified paths:
  • /ddraw/glRenderer.cpp (modified) (history)
  • /ddraw/glTexture.cpp (modified) (history)

Diff [purge]

Index: ddraw/glRenderer.cpp
@@ -116,12 +116,12 @@
117117 }
118118 if (vertexsize)
119119 {
120 - if ((This->state.cmd->write_ptr_vertex + vertexsize) > (unsigned)This->state.cmd->vertices->size)
 120+ if ((This->state.cmd->write_ptr_vertex + vertexsize) > This->state.cmd->vertices->size)
121121 over = TRUE;
122122 }
123123 if (indexsize)
124124 {
125 - if ((This->state.cmd->write_ptr_index + indexsize) > (unsigned)This->state.cmd->indices->size)
 125+ if ((This->state.cmd->write_ptr_index + indexsize) > This->state.cmd->indices->size)
126126 over = TRUE;
127127 }
128128 if (over)
@@ -786,12 +786,12 @@
787787 r1.bottom = cmd->Blt.cmd.dest->levels[0].ddsd.dwHeight;
788788 }
789789 // Check backbuffer size and resize
790 - if(((signed)This->backbuffer->levels[0].ddsd.dwWidth < r1.right) ||
791 - ((signed)This->backbuffer->levels[0].ddsd.dwHeight < r1.bottom))
 790+ if((This->backbuffer->levels[0].ddsd.dwWidth < r1.right) ||
 791+ (This->backbuffer->levels[0].ddsd.dwHeight < r1.bottom))
792792 {
793793 DDSURFACEDESC2 newdesc = This->backbuffer->levels[0].ddsd;
794 - if ((signed)newdesc.dwWidth < r1.right) newdesc.dwWidth = r1.right;
795 - if ((signed)newdesc.dwHeight < r1.bottom) newdesc.dwHeight = r1.bottom;
 794+ if (newdesc.dwWidth < r1.right) newdesc.dwWidth = r1.right;
 795+ if (newdesc.dwHeight < r1.bottom) newdesc.dwHeight = r1.bottom;
796796 tmp_cmd.SetTextureSurfaceDesc.opcode = OP_SETTEXTURESURFACEDESC;
797797 tmp_cmd.SetTextureSurfaceDesc.size = sizeof(SetTextureSurfaceDescCmd) - 8;
798798 tmp_cmd.SetTextureSurfaceDesc.level = 0;
@@ -1138,13 +1138,13 @@
11391139 (cmd->DrawScreen.texture->bigheight != (view[3]-view[2]))))
11401140 {
11411141 // Check backbuffer size and resize
1142 - if (((signed)This->backbuffer->levels[0].ddsd.dwWidth < cmd->DrawScreen.texture->bigwidth) ||
1143 - ((signed)This->backbuffer->levels[0].ddsd.dwHeight < cmd->DrawScreen.texture->bigheight))
 1142+ if ((This->backbuffer->levels[0].ddsd.dwWidth < cmd->DrawScreen.texture->bigwidth) ||
 1143+ (This->backbuffer->levels[0].ddsd.dwHeight < cmd->DrawScreen.texture->bigheight))
11441144 {
11451145 DDSURFACEDESC2 newdesc = This->backbuffer->levels[0].ddsd;
1146 - if ((signed)newdesc.dwWidth < cmd->DrawScreen.texture->bigwidth)
 1146+ if (newdesc.dwWidth < cmd->DrawScreen.texture->bigwidth)
11471147 newdesc.dwWidth = cmd->DrawScreen.texture->bigwidth;
1148 - if ((signed)newdesc.dwHeight < cmd->DrawScreen.texture->bigheight)
 1148+ if (newdesc.dwHeight < cmd->DrawScreen.texture->bigheight)
11491149 newdesc.dwHeight = cmd->DrawScreen.texture->bigheight;
11501150 tmp_cmd.SetTextureSurfaceDesc.opcode = OP_SETTEXTURESURFACEDESC;
11511151 tmp_cmd.SetTextureSurfaceDesc.size = sizeof(SetTextureSurfaceDescCmd) - 8;
@@ -3631,10 +3631,10 @@
36323632 ddsd.dwHeight = y2;
36333633 glTexture_Create(&ddsd, &This->backbuffer, This, x2, y2, FALSE, TRUE);
36343634 }
3635 - if (((signed)This->backbuffer->levels[0].ddsd.dwWidth < x2) || ((signed)This->backbuffer->levels[0].ddsd.dwHeight < y2))
 3635+ if ((This->backbuffer->levels[0].ddsd.dwWidth < x2) || (This->backbuffer->levels[0].ddsd.dwHeight < y2))
36363636 {
3637 - if ((signed)This->backbuffer->levels[0].ddsd.dwWidth > x2) x2 = This->backbuffer->levels[0].ddsd.dwWidth;
3638 - if ((signed)This->backbuffer->levels[0].ddsd.dwHeight > y2) y2 = This->backbuffer->levels[0].ddsd.dwHeight;
 3637+ if (This->backbuffer->levels[0].ddsd.dwWidth > x2) x2 = This->backbuffer->levels[0].ddsd.dwWidth;
 3638+ if (This->backbuffer->levels[0].ddsd.dwHeight > y2) y2 = This->backbuffer->levels[0].ddsd.dwHeight;
36393639 ZeroMemory(&ddsd, sizeof(DDSURFACEDESC2));
36403640 ddsd.dwSize = sizeof(DDSURFACEDESC2);
36413641 ddsd.dwWidth = x2;
Index: ddraw/glTexture.cpp
@@ -272,7 +272,7 @@
273273 }
274274 HRESULT glTexture_Lock(glTexture *This, GLint level, LPRECT r, LPDDSURFACEDESC2 ddsd, DWORD flags, BOOL backend)
275275 {
276 - if (level > (signed)(This->levels[0].ddsd.dwMipMapCount - 1)) return DDERR_INVALIDPARAMS;
 276+ if (level > (This->levels[0].ddsd.dwMipMapCount - 1)) return DDERR_INVALIDPARAMS;
277277 if (!ddsd) return DDERR_INVALIDPARAMS;
278278 InterlockedIncrement(&This->levels[level].locked);
279279 if (backend)
@@ -297,7 +297,7 @@
298298 }
299299 HRESULT glTexture_Unlock(glTexture *This, GLint level, LPRECT r, BOOL backend)
300300 {
301 - if (level > (signed)(This->levels[0].ddsd.dwMipMapCount - 1)) return DDERR_INVALIDPARAMS;
 301+ if (level > (This->levels[0].ddsd.dwMipMapCount - 1)) return DDERR_INVALIDPARAMS;
302302 InterlockedDecrement(&This->levels[level].locked);
303303 if ((This->miplevel > 1) || dxglcfg.DebugUploadAfterUnlock)
304304 {