Attnam / ivan

Iter Vehemens ad Necem - a continuation of the graphical roguelike by members of http://attnam.com
GNU General Public License v2.0
301 stars 43 forks source link

Don't drop containers after tasting unless empty #546

Closed andrewtweber closed 5 years ago

andrewtweber commented 5 years ago

Might fix #545. My SDL is broken so I can't compile and test yet.

andrewtweber commented 5 years ago

I think there may be a problem with building on OSX. I've tried on both my work and home computers. The game compiles but then the main menu screen is just plain black. Didn't used to have this problem.

Can somebody please compile and test my PR? And "squash" when you merge.

Test cases that I wanted to try are:

ryfactor commented 5 years ago

Can somebody please compile and test my PR? And "squash" when you merge.

I compiled your branch and ran it. I get the normal menu screen on boot-up so I'm unable to reproduce the black screen error. I do however observe more of the problems described in #535. Like if I save the game and flee, I get a glitchy transition back to the menu. I wonder if it is related...

andrewtweber commented 5 years ago

@fejoa were you able to test the taste fix?

jakwings commented 5 years ago

All tested OK.

Is the pre-compiled sdl libraries from Homebrew not compatible with your macos?

andrewtweber commented 5 years ago

I have no idea what's going on with SDL or ivan. When I run on my work computer I get the black main menu and this console output:

Class SDLApplication is implemented in both /usr/local/opt/sdl2/lib/libSDL2-2.0.0.dylib 
(0x10c7e31c0) and /Library/Frameworks/SDL2.framework/Versions/A/SDL2 (0x10c6b1680). 
One of the two will be used. Which one is undefined.

plus several more similar errors for different SDL classes. When I deleted the files in /usr/local/opt/sdl2 the game won't run because Library not loaded: /usr/local/opt/sdl2/lib/libSDL2-2.0.0.dylib.

But when I delete /Library/Frameworks/SDL2.framework the game won't run because Library not loaded: @rpath/SDL2.framework/Versions/A/SDL2

So I guess it's using both.... at the same time.....

On my home computer I don't get the above errors but the main menu is still black.

jakwings commented 5 years ago

Looks like an issue about cmake. If a clean build does not help and otool -L $BIN_PATH_OF_IVAN shows both libraries, then we can discuss it in a new issue.

andrewtweber commented 5 years ago

Yep I have tried cloning the repo fresh, still have the same issue.

Here is the output of otool. Kind of weird that SDL is the only one with @rpath, not sure what that means?

/usr/local/bin/ivan:
    /usr/local/opt/pcre/lib/libpcre.1.dylib (compatibility version 4.0.0, current version 4.10.0)
    /usr/local/opt/sdl2_mixer/lib/libSDL2_mixer-2.0.0.dylib (compatibility version 3.0.0, current version 3.0.0)
    /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 23.0.0)
    @rpath/SDL2.framework/Versions/A/SDL2 (compatibility version 1.0.0, current version 8.0.0)
    /usr/local/opt/libpng/lib/libpng16.16.dylib (compatibility version 52.0.0, current version 52.0.0)
    /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
    /System/Library/Frameworks/CoreMIDI.framework/Versions/A/CoreMIDI (compatibility version 1.0.0, current version 69.0.0)
    /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio (compatibility version 1.0.0, current version 1.0.0)
    /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1560.12.0)
    /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 400.9.4)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.200.5)
jakwings commented 5 years ago

It seems you have sdl2 and sdl2_mixer in homebrew cellar, but not both SDL2.framework and SDL2_mixer.framework in /Library. cmake found SDL2.framework but didn't found SDL2_mixer.framework, so it used libSDL2_mixer.dylib from homebrew cellar which is not compatible with the framework. Solution is to installed SDL2_mixer as well. I'll also add a small check in FindSDL2.cmake.

https://www.libsdl.org/projects/SDL_mixer/

https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/RPATH-handling

https://developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/RunpathDependentLibraries.html#//apple_ref/doc/uid/TP40008306-SW1

andrewtweber commented 5 years ago

On my home computer i was actually missing both frameworks. I installed it and I no longer have the black screen of death! I'll have to check my work computer on Monday

AquariusPower commented 5 years ago

missing both frameworks

and still ran? sounds like some better pre-compilation check could be added if I am not wrong (xD) the sdl mixer was added to let the sfx work

andrewtweber commented 5 years ago

Thanks @iology , with the frameworks it's now working on both computers!