PDA

View Full Version : RejKaster - a raycasting example.



pan-te
25-05-2017, 04:01 PM
Hello.
This is my first project with SDL. I tried to port it to Dos with standard graph library,
but I have some optimization problems. Any suggestions?

https://github.com/pan-te/RejKaster3

14641465

de_jean_7777
25-05-2017, 04:16 PM
Compiled it fine on Fedora 25 x64, but when you run it and it asks for level map, I enter test.map and it crashes with runtime error 100.

pan-te
26-05-2017, 01:34 PM
Compiled it fine on Fedora 25 x64, but when you run it and it asks for level map, I enter test.map and it crashes with runtime error 100. Hmm... interesting. I can't reproduce this error, but it looks like problem with file handling.

pan-te
26-05-2017, 01:57 PM
I've just created some workaround- map is hard-coded with engine. It's branch called nomapread.
https://github.com/pan-te/RejKaster3/tree/nomapread

imcold
26-05-2017, 07:58 PM
The numbers in test.map are shortints (2 byte), you are reading it as a file of integer - integer is 4 bytes on 32bit systems.

Edit:
It crashes on division by zero in rendering on this line: draw_yoffset2:= (halfheight*12/ray_draw)-1;
Also, a lot of out of bounds access on map array -> crashes a lot.
Otherwise it runs, Freepascal 3.0 64bit at about 50% cpu load.

btw.probably include the SDL units in the sources as well?

pan-te
27-05-2017, 03:11 PM
The numbers in test.map are shortints (2 byte), you are reading it as a file of integer - integer is 4 bytes on 32bit systems.

Edit:
It crashes on division by zero in rendering on this line: draw_yoffset2:= (halfheight*12/ray_draw)-1;
Also, a lot of out of bounds access on map array -> crashes a lot.
Otherwise it runs, Freepascal 3.0 64bit at about 50% cpu load.

btw.probably include the SDL units in the sources as well?
Thanks. I'll repair it with next commit.

Thyandyr
28-05-2017, 02:59 PM
You have any screenshots etc?