HOWTO: Compile OpenTTD *without* DirectX SDK

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Post Reply
Valentijn
Engineer
Engineer
Posts: 118
Joined: 07 Nov 2007 10:04

HOWTO: Compile OpenTTD *without* DirectX SDK

Post by Valentijn »

Hello,

It's possible to compile OpenTTD without the DirectX SDK installed. The DirectX SDK is only used for game music, so you won't have that after compiling.

Step 1:

Install & configure Visual Studio 2008 express as usual (http://wiki.openttd.org/Microsoft_Visua ... s_Editions).

Skip everything related to the Direct X SDK!

Step 2:

Instruct the preprocessor to not include the code for Win32 music:

Remove WIN32_ENABLE_DIRECTMUSIC_SUPPORT from the preprocessor settings under project properties:
preprocessor.png
preprocessor.png (80.12 KiB) Viewed 3586 times
Step 3:

Remove the dxguid.lib from the additional input dependencies for the linker:
linker.png
linker.png (85.03 KiB) Viewed 3586 times
Step 4:

Compile as normal in Visual Studio.

Step 5:

Put the original gamefiles (http://wiki.openttd.org/Installation#Files_from_TTD) in bin\data e.g. c:\games\ottdsrc\0.7.5\bin\data.

Step 6:

Run/Debug the game!

EDIT: Fix typo (dxguid.lib)
Last edited by Valentijn on 24 Jan 2010 16:23, edited 1 time in total.
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: HOWTO: Compile OpenTTD *without* DirectX SDK

Post by Yexo »

Instead of step 5 you can also put the needed files in My Documents/OpenTTD/data/, that way they're shared by all your openttd installations and you don't have to copy them to every new installation.
petert
Tycoon
Tycoon
Posts: 3008
Joined: 02 Apr 2009 22:43
Location: Massachusetts, USA

Re: HOWTO: Compile OpenTTD *without* DirectX SDK

Post by petert »

Perhaps you could add those pictures/instructions to this wiki page: http://wiki.openttd.org/MSVC#Microsoft. ... irectX_SDK
User avatar
neob
Chief Executive
Chief Executive
Posts: 687
Joined: 29 Dec 2009 02:56

Re: HOWTO: Compile OpenTTD *without* DirectX SDK

Post by neob »

thanks, but look closely under the Direct X there is a 'Alternative' section.
where presented mostly the same steps (only there its 'dxguid.lib' and not 'dxguid.dll')

and those pictures are a great help for those who never seen it before
its will be nice if you can update\expand that wiki section, if necessary.
Image
User avatar
Lord Aro
Tycoon
Tycoon
Posts: 2369
Joined: 25 Jun 2009 16:42
Location: Location, Location
Contact:

Re: HOWTO: Compile OpenTTD *without* DirectX SDK

Post by Lord Aro »

is direct SDX actually nessessary anymore due to the Music Sets being available, or am i just being stupid ?(
AroAI - A really feeble attempt at an AI

It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. --Edsger Dijkstra
petert
Tycoon
Tycoon
Posts: 3008
Joined: 02 Apr 2009 22:43
Location: Massachusetts, USA

Re: HOWTO: Compile OpenTTD *without* DirectX SDK

Post by petert »

You could look at it that way, but the MRP isn't complete yet anyway.
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Re: HOWTO: Compile OpenTTD *without* DirectX SDK

Post by Rubidium »

Sorry, but didn't the music replacement guys decide they would go for the same format as the TTD (for Windows) music? Wouldn't that imply that the same mechanism for playing them would be used?
fabca2
Transport Coordinator
Transport Coordinator
Posts: 312
Joined: 14 Apr 2004 15:18
Location: Fr

Re: HOWTO: Compile OpenTTD *without* DirectX SDK

Post by fabca2 »

doesn't SDL offert music support and sound too ?
ottd on linux can play music and sound... without directx, no?

I use SDL_mixer on one (little) projet, that allow playing all kind of music format (mp3,mid...) and sound (wav)
is SDL_mixer too limited for ottd or maybe ottd will use something similar in the future ? or not ? (it's just a question for myself, not a suggestion or whatever, I know devs may have many other things to deals with yet)
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Re: HOWTO: Compile OpenTTD *without* DirectX SDK

Post by Rubidium »

SDL_mixer requires Timidity to play MIDI, OpenTTD's extmidi uses Timidity to play MIDI directly, but can also use aplaymidi and other MIDI playing applications. As such SDL_mixer is totally unneeded for OpenTTD.

DirectX is a Windows native API to play MIDI, why wouldn't we use it? Especially because installing Timidity and SDL on Windows might be cumbersome and you almost certainly have DirectX installed.
Valentijn
Engineer
Engineer
Posts: 118
Joined: 07 Nov 2007 10:04

Re: HOWTO: Compile OpenTTD *without* DirectX SDK

Post by Valentijn »

neob wrote:thanks, but look closely under the Direct X there is a 'Alternative' section.
where presented mostly the same steps (only there its 'dxguid.lib' and not 'dxguid.dll')
Thanks, didn't see that. I corrected the typo as well.
Valentijn
Engineer
Engineer
Posts: 118
Joined: 07 Nov 2007 10:04

Re: HOWTO: Compile OpenTTD *without* DirectX SDK

Post by Valentijn »

petert wrote:Perhaps you could add those pictures/instructions to this wiki page: http://wiki.openttd.org/MSVC#Microsoft. ... irectX_SDK
Done.
petert
Tycoon
Tycoon
Posts: 3008
Joined: 02 Apr 2009 22:43
Location: Massachusetts, USA

Re: HOWTO: Compile OpenTTD *without* DirectX SDK

Post by petert »

Thanks, those look great!
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 20 guests