mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2025-01-31 05:37:17 -05:00
Switched to software rendering.
This commit is contained in:
parent
0b3a15403c
commit
6e7dccfe5d
@ -90,8 +90,8 @@ namespace OpenDiablo2.Core
|
||||
sw.Start();
|
||||
while (getRenderWindow().IsRunning)
|
||||
{
|
||||
while (sw.ElapsedMilliseconds < 40)
|
||||
Thread.Sleep((int)Math.Min(1, 40 -sw.ElapsedMilliseconds)); // The original runs at about 25 fps.
|
||||
while (sw.ElapsedMilliseconds < 33)
|
||||
Thread.Sleep((int)Math.Min(1, 33 -sw.ElapsedMilliseconds)); // Lock to 30fps
|
||||
|
||||
var ms = sw.ElapsedMilliseconds;
|
||||
|
||||
|
@ -98,7 +98,10 @@ namespace OpenDiablo2.Core.Map_Engine
|
||||
continue;
|
||||
|
||||
var floorLayer = gameState.MapData.FloorLayers[0];
|
||||
var floor = floorLayer.Props[x + (y * gameState.MapData.Width)];
|
||||
var idx = x + (y * gameState.MapData.Width);
|
||||
if (idx >= floorLayer.Props.Length)
|
||||
break;
|
||||
var floor = floorLayer.Props[idx];
|
||||
|
||||
if (floor.Prop1 == 0)
|
||||
return;
|
||||
|
@ -53,7 +53,7 @@ namespace OpenDiablo2.SDL2_
|
||||
if (window == IntPtr.Zero)
|
||||
throw new ApplicationException($"Unable to create SDL Window: {SDL.SDL_GetError()}");
|
||||
|
||||
renderer = SDL.SDL_CreateRenderer(window, -1, SDL.SDL_RendererFlags.SDL_RENDERER_ACCELERATED);
|
||||
renderer = SDL.SDL_CreateRenderer(window, -1, SDL.SDL_RendererFlags.SDL_RENDERER_SOFTWARE);
|
||||
if (renderer == IntPtr.Zero)
|
||||
throw new ApplicationException($"Unable to create SDL Window: {SDL.SDL_GetError()}");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user