Commit Graph

64 Commits

Author SHA1 Message Date
Peter Nelson 5e689ce25e
Codechange: Store cursor sprites in vector. (#12564)
Combine two separate fixed length arrays to allow simpler iteration.

No need to check that arrays are all the same length.
No need to separately store the number of sprites to draw.
Removes the upper limit of the number of sprites that can be drawn.

Removes lengthof and array indices.
2024-04-24 21:26:07 +01:00
Patric Stout a3cfd23cf9
Codechange: rename byte to uint8_t (#12308) 2024-03-16 23:59:32 +01:00
Peter Nelson 0463d4c198 Codechange: Remove direct access to _colour_gradient.
Access is now through GetColourGradient, which ensures parameters are in range.
2024-02-25 12:38:07 +00:00
Rubidium aa5ba5bd7f Codechange: allow certain enumeration to be added
Otherwise C++20 doesn't like it.
2024-01-16 23:30:23 +01:00
Rubidium 3a676a5af0 Codechange: replace static inline with static for non-class functions 2024-01-06 13:37:33 +01:00
Rubidium eaae0bb5e7 Codechange: automatic adding of _t to (u)int types, and WChar to char32_t
for i in `find src -type f|grep -v 3rdparty/fmt|grep -v 3rdparty/catch2|grep -v 3rdparty/opengl|grep -v stdafx.h`; do sed 's/uint16& /uint16 \&/g;s/int8\([ >*),;[]\)/int8_t\1/g;s/int16\([ >*),;[]\)/int16_t\1/g;s/int32\([ >*),;[]\)/int32_t\1/g;s/int64\([ >*),;[]\)/int64_t\1/g;s/ uint32(/ uint32_t(/g;s/_uint8_t/_uint8/;s/Uint8_t/Uint8/;s/ft_int64_t/ft_int64/g;s/uint64$/uint64_t/;s/WChar/char32_t/g;s/char32_t char32_t/char32_t WChar/' -i $i; done
2023-07-19 19:30:14 +02:00
Patric Stout 0d840b4570 Codechange: remove queue_wrap / last_position from mouse movement
No backend uses it anymore, so also no longer any need to support
it.
2023-06-04 00:40:56 +02:00
Peter Nelson 23c46e1abf Fix: #10735: {POP_COLOUR} fails if string is drawn with extra flags. 2023-04-28 23:12:07 +01:00
PeterN 9910240f0e
Cleanup: Remove obsolete (Make)EnumPropsT. (#10697)
This was used by the command system to help extract p1/p2 parameters, which no longer happens.
2023-04-23 17:46:14 +01:00
PeterN e97bf271dc
Codechange: Make SpriteType, CargoSortType, SourceType and ScriptType enum classes. (#10663)
This avoids a (soft) namespace conflict between the four ST_* enums.
2023-04-16 20:00:55 +01:00
Tyler Trahan 8e04cba0c3
Change: Make tick length 27 milliseconds (#10607)
This makes a month last about 60 seconds, allowing the use of real-time units in game.

Co-authored-by: Niels Martin Hansen <nielsm@indvikleren.dk>
2023-04-14 14:50:19 +01:00
glx22 af3df959c2 Codechange: reduce code duplication 2022-12-23 23:23:03 +01:00
Michael Lutz e08b3abe7f Codechange: Un-bitstuff group and autoreplace commands. 2021-12-16 22:28:32 +01:00
Peter Nelson 636e37d183 Codechange: Add internal widget alignment property, along with widget part. 2021-04-22 16:42:04 +01:00
Charles Pigott 860c270c73 Codechange: Replace assert_compile macro with static_assert 2020-12-27 10:55:42 +00:00
Patric Stout d5b9f7ac37 Add: [Emscripten] use "relative mouse mode" with SDL2
This mode doesn't wrap the mouse constantly, but requests SDL
to lock the mouse pointer. This is needed, as with Emscripten
you are not allowed to change the mouse poisition (only to lock
it into place).
2020-12-15 15:46:39 +01:00
Patric Stout d15dc9f40f Add: support for emscripten (play-OpenTTD-in-the-browser)
Emscripten compiles to WASM, which can be loaded via
HTML / JavaScript. This allows you to play OpenTTD inside a
browser.

Co-authored-by: milek7 <me@milek7.pl>
2020-12-15 15:46:39 +01:00
glx 42144ecd56 Add: a TextColour flag to ignore colour changes from strings 2019-12-23 17:30:13 +00:00
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
Charles Pigott 10ba431d21 Codechange: Remove SpriteTypeByte type 2019-04-29 17:40:22 +01:00
PeterN 23960d0f2c Feature: Group liveries, and livery window usability enhancements. (#7108)
* Change: Replace checkbox in livery selection window with Default option in drop down selection.

This reduces clutter in the UI and allows for primary/secondary colours to independently follow the default scheme if desired.

* Feature: Add vehicle group liveries.
2019-01-31 14:57:44 +01:00
Charles Pigott f5b1115039 Doc: Lots and lots of doxymentation fixes 2018-10-31 12:35:54 +01:00
frosch 3cb7d9703b (svn r27628) -Codechange: Prepare for drawing cursors consisting of multiple sprites. 2016-08-15 18:33:08 +00:00
frosch f7a0ee9a15 (svn r27625) -Doc: CursorVars 2016-08-15 18:30:50 +00:00
frosch 4830497f0b (svn r27340) -Fix [FS#6338]: Silence warning by moving _string_colourmap to a file no its own. (Cif) 2015-07-26 09:47:17 +00:00
frosch 352e528cda (svn r27167) -Fix: [SDL, Windows] Right-mouse-button scrolling scrolled/jumped way to far, when OpenTTD lagged during mouse event processing. 2015-02-22 23:06:45 +00:00
frosch 631e8b45fd (svn r26522) -Add: A config-file-only setting to disable usage of 8bpp video modes.
-Remove: [win32] fullscreen_bpp setting, which is replaced by above setting.
-Change: Disable usage of 8bpp blitters and video modes by default. Many modern OS and hardware cause issues with those.
2014-04-27 12:15:14 +00:00
rubidium 54e36c4ff8 (svn r24111) -Codechange: use Colour more instead of manually bitstuffing 2012-04-10 20:16:51 +00:00
rubidium 2ccbd2a6f5 (svn r23446) -Codechange: move _cur_palette and it's related first/count dirty variables into a single structure 2011-12-08 18:13:29 +00:00
rubidium dfefcab47d (svn r23274) -Add: internal support for a monospaced sprite font 2011-11-20 11:56:51 +00:00
frosch bbcd2bab5d (svn r22419) -Change: Always use the DOS palette for drawing.
-Remove: the '-i' option for palette selection.
2011-05-04 17:12:37 +00:00
rubidium 0de8332366 (svn r21897) -Fix (21707): Kenobi visited IsValidConsoleColour shortly 2011-01-23 00:11:15 +00:00
rubidium 37b9c31118 (svn r21702) -Fix: make sure the colour argument of echoc is properly validated to be a text colour 2011-01-03 12:04:53 +00:00
rubidium 9b2a54bfbf (svn r21640) -Change/Feature-ish: allow disabling the shading when drawing text 2010-12-25 20:02:04 +00:00
rubidium 2c41b8ee97 (svn r21637) -Codechange: make it more clear that IS_PALETTE_COLOUR belongs to TextColour 2010-12-25 19:47:15 +00:00
rubidium ab44c91778 (svn r21252) -Codechange: introduce a constant for the number of milliseconds per game tick and use it 2010-11-19 10:35:59 +00:00
yexo 4012f85eec (svn r20067) -Add: special modifier (GLOBAL) to mark hotkeys as global hotkeys 2010-07-03 20:14:56 +00:00
yexo 258ca28819 (svn r20055) -Feature: save/load hotkeys to/from hotkeys.cfg 2010-07-03 13:28:15 +00:00
frosch 75d4bc947d (svn r19654) -Codechange: Use Extract<> in more places. 2010-04-17 13:31:41 +00:00
smatz 53aaabe6e9 (svn r19507) -Codechange: remove semicolon after DECLARE_POSTFIX_INCREMENT and DECLARE_ENUM_AS_BIT_SET 2010-03-23 22:25:43 +00:00
rubidium f94c83a387 (svn r18872) -Codechange: introduce PaletteID and use it 2010-01-21 01:38:13 +00:00
rubidium 82fc28f77f (svn r18809) -Codechange/Cleanup: remove unneeded headers from some files, if a header require a header make it include that header 2010-01-15 16:41:15 +00:00
rubidium 7fbc33dae1 (svn r17248) -Fix: add GPL license notice where appropriate 2009-08-21 20:21:05 +00:00
smatz d703f0c3b5 (svn r16628) -Codechange: remove one gcc2 hack 2009-06-22 23:15:27 +00:00
alberth c1ef6abc6a (svn r16606) -Doc: Added/fixed doxygen comments. 2009-06-20 15:48:55 +00:00
alberth 8aa51823fc (svn r16604) -Codechange: Use FS_BEGIN for iterating over fonts. 2009-06-20 15:05:59 +00:00
rubidium c0a8d09ca7 (svn r15428) -Codechange: consistently use colour instead of having both color and colour. 2009-02-09 02:57:15 +00:00
rubidium 8dae160d0f (svn r15425) -Codechange: some color->colour changes and type safety. 2009-02-09 02:09:47 +00:00
smatz 720eedf7c5 (svn r14997) -Fix [FS#2524](r14223): when handling invalid sprites, entry in spritecache data could lose its parent 2009-01-11 22:28:30 +00:00
rubidium f1f5b248c2 (svn r14461) -Document: add some doxygen comments (Albert) 2008-10-13 03:26:48 +00:00