summaryrefslogtreecommitdiff
path: root/openttd.c
diff options
context:
space:
mode:
authorludde <ludde@openttd.org>2005-07-13 19:51:31 +0000
committerludde <ludde@openttd.org>2005-07-13 19:51:31 +0000
commit2123deff13b3f23352ef82410e76705f9911c184 (patch)
tree24c82eee7c186426a35f3ee245d8d753a296d7e2 /openttd.c
parentca9d0f984143f034725dce098e4a40e3589ed0f4 (diff)
downloadopenttd-2123deff13b3f23352ef82410e76705f9911c184.tar.xz
(svn r2560) Fix: various minor code changes.
Added RandomTile/RandomTileSeed functions to generate a random tile. Changed landscape routines so they don't assume that the Y map side is a power of two. (support for this is not complete, though) Changed some frequently used map macros to not compute the values each time. Silence some warnings on MSVC.
Diffstat (limited to 'openttd.c')
-rw-r--r--openttd.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/openttd.c b/openttd.c
index 0a63fe326..9abf6e78a 100644
--- a/openttd.c
+++ b/openttd.c
@@ -42,7 +42,7 @@
#include <gpmi/packages/paths.h>
#endif /* GPMI */
-void GenerateWorld(int mode, uint log_x, uint log_y);
+void GenerateWorld(int mode, uint size_x, uint size_y);
void CallLandscapeTick(void);
void IncreaseDate(void);
void RunOtherPlayersLoop(void);
@@ -484,7 +484,7 @@ static void LoadIntroGame(void)
sprintf(filename, "%sopntitle.dat", _path.second_data_dir);
if (SaveOrLoad(filename, SL_LOAD) != SL_OK)
#endif
- GenerateWorld(1, 6, 6); // if failed loading, make empty world.
+ GenerateWorld(1, 64, 64); // if failed loading, make empty world.
}
_pause = 0;
@@ -678,7 +678,7 @@ int ttd_main(int argc, char* argv[])
InitPlayerRandoms();
- GenerateWorld(1, 6, 6); // Make the viewport initialization happy
+ GenerateWorld(1, 64, 64); // Make the viewport initialization happy
#ifdef ENABLE_NETWORK
if ((network) && (_network_available)) {
@@ -763,7 +763,7 @@ static void MakeNewGame(void)
SetupColorsAndInitialWindow();
// Randomize world
- GenerateWorld(0, _patches.map_x, _patches.map_y);
+ GenerateWorld(0, 1<<_patches.map_x, 1<<_patches.map_y);
// In a dedicated server, the server does not play
if (_network_dedicated) {
@@ -795,7 +795,7 @@ static void MakeNewEditorWorld(void)
SetupColorsAndInitialWindow();
// Startup the game system
- GenerateWorld(1, _patches.map_x, _patches.map_y);
+ GenerateWorld(1, 1<<_patches.map_x, 1<<_patches.map_y);
_local_player = OWNER_NONE;
MarkWholeScreenDirty();
@@ -977,7 +977,7 @@ void SwitchMode(int new_mode)
break;
case SM_GENRANDLAND: /* Generate random land within scenario editor */
- GenerateWorld(2, _patches.map_x, _patches.map_y);
+ GenerateWorld(2, 1<<_patches.map_x, 1<<_patches.map_y);
// XXX: set date
_local_player = OWNER_NONE;
MarkWholeScreenDirty();