@@ -320,14 +320,14 @@ class TextureShaderApplierDX9 {
320
320
static const Pos pos[4 ] = {
321
321
{-1 , 1 , 0 },
322
322
{ 1 , 1 , 0 },
323
- { 1 , -1 , 0 },
324
323
{-1 , -1 , 0 },
324
+ { 1 , -1 , 0 },
325
325
};
326
326
static const UV uv[4 ] = {
327
327
{0 , 0 },
328
328
{1 , 0 },
329
- {1 , 1 },
330
329
{0 , 1 },
330
+ {1 , 1 },
331
331
};
332
332
333
333
for (int i = 0 ; i < 4 ; ++i) {
@@ -354,25 +354,25 @@ class TextureShaderApplierDX9 {
354
354
355
355
const float left = u1 * invHalfWidth - 1 .0f + xoff;
356
356
const float right = u2 * invHalfWidth - 1 .0f + xoff;
357
- const float top = v1 * invHalfHeight - 1 .0f + yoff;
358
- const float bottom = v2 * invHalfHeight - 1 .0f + yoff;
357
+ const float top = (bufferH_ - v1) * invHalfHeight - 1 .0f + yoff;
358
+ const float bottom = (bufferH_ - v2) * invHalfHeight - 1 .0f + yoff;
359
359
360
360
float z = 0 .0f ;
361
- // Points are: BL, BR, TR, TL.
362
- verts_[0 ].pos = Pos (left, bottom, z);
363
- verts_[1 ].pos = Pos (right, bottom, z);
364
- verts_[2 ].pos = Pos (right, top, z);
365
- verts_[3 ].pos = Pos (left, top, z);
361
+ verts_[0 ].pos = Pos (left, top, z);
362
+ verts_[1 ].pos = Pos (right, top, z);
363
+ verts_[2 ].pos = Pos (left, bottom, z);
364
+ verts_[3 ].pos = Pos (right, bottom, z);
366
365
367
366
// And also the UVs, same order.
368
367
const float uvleft = u1 * invWidth;
369
368
const float uvright = u2 * invWidth;
370
369
const float uvtop = v1 * invHeight;
371
370
const float uvbottom = v2 * invHeight;
372
- verts_[0 ].uv = UV (uvleft, uvbottom);
373
- verts_[1 ].uv = UV (uvright, uvbottom);
374
- verts_[2 ].uv = UV (uvright, uvtop);
375
- verts_[3 ].uv = UV (uvleft, uvtop);
371
+
372
+ verts_[0 ].uv = UV (uvleft, uvtop);
373
+ verts_[1 ].uv = UV (uvright, uvtop);
374
+ verts_[2 ].uv = UV (uvleft, uvbottom);
375
+ verts_[3 ].uv = UV (uvright, uvbottom);
376
376
377
377
// We need to reapply the texture next time since we cropped UV.
378
378
gstate_c.Dirty (DIRTY_TEXTURE_PARAMS);
@@ -396,7 +396,7 @@ class TextureShaderApplierDX9 {
396
396
397
397
D3DVIEWPORT9 vp{ 0 , 0 , (DWORD)renderW_, (DWORD)renderH_, 0 .0f , 1 .0f };
398
398
device_->SetViewport (&vp);
399
- HRESULT hr = device_->DrawPrimitiveUP (D3DPT_TRIANGLEFAN , 2 , verts_, (3 + 2 ) * sizeof (float ));
399
+ HRESULT hr = device_->DrawPrimitiveUP (D3DPT_TRIANGLESTRIP , 2 , verts_, (3 + 2 ) * sizeof (float ));
400
400
if (FAILED (hr)) {
401
401
ERROR_LOG_REPORT (G3D, " Depal render failed: %08x" , hr);
402
402
}
0 commit comments