summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcelestar <celestar@openttd.org>2005-03-19 22:36:13 +0000
committercelestar <celestar@openttd.org>2005-03-19 22:36:13 +0000
commitfe8313159a01fcde746fd3962745d87848ce99b6 (patch)
treeae155e4729f3ccdb51b58d4d003cd31f449018f7
parentd2ae7dd186517b948311dc42e5f76933f8715ede (diff)
downloadopenttd-fe8313159a01fcde746fd3962745d87848ce99b6.tar.xz
(svn r2028) Added detection of SVN version (rev.c generation) for OS/2, updated readme, initial clipboard support (orudge)
-rw-r--r--docs/Readme_OS2.txt29
-rw-r--r--openttd.tgt341
-rw-r--r--os/os2/openttd.wpj15
-rw-r--r--os2.c16
4 files changed, 232 insertions, 169 deletions
diff --git a/docs/Readme_OS2.txt b/docs/Readme_OS2.txt
index d58acdfbc..ee9b64438 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 07d4b689a..25a3e8b00 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
+1
+361
+ActionStates
+362
+WString
+5
+&Make
+363
+WVList
0
52
1
1
0
-361
+364
+MItem
+10
+road_cmd.c
+365
+WString
+4
+COBJ
+366
+WVList
+0
+367
+WVList
+0
+52
+1
+1
+0
+368
MItem
10
road_gui.c
-362
+369
WString
4
COBJ
-363
+370
WVList
0
-364
+371
WVList
0
52
1
1
0
-365
+372
MItem
13
roadveh_cmd.c
-366
+373
WString
4
COBJ
-367
+374
WVList
0
-368
+375
WVList
0
52
1
1
0
-369
+376
MItem
13
roadveh_gui.c
-370
+377
WString
4
COBJ
-371
+378
WVList
0
-372
+379
WVList
0
52
1
1
0
-373
+380
MItem
10
saveload.c
-374
+381
WString
4
COBJ
-375
+382
WVList
0
-376
+383
WVList
0
52
1
1
0
-377
+384
MItem
12
screenshot.c
-378
+385
WString
4
COBJ
-379
+386
WVList
0
-380
+387
WVList
0
52
1
1
0
-381
+388
MItem
5
sdl.c
-382
+389
WString
4
COBJ
-383
+390
WVList
0
-384
+391
WVList
0
52
1
1
0
-385
+392
MItem
10
settings.c
-386
+393
WString
4
COBJ
-387
+394
WVList
0
-388
+395
WVList
0
52
1
1
0
-389
+396
MItem
14
settings_gui.c
-390
+397
WString
4
COBJ
-391
+398
WVList
0
-392
+399
WVList
0
52
1
1
0
-393
+400
MItem
10
ship_cmd.c
-394
+401
WString
4
COBJ
-395
+402
WVList
0
-396
+403
WVList
0
52
1
1
0
-397
+404
MItem
10
ship_gui.c
-398
+405
WString
4
COBJ
-399
+406
WVList
0
-400
+407
WVList
0
52
1
1
0
-401
+408
MItem
7
signs.c
-402
+409
WString
4
COBJ
-403
+410
WVList
0
-404
+411
WVList
0
52
1
1
0
-405
+412
MItem
14
smallmap_gui.c
-406
+413
WString
4
COBJ
-407
+414
WVList
0
-408
+415
WVList
0
52
1
1
0
-409
+416
MItem
7
sound.c
-410
+417
WString
4
COBJ
-411
+418
WVList
0
-412
+419
WVList
0
52
1
1
0
-413
+420
MItem
8
sprite.c
-414
+421
WString
4
COBJ
-415
+422
WVList
0
-416
+423
WVList
0
52
1
1
0
-417
+424
MItem
13
spritecache.c
-418
+425
WString
4
COBJ
-419
+426
WVList
0
-420
+427
WVList
0
52
1
1
0
-421
+428
MItem
13
station_cmd.c
-422
+429
WString
4
COBJ
-423
+430
WVList
0
-424
+431
WVList
0
52
1
1
0
-425
+432
MItem
13
station_gui.c
-426
+433
WString
4
COBJ
-427
+434
WVList
0
-428
+435
WVList
0
52
1
1
0
-429
+436
MItem
8
StdAfx.c
-430
+437
WString
4
COBJ
-431
+438
WVList
0
-432
+439
WVList
0
52
1
1
0
-433
+440
MItem
8
string.c
-434
+441
WString
4
COBJ
-435
+442
WVList
0
-436
+443
WVList
0
52
1
1
0
-437
+444
MItem
9
strings.c
-438
+445
WString
4
COBJ
-439
+446
WVList
0
-440
+447
WVList
0
52
1
1
0
-441
+448
MItem
13
subsidy_gui.c
-442
+449
WString
4
COBJ
-443
+450
WVList
0
-444
+451
WVList
0
52
1
1
0
-445
+452
MItem
15
terraform_gui.c
-446
+453
WString
4
COBJ
-447
+454
WVList
0
-448
+455
WVList
0
52
1
1
0
-449
+456
MItem
9
texteff.c
-450
+457
WString
4
COBJ
-451
+458
WVList
0
-452
+459
WVList
0
52
1
1
0
-453
+460
MItem
6
tile.c
-454
+461
WString
4
COBJ
-455
+462
WVList
0
-456
+463
WVList
0
52
1
1
0
-457
+464
MItem
10
town_cmd.c
-458
+465
WString
4
COBJ
-459
+466
WVList
0
-460
+467
WVList
0
52
1
1
0
-461
+468
MItem
10
town_gui.c
-462
+469
WString
4
COBJ
-463
+470
WVList
0
-464
+471
WVList
0
52
1
1
0
-465
+472
MItem
11
train_cmd.c
-466
+473
WString
4
COBJ
-467
+474
WVList
0
-468
+475
WVList
0
52
1
1
0
-469
+476
MItem
11
train_gui.c
-470
+477
WString
4
COBJ
-471
+478
WVList
0
-472
+479
WVList
0
52
1
1
0
-473
+480
MItem
10
tree_cmd.c
-474
+481
WString
4
COBJ
-475
+482
WVList
0
-476
+483
WVList
0
52
1
1
0
-477
+484
MItem
5
ttd.c
-478
+485
WString
4
COBJ
-479
+486
WVList
0
-480
+487
WVList
0
52
1
1
0
-481
+488
MItem
18
tunnelbridge_cmd.c
-482
+489
WString
4
COBJ
-483
+490
WVList
0
-484
+491
WVList
0
52
1
1
0
-485
+492
MItem
15
unmovable_cmd.c
-486
+493
WString
4
COBJ
-487
+494
WVList
0
-488
+495
WVList
0
52
1
1
0
-489
+496
MItem
9
vehicle.c
-490
+497
WString
4
COBJ
-491
+498
WVList
0
-492
+499
WVList
0
52
1
1
0
-493
+500
MItem
13
vehicle_gui.c
-494
+501
WString
4
COBJ
-495
+502
WVList
0
-496
+503
WVList
0
52
1
1
0
-497
+504
MItem
10
viewport.c
-498
+505
WString
4
COBJ
-499
+506
WVList
0
-500
+507
WVList
0
52
1
1
0
-501
+508
MItem
11
water_cmd.c
-502
+509
WString
4
COBJ
-503
+510
WVList
0
-504
+511
WVList
0
52
1
1
0
-505
+512
MItem
8
widget.c
-506
+513
WString
4
COBJ
-507
+514
WVList
0
-508
+515
WVList
0
52
1
1
0
-509
+516
MItem
8
window.c
-510
+517
WString
4
COBJ
-511
+518
WVList
0
-512
+519
WVList
0
52
diff --git a/os/os2/openttd.wpj b/os/os2/openttd.wpj
index 2c2b542e8..7b1d318a8 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 2764c3454..4c4b93325 100644
--- a/os2.c
+++ b/os2.c
@@ -15,6 +15,7 @@
#define INCL_DOS
#define INCL_OS2MM
#define INCL_WIN
+#define INCL_WINCLIPBOARD
#include <os2.h>
#include <os2me.h>
@@ -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;
}