File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed
Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -172,15 +172,16 @@ void CTRRenderer::draw(VertexArray *vertexArray,
172172 vtx->texcoord [1 ] = texture ? v.texCoords .y /
173173 (texture->getTextureRect ().height *
174174 (texture->getTextureRect ().height / texture->getSize ().y )) : 0 ;
175- vtx->blend [0 ] = 0 ; // reserved for future expansion
176- vtx->blend [1 ] = texture ? (v.color != Color::White ? 1 .0f : 0 ) : 1 .0f ;
175+ vtx->blend [0 ] = 0 ;
176+ float blend = v.color .r == 255 && v.color .g == 255 && v.color .b == 255 ? 0 : 1 ;
177+ vtx->blend [1 ] = texture ? blend : 1 .0f ;
177178 vtx->color = v.color .toABGR ();
178179 }
179180
180- size_t len = ctx.vtxBufPos - ctx.vtxBufLastPos ;
181- if (!len) return ;
182- C3D_DrawArrays (type, ctx.vtxBufLastPos , len) ;
183- ctx. vtxBufLastPos = ctx. vtxBufPos ;
181+ if ( ctx.vtxBufPos - ctx.vtxBufLastPos ) {
182+ C3D_DrawArrays (type, ctx. vtxBufLastPos , ctx. vtxBufPos - ctx. vtxBufLastPos ) ;
183+ ctx.vtxBufLastPos = ctx. vtxBufPos ;
184+ }
184185}
185186
186187void CTRRenderer::clear () {
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ int main(int argc, char **argv) {
3030 auto *tex = new C2DTexture (renderer->getIo ()->getDataPath () + " gbatemp.png" );
3131 if (tex->available ) {
3232 tex->setPosition (rect->getSize ().x / 2 , rect->getSize ().y / 2 );
33- // tex->setScale(0.5f * scaling, 0.5f * scaling);
33+ tex->setScale (0 .5f * scaling, 0 .5f * scaling);
3434 tex->setOrigin (Origin::Center);
3535 rect->add (tex);
3636 }
You can’t perform that action at this time.
0 commit comments