From fe8313159a01fcde746fd3962745d87848ce99b6 Mon Sep 17 00:00:00 2001 From: celestar Date: Sat, 19 Mar 2005 22:36:13 +0000 Subject: [PATCH] (svn r2028) Added detection of SVN version (rev.c generation) for OS/2, updated readme, initial clipboard support (orudge) --- docs/Readme_OS2.txt | 29 ++- openttd.tgt | 571 +++++++++++++++++++++++--------------------- os/os2/openttd.wpj | 15 +- os2.c | 16 ++ 4 files changed, 347 insertions(+), 284 deletions(-) diff --git a/docs/Readme_OS2.txt b/docs/Readme_OS2.txt index d58acdfbcb..ee9b644388 100644 --- a/docs/Readme_OS2.txt +++ b/docs/Readme_OS2.txt @@ -66,13 +66,14 @@ Compiler Open Watcom 1.3 was used to build OpenTTD (earlier versions will NOT work). See http://www.openwatcom.org/ to download it. It may -also be possible to build OpenTTD under OS/2: I attempted this +also be possible to build OpenTTD with GCC: I attempted this before using Open Watcom, but found the tools available for OS/2 at the time to be a bit more tricky to get working. Due to complexities in my set-up, I actually used the Win32 version of Open Watcom to initially compile OpenTTD for OS/2. There should -be no reason of course why the OS/2 version cannot be used. +be no reason of course why the OS/2 version cannot be used, and I +have subsequently built OpenTTD successfully this way. Libraries Required ------------------ @@ -84,10 +85,10 @@ provided, they are not designed for Watcom (apart from SDL): - zlib http://www.zlib.org/ - contains a makefile for OS/2, but is out - of date and uses EMX + of date and uses EMX, ignore this - libpng - http://www.libpng.org/ - contains an EMX/gcc makefile + http://www.libpng.org/ - contains an EMX/gcc makefile, ignore this - SDL for OS/2 For 0.3.5, I used ftp://ftp.netlabs.org/pub/sdl/SDL-1.2.7-src-20040908a.zip - @@ -98,6 +99,24 @@ If you do not wish to build the libraries yourself, pre-built versions can be downloaded from the Files section at http://sourceforge.net/projects/openttd/ - see "os2-useful.zip". +A Note About Subversion Revision Numbers +---------------------------------------- + +The project file uses a bit of a hack to find out the SVN revision number and +create an appropriate rev.c file. It does this using a batch file and a GNU +makefile, as well as the SVN tools (specifically, "svnversion"). For this to +work successfully, you'll need the SVN tools installed and in your path, as +well as some of the GNU tools (GNU make, and some tools from textutils, +possibly others too) - otherwise, a generic rev.c with the revision set to +"norev000" will be created. To specifically force a version number, set +the environment variable "RELEASE" to the number (eg, "0.3.6") -before- +starting the Open Watcom IDE (which must be launched from the same shell +session). Also, beware, as you WILL cause incompatibilities if you try to +play a multiplayer game with a different version. + +Apologies for the complicated hack used here, but it's a bit of a pain to do, +as any Windows MSVC user will tell you. ;) + Compiling --------- @@ -115,4 +134,4 @@ If you have any questions regarding OS/2 issues, please contact me (owen@owenrudge.net) and I'll try to help you out. For general OpenTTD issues, see the Contacting section of readme.txt. -- Owen Rudge, 26th December 2004 +- Owen Rudge diff --git a/openttd.tgt b/openttd.tgt index 07d4b689aa..25a3e8b000 100644 --- a/openttd.tgt +++ b/openttd.tgt @@ -194,7 +194,7 @@ WVList 0 51 WPickList -103 +104 52 MItem 3 @@ -339,8 +339,8 @@ WString 0 88 WString -50 -ENABLE_NETWORK=1 WITH_ZLIB=1 WITH_PNG=1 WITH_SDL=1 +61 +ENABLE_NETWORK=1 WITH_ZLIB=1 WITH_PNG=1 WITH_SDL=1 WITH_REV=1 0 89 MCState @@ -1545,8 +1545,8 @@ WVList 0 357 MItem -10 -road_cmd.c +5 +rev.c 358 WString 4 @@ -1556,689 +1556,716 @@ WVList 0 360 WVList -0 -52 1 -1 -0 361 -MItem -10 -road_gui.c +ActionStates 362 WString -4 -COBJ +5 +&Make 363 WVList 0 -364 -WVList -0 52 1 1 0 -365 +364 MItem -13 -roadveh_cmd.c -366 +10 +road_cmd.c +365 WString 4 COBJ +366 +WVList +0 367 WVList 0 -368 -WVList -0 52 1 1 0 -369 +368 MItem -13 -roadveh_gui.c -370 +10 +road_gui.c +369 WString 4 COBJ +370 +WVList +0 371 WVList 0 -372 -WVList -0 52 1 1 0 -373 +372 MItem -10 -saveload.c -374 +13 +roadveh_cmd.c +373 WString 4 COBJ +374 +WVList +0 375 WVList 0 -376 -WVList -0 52 1 1 0 -377 +376 MItem -12 -screenshot.c -378 +13 +roadveh_gui.c +377 WString 4 COBJ +378 +WVList +0 379 WVList 0 -380 -WVList -0 52 1 1 0 -381 +380 MItem -5 -sdl.c -382 +10 +saveload.c +381 WString 4 COBJ +382 +WVList +0 383 WVList 0 -384 -WVList -0 52 1 1 0 -385 +384 MItem -10 -settings.c -386 +12 +screenshot.c +385 WString 4 COBJ +386 +WVList +0 387 WVList 0 -388 -WVList -0 52 1 1 0 -389 +388 MItem -14 -settings_gui.c -390 +5 +sdl.c +389 WString 4 COBJ +390 +WVList +0 391 WVList 0 -392 -WVList -0 52 1 1 0 -393 +392 MItem 10 -ship_cmd.c -394 +settings.c +393 WString 4 COBJ +394 +WVList +0 395 WVList 0 -396 -WVList -0 52 1 1 0 -397 +396 MItem -10 -ship_gui.c -398 +14 +settings_gui.c +397 WString 4 COBJ +398 +WVList +0 399 WVList 0 -400 -WVList -0 52 1 1 0 -401 +400 MItem -7 -signs.c -402 +10 +ship_cmd.c +401 WString 4 COBJ +402 +WVList +0 403 WVList 0 -404 -WVList -0 52 1 1 0 -405 +404 MItem -14 -smallmap_gui.c -406 +10 +ship_gui.c +405 WString 4 COBJ +406 +WVList +0 407 WVList 0 -408 -WVList -0 52 1 1 0 -409 +408 MItem 7 -sound.c -410 +signs.c +409 WString 4 COBJ +410 +WVList +0 411 WVList 0 -412 -WVList -0 52 1 1 0 -413 +412 MItem -8 -sprite.c -414 +14 +smallmap_gui.c +413 WString 4 COBJ +414 +WVList +0 415 WVList 0 -416 -WVList -0 52 1 1 0 -417 +416 MItem -13 -spritecache.c -418 +7 +sound.c +417 WString 4 COBJ +418 +WVList +0 419 WVList 0 -420 -WVList -0 52 1 1 0 -421 +420 MItem -13 -station_cmd.c -422 +8 +sprite.c +421 WString 4 COBJ +422 +WVList +0 423 WVList 0 -424 -WVList -0 52 1 1 0 -425 +424 MItem 13 -station_gui.c -426 +spritecache.c +425 WString 4 COBJ +426 +WVList +0 427 WVList 0 -428 -WVList -0 52 1 1 0 -429 +428 MItem -8 -StdAfx.c -430 +13 +station_cmd.c +429 WString 4 COBJ +430 +WVList +0 431 WVList 0 -432 -WVList -0 52 1 1 0 -433 +432 MItem -8 -string.c -434 +13 +station_gui.c +433 WString 4 COBJ +434 +WVList +0 435 WVList 0 -436 -WVList -0 52 1 1 0 -437 +436 MItem -9 -strings.c -438 +8 +StdAfx.c +437 WString 4 COBJ +438 +WVList +0 439 WVList 0 -440 -WVList -0 52 1 1 0 -441 +440 MItem -13 -subsidy_gui.c -442 +8 +string.c +441 WString 4 COBJ +442 +WVList +0 443 WVList 0 -444 -WVList -0 52 1 1 0 -445 +444 MItem -15 -terraform_gui.c -446 +9 +strings.c +445 WString 4 COBJ +446 +WVList +0 447 WVList 0 -448 -WVList -0 52 1 1 0 -449 +448 MItem -9 -texteff.c -450 +13 +subsidy_gui.c +449 WString 4 COBJ +450 +WVList +0 451 WVList 0 -452 -WVList -0 52 1 1 0 -453 +452 MItem -6 -tile.c -454 +15 +terraform_gui.c +453 WString 4 COBJ +454 +WVList +0 455 WVList 0 -456 -WVList -0 52 1 1 0 -457 +456 MItem -10 -town_cmd.c -458 +9 +texteff.c +457 WString 4 COBJ +458 +WVList +0 459 WVList 0 -460 -WVList -0 52 1 1 0 -461 +460 MItem -10 -town_gui.c -462 +6 +tile.c +461 WString 4 COBJ +462 +WVList +0 463 WVList 0 -464 -WVList -0 52 1 1 0 -465 +464 MItem -11 -train_cmd.c -466 +10 +town_cmd.c +465 WString 4 COBJ +466 +WVList +0 467 WVList 0 -468 -WVList -0 52 1 1 0 -469 +468 MItem -11 -train_gui.c -470 +10 +town_gui.c +469 WString 4 COBJ +470 +WVList +0 471 WVList 0 -472 -WVList -0 52 1 1 0 -473 +472 MItem -10 -tree_cmd.c -474 +11 +train_cmd.c +473 WString 4 COBJ +474 +WVList +0 475 WVList 0 -476 -WVList -0 52 1 1 0 -477 +476 MItem -5 -ttd.c -478 +11 +train_gui.c +477 WString 4 COBJ +478 +WVList +0 479 WVList 0 -480 -WVList -0 52 1 1 0 -481 +480 MItem -18 -tunnelbridge_cmd.c -482 +10 +tree_cmd.c +481 WString 4 COBJ +482 +WVList +0 483 WVList 0 -484 -WVList -0 52 1 1 0 -485 +484 MItem -15 -unmovable_cmd.c -486 +5 +ttd.c +485 WString 4 COBJ +486 +WVList +0 487 WVList 0 -488 -WVList -0 52 1 1 0 -489 +488 MItem -9 -vehicle.c -490 +18 +tunnelbridge_cmd.c +489 WString 4 COBJ +490 +WVList +0 491 WVList 0 -492 -WVList -0 52 1 1 0 -493 +492 MItem -13 -vehicle_gui.c -494 +15 +unmovable_cmd.c +493 WString 4 COBJ +494 +WVList +0 495 WVList 0 -496 -WVList -0 52 1 1 0 -497 +496 MItem -10 -viewport.c -498 +9 +vehicle.c +497 WString 4 COBJ +498 +WVList +0 499 WVList 0 -500 -WVList -0 52 1 1 0 -501 +500 MItem -11 -water_cmd.c -502 +13 +vehicle_gui.c +501 WString 4 COBJ +502 +WVList +0 503 WVList 0 -504 -WVList -0 52 1 1 0 -505 +504 MItem -8 -widget.c -506 +10 +viewport.c +505 WString 4 COBJ +506 +WVList +0 507 WVList 0 -508 -WVList -0 52 1 1 0 -509 +508 MItem -8 -window.c -510 +11 +water_cmd.c +509 WString 4 COBJ -511 +510 WVList 0 -512 +511 +WVList +0 +52 +1 +1 +0 +512 +MItem +8 +widget.c +513 +WString +4 +COBJ +514 +WVList +0 +515 +WVList +0 +52 +1 +1 +0 +516 +MItem +8 +window.c +517 +WString +4 +COBJ +518 +WVList +0 +519 WVList 0 52 diff --git a/os/os2/openttd.wpj b/os/os2/openttd.wpj index 2c2b542e8c..7b1d318a8c 100644 --- a/os/os2/openttd.wpj +++ b/os/os2/openttd.wpj @@ -4,15 +4,16 @@ projectIdent VpeMain 1 WRect -0 -40 -10320 -9920 +-32 +-40 +10304 +10020 2 MProject 3 MCommand -0 +15 +svn_version.cmd 4 MCommand 0 @@ -42,8 +43,8 @@ WRect WFileName 17 ..\..\openttd.tgt -38 -56 +42 +66 11 VComponent 12 diff --git a/os2.c b/os2.c index 2764c3454e..4c4b93325c 100644 --- a/os2.c +++ b/os2.c @@ -15,6 +15,7 @@ #define INCL_DOS #define INCL_OS2MM #define INCL_WIN +#define INCL_WINCLIPBOARD #include #include @@ -687,6 +688,21 @@ const HalMusicDriver _os2_music_driver = { bool InsertTextBufferClipboard(Textbuf *tb) { +#if 0 + HAB hab = 0; // anchor-block handle + PSZ pszClipText, pszLocalText; + + if (WinOpenClipbrd(hab)) + { + if (pszClipText = (PSZ) WinQueryClipbrdData(hab, CF_TEXT)) + { + while (*pszLocalText++ = *pszClipText++); + } + WinCloseClipbrd(hab); + } + + // text is now in pszLocalText, do something with it! +#endif // TODO return false; }