Skip to content

Commit

Permalink
Fix low-quality software tile rasterization issues (See here for exam…
Browse files Browse the repository at this point in the history
  • Loading branch information
dukope committed Jan 24, 2014
1 parent 60facc4 commit cda7b69
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion project/src/renderer/software/BitmapFill.h
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,12 @@ class BitmapFillerBase : public Filler
}
}

mMapper.Translate(0.5,0.5);
if (mBitmap->smooth)
{
// map from pixel centers? this breaks nearest-neighbor mapping badly.
// not sure if mBitmap->smooth is the right thing to switch this on/off.
mMapper.Translate(0.5,0.5);
}

if (!mPerspective || inComponents<3)
{
Expand Down
4 changes: 2 additions & 2 deletions project/src/renderer/software/TileRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@ class TileRenderer : public Renderer
SpanRect *span = new SpanRect(alpha_rect,aa);
for(int i=0;i<4;i++)
span->Line00(
Fixed10( p[i].x + 0.5 , p[i].y + 0.5 ),
Fixed10( p[(i+1)&3].x + 0.5 , p[(i+1)&3].y + 0.5 ) );
Fixed10( p[i].x , p[i].y ),
Fixed10( p[(i+1)&3].x , p[(i+1)&3].y ) );

AlphaMask *alpha = span->CreateMask(inState.mTransform,tile_alpha);
delete span;
Expand Down

0 comments on commit cda7b69

Please sign in to comment.