Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/1.11' into 1.11
Browse files Browse the repository at this point in the history
  • Loading branch information
ldpl committed Apr 18, 2021
2 parents 942ac9d + 8601ff1 commit 33f4c49
Show file tree
Hide file tree
Showing 149 changed files with 1,491 additions and 877 deletions.
243 changes: 29 additions & 214 deletions .changelog

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .ottdrev
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.11.0 20210401 0 bd80ec7cff2f2186b133ea4bee431cb1a2f1fc95 1 1 2021
1.11.1 20210418 0 0be22efffc3c14db08baf5e58c448b5d074f4427 1 1 2021
2 changes: 1 addition & 1 deletion .release_date
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2021-04-01 12:33 UTC
2021-04-18 21:11 UTC
2 changes: 1 addition & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.11.0
1.11.1
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ endif()
project(${BINARY_NAME})

if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
message(FATAL_ERROR "In-source builds not allowed. Please run \"cmake ..\" from the bin directory")
message(FATAL_ERROR "In-source builds not allowed. Please run \"cmake ..\" from the build directory. You may need to delete \"${CMAKE_SOURCE_DIR}/CMakeCache.txt\" first.")
endif()

# Debug mode by default.
Expand Down
32 changes: 32 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,35 @@
1.11.1 (2021-04-18)
------------------------------------------------------------------------
Feature: Toggle to enable/disable vsync (#8997)
Feature: Volume controls in the Game Options window, and better defaults (#8943)
Add: Hotkey to focus object and rail filters (#8908)
Add: Better plural support for Romanian (#8936)
Change: Improve layout and spacing of several windows at different GUI scales (#9041, #9042, #9044, #9050)
Change: [Win32] Use user UI language setting for initial language selection (#8974)
Change: Make effect volume scale more intuitively (#8945, #8950)
Change: Improve padding of Object & Rail station windows (#8929)
Fix #6322: [Script] Crash when script allocates too much memory, now kills script instead (#9047)
Fix #7513: [Script] Crash on garbage collection with misbehaving script (#9040)
Fix #9028: [OpenGL] Crash when changing max sprite zoom level (#9032)
Fix #8874: show a warning when a NewGRF scan is requested multiple times (#9022)
Fix: Desync when GS unlocks railtype with wagon unlock (#9021)
Fix #9015: [Win32] Crash on running "pwd" command in the console (#9016)
Fix #9008: Validate starting year given on the command line (-t) (#9014)
Fix #8878: [Network] Slow DNS queries could block the server and disconnect clients (#9013)
Fix: Improve validation of OpenGL video driver to avoid crashes (#9007)
Fix: Credits scrolled too slowly with larger font sizes (#8994)
Fix #8977: Crash when altering max sprite resolution (#8993)
Fix #8956: Industry disaster news messages showed the wrong location (#8992)
Fix: [Win32] Font glyphs of certain widths had broken rendering (#8990)
Fix #8930: [Win32] Duplicate text input issue for systems using IME (#8976)
Fix: [Network] Potential stale client entries in client list (#8959)
Fix: Graphical issues when dragging measurement tooltips (#8951)
Fix: [Fluidsynth] Use provided default soundfont if available (#8948, #8953)
Fix #8935: [macOS] Crash on save (#8944)
Fix #8922: Crash when selling shared vehicles with shared vehicle window open (#8926)
Fix: Compiling on armhf (Raspberry Pi) (#8924)


1.11.0 (2021-04-01)
------------------------------------------------------------------------
Feature: Allow setting a custom terrain type to define highest peak (#8891)
Expand Down
30 changes: 16 additions & 14 deletions cmake/CompileFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,22 @@
#
macro(compile_flags)
if(MSVC)
# Switch to MT (static) instead of MD (dynamic) binary

# For MSVC two generators are available
# - a command line generator (Ninja) using CMAKE_BUILD_TYPE to specify the
# configuration of the build tree
# - an IDE generator (Visual Studio) using CMAKE_CONFIGURATION_TYPES to
# specify all configurations that will be available in the generated solution
list(APPEND MSVC_CONFIGS "${CMAKE_BUILD_TYPE}" "${CMAKE_CONFIGURATION_TYPES}")

# Set usage of static runtime for all configurations
foreach(MSVC_CONFIG ${MSVC_CONFIGS})
string(TOUPPER "CMAKE_CXX_FLAGS_${MSVC_CONFIG}" MSVC_FLAGS)
string(REPLACE "/MD" "/MT" ${MSVC_FLAGS} "${${MSVC_FLAGS}}")
endforeach()
if(VCPKG_TARGET_TRIPLET MATCHES "-static" AND NOT VCPKG_TARGET_TRIPLET MATCHES "-md")
# Switch to MT (static) instead of MD (dynamic) binary

# For MSVC two generators are available
# - a command line generator (Ninja) using CMAKE_BUILD_TYPE to specify the
# configuration of the build tree
# - an IDE generator (Visual Studio) using CMAKE_CONFIGURATION_TYPES to
# specify all configurations that will be available in the generated solution
list(APPEND MSVC_CONFIGS "${CMAKE_BUILD_TYPE}" "${CMAKE_CONFIGURATION_TYPES}")

# Set usage of static runtime for all configurations
foreach(MSVC_CONFIG ${MSVC_CONFIGS})
string(TOUPPER "CMAKE_CXX_FLAGS_${MSVC_CONFIG}" MSVC_FLAGS)
string(REPLACE "/MD" "/MT" ${MSVC_FLAGS} "${${MSVC_FLAGS}}")
endforeach()
endif()

# "If /Zc:rvalueCast is specified, the compiler follows section 5.4 of the
# C++11 standard". We need C++11 for the way we use threads.
Expand Down
7 changes: 7 additions & 0 deletions docs/multiplayer.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,3 +211,10 @@ Last updated: 2011-02-16
communication from an admin tool reach the programme. See section 1
'Starting a server' further up for the ports and protocols used by OpenTTD.
The ports can be configured in the config file.

- My advertising server warns a lot about getaddrinfo taking N seconds
This could be a transient issue with your (local) DNS server, but if the
problem persists there is likely a configuration issue in DNS resolving
on your computer. This seems to be a common configuration issue for
Docker instances, where the DNS resolving waits for a time out of usually
5 seconds.
12 changes: 8 additions & 4 deletions src/3rdparty/squirrel/squirrel/sqarray.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ struct SQArray : public CHAINABLE_OBJ
return newarray;
}
#ifndef NO_GARBAGE_COLLECTOR
void Mark(SQCollectable **chain);
void EnqueueMarkObjectForChildren(SQGCMarkerQueue &queue) override;
#endif
void Finalize(){
void Finalize() override {
_values.resize(0);
}
bool Get(const SQInteger nidx,SQObjectPtr &val)
Expand Down Expand Up @@ -78,9 +78,13 @@ struct SQArray : public CHAINABLE_OBJ
ShrinkIfNeeded();
return true;
}
void Release()
void Release() override
{
sq_delete(this,SQArray);
this->_sharedstate->DelayFinalFree(this);
}
void FinalFree() override
{
sq_delete(this, SQArray);
}
SQObjectPtrVec _values;
};
Expand Down
18 changes: 10 additions & 8 deletions src/3rdparty/squirrel/squirrel/sqclass.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ struct SQClass : public CHAINABLE_OBJ
}
void Finalize();
#ifndef NO_GARBAGE_COLLECTOR
void Mark(SQCollectable ** );
void EnqueueMarkObjectForChildren(SQGCMarkerQueue &queue);
#endif
SQInteger Next(const SQObjectPtr &refpos, SQObjectPtr &outkey, SQObjectPtr &outval);
SQInstance *CreateInstance();
Expand Down Expand Up @@ -126,31 +126,33 @@ struct SQInstance : public SQDelegable
}
return false;
}
void Release() {
void Release() override {
_uiRef++;
try {
if (_hook) { _hook(_userpointer,0);}
} catch (...) {
_uiRef--;
if (_uiRef == 0) {
SQInteger size = _memsize;
this->~SQInstance();
SQ_FREE(this, size);
this->_sharedstate->DelayFinalFree(this);
}
throw;
}
_uiRef--;
if(_uiRef > 0) return;
this->_sharedstate->DelayFinalFree(this);
}
void FinalFree() override
{
SQInteger size = _memsize;
this->~SQInstance();
SQ_FREE(this, size);
}
void Finalize();
void Finalize() override;
#ifndef NO_GARBAGE_COLLECTOR
void Mark(SQCollectable ** );
void EnqueueMarkObjectForChildren(SQGCMarkerQueue &queue) override;
#endif
bool InstanceOf(SQClass *trg);
bool GetMetaMethod(SQVM *v,SQMetaMethod mm,SQObjectPtr &res);
bool GetMetaMethod(SQVM *v,SQMetaMethod mm,SQObjectPtr &res) override;

SQClass *_class;
SQUserPointer _userpointer;
Expand Down
6 changes: 3 additions & 3 deletions src/3rdparty/squirrel/squirrel/sqclosure.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ struct SQClosure : public CHAINABLE_OBJ
bool Save(SQVM *v,SQUserPointer up,SQWRITEFUNC write);
static bool Load(SQVM *v,SQUserPointer up,SQREADFUNC read,SQObjectPtr &ret);
#ifndef NO_GARBAGE_COLLECTOR
void Mark(SQCollectable **chain);
void EnqueueMarkObjectForChildren(SQGCMarkerQueue &queue);
void Finalize(){_outervalues.resize(0); }
#endif
SQObjectPtr _env;
Expand Down Expand Up @@ -66,7 +66,7 @@ struct SQGenerator : public CHAINABLE_OBJ
bool Yield(SQVM *v);
bool Resume(SQVM *v,SQInteger target);
#ifndef NO_GARBAGE_COLLECTOR
void Mark(SQCollectable **chain);
void EnqueueMarkObjectForChildren(SQGCMarkerQueue &queue);
void Finalize(){_stack.resize(0);_closure=_null_;}
#endif
SQObjectPtr _closure;
Expand Down Expand Up @@ -106,7 +106,7 @@ struct SQNativeClosure : public CHAINABLE_OBJ
sq_delete(this,SQNativeClosure);
}
#ifndef NO_GARBAGE_COLLECTOR
void Mark(SQCollectable **chain);
void EnqueueMarkObjectForChildren(SQGCMarkerQueue &queue);
void Finalize(){_outervalues.resize(0);}
#endif
SQInteger _nparamscheck;
Expand Down
131 changes: 54 additions & 77 deletions src/3rdparty/squirrel/squirrel/sqobject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -486,104 +486,81 @@ bool SQFunctionProto::Load(SQVM *v,SQUserPointer up,SQREADFUNC read,SQObjectPtr

#ifndef NO_GARBAGE_COLLECTOR

#define START_MARK() if(!(_uiRef&MARK_FLAG)){ \
_uiRef|=MARK_FLAG;

#define END_MARK() RemoveFromChain(&_sharedstate->_gc_chain, this); \
AddToChain(chain, this); }

void SQVM::Mark(SQCollectable **chain)
void SQVM::EnqueueMarkObjectForChildren(SQGCMarkerQueue &queue)
{
START_MARK()
SQSharedState::MarkObject(_lasterror,chain);
SQSharedState::MarkObject(_errorhandler,chain);
SQSharedState::MarkObject(_debughook,chain);
SQSharedState::MarkObject(_roottable, chain);
SQSharedState::MarkObject(temp_reg, chain);
for(SQUnsignedInteger i = 0; i < _stack.size(); i++) SQSharedState::MarkObject(_stack[i], chain);
for(SQUnsignedInteger j = 0; j < _vargsstack.size(); j++) SQSharedState::MarkObject(_vargsstack[j], chain);
for(SQInteger k = 0; k < _callsstacksize; k++) SQSharedState::MarkObject(_callsstack[k]._closure, chain);
END_MARK()
}

void SQArray::Mark(SQCollectable **chain)
SQSharedState::EnqueueMarkObject(_lasterror,queue);
SQSharedState::EnqueueMarkObject(_errorhandler,queue);
SQSharedState::EnqueueMarkObject(_debughook,queue);
SQSharedState::EnqueueMarkObject(_roottable, queue);
SQSharedState::EnqueueMarkObject(temp_reg, queue);
for(SQUnsignedInteger i = 0; i < _stack.size(); i++) SQSharedState::EnqueueMarkObject(_stack[i], queue);
for(SQUnsignedInteger j = 0; j < _vargsstack.size(); j++) SQSharedState::EnqueueMarkObject(_vargsstack[j], queue);
for(SQInteger k = 0; k < _callsstacksize; k++) SQSharedState::EnqueueMarkObject(_callsstack[k]._closure, queue);
}

void SQArray::EnqueueMarkObjectForChildren(SQGCMarkerQueue &queue)
{
START_MARK()
SQInteger len = _values.size();
for(SQInteger i = 0;i < len; i++) SQSharedState::MarkObject(_values[i], chain);
END_MARK()
SQInteger len = _values.size();
for(SQInteger i = 0;i < len; i++) SQSharedState::EnqueueMarkObject(_values[i], queue);
}
void SQTable::Mark(SQCollectable **chain)

void SQTable::EnqueueMarkObjectForChildren(SQGCMarkerQueue &queue)
{
START_MARK()
if(_delegate) _delegate->Mark(chain);
SQInteger len = _numofnodes;
for(SQInteger i = 0; i < len; i++){
SQSharedState::MarkObject(_nodes[i].key, chain);
SQSharedState::MarkObject(_nodes[i].val, chain);
}
END_MARK()
if(_delegate) queue.Enqueue(_delegate);
SQInteger len = _numofnodes;
for(SQInteger i = 0; i < len; i++){
SQSharedState::EnqueueMarkObject(_nodes[i].key, queue);
SQSharedState::EnqueueMarkObject(_nodes[i].val, queue);
}
}

void SQClass::Mark(SQCollectable **chain)
void SQClass::EnqueueMarkObjectForChildren(SQGCMarkerQueue &queue)
{
START_MARK()
_members->Mark(chain);
if(_base) _base->Mark(chain);
SQSharedState::MarkObject(_attributes, chain);
for(SQUnsignedInteger i =0; i< _defaultvalues.size(); i++) {
SQSharedState::MarkObject(_defaultvalues[i].val, chain);
SQSharedState::MarkObject(_defaultvalues[i].attrs, chain);
}
for(SQUnsignedInteger j =0; j< _methods.size(); j++) {
SQSharedState::MarkObject(_methods[j].val, chain);
SQSharedState::MarkObject(_methods[j].attrs, chain);
}
for(SQUnsignedInteger k =0; k< _metamethods.size(); k++) {
SQSharedState::MarkObject(_metamethods[k], chain);
}
END_MARK()
queue.Enqueue(_members);
if(_base) queue.Enqueue(_base);
SQSharedState::EnqueueMarkObject(_attributes, queue);
for(SQUnsignedInteger i =0; i< _defaultvalues.size(); i++) {
SQSharedState::EnqueueMarkObject(_defaultvalues[i].val, queue);
SQSharedState::EnqueueMarkObject(_defaultvalues[i].attrs, queue);
}
for(SQUnsignedInteger j =0; j< _methods.size(); j++) {
SQSharedState::EnqueueMarkObject(_methods[j].val, queue);
SQSharedState::EnqueueMarkObject(_methods[j].attrs, queue);
}
for(SQUnsignedInteger k =0; k< _metamethods.size(); k++) {
SQSharedState::EnqueueMarkObject(_metamethods[k], queue);
}
}

void SQInstance::Mark(SQCollectable **chain)
void SQInstance::EnqueueMarkObjectForChildren(SQGCMarkerQueue &queue)
{
START_MARK()
_class->Mark(chain);
SQUnsignedInteger nvalues = _class->_defaultvalues.size();
for(SQUnsignedInteger i =0; i< nvalues; i++) {
SQSharedState::MarkObject(_values[i], chain);
}
END_MARK()
queue.Enqueue(_class);
SQUnsignedInteger nvalues = _class->_defaultvalues.size();
for(SQUnsignedInteger i =0; i< nvalues; i++) {
SQSharedState::EnqueueMarkObject(_values[i], queue);
}
}

void SQGenerator::Mark(SQCollectable **chain)
void SQGenerator::EnqueueMarkObjectForChildren(SQGCMarkerQueue &queue)
{
START_MARK()
for(SQUnsignedInteger i = 0; i < _stack.size(); i++) SQSharedState::MarkObject(_stack[i], chain);
for(SQUnsignedInteger j = 0; j < _vargsstack.size(); j++) SQSharedState::MarkObject(_vargsstack[j], chain);
SQSharedState::MarkObject(_closure, chain);
END_MARK()
for(SQUnsignedInteger i = 0; i < _stack.size(); i++) SQSharedState::EnqueueMarkObject(_stack[i], queue);
for(SQUnsignedInteger j = 0; j < _vargsstack.size(); j++) SQSharedState::EnqueueMarkObject(_vargsstack[j], queue);
SQSharedState::EnqueueMarkObject(_closure, queue);
}

void SQClosure::Mark(SQCollectable **chain)
void SQClosure::EnqueueMarkObjectForChildren(SQGCMarkerQueue &queue)
{
START_MARK()
for(SQUnsignedInteger i = 0; i < _outervalues.size(); i++) SQSharedState::MarkObject(_outervalues[i], chain);
for(SQUnsignedInteger i = 0; i < _defaultparams.size(); i++) SQSharedState::MarkObject(_defaultparams[i], chain);
END_MARK()
for(SQUnsignedInteger i = 0; i < _outervalues.size(); i++) SQSharedState::EnqueueMarkObject(_outervalues[i], queue);
for(SQUnsignedInteger i = 0; i < _defaultparams.size(); i++) SQSharedState::EnqueueMarkObject(_defaultparams[i], queue);
}

void SQNativeClosure::Mark(SQCollectable **chain)
void SQNativeClosure::EnqueueMarkObjectForChildren(SQGCMarkerQueue &queue)
{
START_MARK()
for(SQUnsignedInteger i = 0; i < _outervalues.size(); i++) SQSharedState::MarkObject(_outervalues[i], chain);
END_MARK()
for(SQUnsignedInteger i = 0; i < _outervalues.size(); i++) SQSharedState::EnqueueMarkObject(_outervalues[i], queue);
}

void SQUserData::Mark(SQCollectable **chain){
START_MARK()
if(_delegate) _delegate->Mark(chain);
END_MARK()
void SQUserData::EnqueueMarkObjectForChildren(SQGCMarkerQueue &queue){
if(_delegate) queue.Enqueue(_delegate);
}

void SQCollectable::UnMark() { _uiRef&=~MARK_FLAG; }
Expand Down
Loading

0 comments on commit 33f4c49

Please sign in to comment.