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

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 a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: [0.6.0-573-g57ad04803] [Blood] Skyboxes is not working

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

by AlexRK » Mon Aug 17, 2020 1:29 pm

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!

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

by Graf Zahl » Mon Aug 17, 2020 1:01 pm

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. :?

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

by AlexRK » Mon Aug 17, 2020 12:33 pm

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. :)

Top