-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
amigaos4 build #21
Comments
The FindSDL2.cmake should be provided by the system. I can probably find one if needed, there are many floating around on the net. For the xinerama and xrandr library stuff, I'll check. There are not needed and it should not require them, so I guess I have some more work to do on the CMake build project... |
Latest commit should have fixed the XINERAMA and XRANDR issue (not the FindSDL2 issue). |
Yeah , xiNERAMA and XRANDR gone. For FindSDL2 i just commented out at moment in main CmakeFile.txt FIND_PACKAGE(SDL2 REQUIRED) , as in geneal all it will do it probabaly just find the path where includes and link library placed ? If so, that not big deal there imho. I also have expected warning about : ADD_LIBRARY called with SHARED option but the target platform does not support dynamic linking. Building a STATIC library instead. This may lead to problems. But that probably harmless for me, as i of course will use static ones. Then i type "make" and compilation starts. It compile for me first GameEntityLib.a , then start to compile GameRunTimeLib, and fail on the friking-shark-master/GameRunTimeLib/PlatformDependent.cpp , with the words: GameRunTimeLib/PlatformDependent.cpp: In function 'unsigned int GetTimeStamp()': GameRunTimeLib/PlatformDependent.cpp:318: error: 'GLOB_ONLYDIR' was not declared in this scope Will check now what is do, and how it can be replaced. Also dunno if there is needs for "GameRunTimeLib" if i will build static version .. |
The |
Ok, I have pushed some changes, with an AMIGAOS4 in the cmake, and alternative code for that function. |
First error with CLOCK_MONOTIC was becase of pandora change, there is even "if/else" for old version, so i enable that one for os4. As for error for "GLOB_ONLYDIR" not being declared :: didn't find it in my GLOB.h at all, so probably too old newlib for me and i currentlyy just "dummied" it from glob.h found in google, like : # define GLOB_ONLYDIR (1 << 13). But that will of course not works as should, but at least object compiles for the moment. Then all continue to builds without single warning (strange!) and compile all those libs for me: And then when start to build GameEngine, fail with words: make[2]: *** No rule to make target 'libgl4es.a', needed by 'Demo/Bin/Release/GameEngine'. Stop. Is that one which i provide for cmake , via : -DOPENGL_gl_LIBRARY="libgl4es.a" \ Maybe that directive is not what build sytem want .. |
Ah its already tried to link binary GameEngine ! Strange, it was only 50% complete of all compilation.. So, with that line i almost compile that binary: ppc-amigaos-g++ -static CMakeFiles/GameEngine.dir/GameEngine/GameEngine.cpp.obj CMakeFiles/GameEngine.dir/GameEngine/StdAfx.cpp.obj -o Demo/Bin/Release/GameEngine GameGUILib/libGameGUILib.a GameRunTimeLib/libGameRunTimeLib.a VectorLib/libVectorLib.a GameEntityLib/libGameEntityLib.a libGameRunTime.a -lpng12 -lopenal libSDL2.a libgl4es.a GameGUILib/libGameGUILib.a GameRunTimeLib/libGameRunTimeLib.a VectorLib/libVectorLib.a -lglob -lpthread -stdc++ -lz Through have those errors: SystemModule.cpp:(.text+0x17e4): undefined reference to I anyway build all statically, dunno what it tryes to do, but probabaly i can comment that part out ? |
Yeah, all those dlopen/dlsym/dlclose are for the dynamic lib system. |
But probabaly i need it only when i use .so , but while i build everything statically, i can just comment everything related to "dl*" out, and it should have no impacts on ? Btw, is there few binaries should be? That one which called "GameEngine" compiles on 50% of whole process, so seems there few binaries ? |
Some of the other .so are dynamic and independant, and are supposed to be loaded at runtime by GameEngine using that SystemModule... That's why they are not linked to GameEngine. |
So.. that mean once 50% is done, we have ready GameEngine.exe, and then, another 50% will be .sobjes. |
So i just comment out at moment all "dlopen/dlclose/dlsym/dlerror" in that systemmodule.cpp (just to deal before with everything else, and to have final binaries, libs, etc). For that i only change in the build/CMakeFiles/GameEngine.dir/link.txt linking line on my one: So it links fine, and continue to compile next stuff, and fail in the GameGraphics/Glee.c , as it has include of gl.h and glx.h , and there is all messes up with errors, because of x11. Probablyy there also needs some SDL2 based changes ? |
Fixed GameGraphics/Glee.h by commenting out #include <GL/glx.h> and line 16546: So, after that have just few errors from GLee.c itself , saying that Display and Dpy undeclared, so at the line 15936 i also doing that: #elif defined(APPLE) || defined(APPLE_CC) || defined(amigaos4) Then Glee.cpp compiles. Then time of OpenGLFont.h, cry about XFontStruct and Display.. and there i think its already need SDL2 changes in those files .. |
Mmmm, XFontStruct, I'll see what I can do. |
Ok @kas1e it should be fixed now with latest commit. |
So , i was able to test latest revision , and yeah ! Everything builds till 100%. And, i also had to comment out include of glu.h , and instead implemnt those fucntions: First 2 i just copy from mesa code:
Third one, in the GameGraphics/OpenGLTexture.cpp:220, i replace like you show in prototype:
But gluProject/gluUnProject i currently comment out as dunno how to replace them, but that imho at moment not so matter. So, in end of all, i have in my build directory bunch of .a files (as cmake at begining says me that can't create shared objects, and create static ones already). So.. I need probably to get rid of systemmonitor.cpp probabaly and somehow made main binary think that all functions should't be taken from external modules, but from internal, and then , link that exe with all the .a files i have. |
Ok, I'll look at that later, see if I can make a static build of everything... |
So, I have added a |
For GLU stuff, I suggest you build the lib. Look here https://github.com/ptitSeb/GLU it should not be too difficult to build as a static lib. |
Awesome ! Yeah, probably i should go for your GLU, as it quite offten happen to need. But at moment to test friking-shark static build, can comment out those parts as usuall, just to try to deal with static build. For first, when i run CMAKE, with AMIGAOS4=ON, it still bring some errors like :
And so on for all others (as it was before), but i think it is harmless as we know what we do. Then, i start compile things, and it compiles till 50% , then it want to do Linking CXX executable Demo/Bin/Release/GameEngine , and it still include libGameRunTime.a , and that one scream about dlopen/dlclose/dlsym and co. |
You need to use also |
As yep, just checked at top of Cmakefile before that there is it , and was thinking it enabled for AMIGAOS4 :) So, trying with STATIC_BUILD=ON : cmake not scream about dynamic, all is fine, compilation going on and on, i only had to comment out GLU parts (for testing now), and all compiles till final 100% and links ! Yeaho ! Now, if i understand things right, there is relevant data files for game: Capturas Now when i trying to run it like this, i have:
Usuall stuff with pathes :) I just tried manually to set in the GameEngine/GameEngine.cpp
And then that what i have :
So it going quite a lot , show us that in the sound module also need to deal with "./" thing , but then, after that it crashes anyway :( Crashlog looks like this:
I.e. it crashes in warp3dlibrary in end, but is that one guilty there ? (probabaly yes, as usuall). But anyway we pretty far already , cool :) I even didn't expect it will start loading but will crashes instead right at begining :) |
It even maybe crashes because i comment out some glu parts .. Oh, after ignoring of that crash (it is not fatal one, can be ignored), game actually starts, i can see menu. Can choice start game, and have 5 levels to choice, but i can't choice any of them, does not matter how hard i press by mouse button on them. But firstly will try to deal with sounds pathes |
You cannot choose menu item because you commented ou |
The crash you have on |
It seems i also need to patch data script files : they use ./ in configs, so even after i fix all pathes in the code itself, it still fail to load, so i had to delete all "./" in the most of Resource/Scripts/*.cfg files. After that sound loads , but , it also have some distortion, so i had a look if game use ov_read() and yep, its here in the SoundType.cpp. But probabaly we should not use in those cases |
I mean:
|
Ah yes, ok, I'll do that tomorrow. |
As for your libglu : maybe i didn't got something, but i just download it, configure; make , and everything done. Then i grab some test case from net which use sdl2 + gl + glu , and compile it via sdl2+gl4es+that_glu , and all works. Is it expected to be like that, without needs for anything else ? Anyway, i then put back all commented glu parts from the friking shark, and build it with your glu library, and sadly i still can't press on the levels. I mean sound is there , i move mouse over it, but click doing nothing.. But i also see in the console output, that one shader fail to compile because of nova. So maybe that can be issue ? |
So GLU built without issue? Good (and yeah, nothing more, build it, link it and that it). Now, why would the mouse selection wont work? I have to analyse how the it work, strange, but I don't think the shader issue can be the reason for that. |
Ok, so I fixed the issue. But it was bigger than what I expected. In fact, the Context was not destroyed before (that's why the memory leaks were always there). Because of a typo. That typo made the DestroyState function doing nothing when some optimisation level was present, and crashing with no optim... So all is fixed, and GLState are cleaned from memory now. I hope nothing is broken, in case some game/aps do some GL Cleaning AFTER destroying the GL Context (friking-shark was doing that for textures, so I already added a failsafe there). |
Cool ! I will check it with Barony, Prototype and FrickingShark now. |
Just to be sure: its is probabaly can't be related to any other issues , only on "free on exit" ones ? |
Failed to build src/glx/glx.c: |
:( of course. I'll fix that. |
Should be fixed now. |
Seems still nope, probabaly on line 144 , of glx.h , should be |
While error in glx.h with N is for sure there , that warning maybe was there even before. There is full output about that warning:
|
I fixed the mistake, and the warning. |
Aha ok Will check now prototytpe, barony and q3 just to see that all is ok and the same as before |
And yep, latest commit make build of everything be warning free and 100% compiles out of box :) Cool ! |
Seems something changes with context still. Now, when i trying to change screenmodes (which mean delete and create of context), be it Q3, or Barony, i have a crash in the glClear call, which i have inside of the OS4_SDL_CreateContext() function, which i call right after:
And then going:
And so glClear crashes. But, it crashes only when it delete and then create context, at first run it didn't crash. |
You need to call
|
Aha will check now. But as it works before like this, it mean context wasn't deleted indeed ! |
Yeah, that way it works! |
Ok Good. Did you notice less memory/ressources leak? |
For sure there no gfx leaks (but it was like this once we deal with agldestroycontext() inside of sdl2's OS4_GL_DeleteContext() ). Didn't checked ram leaks, but it for sure not worse visually. |
If I remember correctly, the leaks were with Barony, right? |
Not only, with prototype as well. But now all good. I think we need to release fricking shark as it too, and when any from list (f4 crash, real shaders will works, gl4es will have precompiled shaders, gl4es will have support for texture shadows), then we can made an update. I will try to desribe those pauses at best, so maybe all will be fine. Btw, is real shaders from games which have them, transfered tranparently via gl4es as it, or they recompiles too ? What i mean is if real shader have usage of arrays, then after it go through gl4es it still have arrays ? |
gl4es transform the shaders, always. It will try to remove arrays, but not too hard. You can try with "LIBGL_NOTEXARRAY=1" to force gl4es to try using less texture array, but it may not work.. |
Aha will check, thanks. Because error we have with real shaders because of bug in arrays support, so if gl4es can generate from real fricking sharks which has arrays shaders without arrays : it may do the trick |
By "it may not work" you mean generated shader withoud arrays will works wrong, or not works at all ? |
It may not work at all, with an error during link of the shaders. But you can try, you will have the awnser quickly. |
Yeah, tried alraeady and it fail, just asking to be sure :) It fail with words:
I can check if it gl4es generate wrong shader (via glslangvalidator) , or w3dnova fail again, if there is needs (i mean if you want to be sure that LIBGL_NOTEXARRAY works there) |
Well, |
Btw, one of testers mention there is no joypad support (while in prototype support is there). Is it matter of just adding sone flag to SDL, or some new code has to be added ? |
There is no joystick code currently in friking shark. But using the SDL2 Gamecontroler interface, I might add something in an not to complicated way. Can you try the joystick code in HydraCastleLabyrinth: build an SDL2 version, I plan to reuse that Gamecontroler code I wrote for this game. |
Cool , ok, will try to build HydraCastleLabyrinth firstly (and if you doesnt mind, as usuall will create a topic in that repo for aos4 build if it will be not straight-forward build ?) |
Btw, you maybe in interst, one of Poland's amiga website made an article about frickingshark and prototype releases , if you in interest to read english version there is:
Sadly author don't call the names , but concetrate instead on the games only, but still, interesting to read :) |
Ah, that look like a nice article. I'll read that, thanks :) |
Hi !
Tried to build SDL2 version for amigaos4 , and tryint to use CMAKE as i am on crosscompiler, so can use that one.
That what i tried:
cd friking-shark-master
mkdir build
cd build
cmake
-DCMAKE_SYSTEM_NAME=Generic
-DCMAKE_SYSTEM_VERSION=1
-DSDL=ON
-DCMAKE_C_COMPILER="/usr/local/amiga/bin/ppc-amigaos-gcc"
-DCMAKE_CXX_COMPILER="/usr/local/amiga/bin/ppc-amigaos-g++"
-DCMAKE_LINKER="/usr/local/amiga/bin/ppc-amigaos-ld"
-DCMAKE_AR="/usr/local/amiga/bin/ppc-amigaos-ar"
-DCMAKE_RANLIB="/usr/local/amiga/bin/ppc-amigaos-ranlib"
-DCMAKE_FIND_ROOT_PATH="/usr/local/amiga/ppc-amigaos/"
-DZLIB_INCLUDE_DIR="/usr/local/amiga/ppc-amigaos/SDK/Local/common/include/"
-DZLIB_LIBRARY="/usr/local/amiga/ppc-amigaos/SDK/Local/newlib/lib/libz.a"
-DPNG_PNG_INCLUDE_DIR="/usr/local/amiga/ppc-amigaos/SDK/Local/common/include/libpng12/"
-DPNG_LIBRARY="/usr/local/amiga/ppc-amigaos/SDK/Local/newlib/lib/libpng12.a"
-DOPENGL_gl_LIBRARY="libgl4es.a"
-DOPENAL_LIBRARY="/usr/local/amiga/ppc-amigaos/SDK/Local/newlib/lib/libopenal.a"
-DOPENAL_INCLUDE_DIR="/usr/local/amiga/ppc-amigaos/SDK/Local/common/include/AL/"
-DTIFF_INCLUDE_DIR="/usr/local/amiga/ppc-amigaos/SDK/Local/common/include/"
-DTIFF_LIBRARY="/usr/local/amiga/ppc-amigaos/SDK/Local/newlib/lib/libtiff.a"
-DJPEG_INCLUDE_DIR="/usr/local/amiga/ppc-amigaos/SDK/Local/common/include/"
-DJPEG_LIBRARY="/usr/local/amiga/ppc-amigaos/SDK/Local/newlib/lib/libjpeg_8b.a"
..
It the says :
CMake Error at CMakeLists.txt:21 (FIND_PACKAGE):
By not providing "FindSDL2.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "SDL2", but
CMake did not find one.
Could not find a package configuration file provided by "SDL2" with any of
the following names:
Add the installation prefix of "SDL2" to CMAKE_PREFIX_PATH or set
"SDL2_DIR" to a directory containing one of the above files. If "SDL2"
provides a separate development package or SDK, be sure it has been
installed.
-- Configuring incomplete, errors occurred!
I tried to remove from CMakeList.txt : FIND_PACKAGE(SDL2 REQUIRED) (as i will link everything manually at end anyway), so , it then cry about non possibility to build shared versions and will use static instead (that ok), but then at end:
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
XINERAMA_LIBRARY
linked by target "GameGraphics" in directory /d/friking-shark-master
XRANDR_LIBARY
linked by target "GameGraphics" in directory /d/friking-shark-master
-- Configuring incomplete, errors occurred!
I probably can set them to some void nulls , but probably they need to be removed from CMake if "-DSDL=ON" is used ?
The text was updated successfully, but these errors were encountered: