mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-09-01 10:59:12 +00:00
Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
d4179a0bec |
2
Makefile
2
Makefile
@@ -268,7 +268,7 @@ ENDIAN_CHECK=endian_check$(EXE)
|
||||
STRGEN=strgen/strgen$(EXE)
|
||||
OSXAPP="OpenTTD.app"
|
||||
|
||||
REV := 0.5.2
|
||||
REV := 0.5.2-RC1
|
||||
|
||||
# define flag to use for -lrt (some OSes overwrites this later for compatibility)
|
||||
ifndef LRT
|
||||
|
@@ -1,10 +1,3 @@
|
||||
0.5.2 (2007-05-29)
|
||||
------------------------------------------------------------------------
|
||||
- Feature: Add threading support for MorphOS (r9759)
|
||||
- Fix: Bridges and tunnels were not always removed on bankruptcy, thus leaving tunnels/bridges with an invalid owner that would crash the game when clicking with the query tool on them (r9966)
|
||||
- Fix: Null pointer dereference under MorphOS and AmigaOS (r9861)
|
||||
|
||||
|
||||
0.5.2-RC1 (2007-05-16)
|
||||
------------------------------------------------------------------------
|
||||
- Feature: Windows 95/98/ME check in Windows 2000/XP/2003/Vista builds (r9834)
|
||||
@@ -32,7 +25,6 @@
|
||||
------------------------------------------------------------------------
|
||||
(None)
|
||||
|
||||
|
||||
0.5.1-RC3 (2007-04-17)
|
||||
------------------------------------------------------------------------
|
||||
- Feature: Add list_patches to console commands; shows all patches and values (r9565)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
.\" Hey, EMACS: -*- nroff -*-
|
||||
.\" Please adjust this date whenever revising the manpage.
|
||||
.Dd May 29, 2007
|
||||
.Dd May 16, 2007
|
||||
.Dt OPENTTD 6
|
||||
.Sh NAME
|
||||
.Nm openttd
|
||||
|
@@ -7,7 +7,7 @@
|
||||
extern const char _openttd_revision[];
|
||||
#elif defined(WITH_REV_HACK)
|
||||
#define WITH_REV
|
||||
const char _openttd_revision[] = "0.5.2";
|
||||
const char _openttd_revision[] = "0.5.2-RC1";
|
||||
#else
|
||||
const char _openttd_revision[] = NOREV_STRING;
|
||||
#endif
|
||||
|
@@ -1,9 +1,3 @@
|
||||
openttd (0.5.2-1) unstable; urgency=low
|
||||
|
||||
* New upstream release.
|
||||
|
||||
-- Matthijs Kooijman <m.kooijman@student.utwente.nl> Tue, 29 May 2007 20:00:00 +0100
|
||||
|
||||
openttd (0.5.2~rc1-1) unstable; urgency=low
|
||||
|
||||
* New upstream release.
|
||||
|
@@ -1,6 +1,6 @@
|
||||
!define APPNAME "OpenTTD" ; Define application name
|
||||
!define APPVERSION "0.5.2" ; Define application version
|
||||
!define INSTALLERVERSION 34 ; NEED TO UPDATE THIS FOR EVERY RELEASE!!!
|
||||
!define INSTALLERVERSION 33 ; NEED TO UPDATE THIS FOR EVERY RELEASE!!!
|
||||
|
||||
!define APPURLLINK "http://www.openttd.org"
|
||||
!define APPNAMEANDVERSION "${APPNAME} ${APPVERSION}"
|
||||
@@ -81,7 +81,6 @@ Page custom ShowWarningsPage
|
||||
!define MUI_FINISHPAGE_NOREBOOTSUPPORT
|
||||
!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\readme.txt"
|
||||
!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
|
||||
!define MUI_WELCOMEFINISHPAGE_CUSTOMFUNCTION_INIT DisableBack
|
||||
|
||||
!insertmacro MUI_PAGE_FINISH
|
||||
!insertmacro MUI_UNPAGE_CONFIRM
|
||||
@@ -355,30 +354,26 @@ NoCD:
|
||||
hasCD:
|
||||
FunctionEnd
|
||||
|
||||
;----------------------------------------------------------------------------------
|
||||
; Disable the "Back" button on finish page if the installer is run on Win9x systems
|
||||
Function DisableBack
|
||||
Call GetWindowsVersion
|
||||
Pop $R0
|
||||
StrCmp $R0 "win9x" 0 WinNT
|
||||
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Settings" "BackEnabled" "0"
|
||||
WinNT:
|
||||
ClearErrors
|
||||
FunctionEnd
|
||||
|
||||
;----------------------------------------------------------------------------------
|
||||
; Custom page function to show notices for running OpenTTD (only for win32 systems)
|
||||
;---------------------------------------------------------------------
|
||||
; Custom page function to show notices for running OpenTTD
|
||||
; We have extracted this custom page as Notice in the .onInit function
|
||||
Function ShowWarningsPage
|
||||
Call GetWindowsVersion
|
||||
Pop $R0
|
||||
; Don't show the UNICODE notice if the installer is run on Win9x systems
|
||||
StrCmp $R0 "win9x" 0 WinNT
|
||||
Abort
|
||||
WinNT:
|
||||
!insertmacro MUI_HEADER_TEXT "Installation Complete" "Important notices for OpenTTD usage."
|
||||
!insertmacro MUI_INSTALLOPTIONS_EXTRACT_AS "notice.ini" "Notice"
|
||||
!insertmacro MUI_INSTALLOPTIONS_INITDIALOG "Notice"
|
||||
|
||||
Call GetWindowsVersion
|
||||
Pop $R0
|
||||
|
||||
; Hide the MSLU text if the installer is not run on Win9x systems
|
||||
StrCmp $R0 "winnt" 0 Win9x
|
||||
!insertmacro MUI_INSTALLOPTIONS_READ $R1 "Notice" "Field 1" "HWND" ; MSLU groupbox
|
||||
ShowWindow $R1 0
|
||||
!insertmacro MUI_INSTALLOPTIONS_READ $R1 "Notice" "Field 2" "HWND" ; MSLU text
|
||||
ShowWindow $R1 0
|
||||
!insertmacro MUI_INSTALLOPTIONS_READ $R1 "Notice" "Field 3" "HWND" ; MSLU link
|
||||
ShowWindow $R1 0
|
||||
Win9x:
|
||||
ClearErrors
|
||||
!insertmacro MUI_INSTALLOPTIONS_SHOW
|
||||
FunctionEnd
|
||||
|
@@ -1,17 +1,41 @@
|
||||
; Ini file generated by the HM NIS Edit IO designer.
|
||||
[Settings]
|
||||
NumFields=3
|
||||
CancelEnabled=0
|
||||
NumFields=6
|
||||
|
||||
[Field 1]
|
||||
Type=Groupbox
|
||||
Text=Notice for Windows 9x/ME users!
|
||||
Left=8
|
||||
Right=292
|
||||
Top=80
|
||||
Bottom=138
|
||||
|
||||
[Field 2]
|
||||
Type=Label
|
||||
Text=OpenTTD will not work without the Microsoft Layer for Unicode installed.\r\nDue to licensing issues we cannot bundle this file with the installer. Please download MSLU from the Microsoft website and extract UnicoWS.dll to the same directory as the openttd executabe.
|
||||
Left=13
|
||||
Right=284
|
||||
Top=91
|
||||
Bottom=127
|
||||
|
||||
[Field 3]
|
||||
Type=Link
|
||||
Text=Microsoft Layer for Unicode
|
||||
State=http://www.microsoft.com/downloads/details.aspx?FamilyId=73BA7BD7-ED06-4F0D-80A4-2A7EEAEE17E2&displaylang=en
|
||||
Left=197
|
||||
Right=284
|
||||
Top=127
|
||||
Bottom=135
|
||||
|
||||
[Field 4]
|
||||
Type=Groupbox
|
||||
Text=UNICODE support
|
||||
Left=8
|
||||
Right=292
|
||||
Top=0
|
||||
Bottom=75
|
||||
|
||||
[Field 2]
|
||||
[Field 5]
|
||||
Type=Label
|
||||
Text=This version of OpenTTD has support for UNICODE, allowing users to use non-ASCII character sets such as Russian or Japanese.\r\nSelecting such a language will result in an unusable and garbled interface. You will need to specify a font that has support for these characters in openttd.cfg, or alternatively use an appropiate grf file.\r\n\r\nFor more information please refer to the readme or the wiki.
|
||||
Left=13
|
||||
@@ -19,7 +43,7 @@ Right=284
|
||||
Top=9
|
||||
Bottom=65
|
||||
|
||||
[Field 3]
|
||||
[Field 6]
|
||||
Type=Link
|
||||
Text=OpenTTD wiki
|
||||
Left=238
|
||||
|
@@ -65,8 +65,8 @@ END
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 0,5,2,0
|
||||
PRODUCTVERSION 0,5,2,0
|
||||
FILEVERSION 0,5,0,0
|
||||
PRODUCTVERSION 0,5,0,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
@@ -84,14 +84,14 @@ BEGIN
|
||||
VALUE "Comments", "This program is licensed under the GNU General Public License.\0"
|
||||
VALUE "CompanyName", "OpenTTD Development Team\0"
|
||||
VALUE "FileDescription", "OpenTTD\0"
|
||||
VALUE "FileVersion", "0.5.2\0"
|
||||
VALUE "FileVersion", "0.5.2-RC1\0"
|
||||
VALUE "InternalName", "openttd\0"
|
||||
VALUE "LegalCopyright", "Copyright <20> OpenTTD Developers 2002-2007. All Rights Reserved.\0"
|
||||
VALUE "LegalTrademarks", "\0"
|
||||
VALUE "OriginalFilename", "openttd.exe\0"
|
||||
VALUE "PrivateBuild", "\0"
|
||||
VALUE "ProductName", "OpenTTD\0"
|
||||
VALUE "ProductVersion", "0.5.2.0\0"
|
||||
VALUE "ProductVersion", "0.0.0.0\0"
|
||||
VALUE "SpecialBuild", "-\0"
|
||||
END
|
||||
END
|
||||
|
@@ -1,6 +1,6 @@
|
||||
OpenTTD README
|
||||
Last updated: 2007-05-29
|
||||
Release version: 0.5.2
|
||||
Last updated: 2007-05-16
|
||||
Release version: 0.5.2-RC1
|
||||
------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
156
thread.c
156
thread.c
@@ -4,7 +4,7 @@
|
||||
#include "thread.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
#if defined(__AMIGA__) || defined(NO_THREADS)
|
||||
#if defined(__AMIGA__) || defined(__MORPHOS__) || defined(NO_THREADS)
|
||||
OTTDThread *OTTDCreateThread(OTTDThreadFunc function, void *arg) { return NULL; }
|
||||
void *OTTDJoinThread(OTTDThread *t) { return NULL; }
|
||||
void OTTDExitThread(void) { NOT_REACHED(); };
|
||||
@@ -62,7 +62,7 @@ void OTTDExitThread(void)
|
||||
_endthread();
|
||||
}
|
||||
|
||||
#elif defined(UNIX) && !defined(__MORPHOS__)
|
||||
#elif defined(UNIX)
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
@@ -154,156 +154,4 @@ void OTTDExitThread(void)
|
||||
{
|
||||
ExitThread(0);
|
||||
}
|
||||
|
||||
#elif defined(MORPHOS)
|
||||
|
||||
#include <exec/types.h>
|
||||
#include <exec/rawfmt.h>
|
||||
#include <dos/dostags.h>
|
||||
|
||||
#include <proto/dos.h>
|
||||
#include <proto/exec.h>
|
||||
|
||||
#include <setjmp.h>
|
||||
|
||||
/* NOTE: this code heavily depends on latest libnix updates. So make
|
||||
* sure you link with new stuff which supports semaphore locking of
|
||||
* the IO resources, else it will just go foobar. */
|
||||
|
||||
struct OTTDThreadStartupMessage {
|
||||
struct Message msg; ///< standard exec.library message (MUST be the first thing in the message struct!)
|
||||
OTTDThreadFunc func; ///< function the thread will execute
|
||||
void *arg; ///< functions arguments for the thread function
|
||||
void *ret; ///< return value of the thread function
|
||||
jmp_buf jumpstore; ///< storage for the setjump state
|
||||
};
|
||||
|
||||
struct OTTDThread {
|
||||
struct MsgPort *replyport;
|
||||
struct OTTDThreadStartupMessage msg;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Default OpenTTD STDIO/ERR debug output is not very useful for this, so we
|
||||
* utilize serial/ramdebug instead.
|
||||
*/
|
||||
#ifndef NO_DEBUG_MESSAGES
|
||||
void KPutStr(CONST_STRPTR format)
|
||||
{
|
||||
RawDoFmt(format, NULL, (void (*)())RAWFMTFUNC_SERIAL, NULL);
|
||||
}
|
||||
#else
|
||||
#define KPutStr(x)
|
||||
#endif
|
||||
|
||||
static void Proxy(void)
|
||||
{
|
||||
struct Task *child = FindTask(NULL);
|
||||
struct OTTDThreadStartupMessage *msg;
|
||||
|
||||
/* Make sure, we don't block the parent. */
|
||||
SetTaskPri(child, -5);
|
||||
|
||||
KPutStr("[Child] Progressing...\n");
|
||||
|
||||
if (NewGetTaskAttrs(NULL, &msg, sizeof(struct OTTDThreadStartupMessage *), TASKINFOTYPE_STARTUPMSG, TAG_DONE) && msg != NULL) {
|
||||
/* Make use of setjmp() here, so this point can be reached again from inside
|
||||
* OTTDExitThread() which can be called from anythere inside msg->func.
|
||||
* It's a bit ugly and in worst case it leaks some memory. */
|
||||
if (setjmp(msg->jumpstore) == 0) {
|
||||
msg->ret = msg->func(msg->arg);
|
||||
} else {
|
||||
KPutStr("[Child] Returned to main()\n");
|
||||
}
|
||||
}
|
||||
|
||||
/* Quit the child, exec.library will reply the startup msg internally. */
|
||||
KPutStr("[Child] Done.\n");
|
||||
}
|
||||
|
||||
OTTDThread* OTTDCreateThread(OTTDThreadFunc function, void *arg)
|
||||
{
|
||||
OTTDThread *t;
|
||||
struct Task *parent;
|
||||
|
||||
KPutStr("[OpenTTD] Create thread...\n");
|
||||
|
||||
t = (struct OTTDThread *)AllocVecTaskPooled(sizeof(struct OTTDThread));
|
||||
if (t == NULL) return NULL;
|
||||
|
||||
parent = FindTask(NULL);
|
||||
|
||||
/* Make sure main thread runs with sane priority */
|
||||
SetTaskPri(parent, 0);
|
||||
|
||||
/* Things we'll pass down to the child by utilizing NP_StartupMsg */
|
||||
t->msg.func = function;
|
||||
t->msg.arg = arg;
|
||||
t->msg.ret = NULL;
|
||||
|
||||
t->replyport = CreateMsgPort();
|
||||
|
||||
if (t->replyport != NULL) {
|
||||
struct Process *child;
|
||||
|
||||
t->msg.msg.mn_Node.ln_Type = NT_MESSAGE;
|
||||
t->msg.msg.mn_ReplyPort = t->replyport;
|
||||
t->msg.msg.mn_Length = sizeof(struct OTTDThreadStartupMessage);
|
||||
|
||||
child = CreateNewProcTags(
|
||||
NP_CodeType, CODETYPE_PPC,
|
||||
NP_Entry, Proxy,
|
||||
NP_StartupMsg, (ULONG)&t->msg,
|
||||
NP_Priority, 5UL,
|
||||
NP_Name, (ULONG)"OpenTTD Thread",
|
||||
NP_PPCStackSize, 131072UL,
|
||||
TAG_DONE);
|
||||
|
||||
if (child != NULL) {
|
||||
KPutStr("[OpenTTD] Child process launched.\n");
|
||||
return t;
|
||||
}
|
||||
DeleteMsgPort(t->replyport);
|
||||
}
|
||||
FreeVecTaskPooled(t);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void* OTTDJoinThread(OTTDThread *t)
|
||||
{
|
||||
struct OTTDThreadStartupMessage *reply;
|
||||
void *ret;
|
||||
|
||||
KPutStr("[OpenTTD] Join threads...\n");
|
||||
|
||||
if (t == NULL) return NULL;
|
||||
|
||||
KPutStr("[OpenTTD] Wait for child to quit...\n");
|
||||
WaitPort(t->replyport);
|
||||
|
||||
reply = (struct OTTDThreadStartupMessage *)GetMsg(t->replyport);
|
||||
ret = reply->ret;
|
||||
|
||||
DeleteMsgPort(t->replyport);
|
||||
FreeVecTaskPooled(t);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void OTTDExitThread()
|
||||
{
|
||||
struct OTTDThreadStartupMessage *msg;
|
||||
|
||||
KPutStr("[Child] Aborting...\n");
|
||||
|
||||
if (NewGetTaskAttrs(NULL, &msg, sizeof(struct OTTDThreadStartupMessage *), TASKINFOTYPE_STARTUPMSG, TAG_DONE) && msg != NULL) {
|
||||
KPutStr("[Child] Jumping back...\n");
|
||||
longjmp(msg->jumpstore, 0xBEAFCAFE);
|
||||
}
|
||||
|
||||
NOT_REACHED();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -1349,13 +1349,7 @@ static void ChangeTileOwner_TunnelBridge(TileIndex tile, PlayerID old_player, Pl
|
||||
SetTileOwner(tile, OWNER_NONE);
|
||||
}
|
||||
} else {
|
||||
if (CmdFailed(DoCommand(tile, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR))) {
|
||||
/* When clearing the bridge/tunnel failed there are still vehicles on/in
|
||||
* the bridge/tunnel. As all *our* vehicles are already removed, they
|
||||
* must be of another owner. Therefor this must be a road bridge/tunnel.
|
||||
* In that case we can safely reassign the ownership to OWNER_NONE. */
|
||||
SetTileOwner(tile, OWNER_NONE);
|
||||
}
|
||||
DoCommand(tile, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user