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

1063 commits

Author SHA1 Message Date
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
fgenesis
01295cda7a Changes to entity/node activation:
- Lua func node_activate() is now variadic and can pass any params to the target's activate()
- Add Lua func entity_activate() that works in the same manner
- Activating nodes/entities via RMB now passes (naija ptr, int input source) to activate()
- Don't delay entity activation by 1 frame
- Minor cleanups to some Lua functions; no functional changes there
2023-02-24 02:10:33 +01:00
fgenesis
66843d338d win build instructions for dummies 2023-02-21 23:00:41 +01:00
fgenesis
99eec85310 fix world map tile selection to actually select the closest tile 2023-02-16 18:33:25 +01:00
fgenesis
7d51a97145 show would map tile name when editing or selecting 2023-01-31 00:52:11 +01:00
fgenesis
c606409403 oops, forgot to remove deprecated functions from list 2022-12-10 01:05:27 +01:00
fgenesis
559a5b39e3 Fix possible world map crash 2022-12-09 04:21:46 +01:00
fgenesis
b17afecd4b Remove 3 unused Lua functions:
- entityFollowEntity()
- entity_followEntity()
- entity_isFollowingEntity()
2022-12-09 04:20:17 +01:00
fgenesis
0edb2d609a Remove unused Lua func entity_watchEntity() 2022-12-09 04:16:05 +01:00
fgenesis
0cc2f565d7 Remove 2 unused Lua functions that only the unused "squeezer" scripts called
- entity_grabTarget()
- entity_releaseTarget()
2022-12-09 04:10:13 +01:00
fgenesis
7f3e457559 Cleanup entity activation, add Lua getter
+ entity_getActivation()
2022-11-24 02:03:24 +01:00
fgenesis
9583375537 fix possible out of bounds access 2022-11-23 20:42:30 +01:00
fgenesis
ed98a3328e anim editor: allow to select anim by name (no more hammering PgUp/PgDown!) 2022-11-18 01:52:46 +01:00
fgenesis
92ab459736 Improve some skel anim edge cases; warning fixes. Also new Lua function.
+ entity_setAnimationTime()
2022-11-16 22:46:56 +01:00
fgenesis
da8faf2bd9 new Lua func to get elapsed time of anim currently playing
+ entity_getAnimationTime(e, layer)
2022-11-13 12:54:00 +01:00
fgenesis
37cf5134ba fix possible crash in anim editor 2022-11-13 12:30:03 +01:00
fgenesis
96f28702e4 fix anim editor not generating keyframes for newly inserted bones.
broke this during my recent anim editor work, oops
2022-11-13 12:29:11 +01:00
fgenesis
288fb6b7fa fix crash when saving skel after bones were removed 2022-10-12 18:59:25 +02:00
fgenesis
0469ab8dfb Add support for below-maxspeed shots
The game used to unconditionally enforce shots to go at close to their max speed;
it is now possible to turn that behavior off if needed:
In a shot txt file, set AlwaysMaxSpeed = 0

New Lua functions:
+ shot_setAlwaysMaxSpeed()
+ shot_isAlwaysMaxSpeed
2022-10-12 18:58:48 +02:00
fgenesis
cc1530b5e5 eliminate one gigantic global float->uint->float roundtrip cast
whyyyy
2022-09-25 06:02:22 +02:00
fgenesis
58e9ba340e Add skel/bone gridDrawOrder attrib to control the way the gris is drawn
Also ignore grid.z (used as worldmap alpha) by default because it's really
only needed for the world map and ignoring it results in less GL calls.
2022-09-25 04:30:38 +02:00
fgenesis
e35dfb9f68 anim edit: slightly more useful border modes 2022-09-24 05:25:54 +02:00