tron
181d586a7c
(svn r3078) Some more stuff, which piled up:
...
- const, whitespace, indentation, bracing, GB/SB, pointless casts
- use the trinary operator where appropriate
- data types (uint[] -> AcceptedCargo, ...)
- if cascade -> switch
- if (ptr) -> if (ptr != NULL)
- DeMorgan's Law
- Fix some comments
- 0 -> '\0', change magic numbers to symbolic constants
19 years ago
tron
0b936c3222
(svn r3077) static, const, bracing, indentation, 0 -> '\0'/NULL, typos in comments, excess empty lines, minor other changes
...
nothing spectacular, just some stuff, which piled up
19 years ago
tron
71d293f2a3
(svn r3066) Constify the parameter of GetSlopeZ_*()
19 years ago
tron
b17b87469c
(svn r3064) Replace some numbers by sprite names
19 years ago
tron
8980891b09
(svn r3024) -Codechange: Another batch of replacements of int/uint/int16/byte/-1 with proper types and constants
19 years ago
tron
39f5dbfd3b
(svn r3019) -Codechange: Replace explicit shifting/anding/oring with GB and SB
19 years ago
tron
6d7c7e67b2
(svn r3010) Get rid of quite some dubious casts, either by using GB(), proper types or just removing them
19 years ago
tron
90e33aed22
(svn r2995) Replace 0xFF/0xFFFF with CT_INVALID/OWNER_SPECTATOR/INVALID_STATION where appropriate
19 years ago
Darkvater
4a58250cb9
(svn r2962) - const correctness for all Get* functions and most Draw* functions that don't change their pointer parameters
...
- change a lot of byte player types to PlayerID
- beautify header files, same "#endif /* filename */" ending
19 years ago
Darkvater
78e4cbbfda
(svn r2956) - Fix: [ 1253736 ] creating many town crash to desktop. Now it 'dies' with an ingame error message informing the gamer if it couldn't generate any towns in user-space. Still if it happens during new-game generation it crashes since we don't yet have actions to do in such a circumstance.
19 years ago
Darkvater
c0c75ef16e
(svn r2951) - Fix: [ 1259345 ] Changing engine in netgame opens train window for everyone
...
- Add IsLocalPlayer() which substitutes _local_player == _current_player
19 years ago
tron
8b74a95d36
(svn r2886) Rename the "owner" attribute to "m1", because when it stores an owner it is accessed by [GS]etOwner anyway and when it doesn't store an owner, but arbitrary data, accessing a field called "owner" is confusing.
19 years ago
tron
2f1d530bb5
(svn r2758) Add the AB() macro to add a value to a bit range and use it in a few places, also make use of GB and SB nearby
19 years ago
celestar
a3739aecdf
(svn r2702) -Codechange: Cleaned up the sprite code and replaced many magic numbers
...
by enums. There remains work in gfx.c to move the "transparency" and
"recolor" bits around to make space for more sprites. However, 2800
additional sprites can now be loaded. There also remains cleanup and
Doxygen work on many of the header files.
19 years ago
tron
647cbd6bdd
(svn r2701) Insert Id tags into all source files
19 years ago
tron
54cbd01825
(svn r2673) Include functions.h directly, not globally via openttd.h
19 years ago
tron
71140a5768
(svn r2669) Shuffle some more stuff around to reduce dependencies
19 years ago
tron
6ad3895306
(svn r2660) Get rid of some more shifting/anding/casting
19 years ago
celestar
1fed0046ac
(svn r2658) -Codechange: Use MAKE_TRANSPARENT to display a transparented sprite
19 years ago
tron
f09638ad3d
(svn r2650) Convert many explicit shifts+ands to extract bits to invocations of GB - should be a bit nicer to read
19 years ago
ludde
dc3ca73bd5
(svn r2580) Change: Added {INDUSTRY} command for printing industry names instead of the old {TOWN} {STRING} way.
...
- The formatting of the industry name can be controlled with the string STR_INDUSTRY_FORMAT.
Change: Changed several occurences of {STRING1} into {TOWN} to get rid of townnametype being used directly.
19 years ago
ludde
31fd5b2768
(svn r2574) Fix: AnimatedTile leak in town_cmd.c (this one has probably been here since day 1)
19 years ago
ludde
ddc939f0ed
(svn r2570) Fix: Removed some code that had no effect.
19 years ago
ludde
2123deff13
(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.
19 years ago
tron
a4bf608d40
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
19 years ago
tron
9617614b04
(svn r2487) Replace TILE_XY by TileXY/TileDiffXY
19 years ago
tron
2b73dec567
(svn r2486) Turn TILE_FROM_XY into an inline function and rename it to TileVirtXY
19 years ago
tron
a733fede9b
(svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
19 years ago
celestar
354058341b
(svn r2468) -Codechange: Got rid of DEREF_PLAYER and replaced it by GetPlayer
19 years ago
tron
aab5561c55
(svn r2434) Fix some defects in r2433
19 years ago
Darkvater
c37cf285ce
(svn r2433) - CodeChange: unmagicify all road/train crossings with IsLevelCrossing() function (peter1138)
19 years ago
tron
ff0030936e
(svn r2408) Introduce SetTileOwner() and use it
20 years ago
tron
a9b95b3cbb
(svn r2407) Use {Get,Is}TileOwner to get/check the owner of a tile and fix some bogus reads of _map_owner
20 years ago
Darkvater
ba8c649fac
(svn r2397) - CodeChange: rename all "ttd" files to "openttd" files.
20 years ago
Darkvater
f4f5cb93f8
(svn r2387) - CodeChange: made the saveload code more readable and also removed the 'byte' saveload arrays which means you can save an array of more than 255 elements, or bigger structs than 255 bytes. This doesn't yet solve the problem that a chunk can be a maximum of 16384 big.
...
- Fix: also fix an unnoticed error in SlSaveLoadConv() due to wrong types.
20 years ago
Darkvater
abc5fd1272
(svn r2345) - Fix: Don't allow stuff to be renamed to nothing if we don't support it. Only valid ones are signs (delete) and waypoints (rename to default).
20 years ago
tron
4eebeff58c
(svn r2324) Introduce _cmd_text for passing strings with a command instead of abusing _decode_parameters as text buffer. This should prevent several possible buffer overruns and is a bit cleaner to use. As bonus it reduces the size of most command packets by 79 bytes.
20 years ago
Darkvater
562a32c3ee
(svn r2297) - CodeChange: server-check the next batch of commands.
...
- CodeChange: since only the server will be able to modify difficulty settings, leave the checking of correct values besides, and trust users will join legit servers.
- CodeChange: for renaming signs, only check if GetDParam(); eg _decode_parameters is empty ('\0') or not, instead of the extra check of players, etc. That basically does the same thing. Also dirty sign two times when renaming, once before, once after the action. Because if the name becomes shorter and you update only after, garbage remains on the screen.
- CodeChange: made GetMaskOfTownActions() available to the town-cmd to double-check if the action was available to the player. For this purpose the hardcoded _local_player has been removed from the function and is now passed as a parameter.
20 years ago
Darkvater
2aa7b2d7ea
(svn r2142) - Fix: Game no longer crashes when you want to remove a piece of road under a bridge that belongs to the town. TODO: railcrossings store owner somewhere else, put it into _map_owner[]!
20 years ago
pasky
00ff85dcb8
(svn r2033) - Fix: Fix some more desync by saving the town growth frequency iterator _cur_town_iter. Needed to bump a svg revision for that thanks to the braindead SlGlob thing, or at least I don't know how to do it without bumping it.
20 years ago
pasky
49f769948b
(svn r2021) Fix: Enlarge _cur_town_ctr from byte to uint32 so that all the towns are considered when growing them even for big maps, where much more than 256 towns are around; reported by Tomasz Dubiński <uboottd@hydra.polsl.gliwice.pl>. The savegame still saves just the lowest 8 bits but that doesn't hurt so much.
20 years ago
Darkvater
ef1325cd36
(svn r2004) - Fix: [ 1149487 ] Autosave ignoring settings
...
- Fix: [ 1153926 ] All my settings in vain... IGNORED!
- Change: I hope I got it all right. Pressing 'New Game' (either choosing random or a preset scenario) and 'Create Scenario' will start a new game with the settings and difficulty in the intro menu. Using 'Load Game' and 'Play Scenario' will take the values from the savegame/scenario itself.
20 years ago
pasky
5483b77865
(svn r1955) Fix: Make the town growth frequency scale properly both up and down. The scaling is now also based on the number of towns instead of the map size. (In cooperation with HackyKid.)
20 years ago
pasky
43fbe3b2da
(svn r1952) Fix: Hopefully fixed the enormous towns growth slowdown in large maps. (Inspired by toholio.)
20 years ago
pasky
7616f7c362
(svn r1925) Fixed an infinite loop if the town generator runs out of town names. The number of generated towns is then limited by the number of available names.
20 years ago
celestar
2eda5228d1
(svn r1881) -Fix: [ 1119308 ] Max passengers / mail variables are now 32 bit
20 years ago
celestar
563eac90ca
(svn r1866) -Fix: Intercepted generated maps with 0 towns on it. Currently just an
...
error() is called, some more graceful handling should be implemented
later.
20 years ago
tron
7d56d1d841
(svn r1839) Move GetTileSlope() and GetTileZ() into tile.[ch] and use more explicit types as parameters
20 years ago
tron
6984d6cd31
(svn r1832) Next byte -> char iteration: custom names
20 years ago
truelight
f1610872de
(svn r1831) -Fix: Scenario Editor now handles human-made roads better (try to build
...
a city layout before placing the city, finally that works very nice)
20 years ago