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 - Game starts, doesn't load #23

Open
gustafbstrom opened this issue Jul 4, 2019 · 16 comments
Open

Mac OS - Game starts, doesn't load #23

gustafbstrom opened this issue Jul 4, 2019 · 16 comments

Comments

@gustafbstrom
Copy link

There's a weird problem when starting the game right after compilation, where the binary starts and the window comes up, but nothing loads inside. I remember that I successfully compiled + ran the game some while ago, but now it seems like it just freezes. I compiled it using Apples clang++ compiler, with libraries from homebrew. I also had to change the TARGET_LINK_LIBRARIES variable in the "CMakeLists.txt" file by appending the original line with: -L/usr/local/lib -lSDLmain -lSDL -lpng.

See attached screenshot. The CPU works at ~20% utilization. Any ideas about what might be going on?

image

@ciplogic
Copy link
Owner

ciplogic commented Jul 5, 2019

Hi, I think it is done by newest versions of macOS which broke SDL 1.2.

I don't have now a Mac. Can you try to build a SDL 1.2 app with graphics and say if it works?

@gustafbstrom
Copy link
Author

gustafbstrom commented Jul 5, 2019

I just compiled some example code from this guy's SDL2 tutorial page. Worked fine. Is that example good enough?
image

@ciplogic
Copy link
Owner

ciplogic commented Jul 8, 2019

SDL 1.2 and SDL 2 are two different underlying implementations. One uses mostly CPU buffers for images, SDL 2 uses textures/OpenGL.

If you feel like, you can port the SDL 1.2 to 2.0 and I will be happy to accept contributions.

@ciplogic
Copy link
Owner

ciplogic commented Jul 8, 2019

There was an open issue for requesting help in exactly this area:
#7

@rkurbatov
Copy link
Contributor

Did you copy every required file at the proper places? It requires data and maps folder, fheroes2.cfg, fheroes2.key and (non-mandatory) dejavusans.ttf which are put to the executable folder. I spent a half of day trying to run it under Linux :)

@gustafbstrom
Copy link
Author

Did you copy every required file at the proper places? It requires data and maps folder, fheroes2.cfg, fheroes2.key and (non-mandatory) dejavusans.ttf which are put to the executable folder. I spent a half of day trying to run it under Linux :)

Yes, all copied.

@gustafbstrom
Copy link
Author

gustafbstrom commented Jul 11, 2019

Addition: I re-installed the SDL libs (usinghomebrew). I also re-ran cmake on a clean repo pull. Difference: sound works fine, but still no graphical view.

@ihhub
Copy link
Contributor

ihhub commented Aug 21, 2019

Same for me. Such issue appears in original source code as well.

@ihhub
Copy link
Contributor

ihhub commented Aug 27, 2019

I took original source code from sourceforge and run with small modifications for SDL2. The game works as perfect with graphics and sound.

@kamiccolo
Copy link
Collaborator

kamiccolo commented Aug 27, 2019

Mhm. That is weird. What exactly SDL versions are You running? Also, any chance of hooking the debugger and/or tracer on and checking what's actually happening beneath? Also, what's exact version of MacOS You're using?

@kamiccolo
Copy link
Collaborator

Also, have You tried resizing/minimazing/dragging the blank Window? Some time ago there were reports of libsdl behaving weird on some Apples until forced action.

@ihhub
Copy link
Contributor

ihhub commented Aug 28, 2019

I'm on MacOS Mojave (10.14.6), I use SDL 2 library (not SDL 1.2). Resizing for SDL 1.2 doesn't help while with SDL 2 it works as charm.

@ihhub
Copy link
Contributor

ihhub commented Aug 28, 2019

I mention again: I'm running original fheroes2 from sourceforge.

@ciplogic
Copy link
Owner

The original FHeroes2 was working full of visual glitches on my machine so I had to drop it. If you know how to fix by porting the code to SDL 2, please do so. I would love if our codebase can support SDL2 nicely as SDL 1.2 is quite old and it looks that it is unsupported on newer MacOS.

@gustafbstrom
Copy link
Author

gustafbstrom commented Oct 4, 2019

@ciplogic After some fooling around with CMake and such I finally got to compile it and it seems to work fine. Rather slow before getting to the main menu after starting, but working nonetheless.
Can you give some reproducible example of what glitches you are referring to? I don't see any problems so far.

@ciplogic
Copy link
Owner

Can you make a branch to test it online? Clone it locally and push the code somewhere. Make a copy of the SDL2 dlls (if you use Windows), so maybe we can base the code on SDL2 if it is just slower

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants