1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-06-20 06:05:23 +00:00

fixed rendering

This commit is contained in:
Tim Sarbin 2018-11-24 20:22:03 -05:00
parent 21eb39bf7a
commit 1c0dede449
2 changed files with 5 additions and 4 deletions

View File

@ -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;
}
}

View File

@ -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++;
}
}