Conversation
…er to get this compiling in an hour or so at most. These changes get the x64 debug build working for VS 2022 community edition. 0. Completely ignore `build.bat`. 1. Change the incursion lib project to not run modaccent or flex. modaccent x64 will crash when running, likely it might still work for x86. See Language Files folder in the project, `grammar.acc` and `tokens.lex`. Right click on each, Properties and exclude from build. 2. Download libtcod-1.7.0-x86_64-msvc binaries. 3. Extract into build\libtcod-1.7.0-x86_64-msvc. 4. Compile `exe_libtcod` project. 5. Debug the `exe_libtcod` project and observe it runs and you see the libtcod game. Exit. 6. Copy `build\libtcod-1.7.0-x86_64-msvc\libtcod.dll` to the top level source directory (for clarity this is where `build.bat` is). 7. Copy `build\libtcod-1.7.0-x86_64-msvc\SDL2.dll` to the top level source directory. 8. Copy `build\x64\Debug\exe_libtcod\Incursion.exe` to the top level source directory. 9. Open a command prompt in the top-level source directory. 10. Run `Incursion.exe -compile`. Observe the module compiles. 11. Delete `Incursion.exe` from the top-level source directory as it will get stale. 12. Now you should be able to debug and play Incursion in Visual Studio. C:\Data\R\git\incursion-roguelike\build\x64\Debug\exe_libtcod
…heck in `flex.exe` for ease of rebuilding the resource compiler lexer and grammar. Added more build instructions.
…2/x64. Fetches libtcod 1.7.0 dependencies and extracts in correct locations.
Apply a standard format to the entire file Update setup-msbuild action to v2 Compile and upload mod file during debug build Upload fully packaged releases
Clean up msbuild workflow
Always initialize Rect variables Prefer member initializer lists Return full Rect from methods since returning a reference to an internal static variable is a disaster waiting to happen. Mark relevant methods and parameters as const
Update parameter and variable names
This define breaks the standard C++11 array template and must be removed. No code relies on this macro.
Includes `<cstdint>` and updates typedefs to point to it so that I don't need to go around the entire source and update every single type. Replace `long` with `int` in any place where the type is used for a plain value. This clarifies that nothing is broken here. Generally use `int` as the "don't care" type. `int` always means `int32_t` on modern compilers on all platforms. This is convention. `unsigned long` becomes `uint32_t`. `printf` function which was converting pointers to int to print them now uses `%p` instead to print the pointer directly. `EffectInfo::Source` is a suspicious union of pointer and enum types. I used `intptr_t` here for comparisons to prevent truncation. Did not touch `long` in preprocessor or tokenizer sources.
Refactor Rect struct
The class was causing minor warnings and on closer inspection it appears it wasn't being used at all. Blame doesn't go back far enough for me to investigate what this was meant for.
Remove array redefinition
Switch to standard types, replace long types
…ting a String to the embedded buffer in VS2022 where it was in VS2105.
Remove dead code: Dictionary and Parser class
Fixes x64 releases
Bundle mod based on architecture
Looking up the standard docs, 0x00 characters have the same results as 0x01. I can't find any way to explain or justify these macros.
Remove modified character checking functions
…ows top-level or docs directory content to be hosted. 'website' directory was moved to a separate repo which is now hosted on incursion-roguelike.net.
Was causing assertions to fail on negative numbers. A classic case of: that code should be safe to remove, oh it turns out it was there for a reason. Added the functions back with new names so that they don't conflict with anything.
… loaded any more.
…event them being in turn given in the line numbers.
The default working directory is now the project root, always. This is simpler and removes the need to copy files around. Any older save files in `build/run` will have to be moved to the project root folder in order to continue them. I've noticed Incursion breaks with relative paths, otherwise I would've used `"."` as the default directory rather than asking `_getcwd`.
No longer need to wonder if I've modified these files correctly. The CI will now verify and fail if generated files are not committed.
Simplify working directory
Verify generated source files
The simplest solution was to add `using` to replace the macros exactly with the C++ functions. Platform toolset has been increased to v143. This was probably not needed for this PR but it is needed for C++17 and libtcod. An explicit type must be given when int constants are mixed with smaller types. The sources which needed to be updated includes `Grammar.acc`. Refactor Grammar.acc to use std:: namespace
Not even a using alias in the headers anymore. Found some subtle edge cases by doing this. Also updates min/max in unused code. Use `define NOMINMAX` instead of `undef` to prevent Windows headers of defining min/max.
Replace min/max macros with standard C++
Current builds were assuming that generated files are already built based on their timestamps, which prevents testing newly updated generated files. This manually deletes the generated files to be tested.
Ensure tracked generated files are rebuilt in tests
…e degress. Remove obsolete build.bat. Update Changelog for rmtew#27.
…nstructions differ).
22ad2d5 to
1c72a01
Compare
Updates README.md with Vcpkg integration instructions Removes libtcod from custom include and library directories Vcpkg manifest includes: breakpad, libtcod, PDCurses, and SDL2 Pinned manifest to the current latest Vcpkg revision Add Vcpkg submodule Install Vcpkg on CI Bundle DLL's installed by Vcpkg Libtcod direct download no longer needed Cache Vcpkg build artifacts
1ff97fb to
5202955
Compare
|
I'm more familiar with setting up Vcpkg for CMake than for MSBuild. The way I've set it up here makes it easy to add a CMake build later on, for cross-platform builds. I can get started on that after this PR if it's a priority. This adds a Vcpkg submodule next to the This updates to the latest version of libtcod. I've discovered an issue where modifier keys will stick if |
|
Can we get rid of the submodule? I am very anti-submodule. I have spent way too much time trying to deal with corrupt submodules. |
|
The Vcpkg repo needs to be cloned for CI and later on CMake, any alternative is just a submodule with extra steps which will be less supported and more error prone than a submodule. In most cases cloning the submodule will be optional. CMake will need it for CI again, but can be configured to use a local repo instead. I've heard some criticism of submodules before, but it's usually about how it doesn't vendor the target repo, how did you manage to get yours corrupted? |
|
I don't know. But it is very hard to fix without deleting the whole parent repo as it keeps coming back. My belief is that this is a layer of unnecessary abstraction that adds problems of it's own and replaces simple standard commands to little benefit. |
|
There's some abstraction, but eventually you learn that internals of Git are actually rather simple, or at least, you learn about how the abstractions work and that makes them less surprising to use. Can I at least assure you that adding a submodule is reversible? The tracked files of submodules are only the I also really want to know what you were doing with submodules that was causing issues. I've done a lot with Git to put myself into unfixable situations, which were no longer unfixable once I became more experienced. What was your goal when you were using submodules? |
|
What is the benefit in using submodules? Surely not using them wouldn't take that much time or add that much work. |
|
Good locality, standard, easy to manipulate. Even if you haven't personally shared that experience I find them convenient to work with, which is why I keep asking for more information about your previous issues working with them since even I had issues of my own when I first started using submodules. I want to know because many solutions to a lot of Git issues are both simple and obscure. Not using submodules means spreading the sub-repo info throughout the repository and adding friction to manipulating the target commit and local testing of alternative Vcpkg ports. I don't think is this worth avoiding submodules for. |
66243c5 to
ab1053f
Compare
Not perfect, it seems Visual Studio needs the
vcpkg integrate installcommand. I've updated the README.md with Vcpkg instructions.Vcpkg manifest includes: breakpad, libtcod, PDCurses, and SDL2. I've also setup the curses project to use Vcpkg if you want to ever start debugging that.
Pinned manifest to the current latest Vcpkg revision. Manifest mode and
"builtin-baseline"is the secret ingredient to stable dependencies.Including modern libtcod headers will fail until #22 is merged, for reasons explained in #12.