Do not rely on GL_UNPACK_SKIP_* attributes, as not all OpenGL drivers
support them right (Bug #914) - Michael git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2647 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -1,4 +1,6 @@
|
|||||||
Changes towards version 0.7:
|
Changes towards version 0.7:
|
||||||
|
- Do not rely on GL_UNPACK_SKIP_* arguments, which some OpenGL drivers
|
||||||
|
mishandle (Bug #914) - Michael
|
||||||
- Do not overwrite GLOBAL_SIS (CrewEnlisted) when leaving Hyperspace
|
- Do not overwrite GLOBAL_SIS (CrewEnlisted) when leaving Hyperspace
|
||||||
(Bug #938) - Michael
|
(Bug #938) - Michael
|
||||||
- Fixed a text entry width problem that was deleting control template
|
- Fixed a text entry width problem that was deleting control template
|
||||||
|
|||||||
@@ -341,23 +341,29 @@ TFB_GL_SwapBuffers (int force_full_redraw)
|
|||||||
scaler (SDL_Screen, scaled_display, &updated);
|
scaler (SDL_Screen, scaled_display, &updated);
|
||||||
|
|
||||||
glPixelStorei (GL_UNPACK_ROW_LENGTH, ScreenWidth * 2);
|
glPixelStorei (GL_UNPACK_ROW_LENGTH, ScreenWidth * 2);
|
||||||
glPixelStorei (GL_UNPACK_SKIP_ROWS, updated.y * 2);
|
/* Matrox OpenGL drivers do not handle GL_UNPACK_SKIP_*
|
||||||
glPixelStorei (GL_UNPACK_SKIP_PIXELS, updated.x * 2);
|
correctly */
|
||||||
|
glPixelStorei (GL_UNPACK_SKIP_ROWS, 0);
|
||||||
|
glPixelStorei (GL_UNPACK_SKIP_PIXELS, 0);
|
||||||
SDL_LockSurface (scaled_display);
|
SDL_LockSurface (scaled_display);
|
||||||
glTexSubImage2D (GL_TEXTURE_2D, 0, updated.x * 2, updated.y * 2,
|
glTexSubImage2D (GL_TEXTURE_2D, 0, updated.x * 2, updated.y * 2,
|
||||||
updated.w * 2, updated.h * 2, GL_RGBA, GL_UNSIGNED_BYTE,
|
updated.w * 2, updated.h * 2, GL_RGBA, GL_UNSIGNED_BYTE,
|
||||||
scaled_display->pixels);
|
scaled_display->pixels +
|
||||||
|
(updated.y * 16 * ScreenWidth + updated.x * 8));
|
||||||
SDL_UnlockSurface (scaled_display);
|
SDL_UnlockSurface (scaled_display);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
glPixelStorei (GL_UNPACK_ROW_LENGTH, ScreenWidth);
|
glPixelStorei (GL_UNPACK_ROW_LENGTH, ScreenWidth);
|
||||||
glPixelStorei (GL_UNPACK_SKIP_ROWS, updated.y);
|
/* Matrox OpenGL drivers do not handle GL_UNPACK_SKIP_*
|
||||||
glPixelStorei (GL_UNPACK_SKIP_PIXELS, updated.x);
|
correctly */
|
||||||
|
glPixelStorei (GL_UNPACK_SKIP_ROWS, 0);
|
||||||
|
glPixelStorei (GL_UNPACK_SKIP_PIXELS, 0);
|
||||||
SDL_LockSurface (SDL_Screen);
|
SDL_LockSurface (SDL_Screen);
|
||||||
glTexSubImage2D (GL_TEXTURE_2D, 0, updated.x, updated.y,
|
glTexSubImage2D (GL_TEXTURE_2D, 0, updated.x, updated.y,
|
||||||
updated.w, updated.h, GL_RGBA, GL_UNSIGNED_BYTE,
|
updated.w, updated.h, GL_RGBA, GL_UNSIGNED_BYTE,
|
||||||
SDL_Screen->pixels);
|
SDL_Screen->pixels +
|
||||||
|
(updated.y * 4 * ScreenWidth + updated.x * 4));
|
||||||
SDL_UnlockSurface (SDL_Screen);
|
SDL_UnlockSurface (SDL_Screen);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user