mirror of https://github.com/OpenTTD/OpenTTD
(svn r25582) [1.3] -Backport from trunk:
- Fix: [Script] Documentation implied that XXList::AddItem has a default for value if it isn't filled in [FS#5638] (r25579, r25577) - Fix: Make content list appear faster (r25573) - Fix: Non-ICU layouter started new lines with the space which triggered the linebreak (r25568) - Fix: If the next order cannot be resolved, reset the current order property instead of leaving it in an intermediate state [FS#5633] (r25562)release/1.3
parent
b0486a940d
commit
6cde48e49f
|
@ -355,7 +355,7 @@ ParagraphLayout::Line *ParagraphLayout::nextLine(int max_width)
|
||||||
last_char = this->buffer;
|
last_char = this->buffer;
|
||||||
} else {
|
} else {
|
||||||
/* A space is found; perfect place to terminate */
|
/* A space is found; perfect place to terminate */
|
||||||
this->buffer = last_space;
|
this->buffer = last_space + 1;
|
||||||
last_char = last_space;
|
last_char = last_space;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -192,8 +192,28 @@ bool NetworkContentSocketHandler::HandlePacket(Packet *p)
|
||||||
*/
|
*/
|
||||||
void NetworkContentSocketHandler::ReceivePackets()
|
void NetworkContentSocketHandler::ReceivePackets()
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
|
* We read only a few of the packets. This as receiving packets can be expensive
|
||||||
|
* due to the re-resolving of the parent/child relations and checking the toggle
|
||||||
|
* state of all bits. We cannot do this all in one go, as we want to show the
|
||||||
|
* user what we already received. Otherwise, it can take very long before any
|
||||||
|
* progress is shown to the end user that something has been received.
|
||||||
|
* It is also the case that we request extra content from the content server in
|
||||||
|
* case there is an unknown (in the content list) piece of content. These will
|
||||||
|
* come in after the main lists have been requested. As a result, we won't be
|
||||||
|
* getting everything reliably in one batch. Thus, we need to make subsequent
|
||||||
|
* updates in that case as well.
|
||||||
|
*
|
||||||
|
* As a result, we simple handle an arbitrary number of packets in one cycle,
|
||||||
|
* and let the rest be handled in subsequent cycles. These are ran, almost,
|
||||||
|
* immediately after this cycle so in speed it does not matter much, except
|
||||||
|
* that the user inferface will appear better responding.
|
||||||
|
*
|
||||||
|
* What arbitrary number to choose is the ultimate question though.
|
||||||
|
*/
|
||||||
Packet *p;
|
Packet *p;
|
||||||
while ((p = this->ReceivePacket()) != NULL) {
|
int i = 42;
|
||||||
|
while (--i != 0 && (p = this->ReceivePacket()) != NULL) {
|
||||||
bool cont = this->HandlePacket(p);
|
bool cont = this->HandlePacket(p);
|
||||||
delete p;
|
delete p;
|
||||||
if (!cont) return;
|
if (!cont) return;
|
||||||
|
|
|
@ -1906,7 +1906,11 @@ VehicleOrderID ProcessConditionalOrder(const Order *order, const Vehicle *v)
|
||||||
*/
|
*/
|
||||||
bool UpdateOrderDest(Vehicle *v, const Order *order, int conditional_depth, bool pbs_look_ahead)
|
bool UpdateOrderDest(Vehicle *v, const Order *order, int conditional_depth, bool pbs_look_ahead)
|
||||||
{
|
{
|
||||||
if (conditional_depth > v->GetNumOrders()) return false;
|
if (conditional_depth > v->GetNumOrders()) {
|
||||||
|
v->current_order.Free();
|
||||||
|
v->dest_tile = 0;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
switch (order->GetType()) {
|
switch (order->GetType()) {
|
||||||
case OT_GOTO_STATION:
|
case OT_GOTO_STATION:
|
||||||
|
|
|
@ -33,11 +33,11 @@ public:
|
||||||
|
|
||||||
/** Sort ascending */
|
/** Sort ascending */
|
||||||
static const bool SORT_ASCENDING = true;
|
static const bool SORT_ASCENDING = true;
|
||||||
/** Sort descnding */
|
/** Sort descending */
|
||||||
static const bool SORT_DESCENDING = false;
|
static const bool SORT_DESCENDING = false;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ScriptListSorter *sorter; ///< Sorting algorithm
|
ScriptListSorter *sorter; ///< Sorting algorithm
|
||||||
SorterType sorter_type; ///< Sorting type
|
SorterType sorter_type; ///< Sorting type
|
||||||
bool sort_ascending; ///< Whether to sort ascending or descending
|
bool sort_ascending; ///< Whether to sort ascending or descending
|
||||||
bool initialized; ///< Whether an iteration has been started
|
bool initialized; ///< Whether an iteration has been started
|
||||||
|
@ -54,13 +54,16 @@ public:
|
||||||
ScriptList();
|
ScriptList();
|
||||||
~ScriptList();
|
~ScriptList();
|
||||||
|
|
||||||
|
#ifdef DOXYGEN_API
|
||||||
/**
|
/**
|
||||||
* Add a single item to the list.
|
* Add a single item to the list.
|
||||||
* @param item the item to add. Should be unique, otherwise it is ignored.
|
* @param item the item to add. Should be unique, otherwise it is ignored.
|
||||||
* @param value the value to assign.
|
* @param value the value to assign.
|
||||||
* @note the value is set to 0 by default.
|
|
||||||
*/
|
*/
|
||||||
|
void AddItem(int32 item, int32 value);
|
||||||
|
#else
|
||||||
void AddItem(int32 item, int32 value = 0);
|
void AddItem(int32 item, int32 value = 0);
|
||||||
|
#endif /* DOXYGEN_API */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove a single item from the list.
|
* Remove a single item from the list.
|
||||||
|
|
Loading…
Reference in New Issue