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
8980891b09
(svn r3024) -Codechange: Another batch of replacements of int/uint/int16/byte/-1 with proper types and constants
19 years ago
tron
980808dac2
(svn r3001) s/Player*/const Player*/
...
s/byte/PlayerID/
s/int/PlayerID/
and related changes
19 years ago
tron
0181327f2d
(svn r2999) Do not pass if the HQ gets built for the first time or gets relocated as parameter - the command function has to check this anyway
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
tron
06ec749425
(svn r2766) Remove string and make use of the plural feature
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
ludde
6246619185
(svn r2573) Codechange: Removed WDF_RESTORE_DPARAM, it's not needed with the new string system.
...
Also fixed a bug introduced in r2564, forgot to remove 4 global variables in network_gui.c.
19 years ago
ludde
8086017097
(svn r2564) Fix: Fixed conceptual issue in network_gui.c. AllocateName is not meant to be used by GUI-code, because it modifies the "game-state".
...
Added a way to bind a C-string to an openttd string which doesn't modify the game state.
19 years ago
celestar
354058341b
(svn r2468) -Codechange: Got rid of DEREF_PLAYER and replaced it by GetPlayer
19 years ago
Darkvater
c3c69ff5cb
(svn r2420) - Codechange: magic number elminitation of cursorsprites.
19 years ago
Darkvater
ba8c649fac
(svn r2397) - CodeChange: rename all "ttd" files to "openttd" files.
19 years ago
Darkvater
708a3046ac
(svn r2381) - Fix: [ 1210610 ] Endgame window on easy difficulty results in infinite loop. Oops. Seperated the window classes of endgame and highscreen.
20 years ago
Darkvater
6dba03a819
(svn r2344) - Fix (regression): [ 1197216 ] Error: !invalid string id 0 in GetString. Dedicated server also had the endgame window shown and because now it is properly no-player anymore it crashed.
20 years ago
tron
d3f8772497
(svn r2329) CMD_CHANGE_PRESIDENT_NAME and CMD_CHANGE_COMPANY_NAME don't use p1, so don't send any meaningful value for it when invoking these commands
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
9cfb89cf24
(svn r2315) - Fix: [ 1187613 ] No HQ present for competitor, disable 'View HQ' button, inspired by lucaspiller
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
b43331c931
(svn r2290) - CodeChange: protect the next batch of commands. This brings us to a total of 61, which is 53% :)
...
- CodeChange: To correctly accept engine-prototypes, the best-player checking has been moved to its own function, I hope it functions the same as before.
- CodeChange: Added symbolic types of PlayerID, OrderID and EngineID. For engines also added GetEngine() and IsEngineIndex(), similar to the other such functions.
- CodeChange: To correctly build industries, some tables have been moved to build_industry.h. The only way to find out currently if an industry is valid in a climate is by looping all industries and checking if it matches. Also to comply with the patch setting build_rawmaterial_industries, it is assumed that these industries do not accept any cargo of any type. This can and probably should changed in the future to some flag in their struct. Also use _opt_ptr instead of _opt.
- CodeChange: implemented the HQ checking code inspired by MarkR2 in "[ 1190944 ] Many commands not checked for security". Unfortunately it is impossible to prevent only deleting a HQ by a modified client atm.
- CodeChange: For insert order and modify order their parameters are implicitely truncated to 8 bits, instead of the 16 bits said in the comments.
20 years ago
tron
52c89cf477
(svn r2271) CMD_SET_PLAYER_FACE, CMD_SET_PLAYER_COLOR, CMD_INCREASE_LOAN, CMD_DECREASE_LOAN only make sense for the current player, so don't explicitly pass a player number
20 years ago
Darkvater
22a375ba73
(svn r2243) -Fix: Rework of console. Use 'help command|variable' to get help about it. You can assign variables with =, ++, --, or just new value. Console parser is now lenient towards typed spaces, and more robust in general (at least readable). Removed the 'set' command, instead implemented all such variables as 'variables'.
...
- Some variables are really special and cannot be assigned normally, use their callback procedure for assignment/querying. This commit also obsoletes "[1172804] Console set command cleanup"
20 years ago
tron
830565514c
(svn r1867) Include tables/sprites.h only in files which need it
20 years ago
tron
c644e6b742
(svn r1827) Next iteration of the byte -> char transition: some string drawing functions and buffers
20 years ago
tron
81ee2d931b
(svn r1610) Remove trailing whitespace (last time ever, i hope)
20 years ago
darkvater
57ffaeeeaf
(svn r1578) -Fix: [1102454] dedicated server crashes after some hours (highscore problems for dedicated...should be really solved now)
20 years ago
bjarni
467e4b82bf
(svn r1568) made an enum of train subtypes to make the code more readable
20 years ago
tron
dd6db73069
(svn r1520) Trim 134 (!) lines with trailing whitespace ):
20 years ago
darkvater
cd4272e08d
(svn r1518) -Fix: server issue where some company names were wrong
...
-Fix: Highscore troubles; accessing members of deleted window
20 years ago
darkvater
33f506a194
(svn r1516) -Cheating players do not get their names added to the highscore table/file
...
-Fixed issue where highscore window would not come up after endgame screen
-Fix: VS6 compiles once again (braindead compiler)
20 years ago
dominik
0a606c94c4
(svn r1506) Fix: [ 1102275 ] Game crashed when clicking "new face" or "company color" twice
20 years ago
darkvater
2257e03c33
(svn r1502) -Fix: [1101889] Crash under windows... stupid typo in player_gui.c ^ should've been &
...
-Fix: in multiplayer clientlist can only be opened once
20 years ago
darkvater
84adfdf8c8
(svn r1496) -Fix: highscore no longer crashes in network games with a dedicated server. At the end of the game (can only be set by the server) the highscore is shown for the top5 companies of that game
...
-Fix: fixed some compiler warnings
-Added PF_NETWORK_ONLY flag to settings. Such a setting can only be modified in a network game.
20 years ago
darkvater
199a77d1ea
(svn r1479) -Added highscore chart (accessible from the difficulty window) with top5 companies for a given difficulty (select the difficulty in the menu)
...
-Added endgame score on 1 jan 2051 where you are added to the highscore if sufficiently large points have been accumulated. Game is paused while
-These values are saved in hs.dat; added read/write functions for it
-Added code to delete all windows to show charts. There is one issue left: somehow a news-gui pops up in front of the the chart at the end of the game.
20 years ago
darkvater
c2b59b2089
(svn r1418) -Feature: [1098254] (dis)Allow Shares. Add patch options to allow buying/selling of shares (Hackykid)
20 years ago
darkvater
5df77bfbcd
(svn r1404) -Fix: Company password no longer shares a widget with buying shares
20 years ago
truelight
124a29f7a5
(svn r1401) -Fix: glitches in train-depot GUI (tnx to Hackykid)
...
-Fix: glitch in Company Overview GUI (Hackykid)
20 years ago
darkvater
d63144e8c0
(svn r1379) -Fix: various GUI glitches. Added default sizes to various widgets. Sticky/Resize- and Scrollbar must be 11 pixels wide, Horizontal scrollbar 11 pixels high, caption must be 13 pixels. I hope I didn't forget any widgets, the game will assert for that so report them to me!
20 years ago
darkvater
9d38a7afca
(svn r1374) -Feature: Add sticky item to finances window; sticky remains when requesting big/small window
...
-Moved resize icon in save dialog to bottom-right
20 years ago
truelight
3b7d2a8b67
(svn r1348) -Feature: resizable windows. Read the comment in window.h to find out
...
how the system works. All useful windows are already made resizable. Enjoy :)
-Fix: fixed some GUI-glitches and flaws along the way
20 years ago
darkvater
2ba5faed6c
(svn r1260) -Fix: [1090357] Patch for braindead MinGW compiler (luzi82)
20 years ago
darkvater
552cb7ad60
(svn r1239) -Feature: Added gui option of setting company password. It can be found in the 'company information' window
...
-Spiced up 'set company_pw' a bit, where if no pw is typed, it shows the current one.
-Added a space between company name and player; looks better
20 years ago
truelight
093540e9b5
(svn r1107) -Fix: [Network] A spectator can no longer buy/sell shares of companies
20 years ago
truelight
242f2c7b60
(svn r1023) -Fix: [Network] [ 1083692 ] You can no longer buy out a company in MP
...
because of the lag between commands (anyway, I hope)
20 years ago
truelight
d6a1f3e412
(svn r942) -Merged branch/network back into the trunk
20 years ago
tron
265ac67183
(svn r901) Small step in the process to clean up the DPARAM mess:
...
- reduce to 2 sizes (*DParam64 for 64bit values, *DParam for the rest)
- use inline functions instead of macros
- add assert()s to check for buffer overruns
20 years ago
tron
acbd1801c7
(svn r815) Include strings.h only in the files which need it.
...
This should reduce the compile time after altering english.txt by about 1/3, because "only" 62 instead of 90 .c files must be recompiled.
20 years ago
truelight
4ccd84f94b
(svn r201) -Fix: [1025836] Company values bigger dan int32 were put to negative
...
-Fix: [1025836] Long bridges had negative value
-Fix: Typo in endian_check.c (Zr40)
20 years ago