Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2014
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.44 KB | None | 0 0
  1. Index: src/date.cpp
  2. ===================================================================
  3. --- src/date.cpp (revision 25493)
  4. +++ src/date.cpp (working copy)
  5. @@ -26,6 +26,7 @@
  6. Date _date; ///< Current date in days (day counter)
  7. DateFract _date_fract; ///< Fractional part of the day.
  8. uint16 _tick_counter; ///< Ever incrementing (and sometimes wrapping) tick counter for setting off various events
  9. +uint8 _tick_skip_counter; ///< Counter for ticks, when only vehicles are moving and nothing else happens
  10.  
  11. /**
  12. * Set the date.
  13. Index: src/date_func.h
  14. ===================================================================
  15. --- src/date_func.h (revision 25493)
  16. +++ src/date_func.h (working copy)
  17. @@ -18,7 +18,8 @@
  18. extern Month _cur_month;
  19. extern Date _date;
  20. extern DateFract _date_fract;
  21. -extern uint16 _tick_counter;
  22. +extern uint16 _tick_counter;
  23. +extern uint8 _tick_skip_counter;
  24.  
  25. void SetDate(Date date, DateFract fract);
  26. void ConvertDateToYMD(Date date, YearMonthDay *ymd);
  27. Index: src/lang/english.txt
  28. ===================================================================
  29. --- src/lang/english.txt (revision 25493)
  30. +++ src/lang/english.txt (working copy)
  31. @@ -1481,6 +1481,8 @@
  32. STR_CONFIG_SETTING_ALLOW_SHARES_HELPTEXT :When enabled, allow buying and selling of company shares. Shares will only be available for companies reaching a certain age
  33. STR_CONFIG_SETTING_FEEDER_PAYMENT_SHARE :Percentage of leg profit to pay in feeder systems: {STRING2}
  34. STR_CONFIG_SETTING_FEEDER_PAYMENT_SHARE_HELPTEXT :Percentage of income given to the intermediate legs in feeder systems, giving more control over the income
  35. +STR_CONFIG_SETTING_DAY_LENGTH_FACTOR :Day length factor: {STRING2}
  36. +STR_CONFIG_SETTING_DAY_LENGTH_FACTOR_HELPTEXT :Game pace is slowed by this factor
  37. STR_CONFIG_SETTING_DRAG_SIGNALS_DENSITY :When dragging, place signals every: {STRING2}
  38. STR_CONFIG_SETTING_DRAG_SIGNALS_DENSITY_HELPTEXT :Set the distance at which signals will be built on a track up to the next obstacle (signal, junction), if signals are dragged
  39. STR_CONFIG_SETTING_DRAG_SIGNALS_DENSITY_VALUE :{COMMA} tile{P 0 "" s}
  40. Index: src/misc.cpp
  41. ===================================================================
  42. --- src/misc.cpp (revision 25493)
  43. +++ src/misc.cpp (working copy)
  44. @@ -60,6 +60,7 @@
  45. _pause_mode = PM_UNPAUSED;
  46. _fast_forward = 0;
  47. _tick_counter = 0;
  48. + _tick_skip_counter = 0;
  49. _cur_tileloop_tile = 1;
  50. _thd.redsq = INVALID_TILE;
  51. if (reset_settings) MakeNewgameSettingsLive();
  52. Index: src/openttd.cpp
  53. ===================================================================
  54. --- src/openttd.cpp (revision 25493)
  55. +++ src/openttd.cpp (working copy)
  56. @@ -1335,13 +1335,25 @@
  57. * for multiplayer compatibility */
  58. Backup<CompanyByte> cur_company(_current_company, OWNER_NONE, FILE_LINE);
  59.  
  60. - AnimateAnimatedTiles();
  61. - IncreaseDate();
  62. - RunTileLoop();
  63. - CallVehicleTicks();
  64. - CallLandscapeTick();
  65. - ClearStorageChanges(true);
  66. + _tick_skip_counter++;
  67.  
  68. + if (_tick_skip_counter < _settings_game.economy.day_length_factor)
  69. + {
  70. + AnimateAnimatedTiles();
  71. + CallVehicleTicks();
  72. + ClearStorageChanges(true);
  73. + }
  74. + else
  75. + {
  76. + _tick_skip_counter = 0;
  77. + AnimateAnimatedTiles();
  78. + IncreaseDate();
  79. + RunTileLoop();
  80. + CallVehicleTicks();
  81. + CallLandscapeTick();
  82. + ClearStorageChanges(true);
  83. + }
  84. +
  85. AI::GameLoop();
  86. Game::GameLoop();
  87. UpdateLandscapingLimits();
  88. Index: src/saveload/misc_sl.cpp
  89. ===================================================================
  90. --- src/saveload/misc_sl.cpp (revision 25493)
  91. +++ src/saveload/misc_sl.cpp (working copy)
  92. @@ -73,6 +73,7 @@
  93. SLEG_CONDVAR(_date, SLE_INT32, 31, SL_MAX_VERSION),
  94. SLEG_VAR(_date_fract, SLE_UINT16),
  95. SLEG_VAR(_tick_counter, SLE_UINT16),
  96. + SLEG_CONDVAR(_tick_skip_counter, SLE_UINT8, 200, SL_MAX_VERSION),
  97. SLE_CONDNULL(2, 0, 156), // _vehicle_id_ctr_day
  98. SLEG_CONDVAR(_age_cargo_skip_counter, SLE_UINT8, 0, 161),
  99. SLE_CONDNULL(1, 0, 45),
  100. @@ -98,6 +99,7 @@
  101. SLEG_CONDVAR(_load_check_data.current_date, SLE_INT32, 31, SL_MAX_VERSION),
  102. SLE_NULL(2), // _date_fract
  103. SLE_NULL(2), // _tick_counter
  104. + SLEG_CONDVAR(_tick_skip_counter, SLE_UINT8, 200, SL_MAX_VERSION),
  105. SLE_CONDNULL(2, 0, 156), // _vehicle_id_ctr_day
  106. SLE_CONDNULL(1, 0, 161), // _age_cargo_skip_counter
  107. SLE_CONDNULL(1, 0, 45),
  108. Index: src/saveload/saveload.cpp
  109. ===================================================================
  110. --- src/saveload/saveload.cpp (revision 25493)
  111. +++ src/saveload/saveload.cpp (working copy)
  112. @@ -250,7 +250,7 @@
  113. * 182 25296
  114. * 183 25363
  115. */
  116. -extern const uint16 SAVEGAME_VERSION = 183; ///< Current savegame version of OpenTTD.
  117. +extern const uint16 SAVEGAME_VERSION = 200; ///< Current savegame version of OpenTTD.
  118.  
  119. SavegameType _savegame_type; ///< type of savegame we are loading
  120.  
  121. Index: src/settings_gui.cpp
  122. ===================================================================
  123. --- src/settings_gui.cpp (revision 25493)
  124. +++ src/settings_gui.cpp (working copy)
  125. @@ -1588,6 +1588,7 @@
  126. SettingEntry(&_settings_economy_towns_page, STR_CONFIG_SETTING_ECONOMY_TOWNS),
  127. SettingEntry(&_settings_economy_industries_page, STR_CONFIG_SETTING_ECONOMY_INDUSTRIES),
  128. SettingEntry("economy.inflation"),
  129. + SettingEntry("economy.day_length_factor"),
  130. SettingEntry("difficulty.initial_interest"),
  131. SettingEntry("difficulty.max_loan"),
  132. SettingEntry("difficulty.subsidy_multiplier"),
  133. Index: src/settings_type.h
  134. ===================================================================
  135. --- src/settings_type.h (revision 25493)
  136. +++ src/settings_type.h (working copy)
  137. @@ -481,6 +481,7 @@
  138. uint16 town_noise_population[3]; ///< population to base decision on noise evaluation (@see town_council_tolerance)
  139. bool allow_town_level_crossings; ///< towns are allowed to build level crossings
  140. bool infrastructure_maintenance; ///< enable monthly maintenance fee for owner infrastructure
  141. + uint8 day_length_factor; ///< factor which the length of day is multiplied
  142. };
  143.  
  144. struct LinkGraphSettings {
  145. Index: src/table/settings.ini
  146. ===================================================================
  147. --- src/table/settings.ini (revision 25493)
  148. +++ src/table/settings.ini (working copy)
  149. @@ -1234,6 +1234,19 @@
  150.  
  151. [SDT_VAR]
  152. base = GameSettings
  153. +var = economy.day_length_factor
  154. +type = SLE_UINT8
  155. +from = 200
  156. +def = 1
  157. +min = 1
  158. +max = 25
  159. +str = STR_CONFIG_SETTING_DAY_LENGTH_FACTOR
  160. +strhelp = STR_CONFIG_SETTING_DAY_LENGTH_FACTOR_HELPTEXT
  161. +strval = STR_JUST_COMMA
  162. +cat = SC_BASIC
  163. +
  164. +[SDT_VAR]
  165. +base = GameSettings
  166. var = construction.raw_industry_construction
  167. type = SLE_UINT8
  168. guiflags = SGF_MULTISTRING
  169. Index: src/vehicle.cpp
  170. ===================================================================
  171. --- src/vehicle.cpp (revision 25493)
  172. +++ src/vehicle.cpp (working copy)
  173. @@ -860,7 +860,7 @@
  174. {
  175. _vehicles_to_autoreplace.Clear();
  176.  
  177. - RunVehicleDayProc();
  178. + if (_tick_skip_counter == 0) RunVehicleDayProc();
  179.  
  180. Station *st;
  181. FOR_ALL_STATIONS(st) LoadUnloadStation(st);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement