Page 54 of 58

Re: SDLPoP; David's open-source port of PoP

Posted: November 13th, 2021, 4:21 pm
by Falcury
David wrote: November 13th, 2021, 3:18 pm I will probably revert the #includes to their original forms.
Or perhaps add some more #ifs to keep everyone happy, once I find out how to detect each possible OS and build environment.
Maybe something like this? Although I am not entirely sure this is supported by every compiler (should work on most?); there might need to be an additional check for that.

Code: Select all

#if __has_include(<SDL2/SDL.h>)
#include "SDL2/SDL.h"
#include "SDL2/SDL_image.h"
#else
#include "SDL.h"
#include "SDL_image.h"
#endif

Re: SDLPoP; David's open-source port of PoP

Posted: November 13th, 2021, 10:55 pm
by VelCheran
Thanks, I added the directories, and now I get this:
https://pastebin.com/ucL3jvJF

Am I missing some libraries again?

Re: SDLPoP; David's open-source port of PoP

Posted: November 20th, 2021, 5:53 pm
by David
Falcury wrote: November 13th, 2021, 4:21 pm Maybe something like this? Although I am not entirely sure this is supported by every compiler (should work on most?); there might need to be an additional check for that.

Code: Select all

#if __has_include(<SDL2/SDL.h>)
#include "SDL2/SDL.h"
#include "SDL2/SDL_image.h"
#else
#include "SDL.h"
#include "SDL_image.h"
#endif
Wow, I didn't know about __has_include.
It works in Dev-C++ (which uses gcc), but I don't know if other compilers support it (for example Visual Studio).

I found this:
https://stackoverflow.com/questions/52379233/is-has-cxx17-macro-usable-in-custom-project-headers-to-enable-c17-language wrote: The recommendation to use __has_include is good, but isn't supported prior to VS 2017 (15.3 update).
and this:
https://en.cppreference.com/w/cpp/preprocessor/include wrote: __has_include (since C++17)
So it's at least a standard thing... in C++. I wonder if it's also a standard feature in C.

EDIT:
It's not: https://en.cppreference.com/w/c/preprocessor/include

But here is how to check if the compiler supports __has_include.
https://en.cppreference.com/w/cpp/feature_test wrote:

Code: Select all

#ifdef __has_include                           // Check if __has_include is present

Re: SDLPoP; David's open-source port of PoP

Posted: November 20th, 2021, 7:12 pm
by David
VelCheran wrote: November 13th, 2021, 10:55 pm Thanks, I added the directories, and now I get this:
https://pastebin.com/ucL3jvJF

Am I missing some libraries again?
No, this time the compiler is complaining about conflicting declarations of almost every function in seg009.c.

Code: Select all

seg009.c:245: error: conflicting types for 'prandom'
proto.h:546: error: previous declaration of 'prandom' was here
seg009.c line 245 is this:

Code: Select all

word __pascal far prandom(word max) {
proto.h line 546 is this:

Code: Select all

word __pascal far prandom(word max);
I can't see any difference in types.

Interestingly, these errors appear only for functions with arguments.


Which version of Dev-C++ are you using?

I am using Dev-Cpp 5.11, which is the latest version here.

Re: SDLPoP; David's open-source port of PoP

Posted: November 24th, 2021, 9:54 pm
by VelCheran
I installed 4.9.9.2, I'll update it and try again. Thanks :)

Re: SDLPoP; David's open-source port of PoP

Posted: November 26th, 2021, 4:53 pm
by atrueprincefanfrom18
A counter which tracks the deaths from the time the mod was started and also a different counter for the level.
And that can be pushed to the stream manager to show on the stream maybe :)

Re: SDLPoP; David's open-source port of PoP

Posted: November 30th, 2021, 2:29 pm
by Norbert
Recently thousands of visits to SDLPoP's page on PoPOT, all from GitHub.
SDLPoP's GitHub got lots of traffic from Reddit and Hacker News.

Re: SDLPoP; David's open-source port of PoP

Posted: December 1st, 2021, 2:05 am
by VelCheran
David wrote: November 13th, 2021, 3:18 pmBTW, why do you have your drives as A: and B:?
Because why not? :D
Since I don't have any floppy disk, those letters are never used, so I used them for my secondary and third internal drives (I still use C as main drive).

Sooo, I installed the latest DevC++, but I still have an error. I mean, why wouldn't I? :lol:

https://pastebin.com/ucJvWWeY

One day, I'll get this.

Re: SDLPoP; David's open-source port of PoP

Posted: December 1st, 2021, 7:20 pm
by dmitry_s
It looks like you are compiling it in 64-bit mode based on the "x86_64-w64-mingw32" path.

Try compiling it in 32-bit mode against "i686-w64-mingw32" libraries.

Re: SDLPoP; David's open-source port of PoP

Posted: December 2nd, 2021, 12:52 am
by VelCheran
Where do I set this? In Tools->Compiler options? If so, even if I select the 32 bits compiler, its directories are all pointing to MinGW64 and not MinGW32. I tried changing them manually without any success.

Re: SDLPoP; David's open-source port of PoP

Posted: December 2nd, 2021, 12:03 pm
by Norbert
VelCheran wrote: December 2nd, 2021, 12:52 am Where do I set this? In Tools->Compiler options? If so, even if I select the 32 bits compiler, its directories are all pointing to MinGW64 and not MinGW32. I tried changing them manually without any success.
Editor apoplexy uses SDL2's MinGW, and has docs/compiling.txt (at GitHub), which explains how to compile apoplexy in 32-bit mode. It has some extra steps you can skip for SDLPoP, but otherwise it should be similar. At the very least it should give you some clues as to what Project Options and such to use.
On a more general note, SDLPoP could probably use step-by-step compilation instructions for Windows, in either its README.md or a new compiling.txt file.

Re: SDLPoP; David's open-source port of PoP

Posted: December 3rd, 2021, 1:34 am
by dmitry_s
There are instructions on SDLPoP github.
https://github.com/NagyD/SDLPoP/blob/ma ... E.md#dev-c

Re: SDLPoP; David's open-source port of PoP

Posted: December 3rd, 2021, 2:17 am
by Norbert
dmitry_s wrote: December 3rd, 2021, 1:34 am There are instructions on SDLPoP github.
https://github.com/NagyD/SDLPoP/blob/ma ... E.md#dev-c
Not step-by-step though.
Check apoplexy's instructions to see what I mean.

Re: SDLPoP; David's open-source port of PoP

Posted: December 8th, 2021, 3:55 pm
by VelCheran
Thanks a lot! I managed to get it right starting from a fresh project and using step-by-step Apoplexy readme when necessary.
It's working perfectly fine now, I have dark screen transitions :)

Re: SDLPoP; David's open-source port of PoP

Posted: April 1st, 2022, 3:29 pm
by Norbert
Not a big bug, but I think maybe quicksave doesn't remember dead guards? I've not tested this at all. Either way, at 00:46:18 here, there's a dead guard, then after a partial level finish, quickload is used, and shortly thereafter the guard is alive again.