RegrowthStudios / Vorb

Regrowth Studios Vorb Engine
MIT License
60 stars 29 forks source link

Templates issue in "Script.h" #102

Open JackalopeGit opened 6 years ago

JackalopeGit commented 6 years ago
In file included from /home/damir/repos/soa/SoA/MainMenuScriptedUI.cpp:3:

In file included from /home/damir/repos/soa/SoA/SoaEngine.h:20:

In file included from /home/damir/repos/soa/SoA/OptionsController.h:20:

In file included from /home/damir/repos/soa/SoA/Vorb//script/Environment.h:40:

/home/damir/repos/soa/SoA/Vorb/script/Script.h:136:24: error: call to 'fRCall' is ambiguous

                return fRCall<Ret, Args...>(s, (RDelegate<Ret, Args...>*)del);
                       ^~~~~~~~~~~~~~~~~~~~
/home/damir/repos/soa/SoA/Vorb/script/Script.h:153:26: note: in instantiation of function template specialization 'vorb::script::impl::luaDRCall<unsigned long>' requested here

            return impl::luaDRCall<Ret, Args...>;
                         ^
/home/damir/repos/soa/SoA/Vorb//script/Environment.h:149:32: note: in instantiation of function template specialization 'vorb::script::fromRDelegate<unsigned long>' requested here

                ScriptFunc f = fromRDelegate<Ret, Args...>();
                               ^
/home/damir/repos/soa/SoA/MainMenuScriptedUI.cpp:34:10: note: in instantiation of function template specialization 'vorb::script::Environment::addCRDelegate<unsigned long>' requested here

    env->addCRDelegate("size", makeRDelegate(*this, &MainMenuScriptedUI::getNumInputs));
         ^
/home/damir/repos/soa/SoA/Vorb/script/Script.h:112:17: note: candidate function [with Ret = unsigned long]

            i32 fRCall(EnvironmentHandle h, RDelegate<Ret>* del) {
                ^

/home/damir/repos/soa/SoA/Vorb/script/Script.h:117:17: note: candidate function [with Ret = unsigned long, Args = <>]

            i32 fRCall(EnvironmentHandle h, RDelegate<Ret, Args...>* del) {
                ^

Can't resolve this by my own.

Barnold1953 commented 6 years ago

I just merged some PRs, see if this is still happening

JackalopeGit commented 6 years ago

I'm compiling soa on Linux with clang. Temporary commented out all "addCDelegate" calls, and get it compiled after thousands corrections like case-sensetive-incorrect-slashes-const-lvalue-rvalue-collisions, include orders and more, but get issue on :

MainMenuLoadScreen::build()
-> m_vorbScreenDuration = (m_env["Vorb.MaxDuration"].as<f64>())();
-> RFunction::template<typename... Args> Ret operator()(Args... args) const
-> void Function::rcall(OUT Ret* retValue, Args... args) const        << m_env = NULL
-> EnvironmentHandle getHandle() const { return m_state;  }        << sigsegv

What is "m_env["Vorb.MaxDuration"]", how string literal as an array index works?

caseymcc commented 5 years ago

I have got the issues in addCDelegate and etc... fixed on at least gcc (haven't tested clang) working through the typos at the moment and a few more items for Linux, likely get to that code in a few.

However m_env is a variable of vorb::script::Environment which has a Function& operator[] (const nString& name); for handling just that.

caseymcc commented 5 years ago

Likely the commented out code to addCDelegate is the reason that is failing as Function is part of this stuff.

caseymcc commented 5 years ago

I have the compile fixed for Linux, I don't know if it works though as my linux machine cannot open an opengl context (need to install a driver I think). However looks like I am going to have to make some changes to get the Windows version working with the changes I made for linux. But if you would like to play with the linux code and debug it (not sure I am going to mess with debugging on linux) the branches are here.

https://github.com/caseymcc/Vorb/tree/linux_compile https://github.com/caseymcc/SoACode-Public/tree/linux_compile

caseymcc commented 5 years ago

Ok, all changes are merged now. You should be able to compile on linux. I have no clue if it runs on linux but it does still run on windows.

czaloj commented 5 years ago

Yeah, shit, all this code was freaking craaaazy