Skip to content
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

Mac OS X port #87

Open
kode54 opened this issue Mar 31, 2014 · 22 comments

Comments

Projects
None yet
6 participants
@kode54
Copy link

commented Mar 31, 2014

It would be really neat if this could also be ported to Mac OS X. I'm not sure what help I could be in that effort, though.

@jeremiah-sypult

This comment has been minimized.

Copy link

commented Apr 1, 2014

I did some work in an attempt to move this forward, thanks to RBDOOM-3-BFG:

https://github.com/jeremiah-sypult/DOOM-3-BFG

It compiles and launches, but audio & video rendering do not work. Based on blind input control after launching, the console output appears to load the game data and run. The audio is merely stubbed out at the moment. The OpenGL rendering is incompatible on OS X mainly due to the fact that DOOM-3-BFG uses a OpenGL 3.2 compatibility profile, which is not supported at all on OS X (only the Core profile is supported). In order for it to ever run on OS X, the compatibility bits of the renderer would have to be rewritten to use core profile (including the GLSL shaders, which produce errors during compilation).

Unfortunately, the required renderer changes are outside of my programming skills...

@JanSimek

This comment has been minimized.

Copy link

commented May 18, 2014

Oh man, I don't know how to use Github. I wanted to link my pull request to this issue, but it created another one instead - #117

Works only with SDL 2 obviously.

RobertBeckebans added a commit that referenced this issue May 20, 2014

@RobertBeckebans

This comment has been minimized.

Copy link
Owner

commented May 20, 2014

Nice I'm going to test this at the weekend.

@JanSimek

This comment has been minimized.

Copy link

commented May 20, 2014

I am not sure if I should submit a new ticket for the following error, but since no one else is complaining, it is probably OS X specific.

When taking the elevator from Mars City to Underground, game throws me back into the main menu with the following error:

idSoundSample_OpenAL::CreateOpenALBuffer: error loading data into OpenAL hardware buffer

As a temporary workaround I changed that error in AL_SoundSample.cpp into a warning and was able to play further without any problems.

https://gist.github.com/JanSimek/5e2fa26f7d4771236f29

@DanielGibson

This comment has been minimized.

Copy link

commented May 20, 2014

Apple's OpenAL is known to suck, you should try openal-soft:
http://kcat.strangesoft.net/openal.html
(but turning that into a warning still makes sense IMHO)

RobertBeckebans added a commit that referenced this issue May 20, 2014

Merge pull request #120 from JanSimek/master
Replaced MACOS_X define with standardised __APPLE__. #87
@kode54

This comment has been minimized.

Copy link
Author

commented May 21, 2014

And now, with this latest commit, I get this error while attempting to compile:

[ 12%] Building CXX object CMakeFiles/RBDoom3BFG.dir/framework/Common.cpp.o
In file included from /Users/Chris/Source/Repos/RBDOOM-3-BFG/neo/framework/Common.cpp:41:
In file included from /Users/Chris/Source/Repos/RBDOOM-3-BFG/neo/idlib/../framework/../../doomclassic/doom/doomlib.h:35:
In file included from /Users/Chris/Source/Repos/RBDOOM-3-BFG/neo/idlib/../framework/../../doomclassic/doom/doominterface.h:35:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/string:437:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/cstdio:143:9: error: 
      no member named 'use_idStr_snPrintf' in the global namespace
using ::snprintf;
      ~~^
/Users/Chris/Source/Repos/RBDOOM-3-BFG/neo/idlib/Str.h:86:19: note: expanded
      from macro 'snprintf'
#define snprintf                use_idStr_snPrintf
                                ^
In file included from /Users/Chris/Source/Repos/RBDOOM-3-BFG/neo/framework/Common.cpp:41:
In file included from /Users/Chris/Source/Repos/RBDOOM-3-BFG/neo/idlib/../framework/../../doomclassic/doom/doomlib.h:35:
In file included from /Users/Chris/Source/Repos/RBDOOM-3-BFG/neo/idlib/../framework/../../doomclassic/doom/doominterface.h:35:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/string:437:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/cstdio:153:9: error: 
      no member named 'use_idStr_vsnPrintf' in the global namespace
using ::vsnprintf;
      ~~^
/Users/Chris/Source/Repos/RBDOOM-3-BFG/neo/idlib/Str.h:88:20: note: expanded
      from macro 'vsnprintf'
#define vsnprintf               use_idStr_vsnPrintf
                                ^
2 errors generated.
make[2]: *** [CMakeFiles/RBDoom3BFG.dir/framework/Common.cpp.o] Error 1
make[1]: *** [CMakeFiles/RBDoom3BFG.dir/all] Error 2
make: *** [all] Error 2
@JanSimek

This comment has been minimized.

Copy link

commented May 21, 2014

Just to clarify, you were able to compile it before commit b8676a5?

@JanSimek

This comment has been minimized.

Copy link

commented May 21, 2014

OK, this happens when building with clang instead of gcc. There is no such thing as use_idStr_snPrintf or use_idStr_vsnPrintf, so removing those four lines from Str.h fixes the problem.

@DanielGibson

This comment has been minimized.

Copy link

commented May 21, 2014

I think the purpose of those lines is to tell people not to use snprintf
but to use idStr::snprintf() instead (on Windows snprintf() is
broken/insecure)

@JanSimek

This comment has been minimized.

Copy link

commented May 21, 2014

I added some objective-c code to replace those functions in linux_main.cpp which rely on procfs and it compiles fine with gcc, but when compiling this source file with clang I get this error:

error: Objective-C 1 was disabled in PCH file but is currently enabled

I have never seen it before and I can't google any useful info about it. Any ideas?

@DanielGibson

This comment has been minimized.

Copy link

commented May 21, 2014

PCH could be precompiled header

RobertBeckebans added a commit that referenced this issue May 22, 2014

Merge pull request #125 from JanSimek/objective-c
Replaced procfs dependent functions with native calls on OS X. #87
@ghost

This comment has been minimized.

Copy link

commented Jul 15, 2014

i've tried to compile it on os x 10.9.4 and got the following errors:

[ 99%] Building CXX object CMakeFiles/RBDoom3BFG.dir/Users/ozenbaken/RBDOOM-3-BFG/doomclassic/doom/i_sound_openal.cpp.o
Linking CXX executable RBDoom3BFG
Undefined symbols for architecture x86_64:
"_SDL_GetPrefPath", referenced from:
Sys_DefaultSavePath() in posix_main.cpp.o
"_SDL_free", referenced from:
Sys_DefaultSavePath() in posix_main.cpp.o
"_SDL_strdup", referenced from:
Sys_DefaultSavePath() in posix_main.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [RBDoom3BFG] Error 1
make[1]: *** [CMakeFiles/RBDoom3BFG.dir/all] Error 2
make: *** [all] Error 2

full log here: http://pastebin.com/vWCdC712

am i doing something wrong?

@JanSimek

This comment has been minimized.

Copy link

commented Jul 15, 2014

My fault. Compile it with SDL 2

@ghost

This comment has been minimized.

Copy link

commented Jul 15, 2014

with SDL2 it failed to compile too:

[ 99%] Building CXX object CMakeFiles/RBDoom3BFG.dir/Users/ozenbaken/RBDOOM-3-BFG/doomclassic/doom/i_sound_openal.cpp.o
Linking CXX executable RBDoom3BFG
Undefined symbols for architecture x86_64:
"_SDL_EnableKeyRepeat", referenced from:
Sys_InitInput() in sdl_events.cpp.o
"_SDL_EnableUNICODE", referenced from:
Sys_InitInput() in sdl_events.cpp.o
"_SDL_GL_SwapBuffers", referenced from:
GLimp_SwapBuffers() in sdl_glimp.cpp.o
"_SDL_GetVideoInfo", referenced from:
R_GetModeListForDisplay(int, idList<vidMode_t, (memTag_t)40>&) in sdl_glimp.cpp.o
"SDL_GetVideoSurface", referenced from:
GLimp_SetScreenParms(glimpParms_t) in sdl_glimp.cpp.o
"SDL_ListModes", referenced from:
R_GetModeListForDisplay(int, idList<vidMode_t, (memTag_t)40>&) in sdl_glimp.cpp.o
"SDL_SetGammaRamp", referenced from:
GLimp_SetGamma(unsigned short
, unsigned short
, unsigned short
) in sdl_glimp.cpp.o
"_SDL_SetVideoMode", referenced from:
GLimp_Init(glimpParms_t) in sdl_glimp.cpp.o
GLimp_SetScreenParms(glimpParms_t) in sdl_glimp.cpp.o
"_SDL_WM_GrabInput", referenced from:
GLimp_GrabInput(int) in sdl_glimp.cpp.o
"SDL_WM_SetCaption", referenced from:
GLimp_Init(glimpParms_t) in sdl_glimp.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *
* [RBDoom3BFG] Error 1
make[1]: *** [CMakeFiles/RBDoom3BFG.dir/all] Error 2
make: *** [all] Error 2

full log here: http://pastebin.com/FuqSDueg

@JanSimek

This comment has been minimized.

Copy link

commented Jul 15, 2014

Set SDL 2 include directory in CMake to /Library/Frameworks/SDL2.framework/Headers

@ghost

This comment has been minimized.

Copy link

commented Jul 15, 2014

now it compiles successfully, but the game runs without sound. game log says that sound system initialzed:

----- Initializing Sound System ------
Setup OpenAL device and context... Done.
OpenAL vendor: Apple Computer Inc.
OpenAL renderer: Software
OpenAL version: 1.1
OpenAL extensions: AL_EXT_OFFSET AL_EXT_LINEAR_DISTANCE AL_EXT_EXPONENT_DISTANCE AL_EXT_float32 AL_EXT_STATIC_BUFFER AL_EXT_SOURCE_NOTIFICATIONS
sound system initialized.

see the game log here: http://pastebin.com/qWK1DsKS

@ghost

This comment has been minimized.

Copy link

commented Jul 15, 2014

i've compiled game with openal-soft instead of apple's openal but with no luck. game log still says that sound system initialized:

----- Initializing Sound System ------
AL lib: (WW) UpdateDeviceParams: SSE performs best with multiple of 4 update sizes (1114)
Setup OpenAL device and context... Done.
OpenAL vendor: OpenAL Community
OpenAL renderer: OpenAL Soft
OpenAL version: 1.1 ALSOFT 1.15.1
OpenAL extensions: AL_EXT_ALAW AL_EXT_DOUBLE AL_EXT_EXPONENT_DISTANCE AL_EXT_FLOAT32 AL_EXT_IMA4 AL_EXT_LINEAR_DISTANCE AL_EXT_MCFORMATS AL_EXT_MULAW AL_EXT_MULAW_MCFORMATS AL_EXT_OFFSET AL_EXT_source_distance_model AL_LOKI_quadriphonic AL_SOFT_buffer_samples AL_SOFT_buffer_sub_data AL_SOFTX_deferred_updates AL_SOFT_direct_channels AL_SOFT_loop_points AL_SOFT_source_latency
sound system initialised.

see the game log here: http://pastebin.com/6U6dVcFR

@ghost

This comment has been minimized.

Copy link

commented Jul 16, 2014

i launched game with "+set developer 1 +set log file 2" params, game log here: http://pastebin.com/DxysUKap

can someone tell me what is wrong with the sound? does anyone got the same problem? is there any workaround?

@ghost

This comment has been minimized.

Copy link

commented Jul 24, 2014

my sound issue appears only if i launch the game as a root, not by other user. seems like there is a mess with some environment variables or something.

@DanielGibson

This comment has been minimized.

Copy link

commented Jul 24, 2014

Why would you launch the game as root? Don't do that..

@ghost

This comment has been minimized.

Copy link

commented Jul 24, 2014

it's because of my old habit, nevermind. thanks to everyone who make it possible to run the game on osx and everyone on this thread.

@tnull

This comment has been minimized.

Copy link

commented Sep 17, 2016

I experience the same error on macOS which @JanSimek described above:

When taking the elevator from Mars City to Underground, game throws me back into the main menu with the following error:

idSoundSample_OpenAL::CreateOpenALBuffer: error loading data into OpenAL hardware buffer

This error still crashes the game. How do I fix that? I installed openal-soft via homebrew and even manually force-linked it. However, CMake does not seem to pick it up:
-- Found OpenGL: /System/Library/Frameworks/OpenGL.framework

I also manually changed the Error into a Warning as temporary workaround, but this is not the only (but the only crashing) openal error I get.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.