aliens

Author Topic: openxcom wii ?  (Read 16429 times)

Offline sergioreynel

  • Squaddie
  • *
  • Posts: 9
    • View Profile
openxcom wii ?
« on: January 10, 2015, 10:26:42 pm »
Has anyone tried to port openxcom to wii since I think its made with sdl and I found this https://wiibrew.org/wiki/SDL_Wii   

 :)

also star control 2 has been ported to wii and it uses sdl https://wiibrew.org/wiki/The_Ur-Quan_Masters
« Last Edit: January 28, 2015, 08:50:17 pm by sergioreynel »

Offline sergioreynel

  • Squaddie
  • *
  • Posts: 9
    • View Profile
Re: openxcom wii ?
« Reply #1 on: January 29, 2015, 01:47:50 am »
so no comments :(

Offline volutar

  • Colonel
  • ****
  • Posts: 351
  • Vanilla digger & Quality assistant
    • View Profile
Re: openxcom wii ?
« Reply #2 on: January 29, 2015, 05:34:28 am »
I guess. There are no people here interested in that and having skills in WII homebrew development. I don't know if it's possible since wii has too few memory.

Offline nebiun

  • Sergeant
  • **
  • Posts: 12
    • View Profile
Re: openxcom wii ?
« Reply #3 on: February 04, 2016, 07:21:32 pm »
Well, I'm trying.
Found sources and compile SDL library for wii.
Found sources and compile libyaml-cpp for wii

Set the environ for run configure:

export SDL_LIBS="-lSDL_net -lSDL_ttf -lSDL_gfx -lSDL_mixer -lSDL_image -lsmpeg -lSDL -ljpeg -lpng -lfreetype -lvorbisidec -lz -lfat -lwiiuse -lbte -lwiikeyboard -logc -lm"
export SDL_CFLAGS="-I/C/devkitPro/libogc/include/SDL -D__WII__"

export YAML_LIBS="-lyaml-cpp"
export YAML_CFLAGS="-std=gnu++11 -I/C/devkitPro/libogc/include"

and run it:

configure --host=powerpc-eabi

Then: now I have the Makefile, but when I run make I have this (first) error.

  CXX    src/Basescape/openxcom-BaseInfoState.o
src/Basescape/BaseInfoState.cpp: In member function 'virtual void OpenXcom::Base
InfoState::init()':
src/Basescape/BaseInfoState.cpp:302:49: error: 'floor' was not declared in this
scope
  ss5 << (int)floor(_base->getUsedStores() + 0.05) << ":" << _base->getAvailable
Stores();
                                                 ^
make[1]: *** [src/Basescape/openxcom-BaseInfoState.o] Error 1
make[1]: Leaving directory `/c/Users/Utente1/Downloads/WIIdev/OpenXcom-master'
make: *** [all-recursive] Error 1

I think that something is missing in my environ.
I'm a C programmer, not a C++ programmer, and now I need a BIG help to continue...

Offline yrizoud

  • Commander
  • *****
  • Posts: 1014
    • View Profile
Re: openxcom wii ?
« Reply #4 on: February 04, 2016, 07:32:45 pm »
In this case, floor is just the basic floor() function from the standard library, so a #include <math.h> should solve this one error. But you may find many other problems...

Offline winterheart

  • Colonel
  • ****
  • Posts: 180
  • Fellow Squaddie
    • View Profile
Re: openxcom wii ?
« Reply #5 on: February 04, 2016, 08:31:42 pm »
Do you use yaml-cpp from git HEAD? If so, you forced to compile openxcom with c++11 features. Currently openxcom source code is not ready to it. These error can be easly fixed in code (I even have local branch for it), but i'm not sure for backward compatibility. If you like, I can provide my branch for testing.

Online Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: openxcom wii ?
« Reply #6 on: February 04, 2016, 09:21:30 pm »
He already doing that.

Overall yaml-cpp purge lot of unused headers from it source code causing breaking OXC because many files depend on yaml headers to include it. Simply adding `#include <math.h>` or `#include <algorithm>` should fix most of this errors.

[ps]
wrong header name: "algorithm" without "s".
« Last Edit: February 05, 2016, 09:06:55 pm by Yankes »

Offline nebiun

  • Sergeant
  • **
  • Posts: 12
    • View Profile
Re: openxcom wii ?
« Reply #7 on: February 05, 2016, 07:24:30 pm »
In this case, floor is just the basic floor() function from the standard library, so a #include <math.h> should solve this one error. But you may find many other problems...

Perfect!
Include <math.h> solve the error.
Now I've some problems with missing SDL header files...

Online Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: openxcom wii ?
« Reply #8 on: February 05, 2016, 07:34:41 pm »
Perfect!
Include <math.h> solve the error.
Now I've some problems with missing SDL header files...
Then probably `SDL_CFLAGS` is not used by build script. I would suggest to place this value manually to script. In long run it isn't proper solution but it could save you lot of time in fighting with strange error caused by not properly configured environment.

Another casue could be that headers and nested deeper in directory (like `/SDL/SDL/` or something like that).

Offline nebiun

  • Sergeant
  • **
  • Posts: 12
    • View Profile
Re: openxcom wii ?
« Reply #9 on: February 05, 2016, 08:12:51 pm »
Then probably `SDL_CFLAGS` is not used by build script. I would suggest to place this value manually to script. In long run it isn't proper solution but it could save you lot of time in fighting with strange error caused by not properly configured environment.

Another casue could be that headers and nested deeper in directory (like `/SDL/SDL/` or something like that).

Not so easy  :(
Problem was OpenGL headers needed by SDL.
I found this https://wiibrew.org/wiki/Gl2gx, compile (there was few errors, "Development is currently on hold until a new maintainer is found") then I install it in my environ.

Now, build stops with the error in the attached file.

Online Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: openxcom wii ?
« Reply #10 on: February 05, 2016, 09:08:41 pm »
add `#include <algorithm>`.

Offline nebiun

  • Sergeant
  • **
  • Posts: 12
    • View Profile
Re: openxcom wii ?
« Reply #11 on: February 05, 2016, 10:33:08 pm »
add `#include <algorithm>`.
Done.
Same problem in 2 other sources.
And we have complete the Basescape folder  :D

Offline nebiun

  • Sergeant
  • **
  • Posts: 12
    • View Profile
Re: openxcom wii ?
« Reply #12 on: February 05, 2016, 10:36:22 pm »
An after a cast problem solved by myself:

src/Battlescape/BattlescapeGenerator.cpp: In member function 'void OpenXcom::Bat
tlescapeGenerator::loadRMP(OpenXcom::MapBlock*, int, int, int)':
src/Battlescape/BattlescapeGenerator.cpp:1672:30: error: comparison between sign
ed and unsigned integer expressions [-Werror=sign-compare]
      if (*k - (int)nodeOffset == *i)
                              ^
This is the next:

src/Battlescape/DebriefingState.cpp: In member function 'void OpenXcom::Debriefi
ngState::prepareDebriefing()':
src/Battlescape/DebriefingState.cpp:863:5: error: 'for_each' is not a member of
'std'
     std::for_each(save->getAlienMissions().begin(), save->getAlienMissions().en
d(),
     ^
make[1]: *** [src/Battlescape/openxcom-DebriefingState.o] Error 1
make[1]: Leaving directory `/c/Users/Utente1/Downloads/WIIdev/OpenXcom-master'
make: *** [all-recursive] Error 1



Solved with google:
added #include <algorithm>    :)
« Last Edit: February 05, 2016, 10:40:05 pm by nebiun »

Online Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: openxcom wii ?
« Reply #13 on: February 05, 2016, 10:51:35 pm »
This is still error caused by lack of algorithms header: https://en.cppreference.com/w/cpp/algorithm/for_each
You should add this two headers (math too) until you get error that is not fix by this change.
Another suggestion is reduce error level in compiler. Right now I see that you have makefile with very aggressive setting (-Werror) that probably will not allow compiling OXC. In long run all this warnings should be fixed but is not your job to do this. Ignore it and try get AFAP working binary.

Offline nebiun

  • Sergeant
  • **
  • Posts: 12
    • View Profile
Re: openxcom wii ?
« Reply #14 on: February 05, 2016, 11:13:39 pm »
This is still error caused by lack of algorithms header: https://en.cppreference.com/w/cpp/algorithm/for_each
You should add this two headers (math too) until you get error that is not fix by this change.
Another suggestion is reduce error level in compiler. Right now I see that you have makefile with very aggressive setting (-Werror) that probably will not allow compiling OXC. In long run all this warnings should be fixed but is not your job to do this. Ignore it and try get AFAP working binary.

Thanks for the tip.

But now I have a big problem: no execinfo.h and no *backtrace* function in devKitPro environ.
Must i stub them?

  CXX    src/Engine/openxcom-CrossPlatform.o
src/Engine/CrossPlatform.cpp: In function 'void OpenXcom::CrossPlatform::stackTr
ace(void*)':
src/Engine/CrossPlatform.cpp:997:49: error: 'backtrace' was not declared in this
 scope
  size_t size = backtrace(array, MAX_STACK_FRAMES);
                                                 ^
src/Engine/CrossPlatform.cpp:998:48: error: 'backtrace_symbols' was not declared
 in this scope
  char **strings = backtrace_symbols(array, size);
                                                ^
make[1]: *** [src/Engine/openxcom-CrossPlatform.o] Error 1
make[1]: Leaving directory `/c/Users/Utente1/Downloads/WIIdev/OpenXcom-master'
make: *** [all-recursive] Error 1