Commit Graph

88 Commits (931b7dab7ba6b06eb802e41d1bc223a164690526)

Author SHA1 Message Date
celestar 69e1c716e8 (svn r4249) -Codechange: Replace more occurences of 16 by TILE_SIZE and of 8 by TILE_HEIGHT. Reverted one change from the previous commit because it was faulty 19 years ago
tron 087fe86ed2 (svn r3564) Several smaller changes:
- Don't treat non-booleans as booleans
- Reduce variable scope
- Bracing
- Use DeMorgan's law to make conditionals easier to read
- if cascade -> switch
- Replace some magic numbers by symbolic names
- Avoid assignments within other statements
19 years ago
tron 1c3e8630fe (svn r3511) More whitespace ([FS#46] by Rubidium) 19 years ago
tron 9712d6f639 (svn r3510) Fiddle with whitespace and parentheses 19 years ago
Darkvater 1e51c18c93 (svn r3425) - Fix: Followup to r3421. Correctly reset the TileHighLightData structure to prevent crashes in all the other cases where it is not guarded against sufficiently 19 years ago
tron 318fe153eb (svn r3365) Staticise 36 functions 19 years ago
tron e588f86bb3 (svn r3364) Remove 3 unused functions (ScrollWindowToTile, AllocateWindowAutoPlace, AllocateWindowAutoPlace2) 19 years ago
tron 849fff602d (svn r3336) byte -> WindowClass, uint16 -> WindowNumber 19 years ago
peter1138 627dd10451 (svn r3247) - Fix: "[ 1335580 ] sticky windows not sticky anymore"
Determine clicked status of sticky icon from window flags rather than the widget click state. This keeps the status in one place where it can't get out of sync.
19 years ago
tron 99a918aaac (svn r3222) -Feature: Right-Click-Scrolling optionally moves in the opposite direction (Requested by manx) 19 years ago
peter1138 65d9eb07a9 (svn r3217) Fix issue with resizing stepped windows introduced in revision 3181. 19 years ago
tron 8a3587fa28 (svn r3185) const 19 years ago
tron 9d0e7b6458 (svn r3181) -Bracing
-Indentation
-Whitespace
-DeMorgan's Law
-Test with NULL or 0 for non-booleans
-'\0' instead of 0 for chars
-Remove redundantly redundant comments (like DoFoo(); // Do foo)
-Join multiple short lines with a single statement
-Split single lines with multiple statements
-Avoid assignments in if
19 years ago
tron 53f00c8f9d (svn r3173) Use the trinary operator and switch to improve readability
Also align short cases nicely
19 years ago
tron 81e5b16d71 (svn r3172) static, const 19 years ago
tron 42f5ec371e (svn r3133) - static, const
- remove long unused stuff and bogus comments
- complement struct typedefs
- remove read-only (_demo_mode) and unused (_fix_mouse_at) global variables
19 years ago
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 53a4a6a0f4 (svn r3046) Replace some numbers with sprite names and fix a typo in the sprite list 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
celestar 3af8aba978 (svn r2734) -Feature: The Main Toolbar Dropdown Menu can now display disabled items 19 years ago
tron 452652e85e (svn r2720) Remove unused declarations and definitions 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 8b05455903 (svn r2664) Remove depedency on player.h from variables.h 19 years ago
tron 1307f90b5e (svn r2535) Tabs 19 years ago
Darkvater 5f2c7448b5 (svn r2530) - Fix: [ 1219829 ] Mouse-wheel crashes OTTD. Widget detection failed to detect the most-right and most-bottom pixels of a widget. If scrollwheel is used on a not-found widget (such as the background of the toolbar), it will now fail correctly (glx) 19 years ago
tron 2b73dec567 (svn r2486) Turn TILE_FROM_XY into an inline function and rename it to TileVirtXY 19 years ago
Darkvater ba8c649fac (svn r2397) - CodeChange: rename all "ttd" files to "openttd" files. 19 years ago
Darkvater c9b23c0571 (svn r2373) - CodeChange: don't redraw the window upon a user-based dirty request if the requested widget is invisible or otherwise not visible (type WWT_EMPTY) 19 years ago
Darkvater 17d1d4a750 (svn r2248) - Fix (regression): fix crashing of game when joining a dedicated server (only reset _thd.pos, not the whole structure; as done in revision 2241 to fix another crash) 19 years ago
Darkvater a2a1e0a114 (svn r2241) - Fix: [ 1190625 ] Changing mapsize crashes game with highlighting. Without shutting down OpenTTD some possibly 'invalid' data in TileHighLightData (_thd) is left behind; reset it. 19 years ago
Darkvater 34811a332e (svn r2161) - Fix: When resizing a window, the button is also visibly depressed
- CodeChange: Use images as arrows in the scenario-date scroller, looks better
- Feature: Clicked buttons with images/text now visibly depress their contents when pressed (eg it really seems like the button is moving)
- Fix: Fix sprite offsets of the arrow sprites in openttd.grf
20 years ago
darkvater 648fa7c97d (svn r2152) - Fix: Chatbar in MP games is now on-top of the news window.
- CodeChange: Introduction of SendWindowMessage() where a window can send another window a message (ala windows style msg, wparam, lparam). Messages can be sent by windowclass and by windowpointer.
- CodeChange: IsVitalWindow() simplifies a lot of checks for window handling that need to know what windows it can close, or be on top of, etc.
20 years ago
Darkvater 9d34e1fe01 (svn r2149) - Fix (Regression): [ 1175877 ] Inputbox of savegamedialog did not have "focus", keyinput went to game. A quick fix for the horrid inputkey-handling. 20 years ago
matthijs fd394303b2 (svn r2146) - Fix: [ 1175973 ] Crash if any key is pressed in startup (pkirchhofer) 20 years ago
Darkvater 9aacf73720 (svn r2141) - Fix: Keys now hopefully only activate the right windows. If console/querybox/chatbox is open, all input goes there, if closed to game itself. 20 years ago
pasky 9d21e74480 (svn r2074) MouseLoop -> InputLoop(), factor out a real mouse-specific MouseLoop from the new InitLoop() (more in the spirit of HandleKeypress()). 20 years ago
Darkvater 4f2816db05 (svn r1978) - Fix: Plug some memleaks; thanks Valgrind 20 years ago
Darkvater 7656c683cf (svn r1901) - Fix: unwanted behaviour of the savegame dialog, as well as a bug with a sloppy termination of a string. When any editbox is open, scrolling is disabled. If any new types of editboxes come up, please use SET/CLRBIT of _no_scroll with its unique identifier (ttd.h) 20 years ago
tron 36c9758c94 (svn r1803) Move debugging stuff into files of it's own 20 years ago
darkvater 5d2eaf5af0 (svn r1613) -Fix: WE_CLICK event is not called on default actions. If special action is needed, use the other events like WE_RESIZE or WE_DESTROY, etc. 20 years ago
tron 81ee2d931b (svn r1610) Remove trailing whitespace (last time ever, i hope) 20 years ago
tron 6140e55f38 (svn r1602) -Fix: [1107514] When resizing a window, make sure the correct window receives the click 20 years ago
tron 97f893ae2f (svn r1596) Add some more statics 20 years ago
tron 94d5aeabb2 (svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile 20 years ago
darkvater 03dd503310 (svn r1539) -Fix: [1103271] free'd memory used. Moved w->wndproc(w, &e) to end of function. Thanks for finding this tamlin. 20 years ago
tron 52c232844e (svn r1534) Use memmove() instead of memcpy() when copying overlapping memory (tamlin) 20 years ago
tron dd6db73069 (svn r1520) Trim 134 (!) lines with trailing whitespace ): 20 years ago
darkvater 16b8912f06 (svn r1497) -Fix: [1101179] Crash if generating land while industry window is open. This also happened for towns and the land information window
-Added DeleteWindowByClass() function that deletes all windows of a given class
20 years ago