DXGL r485 - Code Review
For
DXGL
(
recent comments
|
status changes
|
tags
|
authors
|
states
|
release notes
|
statistics
)
Jump to navigation
Jump to search
Repository:
DXGL
Revision:
<
r484
|
r485
|
r486
>
Date:
00:22, 12 August 2014
Author:
admin
Status:
new
Tags:
Comment:
Support Mirrored Blt.
Modified paths:
/ddraw/glDirectDraw.cpp
(modified) (
history
)
/ddraw/glRenderer.cpp
(modified) (
history
)
Diff
[
purge
]
Index: ddraw/glDirectDraw.cpp
—
—
@@ -955,7 +955,8 @@
956
956
ddCaps.dwCaps2 = DDCAPS2_CANRENDERWINDOWED | DDCAPS2_WIDESURFACES | DDCAPS2_NOPAGELOCKREQUIRED |
957
957
DDCAPS2_FLIPINTERVAL | DDCAPS2_FLIPNOVSYNC | DDCAPS2_NONLOCALVIDMEM;
958
958
ddCaps.dwFXCaps = DDFXCAPS_BLTSHRINKX | DDFXCAPS_BLTSHRINKY |
959
- DDFXCAPS_BLTSTRETCHX | DDFXCAPS_BLTSTRETCHY;
959
+ DDFXCAPS_BLTSTRETCHX | DDFXCAPS_BLTSTRETCHY | DDFXCAPS_BLTMIRRORLEFTRIGHT |
960
+ DDFXCAPS_BLTMIRRORUPDOWN;
960
961
ddCaps.dwPalCaps = DDPCAPS_8BIT | DDPCAPS_PRIMARYSURFACE;
961
962
ddCaps.ddsOldCaps.dwCaps = ddCaps.ddsCaps.dwCaps = DDSCAPS_3DDEVICE |
962
963
DDSCAPS_BACKBUFFER | DDSCAPS_COMPLEX | DDSCAPS_FLIP |
Index: ddraw/glRenderer.cpp
—
—
@@ -1071,9 +1071,33 @@
1072
1072
break;
1073
1073
}
1074
1074
}
1075
+
1076
+void BltFlipLR(BltVertex *vertices)
1077
+{
1078
+ GLfloat s1, s2;
1079
+ s1 = vertices[0].s;
1080
+ s2 = vertices[2].s;
1081
+ vertices[0].s = vertices[1].s;
1082
+ vertices[2].s = vertices[3].s;
1083
+ vertices[1].s = s1;
1084
+ vertices[3].s = s2;
1085
+}
1086
+
1087
+void BltFlipUD(BltVertex *vertices)
1088
+{
1089
+ GLfloat t1, t2;
1090
+ t1 = vertices[0].t;
1091
+ t2 = vertices[1].t;
1092
+ vertices[0].t = vertices[2].t;
1093
+ vertices[1].t = vertices[3].t;
1094
+ vertices[2].t = t1;
1095
+ vertices[3].t = t2;
1096
+}
1097
+
1075
1098
void glRenderer__Blt(glRenderer *This, LPRECT lpDestRect, glDirectDrawSurface7 *src,
1076
1099
glDirectDrawSurface7 *dest, LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx)
1077
1100
{
1101
+ int rotates = 0;
1078
1102
BOOL usedest = FALSE;
1079
1103
BOOL usepattern = FALSE;
1080
1104
LONG sizes[6];
—
—
@@ -1142,7 +1166,21 @@
1143
1167
This->bltvertices[0].s = This->bltvertices[2].s = (GLfloat)srcrect.right / (GLfloat)ddsdSrc.dwWidth;
1144
1168
This->bltvertices[0].t = This->bltvertices[1].t = (GLfloat)srcrect.top / (GLfloat)ddsdSrc.dwHeight;
1145
1169
This->bltvertices[2].t = This->bltvertices[3].t = (GLfloat)srcrect.bottom / (GLfloat)ddsdSrc.dwHeight;
1146
- if(dwFlags & 0x10000000)
1170
+ if ((lpDDBltFx) && (dwFlags & DDBLT_DDFX))
1171
+ {
1172
+ if (lpDDBltFx->dwDDFX & DDBLTFX_MIRRORLEFTRIGHT)
1173
+ BltFlipLR(This->bltvertices);
1174
+ if (lpDDBltFx->dwDDFX & DDBLTFX_MIRRORUPDOWN)
1175
+ BltFlipUD(This->bltvertices);
1176
+ if (lpDDBltFx->dwDDFX & DDBLTFX_ROTATE90) rotates++;
1177
+ if (lpDDBltFx->dwDDFX & DDBLTFX_ROTATE180) rotates += 2;
1178
+ if (lpDDBltFx->dwDDFX & DDBLTFX_ROTATE270) rotates += 3;
1179
+ rotates &= 3;
1180
+ if (rotates)
1181
+ {
1182
+ }
1183
+ }
1184
+ if (dwFlags & 0x10000000)
1147
1185
{
1148
1186
This->bltvertices[1].stencils = This->bltvertices[3].stencils = This->bltvertices[1].x / (GLfloat)dest->fakex;
1149
1187
This->bltvertices[0].stencils = This->bltvertices[2].stencils = This->bltvertices[0].x / (GLfloat)dest->fakex;
Navigation menu
Personal tools
Log in
Namespaces
Special page
English
expanded
collapsed
Views
More
expanded
collapsed
Search
Navigation
Home
Main page
Recent changes
Random page
MediaWiki help
Introduction
Progress
Downloads
Source code
Build from source
AppDB
Bug reports
Forums
Tools
Special pages
Printable version