80 Commits

Author SHA1 Message Date
Stephen E. Baker
8ac4f21038 Merge pull request #2861 from Alberth289346/fix-animview-print-mood-positions
Use %zd for printing a size_t value.
2025-05-15 22:29:56 -04:00
Alberth
2162a9da48 Use %zd for printing a size_t value. 2025-05-15 20:56:14 +02:00
Stephen E. Baker
e3c7ea7ce9 Bump clang-format and clang-tidy for linux pipeline
Use version 20 which is the current latest.

Fix bug clang-tidy found if reading the save file fails.
Format code per clang-format-20

I surpressed all new warnings in clang-tidy but we will probably want to
enable and fix some of them.

run-clang-tidy is used instead of calling clang-tidy directly in order
to automatically pull all source files.
2025-05-10 21:14:56 -04:00
Stephen E. Baker
f70b21e157 Merge pull request #2852 from TheCycoONE/includes
Include what you use
2025-05-07 22:02:44 -04:00
Stephen E. Baker
de7f8bb6d9 Include what you use
Applied IWYU recommendations (mostly).

I deviated on libraries, it always wanted me to include the inner headers
for SDL, ffmpeg, etc. but the definitions were normally expected to be
exported by a top level header. wxWidgets was particularly problematic
since it wanted me to use the gtk specific includes instead of the
generic ones.

I do not intend to add include-what-you-use to the CI/CD pipelines at
this time but some pragmas were added to the code to make it report
somewhat cleaner.
2025-05-07 20:10:00 -04:00
Alberth
bbb000b2d1 Improve the text of the button to set the marker position. 2025-05-07 17:33:04 +02:00
Alberth
deeb108a12 Reformat code 2025-05-06 18:05:26 +02:00
Alberth
7d133fd3d1 Replace regex matching with a character scanning and matching. 2025-05-06 17:43:25 +02:00
Alberth
246a475ffc Reformat CPP code 2025-05-05 16:39:38 +02:00
Alberth
10baf0ee44 Print set mood positions to stdout.
- Simplest way to get the set mood positions as text.
2025-05-05 16:25:26 +02:00
Alberth
cb06c95ed0 Animview: Extend mood handling.
- Allow entering a mood position.
- Allow fine-tuning the position.
2025-05-05 16:25:26 +02:00
Alberth289346
073ec51da9 Add cli function for decoding RNC files. (#2191)
Co-authored-by: Alberth289346 <alberth289346@gmail.com>
Co-authored-by: Stephen E. Baker <baker.stephen.e@gmail.com>
2022-07-03 16:40:15 -04:00
Stephen E. Baker
a3572952b7 Set startup project for Visual Studio
Minor convenience for Visual Studio users.

If CorsixTH is built, set it as the startup project for the top level
sln

Set CorsixTH as the startup project for the CorsixTH.sln
Set AnimView as the startup project for the AnimView.sln
2021-11-27 11:07:47 -05:00
Toby Lane
5336ea93e4 Fix case insensitive file selection in Animview 2021-06-30 20:38:25 +01:00
Toby Lane
8fe826e648 Change BUILD_ANIMVIEWER to BUILD_ANIMVIEW and add sanity check in AnimView cmake 2021-05-01 17:52:49 +01:00
Stephen E. Baker
120751d885 AnimView tidying (#1824)
Use wxSizerFlags to layout wxWidgets

Clearer to read and doesn't violate warnings about oring mismatched
enum types.

Additionally some type conversion fixes for frmMain
2021-04-23 23:25:53 -04:00
Zany XDev
1f7b9b7994 The scope of the variable's can be reduced. (#1820)
* The scope of the variable's can be reduced.

The scope of the variable 'found' can be reduced.
The scope of the variable 'cont' can be reduced.
2021-03-01 16:44:41 -05:00
Stephen E. Baker
ac5c317c5f Clang format th.h 2021-02-21 16:04:12 -05:00
Stephen E. Baker
ee56616d24 Fix formatting size_t strings in AnimView
Reduce number of C style casts and prevents crash when selecting
frames.
2021-02-20 23:34:50 -05:00
Stephen E. Baker
50f74c60a1 AnimView: Do not set background to button colour
Also separate assignment from adding UI
2021-02-20 23:34:50 -05:00
Stephen E. Baker
caa0e5ecee Minor clean up for AnimView 2021-02-20 23:34:50 -05:00
Stephen E. Baker
befe879b34 Shifting signed 32 bit ints by 31bits is UB.
Thanks @ZanyXDev
2021-02-20 23:34:50 -05:00
Toby Lane
9b9a72820b Fix Animview install 2020-11-09 09:25:05 +00:00
Toby Lane
60ed4de1ed Handle spaces in Animview install path 2020-11-09 09:24:30 +00:00
Toby Lane
6b19d8ac72 Cmakelint changes 2020-09-21 15:50:22 +01:00
Toby Lane
d192f47bc4 Codespell changes 2020-02-05 15:01:36 +00:00
Stephen E. Baker
365af5035d Convert common source into libraries 2020-01-20 14:11:30 -05:00
Stephen E. Baker
0a822322bc Add performance checks to clang-tidy
Fix all identified performance issues.
2020-01-11 14:40:06 -05:00
Stephen E. Baker
ef8f7ef1c4 Add override and throw-catch checks and fixes 2020-01-11 13:29:07 -05:00
Stephen E. Baker
f5d0ca22f9 Add more clang-tidy checks
* Enables bugprone- checks.
* Enables a couple more modernize checks.

Most of the changes are avoiding implicit narrowing conversions.
There was a bug caught and fixed fixed with the string comparison in iso_fs.

bugprone-suspicious-enum-usage was disabled due to a large number of
false positives with wxWidgets.
2020-01-11 12:40:46 -05:00
Stephen E. Baker
08fb05d30c Add check for nullptr use
Replace 0/NULL with nullptr
2020-01-08 21:01:58 -05:00
Stephen E. Baker
20ca9f5e7b Use header guards instead of pragma once 2020-01-08 11:20:57 -05:00
Stephen E. Baker
451718fa67 clang-format 2019-12-29 18:47:10 -05:00
Stephen E. Baker
4a1c98a716 [RDY] Cpp fmt (#1562)
* Hand formatted changes before automatic formatting

* Break up / shorten some long lines

* Add some missing braces for clarity

* Multiline strings are merged to let clang-format split them
appropriately.

* sdl_core's frame_count changed from a C style array to std::array
which made the length checks simpler.

* Add includes and forward declairs to avoid transitive dependencies

* Remove th_gfx_font.h include from th_gfx.h - circular dependencies

* using to shorten lines in th_map.cpp

* Avoid non-portable reinterpret_cast for parcels in th_map.

* Use more constants in th_map.

* Use class initializer for th_map classes

* Add clang files to ignore list

* Add clang-format file

* Reformat all files with clang-format

Also includes some manual braces.

* Disable clang-format for backdrop.h

* Clang-format AnimView src files

* clang-format common code

* Fix anonymous struct in union warning

Anonymous structs in anonymous unions are not supported by the standard.

* Check clang-format in travis

* Bin pack parameters

* Bin pack arguments too

* Full Google style

2 space indent, no forced break on braces.

* A couple format overrides

Order of usings in config.h.in since 8 is smaller than 16.
Table layout, since 0x80 nicely fits in 8 columns.
2019-10-06 08:18:25 -04:00
Stephen E. Baker
627a00c624 Remove unnecessary semicolons 2019-06-12 12:27:54 -04:00
Stephen E. Baker
26f985707c Add config.h to animview 2019-06-12 12:27:46 -04:00
Stephen E. Baker
3b94d7ecda Fix a couple easy errors in animview
Errors reported by cppcheck
* undefined behaviour shifting a signed integer.
* memory leak if rnc length check fails.
2019-06-05 18:02:04 -04:00
Stephen E. Baker
485c65cb7f Bump C++ to 14 2019-05-27 12:35:24 -04:00
Stephen E. Baker
893f1d05ab Use CMake standard method of setting C++ std 2019-02-10 21:29:00 -05:00
Stephen E. Baker
9a99400b94 Eliminate _loadArray function 2018-05-04 07:29:59 -04:00
Stephen E. Baker
34b3cdbb7b Move C arrays to C++ vectors and arrays 2018-05-03 22:26:04 -04:00
Stephen E. Baker
2d0f65e651 Remove export/import xml from AnimView
The option didn't work properly and isn't used. For custom graphics we
will not be using this format.
2018-05-02 17:46:19 -04:00
Stephen E. Baker
6415a62830 Memory access fixes for AnimView
Some modernization and cleanup was done in the process of debugging and
has been left in this commit.
2018-05-02 17:45:29 -04:00
Alberth289346
ead102b7c4 Merge pull request #1391 from TheCycoONE/dedupe_rnc
Use the same rnc code for CorsixTH and AnimView
2018-04-30 16:07:45 +02:00
Stephen E. Baker
50a5ac9741 Use the same rnc code for CorsixTH and AnimView
CorsixTH/Lua specific code and AnimView specific code was extracted
into the relevant projects. rnc.h was modified into a public contract
for using rnc as a C++ library. Helper functions were added.

New common rnc code is in new $/common directory.
2018-04-29 06:33:55 -04:00
Stephen E. Baker
f111291fa9 Enhancements for case sensitive filesystems
AnimView's Sprite Viewer did not allow selecting tab/dat/pal files if
they used uppercase naming in Linux.
2018-04-28 13:05:00 -04:00
Stephen E. Baker
48cc5a9002 Simplify convoluted platform conditions 2018-01-11 06:49:45 -05:00
Stephen E. Baker
6edc1926b6 Consistent style for CMake scripts 2018-01-10 21:44:59 -05:00
Stephen E. Baker
d83427b411 Fix leaked array in AnimView 2017-10-13 20:22:38 -04:00
Stephen E. Baker
f8f6d92b74 Remove AnimView generated file from source.
VSPR-0.XML is generated by AnimView and should not be included in source
control.
2016-07-05 14:18:44 -04:00