mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r1289) -Fix: Minor fix for OS/2 message boxes (orudge)
This commit is contained in:
parent
c2ee8d70e4
commit
5b8c604f47
|
@ -16,6 +16,9 @@ LIBRARIES REQUIRED FOR END USERS
|
|||
SDL.DLL (SDL 1.2.7) and FSLib.dll are required to use this program:
|
||||
these can be downloaded from the Files section at
|
||||
http://sourceforge.net/projects/openttd/ - see "os2-useful.zip".
|
||||
(Note that a newer version of SDL is now available at
|
||||
ftp://ftp.netlabs.org/pub/sdl/sdl-dev-os2-2004-12-22.zip which may
|
||||
help solve some problems).
|
||||
|
||||
Note that to actually play the game, I have found in my own
|
||||
experience that a version of the Scitech Display Drivers or its later
|
||||
|
@ -87,8 +90,9 @@ provided, they are not designed for Watcom (apart from SDL):
|
|||
http://www.libpng.org/ - contains an EMX/gcc makefile
|
||||
|
||||
- SDL for OS/2
|
||||
I used ftp://ftp.netlabs.org/pub/sdl/SDL-1.2.7-src-20040908a.zip -
|
||||
take SDL.dll and SDL.lib from the src/ directory.
|
||||
For 0.3.5, I used ftp://ftp.netlabs.org/pub/sdl/SDL-1.2.7-src-20040908a.zip -
|
||||
take SDL.dll and SDL.lib from the src/ directory. Note that 20041222 is
|
||||
out now, which is recommended for stability updates.
|
||||
|
||||
If you do not wish to build the libraries yourself, pre-built versions
|
||||
can be downloaded from the Files section at
|
||||
|
|
32
os2.c
32
os2.c
|
@ -11,8 +11,8 @@
|
|||
#include <dos.h>
|
||||
|
||||
#define INCL_DOS
|
||||
#define INCL_WINDIALOGS
|
||||
#define INCL_OS2MM
|
||||
#define INCL_WIN
|
||||
|
||||
#include <os2.h>
|
||||
#include <os2me.h>
|
||||
|
@ -481,15 +481,38 @@ static void ChangeWorkingDirectory(char *exe)
|
|||
}
|
||||
}
|
||||
|
||||
// for some reason these calls don't actually work properly :/
|
||||
void ShowInfo(const char *str)
|
||||
{
|
||||
WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, str, "OpenTTD", 0, MB_OK | MB_SYSTEMMODAL | MB_MOVEABLE | MB_INFORMATION);
|
||||
HAB hab;
|
||||
HMQ hmq;
|
||||
ULONG rc;
|
||||
|
||||
// init PM env.
|
||||
hmq = WinCreateMsgQueue((hab = WinInitialize(0)), 0);
|
||||
|
||||
// display the box
|
||||
rc = WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, str, "OpenTTD", 0, MB_OK | MB_MOVEABLE | MB_INFORMATION);
|
||||
|
||||
// terminate PM env.
|
||||
WinDestroyMsgQueue(hmq);
|
||||
WinTerminate(hab);
|
||||
}
|
||||
|
||||
void ShowOSErrorBox(const char *buf)
|
||||
{
|
||||
WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, buf, "OpenTTD", 0, MB_OK | MB_SYSTEMMODAL | MB_MOVEABLE | MB_ERROR);
|
||||
HAB hab;
|
||||
HMQ hmq;
|
||||
ULONG rc;
|
||||
|
||||
// init PM env.
|
||||
hmq = WinCreateMsgQueue((hab = WinInitialize(0)), 0);
|
||||
|
||||
// display the box
|
||||
rc = WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, buf, "OpenTTD", 0, MB_OK | MB_MOVEABLE | MB_ERROR);
|
||||
|
||||
// terminate PM env.
|
||||
WinDestroyMsgQueue(hmq);
|
||||
WinTerminate(hab);
|
||||
}
|
||||
|
||||
int CDECL main(int argc, char* argv[])
|
||||
|
@ -588,7 +611,6 @@ void OS2_SwitchToConsoleMode()
|
|||
pib->pib_ultype = 3;
|
||||
}
|
||||
|
||||
|
||||
/**********************
|
||||
* OS/2 MIDI PLAYER
|
||||
**********************/
|
||||
|
|
Loading…
Reference in New Issue