mirror of https://github.com/OpenTTD/OpenTTD
(svn r27579) -Change [FS#6402]: Performance improvement for dedicated servers by skipping drawing calls earlier in the process. (JGR)
parent
ebb6e38075
commit
cade383f9b
|
@ -23,6 +23,7 @@
|
||||||
#include "transport_type.h"
|
#include "transport_type.h"
|
||||||
#include "group_type.h"
|
#include "group_type.h"
|
||||||
#include "base_consist.h"
|
#include "base_consist.h"
|
||||||
|
#include "network/network.h"
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
|
@ -1072,6 +1073,9 @@ struct SpecializedVehicle : public Vehicle {
|
||||||
*/
|
*/
|
||||||
inline void UpdateViewport(bool force_update, bool update_delta)
|
inline void UpdateViewport(bool force_update, bool update_delta)
|
||||||
{
|
{
|
||||||
|
/* Skip updating sprites on dedicated servers without screen */
|
||||||
|
if (_network_dedicated) return;
|
||||||
|
|
||||||
/* Explicitly choose method to call to prevent vtable dereference -
|
/* Explicitly choose method to call to prevent vtable dereference -
|
||||||
* it gives ~3% runtime improvements in games with many vehicles */
|
* it gives ~3% runtime improvements in games with many vehicles */
|
||||||
if (update_delta) ((T *)this)->T::UpdateDeltaXY(this->direction);
|
if (update_delta) ((T *)this)->T::UpdateDeltaXY(this->direction);
|
||||||
|
|
|
@ -3031,6 +3031,10 @@ void UpdateWindows()
|
||||||
w->ProcessHighlightedInvalidations();
|
w->ProcessHighlightedInvalidations();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Skip the actual drawing on dedicated servers without screen.
|
||||||
|
* But still empty the invalidation queues above. */
|
||||||
|
if (_network_dedicated) return;
|
||||||
|
|
||||||
static int we4_timer = 0;
|
static int we4_timer = 0;
|
||||||
int t = we4_timer + 1;
|
int t = we4_timer + 1;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue