mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
DrawEngineDX9: Rename lookup table, cleanup
This commit is contained in:
parent
7305ae51f2
commit
e4f9f3b120
1 changed files with 8 additions and 9 deletions
|
@ -43,17 +43,16 @@
|
|||
|
||||
namespace DX9 {
|
||||
|
||||
const D3DPRIMITIVETYPE glprim[8] = {
|
||||
static const D3DPRIMITIVETYPE d3d_prim[8] = {
|
||||
D3DPT_POINTLIST,
|
||||
D3DPT_LINELIST,
|
||||
D3DPT_LINESTRIP,
|
||||
D3DPT_TRIANGLELIST,
|
||||
D3DPT_TRIANGLESTRIP,
|
||||
D3DPT_TRIANGLEFAN,
|
||||
D3DPT_TRIANGLELIST, // With OpenGL ES we have to expand sprites into triangles, tripling the data instead of doubling. sigh. OpenGL ES, Y U NO SUPPORT GL_QUADS?
|
||||
D3DPT_TRIANGLELIST,
|
||||
};
|
||||
|
||||
// hrydgard's quick guesses - TODO verify
|
||||
static const int D3DPRIMITIVEVERTEXCOUNT[8][2] = {
|
||||
{0, 0}, // invalid
|
||||
{1, 0}, // 1 = D3DPT_POINTLIST,
|
||||
|
@ -499,9 +498,9 @@ rotateVBO:
|
|||
device_->SetVertexDeclaration(pHardwareVertexDecl);
|
||||
if (vb_ == NULL) {
|
||||
if (useElements) {
|
||||
device_->DrawIndexedPrimitiveUP(glprim[prim], 0, maxIndex + 1, D3DPrimCount(glprim[prim], vertexCount), decIndex, D3DFMT_INDEX16, decoded, dec_->GetDecVtxFmt().stride);
|
||||
device_->DrawIndexedPrimitiveUP(d3d_prim[prim], 0, maxIndex + 1, D3DPrimCount(d3d_prim[prim], vertexCount), decIndex, D3DFMT_INDEX16, decoded, dec_->GetDecVtxFmt().stride);
|
||||
} else {
|
||||
device_->DrawPrimitiveUP(glprim[prim], D3DPrimCount(glprim[prim], vertexCount), decoded, dec_->GetDecVtxFmt().stride);
|
||||
device_->DrawPrimitiveUP(d3d_prim[prim], D3DPrimCount(d3d_prim[prim], vertexCount), decoded, dec_->GetDecVtxFmt().stride);
|
||||
}
|
||||
} else {
|
||||
device_->SetStreamSource(0, vb_, 0, dec_->GetDecVtxFmt().stride);
|
||||
|
@ -509,9 +508,9 @@ rotateVBO:
|
|||
if (useElements) {
|
||||
device_->SetIndices(ib_);
|
||||
|
||||
device_->DrawIndexedPrimitive(glprim[prim], 0, 0, maxIndex + 1, 0, D3DPrimCount(glprim[prim], vertexCount));
|
||||
device_->DrawIndexedPrimitive(d3d_prim[prim], 0, 0, maxIndex + 1, 0, D3DPrimCount(d3d_prim[prim], vertexCount));
|
||||
} else {
|
||||
device_->DrawPrimitive(glprim[prim], 0, D3DPrimCount(glprim[prim], vertexCount));
|
||||
device_->DrawPrimitive(d3d_prim[prim], 0, D3DPrimCount(d3d_prim[prim], vertexCount));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -568,9 +567,9 @@ rotateVBO:
|
|||
|
||||
device_->SetVertexDeclaration(transformedVertexDecl_);
|
||||
if (drawIndexed) {
|
||||
device_->DrawIndexedPrimitiveUP(glprim[prim], 0, maxIndex, D3DPrimCount(glprim[prim], numTrans), inds, D3DFMT_INDEX16, drawBuffer, sizeof(TransformedVertex));
|
||||
device_->DrawIndexedPrimitiveUP(d3d_prim[prim], 0, maxIndex, D3DPrimCount(d3d_prim[prim], numTrans), inds, D3DFMT_INDEX16, drawBuffer, sizeof(TransformedVertex));
|
||||
} else {
|
||||
device_->DrawPrimitiveUP(glprim[prim], D3DPrimCount(glprim[prim], numTrans), drawBuffer, sizeof(TransformedVertex));
|
||||
device_->DrawPrimitiveUP(d3d_prim[prim], D3DPrimCount(d3d_prim[prim], numTrans), drawBuffer, sizeof(TransformedVertex));
|
||||
}
|
||||
} else if (result.action == SW_CLEAR) {
|
||||
u32 clearColor = result.color;
|
||||
|
|
Loading…
Add table
Reference in a new issue