Commit Graph

2053 Commits

Author SHA1 Message Date
Duncan 375d8571cc
Further coords work (#1066)
* Refactor centre2dCoordinates

* Refactor getCursorPos
2021-08-05 10:36:28 +01:00
Duncan 63b8813db8
Cleanup duplicated call instances and add notes (#1069) 2021-08-05 10:32:27 +01:00
Aaron van Geffen 06e6c34671
Rename cursor and tool constants (#1080)
* Name unnamed cursor constants

* Use cursor constants for Input::toolSet

* Consolidate access to current tool cursor variable
2021-08-04 20:06:37 +02:00
Aaron van Geffen 4baeabc5d2
Use system cursors for pointer and hand cursors (#1076)
Recently, #674 introduced support for Locomotion's custom cursors on Linux and macOS. As a result of that PR,
however, the pointer and hand cursors regressed to their Windows 9x/2000 counterparts. This PR changes only
these specific cursors to use the appropriate system cursors.
2021-08-04 20:06:10 +02:00
Aaron van Geffen ecae932561
Allow rotating buildings in town list by keyboard shortcut (#1079) 2021-08-03 21:11:22 +02:00
Marijn van der Werf f6f1bd7b2e
Unify pointer to x86-register casts (#1062)
* Use X86Pointer for passing pointers

* Use assert_struct_size macro

* Add conversion support to X86Pointer
2021-08-03 03:07:34 +02:00
Duncan a3221a8df2
Some viewport functions (#1067)
* Implement getCentreMapPosition

* Implement screenGetMapXY

* Use function

* Add helper function and rename members

* Implement and rework getQuadrantFromPos

* Split up further for future use

* Move function location and rename further

* Further tweaks

* Rebase fixes

* Use ternary to simplify code
2021-08-02 12:29:47 +01:00
Duncan 33dd39e760
Implement processMessagesMini (#1073) 2021-08-02 11:24:48 +01:00
Duncan 3b062132c8
Vehicle Tool Update (#1064)
* Start vehicle tool update

* Add remaining water tool update code

* Rework and make work

* Start implementing vehicle air placement update

* Further work

* Finish air pickupToolUpdate

* Start land vehicle tool update

* Start rail update function

* Fix rebase mistake

* Move subposition to seperate data file

* Further work

* Fix placement command

* Handle curves

* Implement road tool update

* Name unk variable

* Clang format

* Finish rename

* Apply review comments
2021-08-01 19:14:16 +01:00
Duncan f85b375063
Townlist ToolUpdate/Down (#1035)
* Start work

* Further work

* Finish function

* Implement toolDown

* Remove unused type

* Fix colour. Improve interfaces

* Fix dropdown colour selection

* Update changelog
2021-08-01 18:59:20 +01:00
Duncan 7e46462f87
Industry Tool Update/Down (#1063)
* Implement ghost removal

* Implement tool update

* Implement toolDown

* Fix mistakes

* Fix compile issue
2021-08-01 18:58:39 +01:00
Duncan d4c49e39e4
Company Window: Tool Update (#1061)
* Finish remaining company tool functions

* Fix compile issues. Add comments
2021-08-01 18:57:20 +01:00
Duncan 26256545ba
Fix station naming crashing after exahusting realNames (#1070) 2021-08-01 09:57:46 +02:00
Ted John 0ee44427e9
Fix bitScanReverse for GCC (#1065) 2021-07-26 21:54:31 +01:00
Duncan 1d5b041df3
Remove duplicated function and rename (#1052)
* Remove duplicated function and rename

* Avoid narrow error

* Actually do transform correctly
2021-07-26 12:16:39 +01:00
Duncan d70a3dd7fc
Provide further notes for string control codes (#1056)
* Provide further notes for string control codes

* Apply review comments
2021-07-21 15:04:09 +01:00
Duncan 82adf56d87
Implement getMaxStringWidth (#1060) 2021-07-21 13:02:40 +01:00
Duncan 92b781cf48
Implement alternative clip string (#1054)
* Implement alternative clip string

* Add explicit newlineXY entry
2021-07-21 13:02:16 +01:00
Duncan cbdbded197
Right Click Interact (#1053)
* Start work

* Headquarter and Tree right click interact

* Implement wall and building removal interaction

* Begin airportInteract

* Implement airport and dock interaction

* Implement track and road station interaction

* Implement signal interact

* refactor for consistent uses
2021-07-21 13:01:39 +01:00
Duncan 4186081736
Partial fix #1048. Utf8 path issues (#1057)
* Partial fix #1048

* Further u8path fixes

* Even further path fixes

* Reduce conversion madness in platform files
2021-07-21 12:54:39 +01:00
Duncan 8a0c0fa68a
Implement getTileStartAtCursor (#1034)
* Implement getTileStartAtCursor

* Use implemented function

* Fix narrowing

* Remove duplicated function
2021-07-21 12:43:16 +01:00
Duncan b7ede286a2
Make accessor functions for mapselection points (#1036)
* Make accessor functions for mapselection points

* Clang format
2021-07-21 05:10:54 +01:00
Marijn van der Werf 0a0d9f985b
Dump cursors from original binary (#674)
* Dump cursors from original binary

* Add routines to convert cursors from ASCII art.

* [tmp] Redump cursor

* Load dumped cursors

* Empty out Cursor.cpp

* Move cursors

* Add Cursor.cpp to vcxproj

* Add header file to vcxproj

Co-authored-by: Aaron van Geffen <aaron@aaronweb.net>
Co-authored-by: duncanspumpkin <duncans_pumpkin@hotmail.co.uk>
2021-07-19 13:01:08 +01:00
duncanspumpkin 70c9d8635c Start v21.07+ 2021-07-18 07:40:47 +01:00
duncanspumpkin 7ec445f7f7 Update OpenLoco version to v21.07 2021-07-18 07:14:25 +01:00
Duncan f280941bc5
Readd window_colour_4 control code (#1055) 2021-07-16 21:45:49 +01:00
Duncan f57a13a7da
Refactor and fix headquarter placement (#1044)
* Refactor and fix headquarter placement

* Add changelog entry
2021-07-14 17:45:02 +01:00
Duncan 29938544e2
Implement TownManager::reset (#1050) 2021-07-14 10:14:13 +01:00
Duncan 46637fb5c2
Implement populateTownSizeSelect (#1038)
* Implement populateTownSizeSelect

* Remove extra size entry
2021-07-14 10:13:57 +01:00
Aaron van Geffen 57166baefd
Mention code style in readme (#1047)
* Add note on code style to readme

* Fix readme section numbering and rebuild table of contents
2021-07-10 08:49:54 +02:00
Duncan ee83e9f53c
Remove redundant rotate function (#1046) 2021-07-09 13:54:06 +01:00
Duncan 6a4e022af8
Link up implemented function (#1043) 2021-07-06 07:22:47 +01:00
Duncan 65d905d2c1
Fix use of constants for coord limits (#1037) 2021-07-05 22:48:04 +02:00
Duncan 79f1d00674
validCoords: remove template parameter and name type (#1033)
There is no requirement for this function to take anything other than Pos2 so best make it an explicit type.
2021-07-04 12:04:52 +02:00
Aaron van Geffen 1444685591
Add coordinate validation to tile loops with offsets (#1031) 2021-07-03 22:42:54 +02:00
Aaron van Geffen 6b0c50f77f
Implement ChangeCompanyColour game command (#1029)
* Implement ChangeCompanyColour game command

* Implement updateHeadquartersColour

* Implement updateHeadquartersColourAtTile

* Implement updateVehicleColours
2021-07-03 19:22:53 +02:00
Aaron van Geffen 2f3b9ef696
Implement colour picker dropdowns (#1028)
* Implement Dropdown::showColour and company colour pickers

* Apply competing colour mask to company primary colour selection

* Colour selections for buildings in TownList

* Tree colour picker (untested)
2021-07-03 18:51:56 +02:00
Aaron van Geffen e9fd958b23
Implement StationManager::generateNewStationName (#1020)
* Start implementing StationManager::generateNewStationName

* Use functions to convert from and to town names

* Implement IndustryManager::industryNearPosition for 'Oilfield' and 'Mines'

* Implement TileManager::countSurroundingWaterTiles for 'Lakeside'

* Implement TileManager::countSurroundingTrees for 'Forest' and 'Woods'

* Implement station heights/valley

* Register hook to allow testing by means of creating stations

* Implement central/north/south/east/west names

* Add enum for town names; use bitsets to keep track

* Remove unnecessary surface loops
2021-07-03 11:58:22 +02:00
Aaron van Geffen fbc145a5bf
Station rename command (#984)
This re-introduces the possibility of resetting/regenerating station names automatically
by using an empty station name. Previously, our re-implementation (C++ code) inadvertently
removed this option.
2021-07-01 19:59:37 +02:00
Michał Janiszewski d10b16e404
Fix access to embedded object name (#1022) 2021-07-01 10:59:38 +02:00
rdrdrdrd95 17f1d1f5b1
Reduce inclusion of StringIds.h in header files (#985) 2021-07-01 10:49:30 +02:00
Michał Janiszewski cace3b9148
Merge pull request #1026 from AaronVanGeffen/animation-hook
Force alignment on TileManager::createAnimation hook
2021-06-30 22:24:00 +02:00
Duncan 4863d0e617
Implement the station name background paint (#1023) 2021-06-30 19:49:51 +01:00
Aaron van Geffen f1adeb7568 Force alignment on TileManager::createAnimation hook 2021-06-30 19:07:22 +02:00
Duncan 004f0c520e
Merge duplicated flags and use accessors (#1025) 2021-06-30 10:41:18 +01:00
Duncan b7c0cf5f9e
Remove use of global stringformatbuffer where not required (#1024) 2021-06-30 10:40:25 +01:00
Duncan 7bdc32d8b2
Refactor calls to tryCreateInitialMovementSound (#1018)
Forgot to do this after implementing all of the land update functions.
2021-06-28 15:39:47 +02:00
Alexander 641898d977
Turn widget draw functions into Widget struct member functions (#1012) 2021-06-26 12:56:42 +02:00
Aaron van Geffen 6a10da15ca
Allow filtering the vehicle list by station or cargo (#997) 2021-06-26 11:12:20 +02:00
Aaron van Geffen d6a0b7a0ff Restore game command table alignment 2021-06-26 11:09:14 +02:00