Help, please!
How to get to the 24th room or in zero - I cannot understand from the schematic map?
Screenshotting and mapmaking
Re: Screenshotting and mapmaking
Screenshotting and mapmaking!!!
How to arrive with invisible rooms??? Their program - does not see in general. Example of MOD-186_14 level. Where the broken rooms.
How to arrive with invisible rooms??? Their program - does not see in general. Example of MOD-186_14 level. Where the broken rooms.
Re: Screenshotting and mapmaking
Yes, if there are broken links in the level then some of the rooms may not be on the map because SDLPoP doesn't know where to put them.
Falcury, Norbert, do you have ideas on how to solve this?
Re: Screenshotting and mapmaking
Well, while drawing the rooms, you should notice you cannot draw certain rooms because they would be attached at locations where you already drew a room. (Where a room already exists.) You could keep a list of all such rooms. Then, at the very end, check which of these rooms you never drew. Put these in a row somewhere below the map, all separate from each other, with room link arrows inside them.
Re: Screenshotting and mapmaking
Maybe the screenshot filename could get some kind of auto-increasing number, as DOSBox has (..._nnn.png/avi).
Currently, to, for instance, make multiple screenshots when frame-skipping with ESC (after disabling the menu), the user has to move/rename screenshot.png before each F12 press.
(Also, the menu doesn't mention screenshotting, and there's no visual feedback - especially when SDLPoP is not launched from console, e.g. from apoplexy.)
Currently, to, for instance, make multiple screenshots when frame-skipping with ESC (after disabling the menu), the user has to move/rename screenshot.png before each F12 press.
(Also, the menu doesn't mention screenshotting, and there's no visual feedback - especially when SDLPoP is not launched from console, e.g. from apoplexy.)
Re: Screenshotting and mapmaking
Done both numbering and feedback: https://github.com/NagyD/SDLPoP/commit/ ... a94a5a1f8fNorbert wrote: ↑April 30th, 2018, 10:02 pm Maybe the screenshot filename could get some kind of auto-increasing number, as DOSBox has (..._nnn.png/avi).
Currently, to, for instance, make multiple screenshots when frame-skipping with ESC (after disabling the menu), the user has to move/rename screenshot.png before each F12 press.
(Also, the menu doesn't mention screenshotting, and there's no visual feedback - especially when SDLPoP is not launched from console, e.g. from apoplexy.)
I also added a check whether IMG_SavePNG() could indeed save the image.
As a side note, the official documentation does not mention IMG_SavePNG() at all: https://libsdl.org/projects/SDL_image/d ... image.html (version 1.2.8!?)
Therefore I had to guess what are its possible return values.
Re: Screenshotting and mapmaking
Nice, thanks!David wrote: ↑May 1st, 2018, 1:00 pmDone both numbering and feedback: https://github.com/NagyD/SDLPoP/commit/ ... a94a5a1f8f
Maybe update ChangeLog.txt?
You could check the source.
In its IMG_png.c it does "if (dst) { return IMG_SavePNG_RW (...); } else { return -1; }", so maybe use "if (result != -1)" for SDLPoP.
Although you might enter a maze with IMG_SavePNG_RW(), if it calls stuff that calls stuff, etc.
Re: Screenshotting and mapmaking
Done: https://github.com/NagyD/SDLPoP/commit/ ... a27efeb5b5
Fortunately it's not so bad in this case:
IMG_SavePNG_RW() calls either IMG_SavePNG_RW_libpng() or IMG_SavePNG_RW_miniz() (through a pointer).
IMG_SavePNG_RW_libpng() has two kinds of return statements: "return -1;" and "return 0;".
IMG_SavePNG_RW_miniz() has a single return at the end, "return result;", where "result" can be -1 or 0.
Re: Screenshotting and mapmaking
This code suggests a small improvement of screenshot.c.
And I also have a related question.
Why is the compiler complaining about drawn_room which is size 2 (+ maybe \0 when used with snprintf) and not about other_room which is size 4?
And I also have a related question.
Why is the compiler complaining about drawn_room which is size 2 (+ maybe \0 when used with snprintf) and not about other_room which is size 4?
Code: Select all
/* This program demonstrates that
* char room_num[4];
* on line 367 of screenshot.c
* should be
* char room_num[6];
* to get rid of the format truncation compilation warning.
*
* The output of this program is:
* room_num: 4 (4294967295), other_room: 4 (4294967295), drawn_room: 2 (65535)
* -1
* [4]: 655
* [5]: 6553
* [6]: 65535
*
* Public domain code by Norbert.
*/
#include <stdlib.h>
#include <stdio.h>
#include <limits.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
typedef Uint16 word;
/*** https://stackoverflow.com/a/12762101 ***/
#define IS_TYPE_SIGNED(a) ((a-1) < 0)
#define MAX_VALUE_UNSIGNED(a) (((unsigned long long)1 << \
(sizeof(a) * CHAR_BIT)) - 1)
#define MAX_VALUE_SIGNED(a) (MAX_VALUE_UNSIGNED(a) >> 1)
#define MAX_VALUE(a) (IS_TYPE_SIGNED(a) ? \
MAX_VALUE_SIGNED(a) : MAX_VALUE_UNSIGNED(a))
int main ()
{
char room_num[4];
char room_num_test1[5];
char room_num_test2[6];
int other_room;
word drawn_room;
other_room = 4294967295;
drawn_room = 65535;
printf ("room_num: %lu (%llu),"
" other_room: %lu (%llu),"
" drawn_room: %lu (%llu)\n",
sizeof (room_num), MAX_VALUE (room_num),
sizeof (other_room), MAX_VALUE (other_room),
sizeof (drawn_room), MAX_VALUE (drawn_room));
snprintf (room_num, sizeof (room_num), "%d", other_room);
printf ("%s\n", room_num);
snprintf (room_num, sizeof (room_num), "%d", drawn_room);
printf ("[4]: %s\n", room_num);
snprintf (room_num_test1, sizeof (room_num_test1), "%d", drawn_room);
printf ("[5]: %s\n", room_num_test1);
snprintf (room_num_test2, sizeof (room_num_test2), "%d", drawn_room);
printf ("[6]: %s\n", room_num_test2);
return 0;
}