News:

SimuTranslator
Make Simutrans speak your language.

Upgraded Code

Started by transporter, February 19, 2014, 09:04:50 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

TurfIt

It's about as simple as can be. All the required libraries except SDL are already installed, eliminating the usual major pain.
1. Install XCode
2. Install the Command Line Tools - 'xcode-select --install'  (not sure needed for SDL2, they were for SDL1 else missing cocoa headers, but SDL2 isn't using the cocoa stub, but no harm installing anyway)
3. Checkout the source
4. Apply my patch from the Mac makefile improvement thread
5. Setup config.default
6. make
That's it. If you want the nightly translations, the distribute script works, but the part where it tries to create an .app doesn't.

transporter

I just downloaded X11 the other day..Now to see what I can do

BR84

What I have done:
1. Installed xcode5 incl. command line tools
2. Checkout the source fails in reason xcode5 always ask for password. Versions works fine without password. xcode5 has no repository manager anymore...:-(
3. checked out by Versions and added the files in xcode project
4. Added the the recommended patch from makefile improvement thread
5. Setup config.default fails ---- can activate SDL and MAC but no idea what are the other requested FLAGS to set or not

So far xcode always complains about "dataobj\koord3d.h" - no such file or directory. But is visible at left side structure. If try to fix, xcode ask for repository password again.

so far I am not successful.....but will work on it

An_dz

Quote from: BR84 on February 27, 2014, 04:26:55 AM
5. Setup config.default fails ---- can activate SDL and MAC but no idea what are the other requested FLAGS to set or not
The required are BACKEND, OSTYPE and COLOUR_DEPTH. I guess you need BACKEND=sdl2. The rest is optional.
You may also try MULTI_THREAD=1 later.

Ters

OPTIMIZE = 1 is probably also a good idea.

kierongreen

Quote from: An_dz on February 27, 2014, 05:09:02 PM
The required are BACKEND, OSTYPE and COLOUR_DEPTH. I guess you need BACKEND=sdl2. The rest is optional.
You may also try MULTI_THREAD=1 later.
MULTI_THREAD already defaults to 1, you should set to the number of cores your machine has if it's different to this.

Ters

Quote from: kierongreen on February 28, 2014, 06:58:00 AM
MULTI_THREAD already defaults to 1, you should set to the number of cores your machine has if it's different to this.

In my experience, multithreading (as Simutrans currently does it) isn't needed, so the usefulness of doing this varies from computer to computer apparently.

kierongreen

Multithreading significantly speeds up rendering, switching to/from underground view and map rotation.

TurfIt

Quote from: kierongreen on February 28, 2014, 06:58:00 AM
MULTI_THREAD already defaults to 1, you should set to the number of cores your machine has if it's different to this.
Not any more... threads= in simuconf.tab should be set to number of cores. MULTI_THREAD=1 in makefile enables threading at all.


Quote from: Ters on February 28, 2014, 08:09:30 AM
In my experience, multithreading (as Simutrans currently does it) isn't needed, so the usefulness of doing this varies from computer to computer apparently.
Higher resolutions (>1920x1200) are really annoying/bordering unplayable without the multithreaded rendering.

Ters

Quote from: TurfIt on February 28, 2014, 11:42:03 AM
Higher resolutions (>1920x1200) are really annoying/bordering unplayable without the multithreaded rendering.

Maybe, but 1920x1080 runs smooth as anything for me, except at when zoomed far out, something I never do anyway as things are too tiny to see. It is also said that Simutrans suffers badly when compiled as 64-bit rather than 32-bit since the hand optimized assembly code won't be used, but I am no longer the only one to have played 64-bit Simutrans without problems.

Quote from: kierongreen on February 28, 2014, 11:01:16 AM
Multithreading significantly speeds up rendering, switching to/from underground view and map rotation.

Map rotation I can understand, but I never use that feature. I'm not comfortable with how it's implemented. It's too fragile for my taste. But this has been discussed before, and showing the map from different angles without actually changing the map to face that way is currently virtually impossible.

My point is that there is no need to start tweaking MULTI_THREAD for personal builds unless you notice that Simutrans still doesn't perform well enough.

BR84

Folks, thanks for your kind advices & support.
Just detected there is something more than using xcode only. So far I need to get allegro installed and running, but not sure if I am going with MacPorts or homebrew for this...
Time to time I'll keep working on it.
If it is successful done I'll summarize it for other newbies trying to make ST running on OSX.

Ters

You shouldn't need Allegro unless you prefer that over SDL. I think the Allegro support in Simutrans is only for Haiku or something.

BR84

The build in xcode always come with allegro.h missing error - the allegro header is called by allegroo.cc in sound folder

TurfIt

If you're trying to compile from some sort of IDE, you're on you own. But, you appear to be adding too many files. See the makefile for what files should be included for the various OS and backend options. i.e. You don't compile every file in the source.

The steps I listed above are for compiling from the command line using the makefile. The only sensible way IMHO.

BR84

Got lost for few months in company projects and lot of travelling.
Now is more time to care about ST again, but noticed that "svn://tron.homeunix.org/simutrans/simutrans/trunk --username anon" will not work anymore. Did not follow up complete now.
What is actually the working checkout command?
Also the exact make command incl. parameters to know would be very helpful.
I am not programmer even joined some courses about. But this has been 25 years ago ;-)
In fact I am working with MacBook Pro (early 2011 series) and think it should be possible to follow up al the advices above.
Once I get it working, it shall be possible to provide a working OSX release (with better performance than the cross compiled one) at least once a month, always related to the latest nightly.
I am offering my support in this way, please help to make it happen.

Ters

Quote from: BR84 on September 14, 2014, 08:46:44 AM
Now is more time to care about ST again, but noticed that "svn://tron.homeunix.org/simutrans/simutrans/trunk --username anon" will not work anymore.

The documentation was upgraded long ago: http://www.simutrans.com/en/develop#code If you already have checked out, and even modified, some code, the exact SVN command for switching was posted on the forum somewhere. It was long ago, so it has probably dropped very far down in the topic lists.

Quote from: BR84 on September 14, 2014, 08:46:44 AM
Also the exact make command incl. parameters to know would be very helpful.
[...]
In fact I am working with MacBook Pro (early 2011 series)

I think building for Mac is a special thing, at least for the native builds. There is also how to make sure you have the libraries Simutrans needs installed, which is slightly different between native build and SDL build. You'll have to wait for some Mac developer to come through for that. I can't help you there.

BR84

Thanks for fast answer! Found the switch thread.
Sudo svn checkout svn://tron.yamagi.org/simutrans works fine for me. checked out V7318 by today.
Changes advised by TurfIt also ok. Config setup done.
Now dealing with make command. hope one Mac developer can give some additional suggestions to createnative 32bit Simutrans.app

prissi

I think Timothy had once a native patch but sadly it was not complete and hence not source for it.

In principle, not much is needed. Elementary events need to be processed and the graphics need to be copied to the screen using a blitter.