mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-08-14 13:15:14 +03:00
Renamed all the functions with "*Subset*" to "*TexCoord".
--HG-- branch : dev-2.1
This commit is contained in:
@@ -425,7 +425,7 @@ void BatchRenderer::batchQuadFreeEx( const Float& x0, const Float& y0, const Flo
|
||||
|
||||
void BatchRenderer::quadsBegin() {
|
||||
setDrawMode( PRIMITIVE_QUADS, true );
|
||||
quadsSetSubset( 0, 0, 1, 1 );
|
||||
quadsSetTexCoord( 0, 0, 1, 1 );
|
||||
quadsSetColor( Color::White );
|
||||
}
|
||||
|
||||
@@ -440,7 +440,7 @@ void BatchRenderer::quadsSetColorFree( const Color& Color0, const Color& Color1,
|
||||
mVerColor[3] = Color3;
|
||||
}
|
||||
|
||||
void BatchRenderer::quadsSetSubset( const Float& tl_u, const Float& tl_v, const Float& br_u, const Float& br_v ) {
|
||||
void BatchRenderer::quadsSetTexCoord( const Float& tl_u, const Float& tl_v, const Float& br_u, const Float& br_v ) {
|
||||
mTexCoord[0].u = tl_u; mTexCoord[1].u = tl_u;
|
||||
mTexCoord[0].v = tl_v; mTexCoord[1].v = br_v;
|
||||
|
||||
@@ -448,7 +448,7 @@ void BatchRenderer::quadsSetSubset( const Float& tl_u, const Float& tl_v, const
|
||||
mTexCoord[2].v = br_v; mTexCoord[3].v = tl_v;
|
||||
}
|
||||
|
||||
void BatchRenderer::quadsSetSubsetFree( const Float& x0, const Float& y0, const Float& x1, const Float& y1, const Float& x2, const Float& y2, const Float& x3, const Float& y3 ) {
|
||||
void BatchRenderer::quadsSetTexCoordFree( const Float& x0, const Float& y0, const Float& x1, const Float& y1, const Float& x2, const Float& y2, const Float& x3, const Float& y3 ) {
|
||||
mTexCoord[0].u = x0; mTexCoord[0].v = y0;
|
||||
mTexCoord[1].u = x1; mTexCoord[1].v = y1;
|
||||
mTexCoord[2].u = x2; mTexCoord[2].v = y2;
|
||||
@@ -466,12 +466,16 @@ void BatchRenderer::rotate( const Vector2f& center, Vector2f* point, const Float
|
||||
|
||||
void BatchRenderer::pointsBegin() {
|
||||
setDrawMode( PRIMITIVE_POINTS, true );
|
||||
quadsSetSubset( 0, 0, 1, 1 );
|
||||
quadsSetTexCoord( 0, 0, 1, 1 );
|
||||
pointSetColor( Color::White );
|
||||
}
|
||||
|
||||
void BatchRenderer::pointSetColor( const Color& Color ) {
|
||||
quadsSetColor( Color );
|
||||
void BatchRenderer::pointSetColor( const Color& color ) {
|
||||
mVerColor[0] = color;
|
||||
}
|
||||
|
||||
void BatchRenderer::pointSetTexCoord( const Float& x, const Float& y ) {
|
||||
mTexCoord[0].u = x; mTexCoord[0].v = y;
|
||||
}
|
||||
|
||||
void BatchRenderer::batchPoint( const Float& x, const Float& y ) {
|
||||
@@ -491,7 +495,7 @@ void BatchRenderer::batchPoint( const Float& x, const Float& y ) {
|
||||
|
||||
void BatchRenderer::linesBegin() {
|
||||
setDrawMode( PRIMITIVE_LINES, true );
|
||||
quadsSetSubset( 0, 0, 1, 1 );
|
||||
quadsSetTexCoord( 0, 0, 1, 1 );
|
||||
pointSetColor( Color::White );
|
||||
}
|
||||
|
||||
@@ -526,7 +530,7 @@ void BatchRenderer::batchLine( const Float& x0, const Float& y0, const Float& x1
|
||||
|
||||
void BatchRenderer::lineLoopBegin() {
|
||||
setDrawMode( PRIMITIVE_LINE_LOOP, true );
|
||||
quadsSetSubset( 0, 0, 1, 1 );
|
||||
quadsSetTexCoord( 0, 0, 1, 1 );
|
||||
pointSetColor( Color::White );
|
||||
}
|
||||
|
||||
@@ -584,7 +588,7 @@ void BatchRenderer::batchLineLoop( const Vector2f& vector1 ) {
|
||||
|
||||
void BatchRenderer::lineStripBegin() {
|
||||
setDrawMode( PRIMITIVE_LINE_STRIP, true );
|
||||
quadsSetSubset( 0, 0, 1, 1 );
|
||||
quadsSetTexCoord( 0, 0, 1, 1 );
|
||||
pointSetColor( Color::White );
|
||||
}
|
||||
|
||||
@@ -642,7 +646,7 @@ void BatchRenderer::batchLineStrip( const Vector2f& vector1 ) {
|
||||
|
||||
void BatchRenderer::triangleFanBegin() {
|
||||
setDrawMode( PRIMITIVE_TRIANGLE_FAN, true );
|
||||
triangleFanSetSubset( 0, 0, 0, 1, 1, 1 );
|
||||
triangleFanSetTexCoord( 0, 0, 0, 1, 1, 1 );
|
||||
triangleFanSetColor( Color::White );
|
||||
}
|
||||
|
||||
@@ -654,7 +658,7 @@ void BatchRenderer::triangleFanSetColorFree( const Color& Color0, const Color& C
|
||||
quadsSetColorFree( Color0, Color1, Color2, Color0 );
|
||||
}
|
||||
|
||||
void BatchRenderer::triangleFanSetSubset( const Float& x0, const Float& y0, const Float& x1, const Float& y1, const Float& x2, const Float& y2 ) {
|
||||
void BatchRenderer::triangleFanSetTexCoord( const Float& x0, const Float& y0, const Float& x1, const Float& y1, const Float& x2, const Float& y2 ) {
|
||||
mTexCoord[0].u = x0; mTexCoord[0].v = y0;
|
||||
mTexCoord[1].u = x1; mTexCoord[1].v = y1;
|
||||
mTexCoord[2].u = x2; mTexCoord[2].v = y2;
|
||||
@@ -705,7 +709,7 @@ void BatchRenderer::batchTriangleFan( const Float& x0, const Float& y0 ) {
|
||||
|
||||
void BatchRenderer::trianglesBegin() {
|
||||
setDrawMode( PRIMITIVE_TRIANGLES, true );
|
||||
trianglesSetSubset( 0, 0, 0, 1, 1, 1 );
|
||||
trianglesSetTexCoord( 0, 0, 0, 1, 1, 1 );
|
||||
trianglesSetColor( Color::White );
|
||||
}
|
||||
|
||||
@@ -717,7 +721,7 @@ void BatchRenderer::trianglesSetColorFree( const Color& Color0, const Color& Col
|
||||
quadsSetColorFree( Color0, Color1, Color2, Color0 );
|
||||
}
|
||||
|
||||
void BatchRenderer::trianglesSetSubset( const Float& x0, const Float& y0, const Float& x1, const Float& y1, const Float& x2, const Float& y2 ) {
|
||||
void BatchRenderer::trianglesSetTexCoord( const Float& x0, const Float& y0, const Float& x1, const Float& y1, const Float& x2, const Float& y2 ) {
|
||||
mTexCoord[0].u = x0; mTexCoord[0].v = y0;
|
||||
mTexCoord[1].u = x1; mTexCoord[1].v = y1;
|
||||
mTexCoord[2].u = x2; mTexCoord[2].v = y2;
|
||||
|
||||
@@ -539,7 +539,7 @@ void Texture::drawFast( const Float& x, const Float& y, const Float& Angle, cons
|
||||
if ( getClampMode() == CLAMP_REPEAT ) {
|
||||
Float iw = (Float)getImageWidth();
|
||||
Float ih = (Float)getImageHeight();
|
||||
sBR->quadsSetSubsetFree( 0, 0, 0, height / ih, width / iw, height / ih, width / iw, 0 );
|
||||
sBR->quadsSetTexCoordFree( 0, 0, 0, height / ih, width / iw, height / ih, width / iw, 0 );
|
||||
}
|
||||
|
||||
sBR->batchQuadEx( x, y, w, h, Angle, Scale );
|
||||
@@ -577,7 +577,7 @@ void Texture::drawEx( Float x, Float y, Float width, Float height, const Float &
|
||||
if ( getClampMode() == CLAMP_REPEAT ) {
|
||||
if ( Effect == RENDER_NORMAL ) {
|
||||
if ( renderSector ) {
|
||||
sBR->quadsSetSubsetFree( Sector.Left / w, Sector.Top / h, Sector.Left / w, Sector.Bottom / h, Sector.Right / w, Sector.Bottom / h, Sector.Right / w, Sector.Top / h );
|
||||
sBR->quadsSetTexCoordFree( Sector.Left / w, Sector.Top / h, Sector.Left / w, Sector.Bottom / h, Sector.Right / w, Sector.Bottom / h, Sector.Right / w, Sector.Top / h );
|
||||
|
||||
Float sw = (Float)( Sector.Right - Sector.Left );
|
||||
Float sh = (Float)( Sector.Bottom - Sector.Top );
|
||||
@@ -618,7 +618,7 @@ void Texture::drawEx( Float x, Float y, Float width, Float height, const Float &
|
||||
Float swn = ( Sector.Right - Sector.Left ) * ( tx - (Float)ttx );
|
||||
Float tor = Sector.Left + swn ;
|
||||
|
||||
sBR->quadsSetSubsetFree( Sector.Left / w, Sector.Top / h, Sector.Left / w, Sector.Bottom / h, tor / w, Sector.Bottom / h, tor / w, Sector.Top / h );
|
||||
sBR->quadsSetTexCoordFree( Sector.Left / w, Sector.Top / h, Sector.Left / w, Sector.Bottom / h, tor / w, Sector.Bottom / h, tor / w, Sector.Top / h );
|
||||
|
||||
for ( Int32 tmpY = 0; tmpY < tty; tmpY++ ) {
|
||||
sBR->batchQuad( x + ttx * sw, y + tmpY * sh, swn, sh );
|
||||
@@ -629,7 +629,7 @@ void Texture::drawEx( Float x, Float y, Float width, Float height, const Float &
|
||||
Float shn = ( Sector.Bottom - Sector.Top ) * ( ty - (Float)tty );
|
||||
Float tob = Sector.Top + shn;
|
||||
|
||||
sBR->quadsSetSubsetFree( Sector.Left / w, Sector.Top / h, Sector.Left / w, tob / h, Sector.Right / w, tob / h, Sector.Right / w, Sector.Top / h );
|
||||
sBR->quadsSetTexCoordFree( Sector.Left / w, Sector.Top / h, Sector.Left / w, tob / h, Sector.Right / w, tob / h, Sector.Right / w, Sector.Top / h );
|
||||
|
||||
for ( Int32 tmpX = 0; tmpX < ttx; tmpX++ ) {
|
||||
sBR->batchQuad( x + tmpX * sw, y + tty * sh, sw, shn );
|
||||
@@ -643,41 +643,41 @@ void Texture::drawEx( Float x, Float y, Float width, Float height, const Float &
|
||||
|
||||
return;
|
||||
} else {
|
||||
sBR->quadsSetSubsetFree( 0, 0, 0, height / h, width / w, height / h, width / w, 0 );
|
||||
sBR->quadsSetTexCoordFree( 0, 0, 0, height / h, width / w, height / h, width / w, 0 );
|
||||
}
|
||||
} else if ( Effect == RENDER_MIRROR ) {
|
||||
sBR->quadsSetSubsetFree( width / w, 0, width / w, height / h, 0, height / h, 0, 0 );
|
||||
sBR->quadsSetTexCoordFree( width / w, 0, width / w, height / h, 0, height / h, 0, 0 );
|
||||
} else if ( Effect == RENDER_FLIPPED ) {
|
||||
sBR->quadsSetSubsetFree( 0, height / h, 0, 0, width / w, 0, width / w, height / h );
|
||||
sBR->quadsSetTexCoordFree( 0, height / h, 0, 0, width / w, 0, width / w, height / h );
|
||||
} else {
|
||||
sBR->quadsSetSubsetFree( width / w, height / h, width / w, 0, 0, 0, 0, height / h );
|
||||
sBR->quadsSetTexCoordFree( width / w, height / h, width / w, 0, 0, 0, 0, height / h );
|
||||
}
|
||||
} else {
|
||||
if ( Effect == RENDER_NORMAL ) {
|
||||
if ( renderSector )
|
||||
sBR->quadsSetSubsetFree( Sector.Left / w, Sector.Top / h, Sector.Left / w, Sector.Bottom / h, Sector.Right / w, Sector.Bottom / h, Sector.Right / w, Sector.Top / h );
|
||||
sBR->quadsSetTexCoordFree( Sector.Left / w, Sector.Top / h, Sector.Left / w, Sector.Bottom / h, Sector.Right / w, Sector.Bottom / h, Sector.Right / w, Sector.Top / h );
|
||||
} else if ( Effect == RENDER_MIRROR ) {
|
||||
if ( renderSector )
|
||||
sBR->quadsSetSubsetFree( Sector.Right / w, Sector.Top / h, Sector.Right / w, Sector.Bottom / h, Sector.Left / w, Sector.Bottom / h, Sector.Left / w, Sector.Top / h );
|
||||
sBR->quadsSetTexCoordFree( Sector.Right / w, Sector.Top / h, Sector.Right / w, Sector.Bottom / h, Sector.Left / w, Sector.Bottom / h, Sector.Left / w, Sector.Top / h );
|
||||
else
|
||||
sBR->quadsSetSubsetFree( 1, 0, 1, 1, 0, 1, 0, 0 );
|
||||
sBR->quadsSetTexCoordFree( 1, 0, 1, 1, 0, 1, 0, 0 );
|
||||
} else if ( Effect == RENDER_FLIPPED ) {
|
||||
if ( renderSector )
|
||||
sBR->quadsSetSubsetFree( Sector.Left / w, Sector.Bottom / h, Sector.Left / w, Sector.Top / h, Sector.Right / w, Sector.Top / h, Sector.Right / w, Sector.Bottom / h );
|
||||
sBR->quadsSetTexCoordFree( Sector.Left / w, Sector.Bottom / h, Sector.Left / w, Sector.Top / h, Sector.Right / w, Sector.Top / h, Sector.Right / w, Sector.Bottom / h );
|
||||
else
|
||||
sBR->quadsSetSubsetFree( 0, 1, 0, 0, 1, 0, 1, 1 );
|
||||
sBR->quadsSetTexCoordFree( 0, 1, 0, 0, 1, 0, 1, 1 );
|
||||
} else if ( Effect == RENDER_FLIPPED_MIRRORED ) {
|
||||
if ( renderSector )
|
||||
sBR->quadsSetSubsetFree( Sector.Right / w, Sector.Bottom / h, Sector.Right / w, Sector.Top / h, Sector.Left / w, Sector.Top / h, Sector.Left / w, Sector.Bottom / h );
|
||||
sBR->quadsSetTexCoordFree( Sector.Right / w, Sector.Bottom / h, Sector.Right / w, Sector.Top / h, Sector.Left / w, Sector.Top / h, Sector.Left / w, Sector.Bottom / h );
|
||||
else
|
||||
sBR->quadsSetSubsetFree( 1, 1, 1, 0, 0, 0, 0, 1 );
|
||||
sBR->quadsSetTexCoordFree( 1, 1, 1, 0, 0, 0, 0, 1 );
|
||||
}
|
||||
}
|
||||
|
||||
sBR->batchQuadEx( x, y, width, height, Angle, Scale, Center );
|
||||
} else {
|
||||
if ( renderSector )
|
||||
sBR->quadsSetSubsetFree( Sector.Left / w, Sector.Top / h, Sector.Left / w, Sector.Bottom / h, Sector.Right / w, Sector.Bottom / h, Sector.Right / w, Sector.Top / h );
|
||||
sBR->quadsSetTexCoordFree( Sector.Left / w, Sector.Top / h, Sector.Left / w, Sector.Bottom / h, Sector.Right / w, Sector.Bottom / h, Sector.Right / w, Sector.Top / h );
|
||||
|
||||
Rectf TmpR( x, y, x + width, y + height );
|
||||
Quad2f Q = Quad2f( Vector2f( TmpR.Left, TmpR.Top ), Vector2f( TmpR.Left, TmpR.Bottom ), Vector2f( TmpR.Right, TmpR.Bottom ), Vector2f( TmpR.Right, TmpR.Top ) );
|
||||
@@ -745,9 +745,9 @@ void Texture::drawQuadEx( Quad2f Q, const Vector2f& Offset, const Float &Angle,
|
||||
}
|
||||
|
||||
if ( getClampMode() == CLAMP_REPEAT ) {
|
||||
sBR->quadsSetSubsetFree( 0, 0, 0, ( Q.V[0].y - Q.V[0].y ) / h, ( Q.V[0].x - Q.V[0].x ) / w, ( Q.V[0].y - Q.V[0].y ) / h, ( Q.V[0].x - Q.V[0].x ) / w, 0 );
|
||||
sBR->quadsSetTexCoordFree( 0, 0, 0, ( Q.V[0].y - Q.V[0].y ) / h, ( Q.V[0].x - Q.V[0].x ) / w, ( Q.V[0].y - Q.V[0].y ) / h, ( Q.V[0].x - Q.V[0].x ) / w, 0 );
|
||||
} else if ( renderSector ) {
|
||||
sBR->quadsSetSubsetFree( texSector.Left / w, texSector.Top / h, texSector.Left / w, texSector.Bottom / h, texSector.Right / w, texSector.Bottom / h, texSector.Right / w, texSector.Top / h );
|
||||
sBR->quadsSetTexCoordFree( texSector.Left / w, texSector.Top / h, texSector.Left / w, texSector.Bottom / h, texSector.Right / w, texSector.Bottom / h, texSector.Right / w, texSector.Top / h );
|
||||
}
|
||||
|
||||
Q.move( Offset );
|
||||
|
||||
@@ -1347,7 +1347,7 @@ void EETest::screen2() {
|
||||
Batch.setTexture( TNP[2] );
|
||||
Batch.quadsBegin();
|
||||
Batch.quadsSetColor( Color(150,150,150,100) );
|
||||
Batch.quadsSetSubset( 0.0f, 0.0f, 0.5f, 0.5f );
|
||||
Batch.quadsSetTexCoord( 0.0f, 0.0f, 0.5f, 0.5f );
|
||||
|
||||
Batch.setBatchRotation( ang );
|
||||
Batch.setBatchScale( scale );
|
||||
|
||||
Reference in New Issue
Block a user