Allegro.cc - Online Community

Allegro.cc Forums » Allegro Development » Factorio is not working on the new OS X Yosemite

Credits go to lordnoriyuki and Trent Gamblin for helping out!
This thread is locked; no one can reply to it. rss feed Print
Factorio is not working on the new OS X Yosemite
kovarex
Member #14,203
April 2012

We are getting a lot of reports like this, do anyone know how to fix it?

http://www.factorioforums.com/forum/viewtopic.php?f=7&t=6159

www.factorio.com - a factory building game.

Trent Gamblin
Member #261
April 2000
avatar

I don't know but I'm concerned about my own games now. I'm going to install Yosemite and take a look.

EDIT: My games don't work either. Going to have to be fixed at some point SOON.

lordnoriyuki
Member #15,771
October 2014

It looks like 10.10 triggers a resize on the view when the OpenGLContext is set.

In macosx/osxgl.m (around line 908 or something):

Move this code:

#SelectExpand
1 /* Hook up the view to its display */ 2 [view setAllegroDisplay: &dpy->parent];

Above this line:

#SelectExpand
1 [view setOpenGLContext: dpy->ctx];

So the new code looks like:

#SelectExpand
1 /* Hook up the view to its display */ 2 [view setAllegroDisplay: &dpy->parent]; 3 [view setOpenGLContext: dpy->ctx]; 4 [view setPixelFormat: fmt]; 5 // moved hook up from here

This fixed the problem for me.

Trent Gamblin
Member #261
April 2000
avatar

Thanks a lot, I'll check it out and if it works I'll commit the fix to git.

EDIT: Fix committed.

kovarex
Member #14,203
April 2012

Hello, thank you for the help, it is appreciated a lot!
I included the change into our new version.

www.factorio.com - a factory building game.

Ingo Maurischat
Member #14,951
February 2013

Hello

Today I did the Update to Yosemite.

The Program crashed and Xcode shows this line. ( 311 ) in osxgl.m

if (dpy->tracking) { -- Thread1: EXC_BAD_ACCESS

in the following function

/* reshape

  • Called when the view changes size */

- (void) reshape
{
if ([NSOpenGLContext currentContext] != nil) {
ALLEGRO_DISPLAY_OSX_WIN* dpy = (ALLEGRO_DISPLAY_OSX_WIN*) dpy_ptr;
NSRect rc = [self bounds];
glViewport(0, 0, NSWidth(rc), NSHeight(rc));

glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0, NSWidth(rc), NSHeight(rc), 0, -1, 1);

if (dpy->tracking) {
[self removeTrackingArea: dpy->tracking];
dpy->tracking = create_tracking_area(self);
[self addTrackingArea: dpy->tracking];
}
}
}

I downloaded the latest Version from git with "lordnoriyuki's" fix

Any idea ??, help would be appreciated
Greatings,
Ingo

Trent Gamblin
Member #261
April 2000
avatar

Make sure you're really using the updated code. That's about all I can think of, because it looks like the same error.

Ingo Maurischat
Member #14,951
February 2013

Thanks Trent for your answer.

I tried a complete rebuild with

git clone git://git.code.sf.net/p/alleg/allegro
cd allegro
git checkout 5.0
mkdir build
cd build
cmake -DSHARED=0 ..
make
sudo make install

But this doesn't help, same error. Are you using shared or static libs?

Elias
Member #358
May 2000

Use 5.1 not 5.0.

--
"Either help out or stop whining" - Evert

Ingo Maurischat
Member #14,951
February 2013

Elias, thanks a lot, now it works.

Chris Katko
Member #1,881
January 2002
avatar

Before this thread, I never realized Factorio ran on Allegro. I might buy it just for that reason. 8-)

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs
"Political Correctness is fascism disguised as manners" --George Carlin

Go to: