mirror of https://github.com/OpenTTD/OpenTTD
(svn r16598) [0.7] -Backport from trunk:
- Fix: Mouse would under some circumstances not be undrawn when drawing the first chat line causing two mouse pointers to be visible [FS#2969] (r16594) - Fix: Do not crash when tars/NewGRFs are removed, just tell the file could not be opened/found [FS#2967] (r16590) - Fix: Set default stack size to 1MB to prevent _chstk crash (MSVC) [FS#2978] (r16589, r16588) - Fix: [Network] Always send the starting date from the game you are currently playing instead the starting date from the config file (r16573)release/0.7
parent
2d454f37f0
commit
024aa14f94
|
@ -103,6 +103,8 @@
|
||||||
IgnoreDefaultLibraryNames=""
|
IgnoreDefaultLibraryNames=""
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
SubSystem="2"
|
SubSystem="2"
|
||||||
|
StackReserveSize="1048576"
|
||||||
|
StackCommitSize="1048576"
|
||||||
OptimizeReferences="2"
|
OptimizeReferences="2"
|
||||||
OptimizeForWindows98="1"
|
OptimizeForWindows98="1"
|
||||||
TargetMachine="1"
|
TargetMachine="1"
|
||||||
|
@ -201,6 +203,8 @@
|
||||||
IgnoreDefaultLibraryNames="LIBCMT.lib"
|
IgnoreDefaultLibraryNames="LIBCMT.lib"
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
SubSystem="2"
|
SubSystem="2"
|
||||||
|
StackReserveSize="1048576"
|
||||||
|
StackCommitSize="1048576"
|
||||||
TargetMachine="1"
|
TargetMachine="1"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
|
@ -312,6 +316,8 @@
|
||||||
IgnoreDefaultLibraryNames=""
|
IgnoreDefaultLibraryNames=""
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
SubSystem="2"
|
SubSystem="2"
|
||||||
|
StackReserveSize="1048576"
|
||||||
|
StackCommitSize="1048576"
|
||||||
OptimizeReferences="2"
|
OptimizeReferences="2"
|
||||||
OptimizeForWindows98="1"
|
OptimizeForWindows98="1"
|
||||||
TargetMachine="17"
|
TargetMachine="17"
|
||||||
|
@ -413,6 +419,8 @@
|
||||||
IgnoreDefaultLibraryNames="LIBCMT.lib"
|
IgnoreDefaultLibraryNames="LIBCMT.lib"
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
SubSystem="2"
|
SubSystem="2"
|
||||||
|
StackReserveSize="1048576"
|
||||||
|
StackCommitSize="1048576"
|
||||||
TargetMachine="17"
|
TargetMachine="17"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
|
|
|
@ -103,6 +103,8 @@
|
||||||
IgnoreDefaultLibraryNames=""
|
IgnoreDefaultLibraryNames=""
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
SubSystem="2"
|
SubSystem="2"
|
||||||
|
StackReserveSize="1048576"
|
||||||
|
StackCommitSize="1048576"
|
||||||
OptimizeReferences="2"
|
OptimizeReferences="2"
|
||||||
OptimizeForWindows98="1"
|
OptimizeForWindows98="1"
|
||||||
TargetMachine="1"
|
TargetMachine="1"
|
||||||
|
@ -201,6 +203,8 @@
|
||||||
IgnoreDefaultLibraryNames="LIBCMT.lib"
|
IgnoreDefaultLibraryNames="LIBCMT.lib"
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
SubSystem="2"
|
SubSystem="2"
|
||||||
|
StackReserveSize="1048576"
|
||||||
|
StackCommitSize="1048576"
|
||||||
TargetMachine="1"
|
TargetMachine="1"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
|
@ -312,6 +316,8 @@
|
||||||
IgnoreDefaultLibraryNames=""
|
IgnoreDefaultLibraryNames=""
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
SubSystem="2"
|
SubSystem="2"
|
||||||
|
StackReserveSize="1048576"
|
||||||
|
StackCommitSize="1048576"
|
||||||
OptimizeReferences="2"
|
OptimizeReferences="2"
|
||||||
OptimizeForWindows98="1"
|
OptimizeForWindows98="1"
|
||||||
TargetMachine="17"
|
TargetMachine="17"
|
||||||
|
@ -413,6 +419,8 @@
|
||||||
IgnoreDefaultLibraryNames="LIBCMT.lib"
|
IgnoreDefaultLibraryNames="LIBCMT.lib"
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
SubSystem="2"
|
SubSystem="2"
|
||||||
|
StackReserveSize="1048576"
|
||||||
|
StackCommitSize="1048576"
|
||||||
TargetMachine="17"
|
TargetMachine="17"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
|
|
|
@ -104,6 +104,8 @@
|
||||||
IgnoreDefaultLibraryNames=""
|
IgnoreDefaultLibraryNames=""
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
SubSystem="2"
|
SubSystem="2"
|
||||||
|
StackReserveSize="1048576"
|
||||||
|
StackCommitSize="1048576"
|
||||||
OptimizeReferences="2"
|
OptimizeReferences="2"
|
||||||
RandomizedBaseAddress="1"
|
RandomizedBaseAddress="1"
|
||||||
DataExecutionPrevention="0"
|
DataExecutionPrevention="0"
|
||||||
|
@ -200,6 +202,8 @@
|
||||||
IgnoreDefaultLibraryNames="LIBCMT.lib"
|
IgnoreDefaultLibraryNames="LIBCMT.lib"
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
SubSystem="2"
|
SubSystem="2"
|
||||||
|
StackReserveSize="1048576"
|
||||||
|
StackCommitSize="1048576"
|
||||||
RandomizedBaseAddress="1"
|
RandomizedBaseAddress="1"
|
||||||
DataExecutionPrevention="0"
|
DataExecutionPrevention="0"
|
||||||
TargetMachine="1"
|
TargetMachine="1"
|
||||||
|
@ -310,6 +314,8 @@
|
||||||
IgnoreDefaultLibraryNames=""
|
IgnoreDefaultLibraryNames=""
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
SubSystem="2"
|
SubSystem="2"
|
||||||
|
StackReserveSize="1048576"
|
||||||
|
StackCommitSize="1048576"
|
||||||
OptimizeReferences="2"
|
OptimizeReferences="2"
|
||||||
TargetMachine="17"
|
TargetMachine="17"
|
||||||
/>
|
/>
|
||||||
|
@ -410,6 +416,8 @@
|
||||||
IgnoreDefaultLibraryNames="LIBCMT.lib"
|
IgnoreDefaultLibraryNames="LIBCMT.lib"
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
SubSystem="2"
|
SubSystem="2"
|
||||||
|
StackReserveSize="1048576"
|
||||||
|
StackCommitSize="1048576"
|
||||||
TargetMachine="17"
|
TargetMachine="17"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
|
|
|
@ -104,6 +104,8 @@
|
||||||
IgnoreDefaultLibraryNames=""
|
IgnoreDefaultLibraryNames=""
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
SubSystem="2"
|
SubSystem="2"
|
||||||
|
StackReserveSize="1048576"
|
||||||
|
StackCommitSize="1048576"
|
||||||
OptimizeReferences="2"
|
OptimizeReferences="2"
|
||||||
RandomizedBaseAddress="1"
|
RandomizedBaseAddress="1"
|
||||||
DataExecutionPrevention="0"
|
DataExecutionPrevention="0"
|
||||||
|
@ -200,6 +202,8 @@
|
||||||
IgnoreDefaultLibraryNames="LIBCMT.lib"
|
IgnoreDefaultLibraryNames="LIBCMT.lib"
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
SubSystem="2"
|
SubSystem="2"
|
||||||
|
StackReserveSize="1048576"
|
||||||
|
StackCommitSize="1048576"
|
||||||
RandomizedBaseAddress="1"
|
RandomizedBaseAddress="1"
|
||||||
DataExecutionPrevention="0"
|
DataExecutionPrevention="0"
|
||||||
TargetMachine="1"
|
TargetMachine="1"
|
||||||
|
@ -310,6 +314,8 @@
|
||||||
IgnoreDefaultLibraryNames=""
|
IgnoreDefaultLibraryNames=""
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
SubSystem="2"
|
SubSystem="2"
|
||||||
|
StackReserveSize="1048576"
|
||||||
|
StackCommitSize="1048576"
|
||||||
OptimizeReferences="2"
|
OptimizeReferences="2"
|
||||||
TargetMachine="17"
|
TargetMachine="17"
|
||||||
/>
|
/>
|
||||||
|
@ -410,6 +416,8 @@
|
||||||
IgnoreDefaultLibraryNames="LIBCMT.lib"
|
IgnoreDefaultLibraryNames="LIBCMT.lib"
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
SubSystem="2"
|
SubSystem="2"
|
||||||
|
StackReserveSize="1048576"
|
||||||
|
StackCommitSize="1048576"
|
||||||
TargetMachine="17"
|
TargetMachine="17"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
|
|
|
@ -337,7 +337,7 @@ FILE *FioFOpenFileSp(const char *filename, const char *mode, Searchpath sp, Subd
|
||||||
FILE *FioFOpenFileTar(TarFileListEntry *entry, size_t *filesize)
|
FILE *FioFOpenFileTar(TarFileListEntry *entry, size_t *filesize)
|
||||||
{
|
{
|
||||||
FILE *f = fopen(entry->tar_filename, "rb");
|
FILE *f = fopen(entry->tar_filename, "rb");
|
||||||
assert(f != NULL);
|
if (f == NULL) return f;
|
||||||
|
|
||||||
fseek(f, entry->position, SEEK_SET);
|
fseek(f, entry->position, SEEK_SET);
|
||||||
if (filesize != NULL) *filesize = entry->size;
|
if (filesize != NULL) *filesize = entry->size;
|
||||||
|
|
|
@ -772,7 +772,6 @@ static void NetworkInitGameInfo()
|
||||||
|
|
||||||
/* The server is a client too */
|
/* The server is a client too */
|
||||||
_network_game_info.clients_on = _network_dedicated ? 0 : 1;
|
_network_game_info.clients_on = _network_dedicated ? 0 : 1;
|
||||||
_network_game_info.start_date = ConvertYMDToDate(_settings_game.game_creation.starting_year, 0, 1);
|
|
||||||
|
|
||||||
NetworkClientInfo *ci = new NetworkClientInfo(CLIENT_ID_SERVER);
|
NetworkClientInfo *ci = new NetworkClientInfo(CLIENT_ID_SERVER);
|
||||||
ci->client_playas = _network_dedicated ? COMPANY_SPECTATOR : _local_company;
|
ci->client_playas = _network_dedicated ? COMPANY_SPECTATOR : _local_company;
|
||||||
|
|
|
@ -124,28 +124,26 @@ void NetworkInitChatMessage()
|
||||||
/** Hide the chatbox */
|
/** Hide the chatbox */
|
||||||
void NetworkUndrawChatMessage()
|
void NetworkUndrawChatMessage()
|
||||||
{
|
{
|
||||||
|
/* Sometimes we also need to hide the cursor
|
||||||
|
* This is because both textmessage and the cursor take a shot of the
|
||||||
|
* screen before drawing.
|
||||||
|
* Now the textmessage takes his shot and paints his data before the cursor
|
||||||
|
* does, so in the shot of the cursor is the screen-data of the textmessage
|
||||||
|
* included when the cursor hangs somewhere over the textmessage. To
|
||||||
|
* avoid wrong repaints, we undraw the cursor in that case, and everything
|
||||||
|
* looks nicely ;)
|
||||||
|
* (and now hope this story above makes sense to you ;))
|
||||||
|
*/
|
||||||
|
if (_cursor.visible &&
|
||||||
|
_cursor.draw_pos.x + _cursor.draw_size.x >= _chatmsg_box.x &&
|
||||||
|
_cursor.draw_pos.x <= _chatmsg_box.x + _chatmsg_box.width &&
|
||||||
|
_cursor.draw_pos.y + _cursor.draw_size.y >= _screen.height - _chatmsg_box.y - _chatmsg_box.height &&
|
||||||
|
_cursor.draw_pos.y <= _screen.height - _chatmsg_box.y) {
|
||||||
|
UndrawMouseCursor();
|
||||||
|
}
|
||||||
|
|
||||||
if (_chatmessage_visible) {
|
if (_chatmessage_visible) {
|
||||||
Blitter *blitter = BlitterFactoryBase::GetCurrentBlitter();
|
Blitter *blitter = BlitterFactoryBase::GetCurrentBlitter();
|
||||||
/* Sometimes we also need to hide the cursor
|
|
||||||
* This is because both textmessage and the cursor take a shot of the
|
|
||||||
* screen before drawing.
|
|
||||||
* Now the textmessage takes his shot and paints his data before the cursor
|
|
||||||
* does, so in the shot of the cursor is the screen-data of the textmessage
|
|
||||||
* included when the cursor hangs somewhere over the textmessage. To
|
|
||||||
* avoid wrong repaints, we undraw the cursor in that case, and everything
|
|
||||||
* looks nicely ;)
|
|
||||||
* (and now hope this story above makes sense to you ;))
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (_cursor.visible) {
|
|
||||||
if (_cursor.draw_pos.x + _cursor.draw_size.x >= _chatmsg_box.x &&
|
|
||||||
_cursor.draw_pos.x <= _chatmsg_box.x + _chatmsg_box.width &&
|
|
||||||
_cursor.draw_pos.y + _cursor.draw_size.y >= _screen.height - _chatmsg_box.y - _chatmsg_box.height &&
|
|
||||||
_cursor.draw_pos.y <= _screen.height - _chatmsg_box.y) {
|
|
||||||
UndrawMouseCursor();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int x = _chatmsg_box.x;
|
int x = _chatmsg_box.x;
|
||||||
int y = _screen.height - _chatmsg_box.y - _chatmsg_box.height;
|
int y = _screen.height - _chatmsg_box.y - _chatmsg_box.height;
|
||||||
int width = _chatmsg_box.width;
|
int width = _chatmsg_box.width;
|
||||||
|
|
|
@ -78,7 +78,7 @@ DEF_UDP_RECEIVE_COMMAND(Server, PACKET_UDP_CLIENT_FIND_SERVER)
|
||||||
|
|
||||||
/* Update some game_info */
|
/* Update some game_info */
|
||||||
ngi.clients_on = _network_game_info.clients_on;
|
ngi.clients_on = _network_game_info.clients_on;
|
||||||
ngi.start_date = _network_game_info.start_date;
|
ngi.start_date = ConvertYMDToDate(_settings_game.game_creation.starting_year, 0, 1);
|
||||||
|
|
||||||
ngi.server_lang = _settings_client.network.server_lang;
|
ngi.server_lang = _settings_client.network.server_lang;
|
||||||
ngi.use_password = !StrEmpty(_settings_client.network.server_password);
|
ngi.use_password = !StrEmpty(_settings_client.network.server_password);
|
||||||
|
|
|
@ -6254,8 +6254,11 @@ void LoadNewGRF(uint load_index, uint file_index)
|
||||||
if (c->status == GCS_DISABLED || c->status == GCS_NOT_FOUND) continue;
|
if (c->status == GCS_DISABLED || c->status == GCS_NOT_FOUND) continue;
|
||||||
if (stage > GLS_INIT && HasBit(c->flags, GCF_INIT_ONLY)) continue;
|
if (stage > GLS_INIT && HasBit(c->flags, GCF_INIT_ONLY)) continue;
|
||||||
|
|
||||||
/* @todo usererror() */
|
if (!FioCheckFileExists(c->filename)) {
|
||||||
if (!FioCheckFileExists(c->filename)) usererror("NewGRF file is missing '%s'", c->filename);
|
DEBUG(grf, 0, "NewGRF file is missing '%s'; disabling", c->filename);
|
||||||
|
c->status = GCS_NOT_FOUND;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (stage == GLS_LABELSCAN) InitNewGRFFile(c, _cur_spriteid);
|
if (stage == GLS_LABELSCAN) InitNewGRFFile(c, _cur_spriteid);
|
||||||
LoadNewGRFFile(c, slot++, stage);
|
LoadNewGRFFile(c, slot++, stage);
|
||||||
|
|
Loading…
Reference in New Issue