[0.6.0-573-g57ad04803] [Blood] Skyboxes is not working

Moderator: Raze Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
AlexRK
Posts: 3
Joined: Mon Aug 17, 2020 12:05 pm

[0.6.0-573-g57ad04803] [Blood] Skyboxes is not working

Post by AlexRK »

Hello, Graf! I think I found a bug. I was trying to get a custom skyboxes to work. They work in NBlood, but don't work in Raze. I was digging through the NBlood/Raze source code and found this (I don't have a C/C++ compiler installed, so I just looked with my eyes).

In the NBlood source code there is a "check_file_exist" function in the "NBlood-master\source\build\src\common.cpp" file. You replaced the calls to this function with the calls to the "FileSystem.FileExists" function from the "Raze-master\source\common\filesystem\filesystem.h" file. In particular, such a place is found in the code for processing skyboxes in the "source\build\src\defs.cpp" file.

It was (NBlood-master\source\build\src\defs.cpp):

Code: Select all

                if (EDUKE32_PREDICT_FALSE(!fn[i])) initprintf("Error: skybox: missing '%s filename' near line %s:%d\n", skyfaces[i], script->filename, scriptfile_getlinum(script,skyboxtokptr)), happy = 0;
                // FIXME?
                if (check_file_exist(fn[i]))
                    happy = 0;
Became (Raze-master\source\build\src\defs.cpp):

Code: Select all

                if (EDUKE32_PREDICT_FALSE(!fn[i])) Printf("Error: skybox: missing '%s filename' near line %s:%d\n", skyfaces[i], script->filename, scriptfile_getlinum(script,skyboxtokptr)), happy = 0;
                // FIXME?
                if (fileSystem.FileExists(fn[i]))
                    happy = 0;
But the point is that the "check_file_exist" function returns TRUE when it does NOT find a file!

Code: Select all

// checks from path and in ZIPs, returns 1 if NOT found
int32_t check_file_exist(const char *fn)
While the "FileSystem.FileExists" function, on the contrary, returns FALSE. I believe that all the places where this replacement was made contain inverted logic.
Not sure if skyboxes are not loading just because of this error, but it definitely needs fixing.

English is not my first language, so I apologize for any mistakes. :)
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49226
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [0.6.0-573-g57ad04803] [Blood] Skyboxes is not working

Post by Graf Zahl »

Yes,it's a known issue that skyboxes are currently not working. But it's not just the file check - there's problems in the renderer as well. But that's an interesting bit of poor coding there, it will surely confuse people to name a function check_exist and then let if (check_exist) mean the exact opposite. :?
AlexRK
Posts: 3
Joined: Mon Aug 17, 2020 12:05 pm

Re: [0.6.0-573-g57ad04803] [Blood] Skyboxes is not working

Post by AlexRK »

Is the renderer problem very serious? It's a shame it's not just about checking the existence of a file. :)

BTW, thanks a lot for the great port!
Post Reply

Return to “Closed Bugs [Raze]”