mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-15 10:35:11 -04:00
Fix coordinates not being converted into tile coordinates properly in launcher.
This commit is contained in:
parent
272b12f00a
commit
f7e8e41346
@ -128,7 +128,7 @@ namespace ClassicalSharp {
|
||||
Graphics.DepthTestFunc( CompareFunc.LessEqual );
|
||||
//Graphics.DepthWrite = true;
|
||||
Graphics.AlphaBlendFunc( BlendFunc.SourceAlpha, BlendFunc.InvSourceAlpha );
|
||||
Graphics.AlphaTestFunc( CompareFunc.Greater, 0.1f );
|
||||
Graphics.AlphaTestFunc( CompareFunc.Greater, 0.5f );
|
||||
fpsScreen = new FpsScreen( this );
|
||||
fpsScreen.Init();
|
||||
hudScreen = new HudScreen( this );
|
||||
|
@ -13,22 +13,20 @@ namespace Launcher2 {
|
||||
int srcX = srcRect.X, dstX = dstRect.X;
|
||||
int srcY = srcRect.Y, dstY = dstRect.Y;
|
||||
int scaleWidth = scale.Width, scaleHeight = scale.Height;
|
||||
int offsetX = dstRect.X * srcRect.Width / scaleWidth;
|
||||
int offsetY = dstRect.Y * srcRect.Height / scaleHeight;
|
||||
|
||||
if( dstX >= dst.Width || dstY >= dst.Height ) return;
|
||||
dstWidth = Math.Min( dstX + dstWidth, dst.Width ) - dstX;
|
||||
dstHeight = Math.Min( dstY + dstHeight, dst.Height ) - dstY;
|
||||
|
||||
for( int yy = 0; yy < dstHeight; yy++ ) {
|
||||
int scaledY = yy * srcHeight / scaleHeight;
|
||||
int* srcRow = src.GetRowPtr( srcY + (scaledY + offsetY) % srcHeight );
|
||||
int scaledY = (yy + dstRect.Y) * srcHeight / scaleHeight;
|
||||
int* srcRow = src.GetRowPtr( srcY + (scaledY % srcHeight) );
|
||||
int* dstRow = dst.GetRowPtr( dstY + yy );
|
||||
byte rgbScale = (byte)Utils.Lerp( scaleA, scaleB, (float)yy / dstHeight );
|
||||
|
||||
for( int xx = 0; xx < dstWidth; xx++ ) {
|
||||
int scaledX = xx * srcWidth / scaleWidth;
|
||||
int pixel = srcRow[srcX + (scaledX + offsetX) % srcWidth];
|
||||
int scaledX = (xx + dstRect.X) * srcWidth / scaleWidth;
|
||||
int pixel = srcRow[srcX + (scaledX % srcWidth)];
|
||||
|
||||
int col = pixel & ~0xFFFFFF; // keep a, but clear rgb
|
||||
col |= ((pixel & 0xFF) * rgbScale / 255);
|
||||
|
@ -94,8 +94,6 @@ namespace Launcher2 {
|
||||
Options.Set( "nostalgia-usecpe", !game.ClassicMode );
|
||||
Options.Set( "nostalgia-servertextures", !game.ClassicMode );
|
||||
Options.Set( "nostalgia-classictablist", game.ClassicMode );
|
||||
Options.Set( "mode-classic", !game.ClassicMode );
|
||||
Options.Set( "mode-classic", !game.ClassicMode );
|
||||
Options.Set( "hacksenabled", !game.ClassicMode );
|
||||
Options.Set( "doublejump", false );
|
||||
Options.Save();
|
||||
|
Loading…
x
Reference in New Issue
Block a user