SDLPoP; David's open-source port of PoP

Open-source port of PoP that runs natively on Windows, Linux, etc.
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5575
Joined: April 9th, 2009, 10:58 pm

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

Post by Norbert »

Norbert wrote: October 30th, 2022, 9:47 amI'll try to find time in the coming weeks/months to add teleports to apoplexy's "native tiles screen" (which is accessible via Ctrl+click and "x").
Done; released apoplexy 3.16.

Hopefully, "teleports" will shortly be merged into master, for an erelong v1.23 release.
I can put together a brief teleports how-to video, similar to the colored torch flames how-to video.
David
The Prince of Persia
The Prince of Persia
Posts: 2760
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

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

Post by David »

Norbert wrote: November 16th, 2022, 10:29 pm Hopefully, "teleports" will shortly be merged into master, for an erelong v1.23 release.
With this change, is it ready for merging?
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5575
Joined: April 9th, 2009, 10:58 pm

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

Post by Norbert »

David wrote: November 19th, 2022, 12:36 pm
Norbert wrote: November 16th, 2022, 10:29 pm Hopefully, "teleports" will shortly be merged into master, for an erelong v1.23 release.
With this change, is it ready for merging?
I think so. I've tested the most recent code, and it works.

Unrelated, screenshot.c throws 2 warnings.
1. line 41, snprintf: output may be truncated writing 12 bytes into a region of size between 1 and 256
2. line 32, strncpy: specified bound 256 equals destination size
Maybe not important, but just in case.
Norbert wrote: November 16th, 2022, 10:29 pmI can put together a brief teleports how-to video, similar to the colored torch flames how-to video.
I've finished making this video, so it's ready to be added to the PoPModding YouTube channel whenever the new SDLPoP release arrives.
FluffyQuack
Sheikh
Sheikh
Posts: 30
Joined: June 6th, 2004, 7:05 pm

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

Post by FluffyQuack »

David wrote: November 12th, 2022, 12:41 pmI have added similar functionality on the branch "redefine_keyboard2".
It adds controls as a separate menu and you can change any key without having to change all the others.

It looks like this:
redefine_keys.png
Oh, then I don't need to work on my branch for that anymore. You've already gotten more progress on it than me.

It would be nice to have the joystick rebindable too. I tried the Xbox ports of POP1/POP2 recently and I like what they did with the controls there:
D-pad \ left stick = Movement
LT\RT = Grab
X = Attack
A = Jump (aka up)
B = Crouch (aka down)
David
The Prince of Persia
The Prince of Persia
Posts: 2760
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

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

Post by David »

Norbert wrote: November 19th, 2022, 4:26 pm
David wrote: November 19th, 2022, 12:36 pm With this change, is it ready for merging?
I think so. I've tested the most recent code, and it works.
Done: https://github.com/NagyD/SDLPoP/commit/ ... 12bca86752
David
The Prince of Persia
The Prince of Persia
Posts: 2760
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

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

Post by David »

Norbert wrote: November 19th, 2022, 4:26 pm Unrelated, screenshot.c throws 2 warnings.
1. line 41, snprintf: output may be truncated writing 12 bytes into a region of size between 1 and 256
2. line 32, strncpy: specified bound 256 equals destination size
Maybe not important, but just in case.

1. is this line:

Code: Select all

teleports:
		snprintf(screenshot_filename, sizeof(screenshot_filename), "%s/screenshot_%03d.png", screenshots_folder, screenshot_index);
master:
		snprintf_check(screenshot_filename, sizeof(screenshot_filename), "%s/screenshot_%03d.png", screenshots_folder, screenshot_index);
I'm not sure what is the compiler trying to say here.
"12 bytes" may be the size of the "/screenshot_" part, between the two placeholders.
And certainly, that might be truncated if screenshots_folder is long enough.

2. is this line:

Code: Select all

teleports:
	strncpy(screenshots_folder, locate_file("screenshots"), sizeof(screenshots_folder));
master:
	snprintf_check(screenshots_folder, sizeof(screenshots_folder), "%s", locate_file("screenshots"));
Again, I'm not sure what is the compiler trying to say here.
Isn't the whole point of the bound that it's equal to the size of the destination buffer?

Maybe it's referring to the fact that strncpy doesn't null-terminate the destination if the source is longer than the bound?


In any case, both calls have been changed to snprintf_check() in this commit: https://github.com/NagyD/SDLPoP/commit/ ... 084c0cc64a
David
The Prince of Persia
The Prince of Persia
Posts: 2760
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

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

Post by David »

FluffyQuack wrote: November 22nd, 2022, 6:13 pm It would be nice to have the joystick rebindable too.
I don't have a joystick or gamepad, so that has to be done by someone else...
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5575
Joined: April 9th, 2009, 10:58 pm

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

Post by Norbert »

Norbert wrote: January 6th, 2021, 3:37 pm There are inconsistencies in doc/Readme.txt when it comes to how keyboard shortcuts are presented to the reader.

Example:
- - - - -
* Ctrl-S: sound on/off
* mute -- Start the game with sound off. (You can still enable sound with Ctrl+S.)
- - - - -

Another (double) example:
- - - - -
* Shift-F (while viewing a replay): skip forward to the next level
While viewing a replay, you can press F to skip forward to the next room, or Shift+F to skip to the next level.
* shift+left/right: careful step
- - - - -

Yet another example:
- - - - -
* r: resurrect kid
* Ctrl-R: return to intro
- - - - -

Personally, I always do e.g. Ctrl+r (because plus indicates addition, and a capital r (R) would indicate Ctrl+Shift+r).
But I'm not sure whether that is also the best solution in this particular case/context.
(If you make any changes related to this, I suggest not including them with the upcoming release. To give yourself enough time to look at it without any added pressure.)
I know you already did this, but I just ran into the casing issue again.
As an example, the documentation says, "T: Toggle display of timer".
To me, "T" is a capital t, which makes me do Shift+t, which increases hit points.
[Edit: Maybe it is just me and my programmer mind. That nobody else is confused by the documentation.]
Post Reply