mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2024-09-27 21:56:19 -04:00
fixed rendering
This commit is contained in:
parent
21eb39bf7a
commit
1c0dede449
@ -137,6 +137,7 @@ namespace OpenDiablo2.SDL2_
|
||||
mapTileOffset = new Point(minX, minY);
|
||||
|
||||
texture = SDL.SDL_CreateTexture(renderer, SDL.SDL_PIXELFORMAT_ARGB8888, (int)SDL.SDL_TextureAccess.SDL_TEXTUREACCESS_STREAMING, FrameSize.Width, FrameSize.Height);
|
||||
SDL.SDL_SetTextureBlendMode(texture, SDL.SDL_BlendMode.SDL_BLENDMODE_BLEND);
|
||||
|
||||
if (texture == IntPtr.Zero)
|
||||
throw new ApplicationException($"Unaple to initialize texture: {SDL.SDL_GetError()}");
|
||||
@ -165,7 +166,7 @@ namespace OpenDiablo2.SDL2_
|
||||
if (index < 0)
|
||||
continue;
|
||||
var color = palette.Colors[block.PixelData[xx + (yy * 32)]];
|
||||
if ((color >> 24) > 0)
|
||||
if ((color & 0xFFFFFF) > 0)
|
||||
data[index] = color;
|
||||
}
|
||||
}
|
||||
|
@ -57,11 +57,11 @@ namespace OpenDiablo2.Scenes
|
||||
renderWindow.Draw(panelSprite, 5, new Point(685, 600));
|
||||
|
||||
// Render the health bar
|
||||
renderWindow.Draw(healthManaSprite, 0, new Point(28, 590));
|
||||
renderWindow.Draw(healthManaSprite, 0, new Point(30, 587));
|
||||
renderWindow.Draw(gameGlobeOverlapSprite, 0, new Point(28, 595));
|
||||
|
||||
// Render the mana bar
|
||||
renderWindow.Draw(healthManaSprite, 1, new Point(691, 590));
|
||||
renderWindow.Draw(healthManaSprite, 1, new Point(692, 588));
|
||||
renderWindow.Draw(gameGlobeOverlapSprite, 1, new Point(693, 591));
|
||||
|
||||
}
|
||||
@ -87,7 +87,7 @@ namespace OpenDiablo2.Scenes
|
||||
for (int x = 0; x < gameState.MapData.Width; x++)
|
||||
{
|
||||
testSprite[idx] = renderWindow.GenerateMapCell(gameState.MapData, x, y, eRenderCellType.Floor, gameState.CurrentPalette);
|
||||
testSprite[idx].Location = new Point(((x - y) * 80) - 1200, ((x + y) * 40) - 1200);
|
||||
testSprite[idx].Location = new Point(((x - y) * 80) - 900, ((x + y) * 40) - 900);
|
||||
idx++;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user