Gleb Mazovetskiy
b5f788cb33
trigs.cpp: Optimize & clean up the data structures
...
1. Use appropriate types.
2. Do not use an end marker for static arrays (their length is known).
3 years ago
Gleb Mazovetskiy
759ca7f055
`WorldTileRectangle/Size`
...
Adds a custom sized type for the world tile rectagle.
This allows us to better express intent.
It also allows us to make certain globals smaller, e.g. `THEME_LOC`.
3 years ago
Gleb Mazovetskiy
41f43ea3f5
Support unpacked MPQs from devilutionx-mpq-tools
...
https://github.com/diasurgical/devilutionx-mpq-tools produces an unpacked MPQ
with all the graphics converted to CLX and the unused files removed.
This is primarily useful on RAM-constrained platforms, such as PS2,
because it eliminates the MPQ overhead.
Adds a build option to load from such unpacked directories instead of the MPQ.
These directories are searched for in the same locations
where the MPQs would be searched for otherwise.
Example directory layout:
* /usr/local/share/diasurgical/devilutionx/diabdat/ -- unpacked and converted diabdat.mpq
* /usr/local/share/diasurgical/devilutionx/hellfire/ -- unpacked and converted hellfire MPQs (all of them merged into 1 directory)
* /usr/local/share/diasurgical/devilutionx/fonts/ -- unpacked fonts.mpq
* /usr/local/share/diasurgical/devilutionx/pl/ -- unpacked pl.mpq
These directory structure is produced by calling `unpack_and_minify_mpq`
3 years ago
Gleb Mazovetskiy
b5d3f3561b
AnimationInfo: Reorder to save 8 bytes (32->24)
...
```
pahole --reorganize --show_reorg_steps --show_only_data_members -C AnimationInfo build/test/liblibdevilutionx_so.so
```
3 years ago
staphen
5de080541a
Ensure that the last line of text does not exceed the lower bounds of the rectangle in DrawString()
4 years ago
staphen
e580c26a1f
Ensure that vertically aligned text does not exceed the upper bounds of the rectangle in DrawString()
4 years ago
obligaron
a2ec22667f
Use AnimationInfo::isLastFrame in more places
4 years ago
obligaron
925e13d22a
Introduce AnimationInfo::isLastFrame and use it instead of _pXYZFrames
4 years ago
zaid-ismail031
b0c9a8024e
Refactor missiles.cpp to use Direction enum instead of magic Point/Displacement constants.
4 years ago
obligaron
deb0d6d9e1
Use missile helpers in MoveMissile/UpdateMissileRendererData ( #5291 )
4 years ago
Gleb Mazovetskiy
188dc79f6e
Make `Players` a vector
4 years ago
staphen
b12bf10c77
Fix template data type when loading class TRN
4 years ago
Gleb Mazovetskiy
6327e713e0
Lowercase all file paths
...
We want to be able to use unpacked MPQs on low-end platforms
(PS2/rg99/etc).
This is tricky on case-sensitive filesystems. Avoids case issues by
lowercasing all paths in the code (then we'll just need lowercased
listfiles).
4 years ago
obligaron
68891a8df1
Rename MissileMovementDistrubution => MissileMovementDistribution
4 years ago
Gleb Mazovetskiy
4cf0053ece
Set underlying type for all the enums
...
Reduces rg99 binary size by 3 KiB.
4 years ago
qndel
5dc95550ce
Add TRN debug command and support for optional class TRNs
4 years ago
Gleb Mazovetskiy
3b357f3936
CMake: An option to disable demomode support
...
Useful for targets with limited RAM.
Reduces RG99 binary size by 8 KiB.
4 years ago
Gleb Mazovetskiy
9b65eca49b
Remove `Art` and related functions
4 years ago
Gleb Mazovetskiy
580d3cb6ee
touch/renderers: Migrate away from Art
4 years ago
Gleb Mazovetskiy
d71a54dba8
Render main panel buttons as CLX
...
Converted with:
```
pcx2clx --num-sprites 3 data/talkbutton.pcx && rm data/talkbutton.pcx
```
Sizes:
```
Surface(63, 114) -> CLX 7296 -> 5336 -26.9%
Surface(53, 48) -> CLX 2688 -> 2324 -13.5%
```
4 years ago
Anders Jenbo
7c9111ddb0
Correct casing for isDoor()
4 years ago
obligaron
2493f06116
ActorPosition: Remove offset, offset2 and velocity
4 years ago
obligaron
5913783826
Add walking offset calculation to ActorPosition (and validate it)
4 years ago
obligaron
a410e989bf
Remove ScrollInfo
4 years ago
Gleb Mazovetskiy
8f7dd16ac3
Show an error on outdated devilutionx/font.mpq
4 years ago
Gleb Mazovetskiy
17a97450bc
Convert assets to CLX
...
Converted using the following commands:
```
cd Packaging/resources/assets
pcx2clx --transparent-color 1 --num-sprites 256 fonts/*.pcx && rm fonts/*.pcx
pcx2clx --num-sprites 2 ui_art/dvl_but_sml.pcx && rm ui_art/dvl_but_sml.pcx
pcx2clx --transparent-color 1 data/hintbox.pcx data/hintboxbackground.pcx && rm data/hintbox.pcx data/hintboxbackground.pcx
pcx2clx --transparent-color 1 --num-sprites 6 data/hinticons.pcx && rm data/hinticons.pcx
pcx2clx --num-sprites 2 data/panel8buc.pcx data/dirtybuc.pcx data/dirtybucp.pcx && rm data/panel8buc.pcx data/dirtybuc.pcx data/dirtybucp.pcx
pcx2clx --transparent-color 1 data/healthbox.pcx && rm data/healthbox.pcx
pcx2clx --transparent-color 1 --num-sprites 6 data/resistance.pcx && rm data/resistance.pcx
pcx2clx --transparent-color 1 --num-sprites 5 data/monstertags.pcx && rm data/monstertags.pcx
pcx2clx --transparent-color 1 data/stash.pcx && rm data/stash.pcx
pcx2clx --transparent-color 1 --num-sprites 5 data/stashnavbtns.pcx && rm data/stashnavbtns.pcx
pcx2clx **/*.pcx && rm **/*.pcx
git checkout master -- ui_art/black_diablo.pcx ui_art/black_hellfire.pcx data/charbg.pcx data/talkbutton.pcx data/panel8bucp.pcx
rm ui_art/black_diablo.clx ui_art/black_hellfire.clx data/charbg.clx data/talkbutton.clx data/panel8bucp.clx
```
4 years ago
Gleb Mazovetskiy
ba34bafb3f
Use SDL events directly
...
Removes redundant miniwin events and queue, using SDL events directly instead.
Demo migrated using this script: https://gist.github.com/glebm/8a73b04f695de96f344cc2e35151e03e
4 years ago
Gleb Mazovetskiy
0f0f57080c
render: Move `common_impl.h` into `clx_render.cpp`
...
We no longer have other renderers.
4 years ago
Gleb Mazovetskiy
961866e1c4
CLX: A new graphics format
...
The format is almost identical to CL2, except it uses the frame header
to store frame width and height instead of 5 32-line offsets.
This means we always have access to frame dimensions, so we can use it
as an on-disk format for our graphics as well.
Additionally, we may be able to optimize the rendering even more
in the future now that we have guaranteed knowledge of frame dimensions.
4 years ago
ephphatha
2121d8dc67
Use position for object delta messages
...
Co-authored-by: Stephen C. Wills <swills@gridprotectionalliance.org>
Co-authored-by: Anders Jenbo <anders@jenbo.dk>
4 years ago
obligaron
2c7e886c85
Add detail log info to CompareSaves
4 years ago
Andrew James
480ab945e7
Only draw towners on their base tile ( #5171 )
4 years ago
obligaron
c5ce29106e
Fix left sideways walking monsters draw order
4 years ago
ephphatha
0ce76a3f13
Add Object lookup method to mimic map::at()
4 years ago
Gleb Mazovetskiy
7c0b72abc0
Improve demo test error message
...
Example:
```
file "game" is different at byte 54251:
Expected: ... 00 00 00 00 00 00 00 00 30 00 00 00 50 00 00 00 ...
Actual: ... FF FF FF FF 00 00 00 00 30 00 00 00 50 00 00 00 ...
```
4 years ago
Gleb Mazovetskiy
1cdd76b617
Remove PCX rendering code
...
We no longer render PCX
4 years ago
Gleb Mazovetskiy
0cd035ef61
Load PCX as CL2
...
Similar to #5059 , which converted CEL to CL2 at load time,
we now do the same for PCX.
Some size stats: https://gist.github.com/glebm/067bf1ec73f9d14514932cfe237e4e8e
Notably, fonts RAM usage is decreased by ~35%.
4 years ago
ephphatha
9e76cd4ab7
Use object pointer for pcursobj
4 years ago
Gleb Mazovetskiy
43a5d91074
Remove CEL rendering code
...
We no longer render CEL
4 years ago
Gleb Mazovetskiy
8ca71272b8
Load all CEL as CL2
...
Convert CEL files to CL2 at load time. CL2 format is more efficient and is about as fast to render.
CEL vs CL2 sizes, on dLvl 5: https://gist.github.com/glebm/9bbdd76962abcd4fd2405ecd3379af97
Memory:
* Peak memory (while loading): -300 KiB
* Memory in-game (dLvl5): -700 KiB
* RG99 binary size: -15 KiB (1333096 -> 1317192)
Performance on rg99:
* On average, -1 FPS in town.
* Same FPS in dungeon (20 FPS on dLvl 1).
4 years ago
Gleb Mazovetskiy
adf40f5c80
misc_msg: Always use `lParam` for mod state
...
Previously, keyboard events used `lParam` for modifier key state,
while mouse events used `wParam`.
Changes the mouse events to use `lParam`, which allows us to
change `lParam` to `uint16_t`.
Demo migrated with a script.
4 years ago
Gleb Mazovetskiy
4c1dbaba72
Demo mode: Handle endianness
4 years ago
Gleb Mazovetskiy
f9b9a7de9d
CL2 render: `Point` position argument
...
Bring the CL2 API closer to CEL and PCX.
4 years ago
Vladimir Olteanu
8fd3be67b5
Refactor VisionCrawlTable
4 years ago
Gleb Mazovetskiy
ea1087dfeb
Use `StrCat` in a few more places
...
Now `fmt` is only used for more complex formatting and for translations.
4 years ago
Gleb Mazovetskiy
6f01fb6b79
Unify CEL/PCX/CL2 render functions
...
Except for the outline rendering.
4 years ago
Gleb Mazovetskiy
a4ac41cece
Replace `DVL_VK` virtual key codes with `SDLK`
4 years ago
Anders Jenbo
74eacc1794
Clean up color cycling ( #4966 )
4 years ago
Gleb Mazovetskiy
70364013b0
Fix fmt v9 deprecation warnings
...
Version 9 of libfmt deprecates printing `enum` without casting it to an
integral type explicitly (consistent with `enum class`).
4 years ago
Mikołaj Piróg
c38db60d0b
Remove monster name member from monster struct ( #4986 )
4 years ago