os2.c
author rubidium
Mon, 01 Jan 2007 22:00:54 +0000
changeset 5462 ebb6fe93a23a
parent 5296 e7acddfdd8a7
permissions -rw-r--r--
(svn r7731) -Fix (r5999): off-by-one error in the date to YMD calculation for first 4 years of a century that was not divisable by 400.
2186
db48cf29b983 (svn r2701) Insert Id tags into all source files
tron
parents: 2180
diff changeset
     1
/* $Id$ */
db48cf29b983 (svn r2701) Insert Id tags into all source files
tron
parents: 2180
diff changeset
     2
801
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
     3
#include "stdafx.h"
1892
8717d92b32b1 (svn r2398) - CodeChange: forgot to update unix and os2 specific files as well.
Darkvater
parents: 1890
diff changeset
     4
#include "openttd.h"
2167
5686131337a4 (svn r2681) - Fix OS/2 port, please do not modify openttd.wpj/tgt by hand unless you know what you're doing!
orudge
parents: 2099
diff changeset
     5
#include "variables.h"
1317
3c90086ff34f (svn r1821) Move generic string handling functions to string.[ch] and introduce stre{cpy,cat}, see string.h for their semantics
tron
parents: 1301
diff changeset
     6
#include "string.h"
801
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
     7
#include "table/strings.h"
1888
dac7806032f8 (svn r2394) - Completed clipboard functions for OS/2 port
orudge
parents: 1887
diff changeset
     8
#include "gfx.h"
dac7806032f8 (svn r2394) - Completed clipboard functions for OS/2 port
orudge
parents: 1887
diff changeset
     9
#include "gui.h"
2167
5686131337a4 (svn r2681) - Fix OS/2 port, please do not modify openttd.wpj/tgt by hand unless you know what you're doing!
orudge
parents: 2099
diff changeset
    10
#include "functions.h"
5686131337a4 (svn r2681) - Fix OS/2 port, please do not modify openttd.wpj/tgt by hand unless you know what you're doing!
orudge
parents: 2099
diff changeset
    11
#include "macros.h"
801
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
    12
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
    13
#include <direct.h>
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
    14
#include <unistd.h>
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
    15
#include <sys/stat.h>
1887
6107f7704454 (svn r2393) - Implemented threaded saving for OS/2
orudge
parents: 1817
diff changeset
    16
#include <stdlib.h>
801
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
    17
#include <time.h>
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
    18
#include <dos.h>
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
    19
818
546a7894f312 (svn r1289) -Fix: Minor fix for OS/2 message boxes (orudge)
truelight
parents: 810
diff changeset
    20
#define INCL_WIN
1524
d5cb3a8cfddc (svn r2028) Added detection of SVN version (rev.c generation) for OS/2, updated readme, initial clipboard support (orudge)
celestar
parents: 1508
diff changeset
    21
#define INCL_WINCLIPBOARD
810
a1494b19bd2a (svn r1281) -Fix: the OS/2 is now finished. Fixes:
truelight
parents: 801
diff changeset
    22
801
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
    23
#include <os2.h>
2167
5686131337a4 (svn r2681) - Fix OS/2 port, please do not modify openttd.wpj/tgt by hand unless you know what you're doing!
orudge
parents: 2099
diff changeset
    24
#include <i86.h>
5686131337a4 (svn r2681) - Fix OS/2 port, please do not modify openttd.wpj/tgt by hand unless you know what you're doing!
orudge
parents: 2099
diff changeset
    25
4223
d4c9ef555f43 (svn r5767) - Cleanup: Improve upon the header file mess regarding fios. Move all relevant types from hal.h into fios.h, eliminate the unneccessary passing of a global variable, and extern variables in header files (declare in fios.c and misc_gui.c
Darkvater
parents: 4222
diff changeset
    26
bool FiosIsRoot(const char *file)
810
a1494b19bd2a (svn r1281) -Fix: the OS/2 is now finished. Fixes:
truelight
parents: 801
diff changeset
    27
{
4221
ff4a040f30c6 (svn r5765) - Codechange: Fully unify the OS-specific FiosGet...List functions into fios.c, as well as FiosGetSavegameList and FiosGetScenarioList functions with the help of some callbacks.
Darkvater
parents: 4220
diff changeset
    28
	return path[3] == '\0';
810
a1494b19bd2a (svn r1281) -Fix: the OS/2 is now finished. Fixes:
truelight
parents: 801
diff changeset
    29
}
a1494b19bd2a (svn r1281) -Fix: the OS/2 is now finished. Fixes:
truelight
parents: 801
diff changeset
    30
4221
ff4a040f30c6 (svn r5765) - Codechange: Fully unify the OS-specific FiosGet...List functions into fios.c, as well as FiosGetSavegameList and FiosGetScenarioList functions with the help of some callbacks.
Darkvater
parents: 4220
diff changeset
    31
void FiosGetDrives(void)
801
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
    32
{
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
    33
	FiosItem *fios;
4221
ff4a040f30c6 (svn r5765) - Codechange: Fully unify the OS-specific FiosGet...List functions into fios.c, as well as FiosGetSavegameList and FiosGetScenarioList functions with the help of some callbacks.
Darkvater
parents: 4220
diff changeset
    34
	unsigned disk, disk2, save, total;
801
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
    35
4221
ff4a040f30c6 (svn r5765) - Codechange: Fully unify the OS-specific FiosGet...List functions into fios.c, as well as FiosGetSavegameList and FiosGetScenarioList functions with the help of some callbacks.
Darkvater
parents: 4220
diff changeset
    36
	_dos_getdrive(&save); // save original drive
1486
647d3a2be4fe (svn r1990) Reduce the diff between the OS specific files with respect to file handling and fix some inconsitencies (I hope I didn't break the OS/2 part, couldn't test it, feedback is welcome)
tron
parents: 1482
diff changeset
    37
4221
ff4a040f30c6 (svn r5765) - Codechange: Fully unify the OS-specific FiosGet...List functions into fios.c, as well as FiosGetSavegameList and FiosGetScenarioList functions with the help of some callbacks.
Darkvater
parents: 4220
diff changeset
    38
	/* get an available drive letter */
ff4a040f30c6 (svn r5765) - Codechange: Fully unify the OS-specific FiosGet...List functions into fios.c, as well as FiosGetSavegameList and FiosGetScenarioList functions with the help of some callbacks.
Darkvater
parents: 4220
diff changeset
    39
	for (disk = 1;; disk++) {
ff4a040f30c6 (svn r5765) - Codechange: Fully unify the OS-specific FiosGet...List functions into fios.c, as well as FiosGetSavegameList and FiosGetScenarioList functions with the help of some callbacks.
Darkvater
parents: 4220
diff changeset
    40
		_dos_setdrive(disk, &total);
ff4a040f30c6 (svn r5765) - Codechange: Fully unify the OS-specific FiosGet...List functions into fios.c, as well as FiosGetSavegameList and FiosGetScenarioList functions with the help of some callbacks.
Darkvater
parents: 4220
diff changeset
    41
		if (disk >= total) return;
ff4a040f30c6 (svn r5765) - Codechange: Fully unify the OS-specific FiosGet...List functions into fios.c, as well as FiosGetSavegameList and FiosGetScenarioList functions with the help of some callbacks.
Darkvater
parents: 4220
diff changeset
    42
		_dos_getdrive(&disk2);
2099
02c5a49863e9 (svn r2609) - Feature: remove extension from savegames/scenarios when browsing the folders.
Darkvater
parents: 1893
diff changeset
    43
4221
ff4a040f30c6 (svn r5765) - Codechange: Fully unify the OS-specific FiosGet...List functions into fios.c, as well as FiosGetSavegameList and FiosGetScenarioList functions with the help of some callbacks.
Darkvater
parents: 4220
diff changeset
    44
		if (disk == disk2) {
ff4a040f30c6 (svn r5765) - Codechange: Fully unify the OS-specific FiosGet...List functions into fios.c, as well as FiosGetSavegameList and FiosGetScenarioList functions with the help of some callbacks.
Darkvater
parents: 4220
diff changeset
    45
			FiosItem *fios = FiosAlloc();
ff4a040f30c6 (svn r5765) - Codechange: Fully unify the OS-specific FiosGet...List functions into fios.c, as well as FiosGetSavegameList and FiosGetScenarioList functions with the help of some callbacks.
Darkvater
parents: 4220
diff changeset
    46
			fios->type = FIOS_TYPE_DRIVE;
ff4a040f30c6 (svn r5765) - Codechange: Fully unify the OS-specific FiosGet...List functions into fios.c, as well as FiosGetSavegameList and FiosGetScenarioList functions with the help of some callbacks.
Darkvater
parents: 4220
diff changeset
    47
			fios->mtime = 0;
ff4a040f30c6 (svn r5765) - Codechange: Fully unify the OS-specific FiosGet...List functions into fios.c, as well as FiosGetSavegameList and FiosGetScenarioList functions with the help of some callbacks.
Darkvater
parents: 4220
diff changeset
    48
			snprintf(fios->name, lengthof(fios->name),  "%c:", 'A' + disk - 1);
ff4a040f30c6 (svn r5765) - Codechange: Fully unify the OS-specific FiosGet...List functions into fios.c, as well as FiosGetSavegameList and FiosGetScenarioList functions with the help of some callbacks.
Darkvater
parents: 4220
diff changeset
    49
			ttd_strlcpy(fios->title, fios->name, lengthof(fios->title));
801
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
    50
		}
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
    51
	}
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
    52
4221
ff4a040f30c6 (svn r5765) - Codechange: Fully unify the OS-specific FiosGet...List functions into fios.c, as well as FiosGetSavegameList and FiosGetScenarioList functions with the help of some callbacks.
Darkvater
parents: 4220
diff changeset
    53
	_dos_setdrive(save, &total); // restore the original drive
801
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
    54
}
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
    55
4222
36e9bd216011 (svn r5766) - Cleanup: Unify FiosBrowseTo and FiosGetDescText
Darkvater
parents: 4221
diff changeset
    56
bool FiosGetDiskFreeSpace(const char *path, uint32 *tot)
36e9bd216011 (svn r5766) - Cleanup: Unify FiosBrowseTo and FiosGetDescText
Darkvater
parents: 4221
diff changeset
    57
{
36e9bd216011 (svn r5766) - Cleanup: Unify FiosBrowseTo and FiosGetDescText
Darkvater
parents: 4221
diff changeset
    58
	struct diskfree_t free;
36e9bd216011 (svn r5766) - Cleanup: Unify FiosBrowseTo and FiosGetDescText
Darkvater
parents: 4221
diff changeset
    59
	char drive = path[0] - 'A' + 1;
36e9bd216011 (svn r5766) - Cleanup: Unify FiosBrowseTo and FiosGetDescText
Darkvater
parents: 4221
diff changeset
    60
36e9bd216011 (svn r5766) - Cleanup: Unify FiosBrowseTo and FiosGetDescText
Darkvater
parents: 4221
diff changeset
    61
	if (tot != NULL && _getdiskfree(drive, &free) == 0) {
36e9bd216011 (svn r5766) - Cleanup: Unify FiosBrowseTo and FiosGetDescText
Darkvater
parents: 4221
diff changeset
    62
		*tot = free.avail_clusters * free.sectors_per_cluster * free.bytes_per_sector;
36e9bd216011 (svn r5766) - Cleanup: Unify FiosBrowseTo and FiosGetDescText
Darkvater
parents: 4221
diff changeset
    63
		return true;
36e9bd216011 (svn r5766) - Cleanup: Unify FiosBrowseTo and FiosGetDescText
Darkvater
parents: 4221
diff changeset
    64
	}
36e9bd216011 (svn r5766) - Cleanup: Unify FiosBrowseTo and FiosGetDescText
Darkvater
parents: 4221
diff changeset
    65
36e9bd216011 (svn r5766) - Cleanup: Unify FiosBrowseTo and FiosGetDescText
Darkvater
parents: 4221
diff changeset
    66
	return false;
36e9bd216011 (svn r5766) - Cleanup: Unify FiosBrowseTo and FiosGetDescText
Darkvater
parents: 4221
diff changeset
    67
}
36e9bd216011 (svn r5766) - Cleanup: Unify FiosBrowseTo and FiosGetDescText
Darkvater
parents: 4221
diff changeset
    68
4221
ff4a040f30c6 (svn r5765) - Codechange: Fully unify the OS-specific FiosGet...List functions into fios.c, as well as FiosGetSavegameList and FiosGetScenarioList functions with the help of some callbacks.
Darkvater
parents: 4220
diff changeset
    69
bool FiosIsValidFile(const char *path, const struct dirent *ent, struct stat *sb)
801
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
    70
{
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
    71
	char filename[MAX_PATH];
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
    72
4221
ff4a040f30c6 (svn r5765) - Codechange: Fully unify the OS-specific FiosGet...List functions into fios.c, as well as FiosGetSavegameList and FiosGetScenarioList functions with the help of some callbacks.
Darkvater
parents: 4220
diff changeset
    73
	snprintf(filename, lengthof(filename), "%s" PATHSEP "%s", path, ent->d_name);
ff4a040f30c6 (svn r5765) - Codechange: Fully unify the OS-specific FiosGet...List functions into fios.c, as well as FiosGetSavegameList and FiosGetScenarioList functions with the help of some callbacks.
Darkvater
parents: 4220
diff changeset
    74
	if (stat(filename, sb) != 0) return false;
1486
647d3a2be4fe (svn r1990) Reduce the diff between the OS specific files with respect to file handling and fix some inconsitencies (I hope I didn't break the OS/2 part, couldn't test it, feedback is welcome)
tron
parents: 1482
diff changeset
    75
4221
ff4a040f30c6 (svn r5765) - Codechange: Fully unify the OS-specific FiosGet...List functions into fios.c, as well as FiosGetSavegameList and FiosGetScenarioList functions with the help of some callbacks.
Darkvater
parents: 4220
diff changeset
    76
	return (ent->d_name[0] != '.'); // hidden file
801
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
    77
}
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
    78
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
    79
static void ChangeWorkingDirectory(char *exe)
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
    80
{
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
    81
	char *s = strrchr(exe, '\\');
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
    82
	if (s != NULL) {
1486
647d3a2be4fe (svn r1990) Reduce the diff between the OS specific files with respect to file handling and fix some inconsitencies (I hope I didn't break the OS/2 part, couldn't test it, feedback is welcome)
tron
parents: 1482
diff changeset
    83
		*s = '\0';
801
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
    84
		chdir(exe);
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
    85
		*s = '\\';
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
    86
	}
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
    87
}
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
    88
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
    89
void ShowInfo(const char *str)
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
    90
{
818
546a7894f312 (svn r1289) -Fix: Minor fix for OS/2 message boxes (orudge)
truelight
parents: 810
diff changeset
    91
	HAB hab;
546a7894f312 (svn r1289) -Fix: Minor fix for OS/2 message boxes (orudge)
truelight
parents: 810
diff changeset
    92
	HMQ hmq;
546a7894f312 (svn r1289) -Fix: Minor fix for OS/2 message boxes (orudge)
truelight
parents: 810
diff changeset
    93
	ULONG rc;
915
d845fe7cf6f2 (svn r1402) Trim trailing whitespace
tron
parents: 818
diff changeset
    94
818
546a7894f312 (svn r1289) -Fix: Minor fix for OS/2 message boxes (orudge)
truelight
parents: 810
diff changeset
    95
	// init PM env.
546a7894f312 (svn r1289) -Fix: Minor fix for OS/2 message boxes (orudge)
truelight
parents: 810
diff changeset
    96
	hmq = WinCreateMsgQueue((hab = WinInitialize(0)), 0);
546a7894f312 (svn r1289) -Fix: Minor fix for OS/2 message boxes (orudge)
truelight
parents: 810
diff changeset
    97
546a7894f312 (svn r1289) -Fix: Minor fix for OS/2 message boxes (orudge)
truelight
parents: 810
diff changeset
    98
	// display the box
546a7894f312 (svn r1289) -Fix: Minor fix for OS/2 message boxes (orudge)
truelight
parents: 810
diff changeset
    99
	rc = WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, str, "OpenTTD", 0, MB_OK | MB_MOVEABLE | MB_INFORMATION);
546a7894f312 (svn r1289) -Fix: Minor fix for OS/2 message boxes (orudge)
truelight
parents: 810
diff changeset
   100
546a7894f312 (svn r1289) -Fix: Minor fix for OS/2 message boxes (orudge)
truelight
parents: 810
diff changeset
   101
	// terminate PM env.
546a7894f312 (svn r1289) -Fix: Minor fix for OS/2 message boxes (orudge)
truelight
parents: 810
diff changeset
   102
	WinDestroyMsgQueue(hmq);
546a7894f312 (svn r1289) -Fix: Minor fix for OS/2 message boxes (orudge)
truelight
parents: 810
diff changeset
   103
	WinTerminate(hab);
801
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
   104
}
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
   105
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
   106
void ShowOSErrorBox(const char *buf)
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
   107
{
818
546a7894f312 (svn r1289) -Fix: Minor fix for OS/2 message boxes (orudge)
truelight
parents: 810
diff changeset
   108
	HAB hab;
546a7894f312 (svn r1289) -Fix: Minor fix for OS/2 message boxes (orudge)
truelight
parents: 810
diff changeset
   109
	HMQ hmq;
546a7894f312 (svn r1289) -Fix: Minor fix for OS/2 message boxes (orudge)
truelight
parents: 810
diff changeset
   110
	ULONG rc;
915
d845fe7cf6f2 (svn r1402) Trim trailing whitespace
tron
parents: 818
diff changeset
   111
818
546a7894f312 (svn r1289) -Fix: Minor fix for OS/2 message boxes (orudge)
truelight
parents: 810
diff changeset
   112
	// init PM env.
546a7894f312 (svn r1289) -Fix: Minor fix for OS/2 message boxes (orudge)
truelight
parents: 810
diff changeset
   113
	hmq = WinCreateMsgQueue((hab = WinInitialize(0)), 0);
546a7894f312 (svn r1289) -Fix: Minor fix for OS/2 message boxes (orudge)
truelight
parents: 810
diff changeset
   114
546a7894f312 (svn r1289) -Fix: Minor fix for OS/2 message boxes (orudge)
truelight
parents: 810
diff changeset
   115
	// display the box
546a7894f312 (svn r1289) -Fix: Minor fix for OS/2 message boxes (orudge)
truelight
parents: 810
diff changeset
   116
	rc = WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, buf, "OpenTTD", 0, MB_OK | MB_MOVEABLE | MB_ERROR);
546a7894f312 (svn r1289) -Fix: Minor fix for OS/2 message boxes (orudge)
truelight
parents: 810
diff changeset
   117
546a7894f312 (svn r1289) -Fix: Minor fix for OS/2 message boxes (orudge)
truelight
parents: 810
diff changeset
   118
	// terminate PM env.
546a7894f312 (svn r1289) -Fix: Minor fix for OS/2 message boxes (orudge)
truelight
parents: 810
diff changeset
   119
	WinDestroyMsgQueue(hmq);
546a7894f312 (svn r1289) -Fix: Minor fix for OS/2 message boxes (orudge)
truelight
parents: 810
diff changeset
   120
	WinTerminate(hab);
801
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
   121
}
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
   122
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
   123
int CDECL main(int argc, char* argv[])
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
   124
{
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
   125
	// change the working directory to enable doubleclicking in UIs
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
   126
	ChangeWorkingDirectory(argv[0]);
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
   127
4369
3812b4335df9 (svn r6086) -Fix: InteractiveRandom was not seeded properly resulting in the dedicated server always generating the same map. Thanks to the #openttdcoop team for detecting.
rubidium
parents: 4300
diff changeset
   128
	_random_seeds[1][1] = _random_seeds[1][0] = _random_seeds[0][1] = _random_seeds[0][0] = time(NULL);
801
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
   129
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
   130
	return ttd_main(argc, argv);
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
   131
}
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
   132
1390
e7cdf3ce0fb6 (svn r1894) - Codechange: cleaned up the console a bit, wholly unified handling of text with that of editboxes
Darkvater
parents: 1346
diff changeset
   133
void DeterminePaths(void)
801
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
   134
{
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
   135
	char *s;
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
   136
5296
e7acddfdd8a7 (svn r7449) -Codechange: Rename _path to _paths as it is technically more correct, but mainly because
Darkvater
parents: 5167
diff changeset
   137
	_paths.game_data_dir = malloc(MAX_PATH);
e7acddfdd8a7 (svn r7449) -Codechange: Rename _path to _paths as it is technically more correct, but mainly because
Darkvater
parents: 5167
diff changeset
   138
	ttd_strlcpy(_paths.game_data_dir, GAME_DATA_DIR, MAX_PATH);
801
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
   139
	#if defined SECOND_DATA_DIR
5296
e7acddfdd8a7 (svn r7449) -Codechange: Rename _path to _paths as it is technically more correct, but mainly because
Darkvater
parents: 5167
diff changeset
   140
	_paths.second_data_dir = malloc(MAX_PATH);
e7acddfdd8a7 (svn r7449) -Codechange: Rename _path to _paths as it is technically more correct, but mainly because
Darkvater
parents: 5167
diff changeset
   141
	ttd_strlcpy(_paths.second_data_dir, SECOND_DATA_DIR, MAX_PATH);
801
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
   142
	#endif
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
   143
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
   144
#if defined(USE_HOMEDIR)
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
   145
	{
1486
647d3a2be4fe (svn r1990) Reduce the diff between the OS specific files with respect to file handling and fix some inconsitencies (I hope I didn't break the OS/2 part, couldn't test it, feedback is welcome)
tron
parents: 1482
diff changeset
   146
		const char *homedir = getenv("HOME");
801
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
   147
1486
647d3a2be4fe (svn r1990) Reduce the diff between the OS specific files with respect to file handling and fix some inconsitencies (I hope I didn't break the OS/2 part, couldn't test it, feedback is welcome)
tron
parents: 1482
diff changeset
   148
		if (homedir == NULL) {
647d3a2be4fe (svn r1990) Reduce the diff between the OS specific files with respect to file handling and fix some inconsitencies (I hope I didn't break the OS/2 part, couldn't test it, feedback is welcome)
tron
parents: 1482
diff changeset
   149
			const struct passwd *pw = getpwuid(getuid());
647d3a2be4fe (svn r1990) Reduce the diff between the OS specific files with respect to file handling and fix some inconsitencies (I hope I didn't break the OS/2 part, couldn't test it, feedback is welcome)
tron
parents: 1482
diff changeset
   150
			if (pw != NULL) homedir = pw->pw_dir;
801
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
   151
		}
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
   152
5296
e7acddfdd8a7 (svn r7449) -Codechange: Rename _path to _paths as it is technically more correct, but mainly because
Darkvater
parents: 5167
diff changeset
   153
		_paths.personal_dir = str_fmt("%s" PATHSEP "%s", homedir, PERSONAL_DIR);
801
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
   154
	}
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
   155
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
   156
#else /* not defined(USE_HOMEDIR) */
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
   157
5296
e7acddfdd8a7 (svn r7449) -Codechange: Rename _path to _paths as it is technically more correct, but mainly because
Darkvater
parents: 5167
diff changeset
   158
	_paths.personal_dir = malloc(MAX_PATH);
e7acddfdd8a7 (svn r7449) -Codechange: Rename _path to _paths as it is technically more correct, but mainly because
Darkvater
parents: 5167
diff changeset
   159
	ttd_strlcpy(_paths.personal_dir, PERSONAL_DIR, MAX_PATH);
801
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
   160
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
   161
	// check if absolute or relative path
5296
e7acddfdd8a7 (svn r7449) -Codechange: Rename _path to _paths as it is technically more correct, but mainly because
Darkvater
parents: 5167
diff changeset
   162
	s = strchr(_paths.personal_dir, '\\');
801
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
   163
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
   164
	// add absolute path
5296
e7acddfdd8a7 (svn r7449) -Codechange: Rename _path to _paths as it is technically more correct, but mainly because
Darkvater
parents: 5167
diff changeset
   165
	if (s == NULL || _paths.personal_dir != s) {
e7acddfdd8a7 (svn r7449) -Codechange: Rename _path to _paths as it is technically more correct, but mainly because
Darkvater
parents: 5167
diff changeset
   166
		getcwd(_paths.personal_dir, MAX_PATH);
e7acddfdd8a7 (svn r7449) -Codechange: Rename _path to _paths as it is technically more correct, but mainly because
Darkvater
parents: 5167
diff changeset
   167
		s = strchr(_paths.personal_dir, 0);
801
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
   168
		*s++ = '\\';
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
   169
		ttd_strlcpy(s, PERSONAL_DIR, MAX_PATH);
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
   170
	}
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
   171
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
   172
#endif /* defined(USE_HOMEDIR) */
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
   173
5296
e7acddfdd8a7 (svn r7449) -Codechange: Rename _path to _paths as it is technically more correct, but mainly because
Darkvater
parents: 5167
diff changeset
   174
	s = strchr(_paths.personal_dir, 0);
801
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
   175
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
   176
	// append a / ?
1486
647d3a2be4fe (svn r1990) Reduce the diff between the OS specific files with respect to file handling and fix some inconsitencies (I hope I didn't break the OS/2 part, couldn't test it, feedback is welcome)
tron
parents: 1482
diff changeset
   177
	if (s[-1] != '\\') strcpy(s, "\\");
801
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
   178
5296
e7acddfdd8a7 (svn r7449) -Codechange: Rename _path to _paths as it is technically more correct, but mainly because
Darkvater
parents: 5167
diff changeset
   179
	_paths.save_dir = str_fmt("%ssave", _paths.personal_dir);
e7acddfdd8a7 (svn r7449) -Codechange: Rename _path to _paths as it is technically more correct, but mainly because
Darkvater
parents: 5167
diff changeset
   180
	_paths.autosave_dir = str_fmt("%s\\autosave", _paths.save_dir);
e7acddfdd8a7 (svn r7449) -Codechange: Rename _path to _paths as it is technically more correct, but mainly because
Darkvater
parents: 5167
diff changeset
   181
	_paths.scenario_dir = str_fmt("%sscenario", _paths.personal_dir);
e7acddfdd8a7 (svn r7449) -Codechange: Rename _path to _paths as it is technically more correct, but mainly because
Darkvater
parents: 5167
diff changeset
   182
	_paths.heightmap_dir = str_fmt("%sscenario\\heightmap", _paths.personal_dir);
e7acddfdd8a7 (svn r7449) -Codechange: Rename _path to _paths as it is technically more correct, but mainly because
Darkvater
parents: 5167
diff changeset
   183
	_paths.gm_dir = str_fmt("%sgm\\", _paths.game_data_dir);
e7acddfdd8a7 (svn r7449) -Codechange: Rename _path to _paths as it is technically more correct, but mainly because
Darkvater
parents: 5167
diff changeset
   184
	_paths.data_dir = str_fmt("%sdata\\", _paths.game_data_dir);
1482
80e315adc3bd (svn r1986) - Fix: free _config_file when shutting down openttd. Strange that Valgrind didn't catch this, kudos to TrueLight
Darkvater
parents: 1390
diff changeset
   185
80e315adc3bd (svn r1986) - Fix: free _config_file when shutting down openttd. Strange that Valgrind didn't catch this, kudos to TrueLight
Darkvater
parents: 1390
diff changeset
   186
	if (_config_file == NULL)
5296
e7acddfdd8a7 (svn r7449) -Codechange: Rename _path to _paths as it is technically more correct, but mainly because
Darkvater
parents: 5167
diff changeset
   187
		_config_file = str_fmt("%sopenttd.cfg", _paths.personal_dir);
915
d845fe7cf6f2 (svn r1402) Trim trailing whitespace
tron
parents: 818
diff changeset
   188
5296
e7acddfdd8a7 (svn r7449) -Codechange: Rename _path to _paths as it is technically more correct, but mainly because
Darkvater
parents: 5167
diff changeset
   189
	_highscore_file = str_fmt("%shs.dat", _paths.personal_dir);
e7acddfdd8a7 (svn r7449) -Codechange: Rename _path to _paths as it is technically more correct, but mainly because
Darkvater
parents: 5167
diff changeset
   190
	_log_file = str_fmt("%sopenttd.log", _paths.personal_dir);
1486
647d3a2be4fe (svn r1990) Reduce the diff between the OS specific files with respect to file handling and fix some inconsitencies (I hope I didn't break the OS/2 part, couldn't test it, feedback is welcome)
tron
parents: 1482
diff changeset
   191
801
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
   192
#if defined CUSTOM_LANG_DIR
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
   193
	// sets the search path for lng files to the custom one
5296
e7acddfdd8a7 (svn r7449) -Codechange: Rename _path to _paths as it is technically more correct, but mainly because
Darkvater
parents: 5167
diff changeset
   194
	_paths.lang_dir = malloc( MAX_PATH );
e7acddfdd8a7 (svn r7449) -Codechange: Rename _path to _paths as it is technically more correct, but mainly because
Darkvater
parents: 5167
diff changeset
   195
	ttd_strlcpy( _paths.lang_dir, CUSTOM_LANG_DIR, MAX_PATH);
801
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
   196
#else
5296
e7acddfdd8a7 (svn r7449) -Codechange: Rename _path to _paths as it is technically more correct, but mainly because
Darkvater
parents: 5167
diff changeset
   197
	_paths.lang_dir = str_fmt("%slang\\", _paths.game_data_dir);
801
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
   198
#endif
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
   199
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
   200
	// create necessary folders
5296
e7acddfdd8a7 (svn r7449) -Codechange: Rename _path to _paths as it is technically more correct, but mainly because
Darkvater
parents: 5167
diff changeset
   201
	mkdir(_paths.personal_dir);
e7acddfdd8a7 (svn r7449) -Codechange: Rename _path to _paths as it is technically more correct, but mainly because
Darkvater
parents: 5167
diff changeset
   202
	mkdir(_paths.save_dir);
e7acddfdd8a7 (svn r7449) -Codechange: Rename _path to _paths as it is technically more correct, but mainly because
Darkvater
parents: 5167
diff changeset
   203
	mkdir(_paths.autosave_dir);
e7acddfdd8a7 (svn r7449) -Codechange: Rename _path to _paths as it is technically more correct, but mainly because
Darkvater
parents: 5167
diff changeset
   204
	mkdir(_paths.scenario_dir);
e7acddfdd8a7 (svn r7449) -Codechange: Rename _path to _paths as it is technically more correct, but mainly because
Darkvater
parents: 5167
diff changeset
   205
	mkdir(_paths.heightmap_dir);
801
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
   206
}
7b6cb481359c (svn r1271) -Fix: set eol-style to native on missing files
darkvater
parents: 782
diff changeset
   207
1888
dac7806032f8 (svn r2394) - Completed clipboard functions for OS/2 port
orudge
parents: 1887
diff changeset
   208
/**
dac7806032f8 (svn r2394) - Completed clipboard functions for OS/2 port
orudge
parents: 1887
diff changeset
   209
 * Insert a chunk of text from the clipboard onto the textbuffer. Get TEXT clipboard
dac7806032f8 (svn r2394) - Completed clipboard functions for OS/2 port
orudge
parents: 1887
diff changeset
   210
 * and append this up to the maximum length (either absolute or screenlength). If maxlength
dac7806032f8 (svn r2394) - Completed clipboard functions for OS/2 port
orudge
parents: 1887
diff changeset
   211
 * is zero, we don't care about the screenlength but only about the physical length of the string
dac7806032f8 (svn r2394) - Completed clipboard functions for OS/2 port
orudge
parents: 1887
diff changeset
   212
 * @param tb @Textbuf type to be changed
dac7806032f8 (svn r2394) - Completed clipboard functions for OS/2 port
orudge
parents: 1887
diff changeset
   213
 * @return Return true on successfull change of Textbuf, or false otherwise
dac7806032f8 (svn r2394) - Completed clipboard functions for OS/2 port
orudge
parents: 1887
diff changeset
   214
 */
1486
647d3a2be4fe (svn r1990) Reduce the diff between the OS specific files with respect to file handling and fix some inconsitencies (I hope I didn't break the OS/2 part, couldn't test it, feedback is welcome)
tron
parents: 1482
diff changeset
   215
bool InsertTextBufferClipboard(Textbuf *tb)
647d3a2be4fe (svn r1990) Reduce the diff between the OS specific files with respect to file handling and fix some inconsitencies (I hope I didn't break the OS/2 part, couldn't test it, feedback is welcome)
tron
parents: 1482
diff changeset
   216
{
1893
99e4c49938af (svn r2399) - Fix: Update OS/2 project file with filename changes
orudge
parents: 1892
diff changeset
   217
	HAB hab = 0;
1524
d5cb3a8cfddc (svn r2028) Added detection of SVN version (rev.c generation) for OS/2, updated readme, initial clipboard support (orudge)
celestar
parents: 1508
diff changeset
   218
d5cb3a8cfddc (svn r2028) Added detection of SVN version (rev.c generation) for OS/2, updated readme, initial clipboard support (orudge)
celestar
parents: 1508
diff changeset
   219
	if (WinOpenClipbrd(hab))
d5cb3a8cfddc (svn r2028) Added detection of SVN version (rev.c generation) for OS/2, updated readme, initial clipboard support (orudge)
celestar
parents: 1508
diff changeset
   220
	{
1893
99e4c49938af (svn r2399) - Fix: Update OS/2 project file with filename changes
orudge
parents: 1892
diff changeset
   221
		const char* text = (const char*)WinQueryClipbrdData(hab, CF_TEXT);
99e4c49938af (svn r2399) - Fix: Update OS/2 project file with filename changes
orudge
parents: 1892
diff changeset
   222
99e4c49938af (svn r2399) - Fix: Update OS/2 project file with filename changes
orudge
parents: 1892
diff changeset
   223
		if (text != NULL)
99e4c49938af (svn r2399) - Fix: Update OS/2 project file with filename changes
orudge
parents: 1892
diff changeset
   224
		{
99e4c49938af (svn r2399) - Fix: Update OS/2 project file with filename changes
orudge
parents: 1892
diff changeset
   225
			uint length = 0;
99e4c49938af (svn r2399) - Fix: Update OS/2 project file with filename changes
orudge
parents: 1892
diff changeset
   226
			uint width = 0;
99e4c49938af (svn r2399) - Fix: Update OS/2 project file with filename changes
orudge
parents: 1892
diff changeset
   227
			const char* i;
99e4c49938af (svn r2399) - Fix: Update OS/2 project file with filename changes
orudge
parents: 1892
diff changeset
   228
99e4c49938af (svn r2399) - Fix: Update OS/2 project file with filename changes
orudge
parents: 1892
diff changeset
   229
			for (i = text; IsValidAsciiChar(*i); i++)
99e4c49938af (svn r2399) - Fix: Update OS/2 project file with filename changes
orudge
parents: 1892
diff changeset
   230
			{
99e4c49938af (svn r2399) - Fix: Update OS/2 project file with filename changes
orudge
parents: 1892
diff changeset
   231
				uint w;
99e4c49938af (svn r2399) - Fix: Update OS/2 project file with filename changes
orudge
parents: 1892
diff changeset
   232
99e4c49938af (svn r2399) - Fix: Update OS/2 project file with filename changes
orudge
parents: 1892
diff changeset
   233
				if (tb->length + length >= tb->maxlength - 1) break;
99e4c49938af (svn r2399) - Fix: Update OS/2 project file with filename changes
orudge
parents: 1892
diff changeset
   234
3800
75a58f751bfe (svn r4808) - Fix GetCharacterWidth() change in os2.c missed in r4802.
peter1138
parents: 3329
diff changeset
   235
				w = GetCharacterWidth(FS_NORMAL, (byte)*i);
1893
99e4c49938af (svn r2399) - Fix: Update OS/2 project file with filename changes
orudge
parents: 1892
diff changeset
   236
				if (tb->maxwidth != 0 && width + tb->width + w > tb->maxwidth) break;
99e4c49938af (svn r2399) - Fix: Update OS/2 project file with filename changes
orudge
parents: 1892
diff changeset
   237
99e4c49938af (svn r2399) - Fix: Update OS/2 project file with filename changes
orudge
parents: 1892
diff changeset
   238
				width += w;
99e4c49938af (svn r2399) - Fix: Update OS/2 project file with filename changes
orudge
parents: 1892
diff changeset
   239
				length++;
99e4c49938af (svn r2399) - Fix: Update OS/2 project file with filename changes
orudge
parents: 1892
diff changeset
   240
			}
99e4c49938af (svn r2399) - Fix: Update OS/2 project file with filename changes
orudge
parents: 1892
diff changeset
   241
99e4c49938af (svn r2399) - Fix: Update OS/2 project file with filename changes
orudge
parents: 1892
diff changeset
   242
			memmove(tb->buf + tb->caretpos + length, tb->buf + tb->caretpos, tb->length - tb->caretpos + 1);
99e4c49938af (svn r2399) - Fix: Update OS/2 project file with filename changes
orudge
parents: 1892
diff changeset
   243
			memcpy(tb->buf + tb->caretpos, text, length);
99e4c49938af (svn r2399) - Fix: Update OS/2 project file with filename changes
orudge
parents: 1892
diff changeset
   244
			tb->width += width;
99e4c49938af (svn r2399) - Fix: Update OS/2 project file with filename changes
orudge
parents: 1892
diff changeset
   245
			tb->caretxoffs += width;
99e4c49938af (svn r2399) - Fix: Update OS/2 project file with filename changes
orudge
parents: 1892
diff changeset
   246
			tb->length += length;
99e4c49938af (svn r2399) - Fix: Update OS/2 project file with filename changes
orudge
parents: 1892
diff changeset
   247
			tb->caretpos += length;
99e4c49938af (svn r2399) - Fix: Update OS/2 project file with filename changes
orudge
parents: 1892
diff changeset
   248
99e4c49938af (svn r2399) - Fix: Update OS/2 project file with filename changes
orudge
parents: 1892
diff changeset
   249
			WinCloseClipbrd(hab);
99e4c49938af (svn r2399) - Fix: Update OS/2 project file with filename changes
orudge
parents: 1892
diff changeset
   250
			return true;
99e4c49938af (svn r2399) - Fix: Update OS/2 project file with filename changes
orudge
parents: 1892
diff changeset
   251
		}
1888
dac7806032f8 (svn r2394) - Completed clipboard functions for OS/2 port
orudge
parents: 1887
diff changeset
   252
1524
d5cb3a8cfddc (svn r2028) Added detection of SVN version (rev.c generation) for OS/2, updated readme, initial clipboard support (orudge)
celestar
parents: 1508
diff changeset
   253
		WinCloseClipbrd(hab);
d5cb3a8cfddc (svn r2028) Added detection of SVN version (rev.c generation) for OS/2, updated readme, initial clipboard support (orudge)
celestar
parents: 1508
diff changeset
   254
	}
d5cb3a8cfddc (svn r2028) Added detection of SVN version (rev.c generation) for OS/2, updated readme, initial clipboard support (orudge)
celestar
parents: 1508
diff changeset
   255
1893
99e4c49938af (svn r2399) - Fix: Update OS/2 project file with filename changes
orudge
parents: 1892
diff changeset
   256
	return false;
1486
647d3a2be4fe (svn r1990) Reduce the diff between the OS specific files with respect to file handling and fix some inconsitencies (I hope I didn't break the OS/2 part, couldn't test it, feedback is welcome)
tron
parents: 1482
diff changeset
   257
}
1887
6107f7704454 (svn r2393) - Implemented threaded saving for OS/2
orudge
parents: 1817
diff changeset
   258
2167
5686131337a4 (svn r2681) - Fix OS/2 port, please do not modify openttd.wpj/tgt by hand unless you know what you're doing!
orudge
parents: 2099
diff changeset
   259
5686131337a4 (svn r2681) - Fix OS/2 port, please do not modify openttd.wpj/tgt by hand unless you know what you're doing!
orudge
parents: 2099
diff changeset
   260
void CSleep(int milliseconds)
5686131337a4 (svn r2681) - Fix OS/2 port, please do not modify openttd.wpj/tgt by hand unless you know what you're doing!
orudge
parents: 2099
diff changeset
   261
{
5686131337a4 (svn r2681) - Fix OS/2 port, please do not modify openttd.wpj/tgt by hand unless you know what you're doing!
orudge
parents: 2099
diff changeset
   262
	delay(milliseconds);
5686131337a4 (svn r2681) - Fix OS/2 port, please do not modify openttd.wpj/tgt by hand unless you know what you're doing!
orudge
parents: 2099
diff changeset
   263
}
5167
12c46fb7eccf (svn r7274) -Codechange [utf8]: Add input/output unicode support. This actually only changes win32
Darkvater
parents: 4369
diff changeset
   264
12c46fb7eccf (svn r7274) -Codechange [utf8]: Add input/output unicode support. This actually only changes win32
Darkvater
parents: 4369
diff changeset
   265
const char *FS2OTTD(const char *name) {return name;}
12c46fb7eccf (svn r7274) -Codechange [utf8]: Add input/output unicode support. This actually only changes win32
Darkvater
parents: 4369
diff changeset
   266
const char *OTTD2FS(const char *name) {return name;}