DXGL r537 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r536‎ | r537 | r538 >
Date:00:11, 18 September 2014
Author:admin
Status:new
Tags:
Comment:
Partially revert r536.
Define client buffer in glDirectDrawSurface.h
Modified paths:
  • /ddraw/TextureManager.c (modified) (history)
  • /ddraw/glDirectDrawSurface.cpp (modified) (history)
  • /ddraw/glDirectDrawSurface.h (modified) (history)

Diff [purge]

Index: ddraw/TextureManager.c
@@ -513,8 +513,9 @@
514514 GLenum error;
515515 texture->width = width;
516516 texture->height = height;
517 - glPixelStorei(GL_UNPACK_ALIGNMENT, bufferalign(texture->pitch));
518 - glPixelStorei(GL_UNPACK_ROW_LENGTH, pixelsfrompitch(texture->pitch, texture->pixelformat.dwRGBBitCount));
 517+ //glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
 518+ //glPixelStorei(GL_UNPACK_ALIGNMENT, bufferalign(texture->pitch));
 519+ //glPixelStorei(GL_UNPACK_ROW_LENGTH, pixelsfrompitch(texture->pitch, texture->pixelformat.dwRGBBitCount));
519520 if (checkerror)
520521 {
521522 do
@@ -563,12 +564,14 @@
564565 else glTexSubImage2D(GL_TEXTURE_2D, level, 0, 0, width, height, texture->format, texture->type, data);
565566 }
566567 }
 568+ //glPopClientAttrib();
567569 }
568570
569571 void TextureManager_DownloadTextureClassic(TextureManager *This, TEXTURE *texture, int level, void *data)
570572 {
571 - glPixelStorei(GL_PACK_ALIGNMENT, bufferalign(texture->pitch));
572 - glPixelStorei(GL_PACK_ROW_LENGTH, bufferalign(texture->pixelformat.dwRGBBitCount));
 573+ //glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
 574+ //glPixelStorei(GL_PACK_ALIGNMENT, bufferalign(texture->pitch));
 575+ //glPixelStorei(GL_PACK_ROW_LENGTH, bufferalign(texture->pixelformat.dwRGBBitCount));
573576 if(This->ext->GLEXT_EXT_direct_state_access) This->ext->glGetTextureImageEXT(texture->id,GL_TEXTURE_2D,level,texture->format,texture->type,data);
574577 else
575578 {
@@ -576,6 +579,7 @@
577580 TextureManager_SetTexture(This, 0,texture);
578581 glGetTexImage(GL_TEXTURE_2D,level,texture->format,texture->type,data);
579582 }
 583+ //glPopClientAttrib();
580584 }
581585
582586 void TextureManager_SetActiveTexture(TextureManager *This, int level)
Index: ddraw/glDirectDrawSurface.cpp
@@ -73,6 +73,7 @@
7474 buffer = gdibuffer = NULL;
7575 bigbuffer = NULL;
7676 bigpitch = 0;
 77+ clientbuffer = NULL;
7778 zbuffer = NULL;
7879 this->miplevel = miplevel;
7980 DWORD colormasks[3];
Index: ddraw/glDirectDrawSurface.h
@@ -179,7 +179,7 @@
180180 bool overlay;
181181 IUnknown *zbuffer_iface;
182182 int version;
183 - bool clientmem;
 183+ unsigned char *clientbuffer;
184184 };
185185
186186 // Legacy DDRAW Interfaces

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r536Set pitch for texture upload and download.admin23:49, 17 September 2014