OS/2, eCS & ArcaOS - Technical > Games
OS/2 - ArcaOS - Native Games
Mentore:
--- Quote from: Dave Yeo on July 04, 2021, 06:16:26 am ---Digi's SDL trps the same.
What I think the bug is, is that it queries the list of possible full screen video modes, which here just returns one, 1680x1050 in my case, and then tries to go through the list of video modes to make sure they will work. At this point it crashes when trying to load the 2nd member of an array of one.
I'm not really a programmer and can't see the simple fix, I'll think on it some more.
The broken code is,
--- Code: --- else {
IFDEBUG_VIDEO(sys_printf("xrick/video: SDL says, use these modes:\n"););
for (i = 0; modes[i]; i++) {
IFDEBUG_VIDEO(sys_printf(" %dx%d\n", modes[i]->w, modes[i]->h););
--- End code ---
--- End quote ---
I actually don't like the for cycle written above: (reported below)
--- Code: --- for (i = 0; modes[i]; i++) {
--- End code ---
It implies that the cycle should stop after cycling through all the items in the "modes" array but I feel this should be written better asking for the actual length of the array. Don't know if this is C-99 or some more modern incarnation (this code uses lambda expressions so I assume is pretty modern, and I'm no expert in this) but this writing leaves me perplexed.
Mentore
Jochen Schäfer:
Problem is, that you don't know the size of array in C/C++. That is why APIs almost always give you an list size or a 0 terminated list.
The latter is what this "for" is assuming. But we have a field "num_display_modes" in the display structure, that could be used.
But in BWWs version, I fixed an init error in the display structures, which should be applied to Digis version, if not already done.
Dave Yeo:
--- Quote from: Jochen Schäfer on July 28, 2021, 11:50:09 am ---But in BWWs version, I fixed an init error in the display structures, which should be applied to Digis version, if not already done.
--- End quote ---
I didn't find your fix.
Lars:
--- Quote from: Dave Yeo on July 28, 2021, 05:39:01 pm ---
--- Quote from: Jochen Schäfer on July 28, 2021, 11:50:09 am ---But in BWWs version, I fixed an init error in the display structures, which should be applied to Digis version, if not already done.
--- End quote ---
I didn't find your fix.
--- End quote ---
https://github.com/bitwiseworks/SDL2-os2/commit/f5057a506716d15c405a545403b316e807d7069e
Martin Iturbide:
Hi
I have a noob question about SDL development. For games that had been developed with SDL 1x, is it possible to recompile those with SDL 2.x? or all the game code (like functions calls, etc) will need to be changed to use the SDL 2.x instead?
Regards
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version