diku-dk/DIKUArcade

Image loading on Windows

Closed this issue · 3 comments

I still can't make this work after the latest commit.

Ikke-afviklet undtagelse: System.IO.FileNotFoundException: Error: The file "Galaga-Exercise-1\Assets\Images\BlueMonster.png" does not exist.
   ved DIKUArcade.Graphics.Texture..ctor(String filename, Int32 currentStride, Int32 stridesInImage) i C:\Users\Matilde\Desktop\su18-ChrEvaMat\DIKUArcade\DIKUArcade\Graphics\Texture.cs:linje 91
   ved DIKUArcade.Graphics.ImageStride.CreateStrides(Int32 numStrides, String imagePath) i C:\Users\Matilde\Desktop\su18-ChrEvaMat\DIKUArcade\DIKUArcade\Graphics\ImageStride.cs:linje 123
   ved Galaga_Exercise_1.Game..ctor() i C:\Users\Matilde\Desktop\su18-ChrEvaMat\SU18-Exercises\Galaga-Exercise-1\Game.cs:linje 39
   ved Galaga_Exercise_1.Program.Main(String[] args) i C:\Users\Matilde\Desktop\su18-ChrEvaMat\SU18-Exercises\Galaga-Exercise-1\Program.cs:linje 4

Line 89 in Graphics/Texture.cs should be changed from:

var path = Path.Combine(dir.ToString(), filename);
to
var path = Path.Combine(dir.FullName.ToString(), filename);

See here: 7bfe772

Tell me if it still does not work, but for now this issue has been closed.