Remove viewport-per-drawcall data (thanks Hugh)

This commit is contained in:
Joshua Granick
2014-02-04 11:02:20 -08:00
parent 1d0b5324e4
commit 36051e31c8
6 changed files with 7 additions and 24 deletions

View File

@@ -308,7 +308,7 @@ public:
const QuickVec<int> &inIndixes,
const QuickVec<float> &inUVT, int inCull,
const QuickVec<int> &inColours,
int blendMode, const QuickVec<float,4> &inViewport );
int blendMode);
VertexType mType;
int mTriangleCount;
@@ -316,7 +316,6 @@ public:
QuickVec<float> mUVT;
QuickVec<uint32> mColours;
int mBlendMode;
QuickVec<float,4> mViewport;
};
// ----------------------------------------------------------------------
@@ -509,7 +508,6 @@ struct HardwareArrays
Vertices mVertices;
TexCoords mTexCoords;
Colours mColours;
QuickVec<float,4> mViewport;
Surface *mSurface;
unsigned int mFlags;
//unsigned int mVertexBO;
@@ -669,7 +667,7 @@ public:
void drawPoints(QuickVec<float> inXYs, QuickVec<int> inRGBAs, unsigned int inDefaultRGBA=0xffffffff, double inSize=-1.0 );
void drawTriangles(const QuickVec<float> &inXYs, const QuickVec<int> &inIndixes,
const QuickVec<float> &inUVT, int inCull, const QuickVec<int> &inColours,
int blendMode, const QuickVec<float,4> &inViewport );
int blendMode);
const Extent2DF &GetExtent0(double inRotation);
bool HitTest(const UserPoint &inPoint);

View File

@@ -2289,7 +2289,7 @@ DEFINE_PRIM_MULT(lime_gfx_draw_round_rect);
value lime_gfx_draw_triangles(value *arg, int args )
{
enum { aGfx, aVertices, aIndices, aUVData, aCull, aColours, aBlend, aViewport };
enum { aGfx, aVertices, aIndices, aUVData, aCull, aColours, aBlend };
Graphics *gfx;
if (AbstractToObject(arg[aGfx],gfx))
@@ -2298,15 +2298,13 @@ value lime_gfx_draw_triangles(value *arg, int args )
QuickVec<int> indices;
QuickVec<float> uvt;
QuickVec<int> colours;
QuickVec<float,4> viewport;
FillArrayDouble(vertices,arg[aVertices]);
FillArrayInt(indices,arg[aIndices]);
FillArrayDouble(uvt,arg[aUVData]);
FillArrayInt(colours, arg[aColours]);
FillArrayDoubleN<float,4>(viewport, arg[aViewport] );
gfx->drawTriangles(vertices, indices, uvt, val_int(arg[aCull]), colours, val_int( arg[ aBlend ] ), viewport );
gfx->drawTriangles(vertices, indices, uvt, val_int(arg[aCull]), colours, val_int( arg[ aBlend ] ) );
}
return alloc_null();

View File

@@ -439,7 +439,7 @@ void Graphics::drawTriangles(const QuickVec<float> &inXYs,
const QuickVec<int> &inIndices,
const QuickVec<float> &inUVT, int inCull,
const QuickVec<int> &inColours,
int blendMode, const QuickVec<float,4> &inViewport )
int blendMode)
{
Flush( );
@@ -451,7 +451,7 @@ void Graphics::drawTriangles(const QuickVec<float> &inXYs,
IGraphicsFill *fill = mFillJob.mFill;
GraphicsTrianglePath *path = new GraphicsTrianglePath(inXYs,
inIndices, inUVT, inCull, inColours, blendMode, inViewport );
inIndices, inUVT, inCull, inColours, blendMode );
GraphicsJob job;
path->IncRef();

View File

@@ -172,7 +172,7 @@ GraphicsTrianglePath::GraphicsTrianglePath( const QuickVec<float> &inXYs,
const QuickVec<int> &inIndices,
const QuickVec<float> &inUVT, int inCull,
const QuickVec<int> &inColours,
int inBlendMode, const QuickVec<float,4> &inViewport )
int inBlendMode)
{
UserPoint *v = (UserPoint *) &inXYs[0];
uint32 *c = (uint32 *) &inColours[0];
@@ -183,7 +183,6 @@ GraphicsTrianglePath::GraphicsTrianglePath( const QuickVec<float> &inXYs,
const float *uvt = &inUVT[0];
mBlendMode = inBlendMode;
mViewport = inViewport;
if (inIndices.empty())
{

View File

@@ -253,9 +253,6 @@ public:
mElement.mFirst = vertices.size() / (persp?2:1);
mElement.mPrimType = ptTriangles;
//Just overwriting viewport
mArrays->mViewport = inPath->mViewport;
const float *t = &inPath->mUVT[0];
for(int v=0;v<inPath->mVertices.size();v++)
{
@@ -293,9 +290,6 @@ public:
mElement.mFirst = vertices.size();
mElement.mPrimType = ptLines;
//Just overwriting blend mode and viewport
mArrays->mViewport = inPath->mViewport;
int tri_count = inPath->mVertices.size()/3;
UserPoint *tri = &inPath->mVertices[0];
for(int v=0;v<tri_count;v++)

View File

@@ -357,12 +357,6 @@ namespace lime {
Vertices &tex_coords = arrays.mTexCoords;
bool persp = arrays.mFlags & HardwareArrays::PERSPECTIVE;
if (!arrays.mViewport.empty ()) {
SetViewport (Rect (arrays.mViewport[0], arrays.mViewport[1], arrays.mViewport[2], arrays.mViewport[3]));
}
if (arrays.mFlags & HardwareArrays::BM_ADD) {
glBlendFunc (GL_SRC_ALPHA, GL_ONE);