mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-16 11:06:06 -04:00
Fix few bugs from last commit
This commit is contained in:
parent
ca5d0899fd
commit
4618df5331
@ -96,7 +96,7 @@ namespace ClassicalSharp {
|
||||
public Texture MakeTextTexture(ref DrawTextArgs args, int windowX, int windowY) {
|
||||
Size size = MeasureSize(ref args);
|
||||
if (size == Size.Empty)
|
||||
return new Texture(-1, windowX, windowY, 0, 0, 1, 1);
|
||||
return new Texture(0, windowX, windowY, 0, 0, 1, 1);
|
||||
|
||||
using (Bitmap bmp = CreatePow2Bitmap(size)) {
|
||||
SetBitmap(bmp);
|
||||
|
@ -56,7 +56,6 @@
|
||||
<DefineConstants>DEBUG;TRACE;USE_DX;</DefineConstants>
|
||||
<StartAction>Project</StartAction>
|
||||
<BaseIntermediateOutputPath>obj\</BaseIntermediateOutputPath>
|
||||
<StartArguments>unk aa 127.0.0.1 25566</StartArguments>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release_D3D' ">
|
||||
<OutputPath>..\output\release\</OutputPath>
|
||||
|
@ -23,14 +23,13 @@ namespace ClassicalSharp.Textures {
|
||||
}
|
||||
|
||||
public static int LoadTile(int texLoc) {
|
||||
int size = TileSize;
|
||||
int size = TileSize, x = texLoc % TilesPerRow, y = texLoc / TilesPerRow;
|
||||
if (y >= RowsCount) return 0;
|
||||
|
||||
using (FastBitmap atlas = new FastBitmap(Atlas, true, true))
|
||||
using (Bitmap bmp = Platform.CreateBmp(size, size))
|
||||
using (FastBitmap dst = new FastBitmap(bmp, true, false))
|
||||
{
|
||||
int x = texLoc % TilesPerRow, y = texLoc / TilesPerRow;
|
||||
y %= RowsCount;
|
||||
|
||||
FastBitmap.MovePortion(x * size, y * size, 0, 0, atlas, dst, size);
|
||||
return game.Graphics.CreateTexture(dst, false, game.Graphics.Mipmaps);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user