Jeija / spheretest

Technical Demo - Minetest on a spherical world
157 stars 20 forks source link

Problems with merging upstream minetest code #4

Closed Anth0rx closed 6 years ago

Anth0rx commented 6 years ago

Hello Jeija,

first off: Thank you very much for the effort you put into this cool modification. In my point of view it gives Minetest a whole new feeling.

I'm kind of a novice programmer with a little bit of building and compiling experience. Since this repository was last modified back in october last year I tried to merge the up to date codebase of minetest. After fighting some merge confilicts I am not getting any further with the following error message:

~/spheretest/src/content_cao.cpp:752:27: error: invalid use of incomplete type 'class IShaderSource'
    u16 shader_id = shdrsrc->getShader("object_shader", 1, 1);
                           ^~
In file included from ~/spheretest/src/content_cao.cpp:35:0:
~/spheretest/src/gamedef.h:31:7: note: forward declaration of 'class IShaderSource'
    class IShaderSource;

It would be very kind of you, if you helped me out on that matter.

Regards Anth0rx

Jeija commented 6 years ago

It might be enough to just

#include "shader.h"

somewhere at the top of content_cao.cpp. This error seems to occur because the IShaderSource class only happens to be included due to a forward declaration in gamedef.h, but content_cao.cpp needs to access a method of that class (getShader()) and therefore requires the full definition of the class.

Just as a warning: Getting spheretest up to date with the current minetest branch could turn out to be quite difficult, it might be easier to manually copy-paste the spheretest changes into minetest one at a time instead of automatically merging the codebase.

Anth0rx commented 6 years ago

Okay, thank you for the tip. Actually I try to merge spheretest into the minetest codebase.

From where do you know to import "shader.h"?

Jeija commented 6 years ago

Your message said

error: invalid use of incomplete type 'class IShaderSource'

So it's obviously missing information about the IShaderSource class which is defined in shader.h.

Anth0rx commented 6 years ago

Ah okay, thank you. So after 2 days of trying to merge your changes into the upstream codebase or rather vice versa I am still getting errors. Do you have any concrete tips for me how you would do this?

Jeija commented 6 years ago

You could go to https://github.com/Jeija/spheretest/commits/master?author=Jeija and look at all the commits that I made in order to make spheretest out of minetest, starting with 50f8a37297ecf9a548048b243f57f0ad539de0a1 on May 17th (the older ones are just some contributions to minetest I made earlier and don't have anything to do with spheretest).

Then manually apply the changes of one commit after the other to the current minetest and only continue with the next (more recent) commit if your minetest still compiles. This probably means quite a lot of redundant work, but it is probably the least frustrating way to accomplish what you're trying to do.

Anth0rx commented 6 years ago

Thanks for the tip. But won't a git pull https://github.com/Jeija/spheretest.git inside the minetest master branch do just the same?

Jeija commented 6 years ago

Technically yes, but then you don't know what exactly the problems are if something doesn't work. You will have to do some manual changes to the code since minetest has just changed too much since spheretest was originally forked from minetest, but nothing that should be too difficult if done in small steps. Alternatively, you can also git cherry-pick the individual commits.

Anth0rx commented 6 years ago

Yes, I thought about cherry-picking. I'll have a try and come back to you, if any major problems arise. Thanks for your support.

LunaSquee commented 6 years ago

I have done a sort of a merge to the latest version, I credited you and everything. It seems to work except for some collision issues and rendering issues. Since I'm not a C++ programmer, I unfortunately can't continue to develop this further on my own.

Anth0rx commented 6 years ago

Hey, thanks :)