1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2024-11-29 22:35:45 +00:00
Commit graph

1084 commits

Author SHA1 Message Date
fgenesis
3ba31b6aa0 remove bool Element::elementActive, use _hidden instead
Element is always alone, never has parent or children,
and can use the normal RenderObject::_hidden logic
to determine visibility and update calls.
2023-06-01 20:23:34 +02:00
fgenesis
76b391e1fc hide the cursor layer when taking screenshot 2023-06-01 20:20:30 +02:00
fgenesis
fc76b2de12 fix hidden checks, oops
Turns out any part of the hierarchy can be hidden, not just the parent.
Esp. the game menu does this.
2023-06-01 20:19:37 +02:00
fgenesis
36ea0fb8fb oops 2023-06-01 13:49:22 +02:00
fgenesis
f15771f79b skip an extra 1 second black-screen time on startup whenever possible
The transition time is still there when entering the title
from another game state where it makes sense;
especially the intro.
2023-06-01 13:04:57 +02:00
fgenesis
d740aa06e1 very slightly more verbose loading 2023-06-01 12:59:07 +02:00
fgenesis
263bff3659 update precacher.txt, file is now in the repo, and speedup loading a little bit more on slow machines 2023-06-01 12:58:00 +02:00
fgenesis
e5fad1e72e fix harmless typo added in 70b8dcdc3a91c9; kill unused variable 2023-06-01 04:41:13 +02:00
fgenesis
e00940b2ae better way to skip the logo; do post-load transitions in a single place now 2023-06-01 04:19:41 +02:00
fgenesis
b9798a1889 tweaks to loading screen; skip short logo entirely because even waiting 2 seconds for nothing is unnecessary 2023-06-01 03:56:26 +02:00
fgenesis
ccd22f2015 Can now quit the intro sequence on Esc (finally!)
Apparently this was planned, but never worked.
Also removed watch() canQuit parameter because during watch(),
input is disabled.
Moved the quitting logic to DSQ::run() and added the canQuit param there.
Game still didn't get the ACTION_ESC for some reason so an extra check for
a raw Esc keypress seems like a good solution.

Game scripts calling watch() and watchForVoice() never used the canQuit
parameter (presumably because it was broken?) so i've felt it's an ok
thing to take it out completely.
2023-06-01 02:31:50 +02:00
fgenesis
1743e1a996 script compat: entity_toggleBone() and Lua platform detection is deprecated; forgot newproxy() is a valid Lua 5.1 function 2023-05-31 18:10:55 +02:00
fgenesis
d1cbc6f783 support loading *.qoi images
Now png/qoi/jpg are supported, and some subset of tga
because we need that to load zga files for savegame thumbnails
2023-05-31 18:07:55 +02:00
fgenesis
1719fb5e74 eliminate DSQ::game, singe game is already a global ptr and we don't need both 2023-05-31 17:52:06 +02:00
fgenesis
73c58b3153 preparations for gems save format update; not yet sure how to best do this so i'm leaving it at that 2023-05-31 17:46:44 +02:00
fgenesis
9047e5e083 remove dsq->game-> indirection inside Game 2023-05-31 17:43:27 +02:00
fgenesis
dc5d385864 remove self-refs (core->...) in Core 2023-05-31 17:40:41 +02:00
fgenesis
fd1ac85af3 remove pointless self-refs (dsq->... and core->...) in DSQ 2023-05-31 17:37:20 +02:00
fgenesis
dbda4d0bf8 Texture loading, part 3: Drop recache property from mod XML, this is now automatic 2023-05-31 17:13:24 +02:00
fgenesis
7041143ef8 Texture loading, part 2: make TextureMgr work with special paths; some fixes
Ie. explicit relativs paths (./) or absolute paths that are not part of
the regular texture search dirs

Also forgot to clear a free()'d pointer.
2023-05-31 17:12:14 +02:00
fgenesis
4e632f9f6c BmpFont usage is now a ref instead of a ptr, const-ify glfont 2023-05-31 17:08:52 +02:00
fgenesis
69ae4bdb20 Fix uninitialized glLineWidth() when rendering nodes; use green color for nodes that have a script
That would explain why nodes were drawn with thin lines whenever DebugText was on screen...
2023-05-31 17:06:33 +02:00
fgenesis
9cd9601485 Drop textures when no longer needed
Textures used to be unloaded as soon as they were unreferenced.
The TextureMgr cache keeps an active reference to prevent load-unload-load
cycles so it only unloads things when explicitly asked.
This does require some more peak VRAM during map/tileset transitions
especially, since old textures are unloaded only after the next map
has been loaded, but the shortened load times should be worth it.
2023-05-31 01:36:50 +02:00
fgenesis
6dc9dc7e8f now that textures are no longer the bottleneck, speed up editor map reload 2023-05-31 01:10:39 +02:00
fgenesis
70b8dcdc3a Rework texture loading, part 1
Major code/logic cleanups + it has a multithreaded batch mode now.
The VFS code doesn't like multiple threads at all,
so for now there's a big lock in front of where it matters.
Changed precacher, map/tileset, and worldmap loading to batched mode.

Still TODO:
- fix broken mod preview images
- reloading resources on debug key
- make mod recache entirely unnecessary
- actually drop resources when no longer needed
2023-05-31 00:55:16 +02:00
fgenesis
1100e286a6 don't spam log when bone not found 2023-05-30 00:41:16 +02:00
fgenesis
c7c9cae999 remove semi-broken editor tile alignment functions and related code 2023-05-25 17:54:38 +02:00
fgenesis
74ad8f7804 Build fixes for Linux, some warnings and compatibility fixes for C++17 and up 2023-05-25 16:58:08 +02:00
fgenesis
924bc058b4 oh come on, another tiny simplification now that IDs are really unique 2023-05-09 05:39:15 +02:00
fgenesis
e3eebf63e9 Remove pointer from EntitySaveData
Can properly address entities by ID now that they are really unique.
2023-05-09 05:28:16 +02:00
fgenesis
eec6027ccc eliminate some unused code 2023-05-09 05:21:47 +02:00
fgenesis
aa067be1f7 Rework and fix entity spawning and ID handling.
Bugfix: Actually call postInit() for entities spawned via "se" node.
Bugfix: Don't call postInit() twice for the active pet

Previously, f55a70b459 changed entity ID handling so that
script-spawned entities have negative IDs and entities placed
on the map have positive IDs.
Turns out that positive IDs were still flaky due to frequent renumbering
upon map load. Typically entity IDs are assigned sequentially, and if,
upon loading, an entity with an already existing ID was to be spawned,
that new entity would be assigned a new unique ID (often its ID+1).
That in turn would often cascade into a long string of IDs falsely
considered conflicting because one bad entity started the entire thing.

During lots of map editing I've noticed that sometimes after adding an
entity to an older map, saving, and loading, many entities could be shuffled
around on the map. I'm not 100% sure this bug is related (and it may or
may not be fixed, i don't know yet, time will tell)
but at least entity numbering should be fine now.

This change properly and permanently renumbers entities so that upon map save,
the problem will no longer occur on subsequent loads and entity IDs
will be stable from then on.
Duplicate entity IDs should also no longer happen.

Also kill Entity::entityTypeIdx because there's no need to store it.

And yes i do feel bad for nuking that funny comment block :<
2023-05-09 04:49:06 +02:00
fgenesis
33e8c0643d Implement element tags
A map element ("tile") can now be tagged with an int.
In the editor:
Ctrl+Numpad to quickly set tag 0-9
Ctrl+T to input tag number for selection

This tag can be used by scripts for more advanced tile
manipulation compared to the old node_setElementsInLayerActive().
This function now takes a 4th parameter, the tag.
If 0 or omitted, the behavior is unchanged.
Otherwise, only affect tiles with that tag.

Add Lua func refreshElementsWithTagCallback(tag, callback):
Call callback(templateIdx:int, texture:str, active:bool, layer:int, tag:int),
and the tile is set to active when the return value is true.

refreshElementsOnLayerCallback(tag, callback) is also changed to use
the same callback.

Also fix UB (dangling pointer)in Element::render()
that never even caused a single problem.
2023-05-05 04:15:41 +02:00
fgenesis
c73aa23906 Use multiplicative scaling in anim editor for a more uniform feel 2023-05-05 03:49:14 +02:00
fgenesis
6d6697fd72 pushed too soon 2023-04-18 02:22:19 +02:00
fgenesis
4cb2d7ced4 Optimize Game::getWallNormal() a bit more
Don't need dist output param.
2023-04-18 02:21:24 +02:00
fgenesis
d7bf48fc30 Unfuck & optimize Game::getWallNormal()
Another float->int->float roundtrip fixed.
2023-04-18 02:16:18 +02:00
fgenesis
d2c0e3e241 Add Lua func bone_getCollisionMaskNormal()
This repurposes the (now, after the prev commit) unused Bone::getCollisionMaskNormal()
2023-04-18 01:54:12 +02:00
fgenesis
640f08af13 simplify bonelocking, add Lua functions
- does no longer depend on collision mask
- remove global Game::lastCollideMaskIndex
- remove the horribly convoluted and now unused RenderObject::getInvRotPosition()
+ Lua func entity_getBoneLockDelay()
+ Lua func entity_setBoneLockDelay()
2023-04-18 01:42:21 +02:00
fgenesis
7e93956e9c dump obs as png, not as tga. also fix upside-down and memleak 2023-04-17 18:55:52 +02:00
fgenesis
c11d72f8e0 fix shot script canShotHit() API function 2023-03-19 18:11:57 +01:00
fgenesis
66b0aa710f Add Lua functions for bonelock control. Also make quad_setRepeatTexture() update tex params properly.
+ entity_setBoneLockRotation()
+ entity_setBoneLockOffset()
2023-03-19 15:26:45 +01:00
fgenesis
04cb3bba11 copy missing texture params when cloning Element 2023-03-19 15:18:11 +01:00
fgenesis
bbc6636c65 fix predatorytunicate always spitting out to the left, now it's the facing direction 2023-03-06 00:54:28 +01:00
fgenesis
0a3f57486b Simplify RenderObject::followCamera math, remove branches, cleanup followCamera related code.
It also appears that a RenderObject is always on a layer when rendered.
Assert this in the code. This saves some extra branches.
2023-03-05 21:25:59 +01:00
fgenesis
81bfcb2f65 more precise comment 2023-03-02 03:42:39 +01:00
fgenesis
28766f0d5a make RenderObject::followCamera not modified during rendering
This takes out the last of the RenderObject mutables.

This also fixes the long-standing editor bug that map tiles
that are once moved to parallax layers and then back to a
normal layer keep their scroll factor until the tile is deleted
or the map saved and reloaded.
2023-03-02 03:41:00 +01:00
fgenesis
76ba2b1211 make RenderObject::rotation not modified during rendering, simplify duplicated code 2023-03-02 03:29:04 +01:00
fgenesis
f4147b99c4 make RenderObject::scale not modified during rendering 2023-03-02 02:19:48 +01:00
fgenesis
7a5a5feb39 make RenderObject::position not modified during rendering; small cleanup 2023-03-02 02:12:32 +01:00