Commit Graph

72 Commits (cae2bca0a7487195d0381c9bf4013d0fcaf0773f)

Author SHA1 Message Date
lethosor d1f0edd33b
Apply initial pre-commit config 2022-04-12 14:48:19 -04:00
lethosor e7754ea890
Enable -Wunused-variable and fix most errors 2021-09-07 01:16:21 -04:00
bseiller 5cd86743f1 trying to make gcc happy
- survey.cpp: adding include to allow gcc to find std::memset
2021-05-25 18:56:58 +02:00
bseiller 838285e925 Improve performance of surveying => faster search
- def.h: changed vectors for inorganics to contain uint8_t instead of bool which improves the performance when using std::fill and std::memset to batch-set the whole array
- survey.cpp: using std::memset instead of direct assignment to reset the inorganic vectors, also using the actual size of each vector for the call
- changelog.txt: add note concerning the changes
2021-05-23 11:28:48 +02:00
bseiller 60e83046f8 Prevent accidental double-frees
- matcher.cpp, survey.cpp: setting the state pointer to null/nullptr in ::shutdown() to prevent errors caused by accidental double-frees - an additional check if the pointer is null already is not necessary as the standard guarantees that nothing happens if delete is called on a nullpointer

Co-Authored-By: Alan <3719547+lethosor@users.noreply.github.com>
2021-02-20 22:43:12 +01:00
bseiller 6ffbf401c4 Merge branch 'develop' into ea_improve_survey_performance_keep_mlts_on_heap 2021-02-09 08:42:42 +01:00
bseiller 52bf998224 Adapt to review comments by @PatrikLundell
- survey.cpp: rename loop variable for more clarity; replace use of parmeter with use of vector.size(), replace nested vector.at calls with direct index access/subscript as it is faster and easier to read
2021-02-03 14:32:03 +01:00
bseiller 0c304cf85f Improve performance of surveying => faster search
replace the local/automatic mid_level_tiles variable in matcher::match_world_tile with one that is created once during the setup phase (heap).
The dynamic part of the contained (16*16*3 = 768) vectors is being allocated on the heap in both cases - which made the repeated instatiations of the automatic variable so slow/expensive.

Also replace calls to vector<bool>.resize in nested loops with direct assignments to those vectors, which curiously even after a lot of profiling is the fastest way to reset the inorganic vectors - at least on Windows.

- embark-assistant.cpp: Replace 2 local/automatic mid_level_tiles variables with a single dynamic variable created during setup as well; add calls to matcher::setup() and matcher::shutdown()
- matcher.cpp/.h: add state with mid_level_tiles member; add setup and shutdown functions
- survey.cpp: add function reset_mlt_inorganics as replacement for the looped calls to vector::resize as all inorganic vectors are now expected to have the proper size when entering survey::survey_mid_level_tile
2021-02-03 00:08:59 +01:00
bseiller fede136008 refactoring embark-assistant survey, 12.iteration
- survey.cpp: replace repeated (nested) vector access with an const int / auto pointer in survey_mid_level_tile
2021-02-01 22:57:30 +01:00
bseiller aff64956fb refactoring embark-assistant survey, 11.iteration
- survey.cpp: replace repeated (nested) vector access with a auto pointers in survey_mid_level_tile
2021-02-01 22:53:45 +01:00
bseiller 4fdcec5893 refactoring embark-assistant survey, 10.iteration
- survey.cpp: replacing repeated vector access with auto value in survey_mid_level_tile
2021-02-01 22:36:16 +01:00
bseiller 1ed783284e refactoring embark-assistant survey, 9.iteration
- survey.cpp: replacing repeated vector access with a const world_geo_biome pointer in survey_mid_level_tile
2021-02-01 22:31:58 +01:00
bseiller 9d64c9a549 refactoring embark-assistant survey, 8.iteration
survey.cpp: remove unused includes
2021-02-01 22:25:57 +01:00
bseiller db423cc11e refactoring embark-assistant survey, 7.iteration
- survey.cpp: replacing repeated nested vector access with a const df::inorganic_raw pointer in survey_mid_level_tile
2021-02-01 22:22:10 +01:00
bseiller aa520dfcce refactoring embark-assistant survey, 6.iteration
- survey.cpp: add function to copy all incursion values from one  mid_level_tile_incursion_base instance to another; replace repeated assignments with  calls to new function in survey_mid_level_tile
2021-02-01 16:00:01 +01:00
bseiller 3181532bf2 refactoring embark-assistant survey, 5.iteration
- survey.cpp: replacing repeated nested vector access with a const mid_level_tile reference in survey_mid_level_tile
2021-02-01 00:24:56 +01:00
bseiller 16438c59c8 Remove trailing whitespace as per lint rules 2021-01-31 14:03:49 +01:00
bseiller 115b8a439f fixing use of wrong indices, discovered during refactoring in survey::survey_mid_level_tile
- survey.cpp: replacing faulty repeated nested vector access (due to wrong indices) with the existing region_map_entry reference
2021-01-31 13:58:17 +01:00
bseiller 741e430a06 removing dead store from survey::survey_mid_level_tile
- survey.cpp: deleting declaration of and assigments to variable base_z which is never used apart from a self-assigment
2021-01-30 23:37:09 +01:00
bseiller 028a68ae6f refactoring embark-assistant survey, 4.iteration
- survey.cpp: replacing repeated nested vector access with a region_map_entry reference in survey_mid_level_tile; made a reference mid_level_tile const to prevent acidental change of values
2021-01-30 23:33:09 +01:00
bseiller b1cf65860c Merge branch 'develop' into ea_refactoring 2021-01-30 17:39:41 +01:00
bseiller b33f06efee refactoring embark-assistant survey, 3.iteration
- survey.cpp: replacing repeated nested vector access with a mid_level_tile reference in survey_mid_level_tile
2021-01-28 23:48:09 +01:00
bseiller e90e84ab87 refactoring embark-assistant survey, 2.iteration
- survey.cpp: replacing pointer and repeated nested vector access with a region_tile_datum reference in survey_mid_level_tile
2021-01-28 23:40:58 +01:00
bseiller 6e012bb032 refactoring embark-assistant survey, 1.iteration
- survey.cpp: replacing repeated double vector access with a reference in survey_mid_level_tile
2021-01-28 23:38:40 +01:00
bseiller c525b80dda Merge branch 'develop' of https://github.com/DFHack/dfhack into ea_incursion_struct 2021-01-24 13:54:25 +01:00
bseiller 9b9373be4f removing commented out assigments 2021-01-19 12:06:36 +01:00
bseiller e99c8faa24 switching to mid_level_tile_incursion_base to store incursion data of world tile edges
- defs.h: using mid_level_tile_incursion_base in region_tile_datum to store incursion data of world tile edges
- survey.cpp: commented out "not used" blocks of assignment in survey_mid_level_tile that no longer make sense now
2021-01-19 00:01:54 +01:00
bseiller bdfd50cc65 using mid_level_tile_incursion_base instead of mid_level_tile for incursion processing
- matcher.cpp, survey.cpp: adapting signatures to use new struct that only contains incursion specific attributes
2021-01-18 23:50:14 +01:00
bseiller c300cae2f9 removing 2 dead stores to speed up survey::survey_mid_level_tile
- survey.cpp: removing layer_bottom and layer_top, which are never read, but slow down survey_mid_level_tile significantly because entries are added quite often into the tree map structure
- survey.h: removing now obsolete include for map
2021-01-18 19:38:57 +01:00
PatrikLundell dbfd838786 corrected temperature calculation factor order 2020-12-27 11:07:33 +01:00
PatrikLundell 0b7ab90d3d corrected mismatched indices 2020-12-17 11:49:15 +01:00
PatrikLundell 3e3a34af99 corrected index usage 2020-12-16 10:59:27 +01:00
PatrikLundell c36fbe4c8b Corrected river size handling 2020-12-03 15:40:22 +01:00
PatrikLundell 1cd9babfb7 2 spaces killed 2020-11-17 21:10:40 +01:00
PatrikLundell ab617f67cc corrected world tile level incursion calculations 2020-11-17 19:52:46 +01:00
PatrikLundell 46835c9edd reworked aquifer bit fiddling 2020-11-14 14:43:43 +01:00
PatrikLundell 6014a45235 Fixed bug missing world tiles lacking incurson supplied resources 2020-11-13 20:11:03 +01:00
PatrikLundell 19ad5c92d6 corrected incursion bugs 2020-07-30 10:09:41 +02:00
PatrikLundell d5a491e852 fixed parameter bugs 2020-06-07 08:38:12 +02:00
PatrikLundell 4a48c356a9 fixed bug with incursion handling along world tile edges 2020-06-02 15:58:46 +02:00
PatrikLundell 31d984e934 Fixed 2 incursion handling bugs 2020-05-05 10:21:56 +02:00
PatrikLundell 8dd89eee8a Addressed warnings 2020-03-04 10:09:51 +01:00
PatrikLundell cd4c7ee422 Updated embark-assistant. Lt aquifer, trees, neighbors 2020-03-03 21:45:20 +01:00
PatrikLundell 1a695621c3
Adjusted to int-> enum defs, fixed bug 2020-02-10 18:22:26 -06:00
PatrikLundell 07dedfb333 Fixed/improved river tile detection 2019-11-24 21:32:07 +01:00
PatrikLundell 7e501fd70b Fixed bug in region type determination in new code 2019-10-31 20:07:34 +01:00
lethosor 0b8eba7d23 Merge remote-tracking branch 'PatrikLundell/embark-assistant' into develop
Conflicts:
	docs/changelog.txt
2019-08-22 21:50:54 -04:00
lethosor 99038c395a Merge remote-tracking branch 'ab9rf/biometype' into develop 2019-07-20 16:32:46 -04:00
PatrikLundell af26f7dc6e Added intrusion calculations for world edges 2019-07-14 16:11:51 +02:00
PatrikLundell 6f5abc79e9 Restored install-debug contents and removed offensive white space 2019-07-12 22:38:12 +02:00