Commit graph

927 commits

Author SHA1 Message Date
Matt Penny 62c49ddcdf Remove collisionSceneGetPortalRotation() 2024-04-05 20:18:25 -04:00
Deconimus 97b31b4579 grab_rotation: simplifying playerInitGrabRotationBase() 2024-04-05 13:00:23 +02:00
Deconimus 4ca1c484f1 player grab rotation cleanup 2024-04-04 12:12:58 +02:00
Deconimus 83e94af894 add collision for fizzler frames 2024-04-02 22:52:10 +02:00
Deconimus 3c8c0d3234 Merge branch 'master' into grab_rotation_snap_cubenormals 2024-04-02 13:27:27 +02:00
Deconimus 70019f281a Merge branch 'master' into issue52_grab_y_offset 2024-04-02 13:26:52 +02:00
Matt Penny 618f147da6 Halve ball catcher sound volume (#51) 2024-04-01 18:17:09 -04:00
Deconimus 01a7a67536 constrain y-offset of grabbed object to match Portal-PC, circumventing buggy behavior documented in issue #52 2024-03-31 17:04:06 +02:00
Deconimus 7e3db77731 fix cube normal snapping (has been broken in cases where object's upwards direction wasn't equal to gUp) 2024-03-30 23:12:18 +01:00
Deconimus bce6a41fcb fix playerGetMoveBasis call in scene.c 2024-03-29 15:01:38 +01:00
Deconimus 56672ff562 grabRotation: snap all grabbed object rotation to cube normals
+ some related code refactoring
2024-03-29 00:35:51 +01:00
Giacomo Garbin 70193f33c4 Also link libm for the C Standard Library math functions.
Remove isnan as it conflicts with the one defined in <math.h>.

TODO: Replace math functions defined in Mathf.c with those from the standard library.
2024-03-27 23:45:12 +01:00
Matt Penny 43f07a1766
Merge pull request #46 from GiacomoGarbin/replace_floor_function
Use floorf defined in mathf.c instead of the C standard library floor function.
2024-03-26 12:52:51 -04:00
Matt Penny 1fb2390a57
Merge pull request #43 from Deconimus/issue38_fizzler_width
Apply blender object scale to fizzlers
2024-03-26 12:47:36 -04:00
Giacomo Garbin 4449ccf723 Use floorf defined in mathf.c instead of the C standard library floor function. 2024-03-26 01:07:41 +01:00
Matt Penny bba7d9add1 Confirm when loading game while in a level 2024-03-24 20:50:03 -04:00
Matt Penny f3ab06c9dc Confirm when starting new game while in a level 2024-03-24 20:50:01 -04:00
Matt Penny a3cde0c690 Confirm before quitting 2024-03-24 20:49:47 -04:00
Matt Penny 03034a3868 Re-enable freecam
Previous camera changes caused the freecam transform to not be applied
2024-03-23 22:45:22 -04:00
Deconimus 5e6425075d make fizzler width scale with blender scale & fix rendering bug which used to cause fizzlers from disappearing at some viewing angles 2024-03-21 22:54:42 +01:00
Matt Penny ef5b032fc6 Add sound to chamber 14 stair animations 2024-03-11 21:25:49 -04:00
Matt Penny 236e7993c4 More performant collision detection between portals and moving dynamic collision
Short circuit if bounding boxes do not intersect
2024-03-20 22:12:00 -04:00
Matt Penny 1318e8ec4b Don't cull animated objects in rooms where many exist
Calculating whether or not to cull many objects can be more expensive
than rendering them
2024-03-20 21:14:11 -04:00
Matt Penny 35e9d433a4 Read level animation sound from first specifying bone, and play from armature center
Removes multi-bone animation dependency on bone order for audio, and
allows the sound to play as long as one bone is still moving. The center
is also a more natural sound position.

This is needed for the chamber 14 stairs.
2024-03-13 01:03:41 -04:00
Matt Penny f16f88a73a Close portals touched by moving dynamic collision
This allows collision brushing up against portals to close them, such as
the stairs in chamber 14, making it more difficult to get underneath.

Dynamic collision part of the same animation as the portal is excluded.
2024-03-12 22:18:41 -04:00
Deconimus 7d48221146 rotate grabbed objects towards players' forwards direction (XZ-plane) instead of looking direction 2024-03-12 14:19:50 +01:00
Deconimus b6afce6e0a Merge branch 'master' into pr31split_keep_objects_in_front 2024-03-12 12:25:53 +01:00
Deconimus 64bcfe30aa encapsulate the hacky way of looking up a decor type id from CollisionObjects into the function decorIdForCollisionObject(struct CollisionObject*) 2024-03-09 14:42:14 +01:00
Deconimus b6fdc1116e keep grabbed objects in front of player.
fix grabbed objects being let go of when loading a savegame in which the player was grabbing through a portal.
2024-03-09 13:46:38 +01:00
Matt Penny 53605070f3 Create function to share portal grab transform code between held object throw and update 2024-03-08 17:42:56 -05:00
Deconimus 8eb474856c fix throw direction when throwing a grabbed object that is being held through a portal 2024-03-08 17:43:45 +01:00
Matt Penny a873ab233b
Merge pull request #32 from Deconimus/issue_26_dont_fire_portal_whith_grabbed_object
Dont fire portal with grabbed object or from pause menu
2024-03-07 23:10:32 -05:00
Deconimus 689f7a9358 replace obsolete ignorePortalGun with controllerActionMuteActive() 2024-03-08 02:04:12 +01:00
Deconimus 3bf2d80d63 replace all security_camera related ridigbody flag checks regarding kinematic with the securityCameraIsDetached function 2024-03-07 13:09:34 +01:00
Deconimus d5418db73d make security_camera serialization object oriented again 2024-03-07 12:47:20 +01:00
Deconimus 73900f76f7 fix portal fire from exiting pause menu + improved ignorePortalGun logic 2024-03-05 23:30:14 +01:00
Deconimus eee2c25890 player throw impulse now scales with mass of grabbed object, to ensure every object is thrown the same distance 2024-03-05 22:54:03 +01:00
Deconimus 43b5a83f6f throw grabbed objects when using the portal buttons 2024-03-05 20:33:49 +01:00
Deconimus d7b2bcfe67 prevent portalgun from firing when dropping a grabbed object 2024-03-05 19:16:34 +01:00
Deconimus b23e22bb34 scene_serialize: serialize and deserialize security cameras
security_camera: replaced hardcoded mass of 1.0f with SECURITY_CAMERA_RIGID_BODY_MASS definition in header. added utility function to calculate security_camera moment_of_inertia, making it accessible to scene_serialize for deserialization due to rigidBodyUnmarkKinematic
2024-03-04 13:24:06 +01:00
Matt Penny 6a1a7994b9 Avoid unnecessary signal definition
* Don't generate button cube signal if -1 or omitted
* Require button press, door, and box dropper signals to be specified
2024-03-02 22:03:13 -05:00
Matt Penny 754273d955 Update fizzler docs, and consistent spacing 2024-03-02 16:06:26 -05:00
Deconimus 984dd65d2c fix fizzler optional signals generating unnecessary signals.
in test_chamber blender files, renamed @fizzler objects to not cause generation of unused signals.
removed "parse_trigger_signal" in trigger.lua, added "optional_signal_index_for_name", which is used for both trigger signals and fizzler signals.
added check in fizzler.c if signal is -1
2024-03-02 03:19:44 +01:00
Deconimus 59cdb047ec Merge branch 'master' into bug_13_fizzler_voice_lines 2024-03-02 02:23:25 +01:00
Matt Penny 2cc4b37757 Rename button pressFrames to cubePressFrames for clarity 2024-03-01 09:07:49 -05:00
Deconimus 2da3537c82 button.c: cleanup, removed unnecessary check 2024-03-01 12:48:14 +01:00
Deconimus d5b7d16f01 added cube_near_button trigger to chamber14
cleaned up level logic of chamber14
fixed buttons sending cubeSignals when colliding with triggers
2024-02-29 13:18:02 +01:00
Deconimus 3d37c2504c enabled fizzler objects to send signals on cube contact, the "@fizzler" objects in blender files now can have an argument for the signal name to send.
test_chamber_00: added level logic to trigger voice lines whenever the cube in the first room is fizzled.
added missing voice lines
box_dropper.c: fixed typo "DROPPER_.." instead of "DROOPER_.."

(Issue #13)
2024-02-28 13:32:44 +01:00
Matt Penny a8f9e9144c Make exit elevator cutscene condition more clear
Elevator destination is taken into account when initializing
cutscenePreventingMovement, so the else block (intended for end of level
elevators) will not be mistakenly entered for start of level elevators
when voice lines are playing.

However, not nesting the condition makes it look like there is a bug
here, and makes the intention of the code (one branch for each elevator
type) less clear. Moved the voice line condition to inside the if body to
avoid this. There is no functional change.

Eventually the elevator logic as a whole should be refactored as it has
grown to be unnecessarily complex.
2024-02-15 19:11:06 -05:00
Matt Penny d5bd90f7b2 Fix incorrect copy size in armature initialization 2024-02-11 19:19:17 -05:00
Matt Penny 7521ab9a44 Fix clock digit position
The clock in the original is formatted as:
    min:sec:hund:tenthou

Previously, the game used:
    00:min::sec::hund

This change updates it to match the original.
2024-02-03 16:30:37 -05:00
Bobby Lovell 1ba19f1f44
Use the square root of the distance for volume attenuation. 2024-01-23 08:19:24 -05:00
Matt Penny 7e699a4324 Dynamically get level count for all levels cheat 2024-01-14 00:09:40 -05:00
Matt Penny 3d5b1b860f Do not save partial savefile on first boot (fixes #583)
With the implementation of save file deletion, I refactored
savefileNew() to re-use the common save file deletion code.

However, savefileDeleteGame() has the side effect of writing
the save back to SRAM. Since the rest of savefileNew() does
not write to SRAM, this means that on first boot it was
possible to get a partially-written save file if the game
was powered off before the first real save (some options had
zero/null values).

To fix this, I created a helper function to update a save file
in memory without writing it back to SRAM. This has the added
benefit of not unnecessarily re-ordering the slots in savefileNew().

I chose not to add a savefileSave() to the end of savefileNew()
since it is called from savefileLoad(), and saving while loading
doesn't seem intuitive. I also don't think it's a good idea to save
in the middle of initialization, in case a user is able to cut
power at the (im)perfect time. The operation should be atomic.
2024-01-07 14:03:31 -05:00
James Lambert 61d225e9a4 Increase max render distance 2024-01-03 21:42:33 -07:00
James Lambert 4ddf568628 Use correct starting scene 2024-01-03 19:18:09 -07:00
James Lambert 95ca05b846 Build out much of test chamber 09 2024-01-02 21:36:53 -07:00
James Lambert 49ab59dc5b Updates menus to include new test chamber 2023-12-29 21:48:16 -07:00
James Lambert 0c1795485c Fix bug where cubes slide off of moving platforms 2023-12-29 21:48:16 -07:00
James Lambert ee42238411 Work on test chamber 08 2023-12-29 21:48:16 -07:00
lambertjamesd 18730b7f12
Merge pull request #580 from VanGorkum/Gorky/options_menu_highlighted
Introduced highlighted options menu similar to Portal Switch version
2023-12-29 10:22:41 -07:00
James Lambert e01fa284b7 First draft of test chamber 13 2023-12-28 21:32:03 -07:00
lambertjamesd cfd50df93f
Merge pull request #577 from VanGorkum/Gorky/portal
Introduce Portal UI look from Switch version
2023-12-28 20:54:39 -07:00
VanGorkum 9e84e92a87 Repositioned code to draw orange rectangle in landing menu 2023-12-29 00:05:07 +01:00
VanGorkum e9b21e0d38 Updated implementation to use max text width property 2023-12-28 23:56:37 +01:00
VanGorkum c1d4ea5314 Introduced highlighted options menu similar to Portal Switch version 2023-12-28 19:37:49 +01:00
VanGorkum 3c5b8c9e7c Used option text properties for x and y coordinates 2023-12-28 18:40:08 +01:00
VanGorkum 6da067113e Increased highlight width to support all languages 2023-12-28 08:34:28 +01:00
VanGorkum 8d9f001ffd Added packed menu threshold constant for UI, minor cleanup 2023-12-27 10:38:30 +01:00
lambertjamesd 61ed827764
Merge pull request #573 from mwpenny/save-deletion
Support save file deletion (#412)
2023-12-26 09:42:27 -07:00
VanGorkum 03a6395dce Introduced Portal UI look from Switch version 2023-12-26 16:48:09 +01:00
Matt Penny 4f1a322c46 Confirm before deleting or overwriting save 2023-12-24 13:35:39 -05:00
Matt Penny 4e4a5e6ed0 Add menu icons and text for save/load/delete 2023-12-24 11:40:59 -05:00
James Lambert 9c6e54112d fix sparks from balls passing through portals 2023-12-23 19:39:38 -07:00
James Lambert 0c141a9cff more profile work 2023-12-23 18:15:51 -07:00
Matt Penny 5036b40505 Support save file deletion on load/save menus with Z trigger 2023-12-21 12:10:27 -05:00
James Lambert f41a919452 work on profile visualiziation 2023-12-16 19:19:24 -07:00
James Lambert a37a8497cd Change which button triggers profile 2023-12-16 10:20:39 -07:00
James Lambert 2fd1c8efbf Put camera arm on correct side 2023-12-12 20:35:43 -07:00
James Lambert 39a1ec576d Fix some profiler issues 2023-12-12 20:35:00 -07:00
James Lambert d775df6b22 Have profiler label nested display lists 2023-12-12 18:00:47 -07:00
Matt Penny 4533814520 Do not dereference hud as pointer in scene.c 2023-12-11 19:30:55 -05:00
Matt Penny 14f332def5 Render HUD during intro fade
The HUD is responsible for filling the screen with black. Before this
fix, when pausing during the intro, the level would become visible.
2023-12-11 18:33:31 -05:00
James Lambert 05ad888975 Fix build when debugger is turned off 2023-12-11 07:45:51 -07:00
James Lambert af2240298f work on rsp profiler 2023-12-10 21:34:46 -07:00
James Lambert eae2f6d3b1 Show 01:59:50:00 on the clock in the main menu 2023-12-10 21:00:28 -07:00
James Lambert fa8571be54 Activate main menu sign after 5 seconds 2023-12-10 20:46:21 -07:00
James Lambert 9dfbcf11d3 Make profiler code included conditionally 2023-12-10 20:19:01 -07:00
James Lambert 7e10fc5d2f Get profiler working 2023-12-10 20:19:01 -07:00
James Lambert e50e0a32ac get this profile mostly working 2023-12-10 20:19:01 -07:00
James Lambert 8073daae90 Start work on rsp profiler 2023-12-10 20:19:01 -07:00
James Lambert f0146f2041 Adjust time step for pal consoles 2023-12-07 20:24:14 -07:00
James Lambert 8e87df9b8b Changed tolerances for moving objects backwards when doing swept collision 2023-12-07 20:13:36 -07:00
James Lambert 31ad3967ba Cleanup legacy font renderer 2023-12-06 21:18:57 -07:00
James Lambert e79b2994d2 Small adjustments and polish
cut up light bridge to better z sort
2023-12-04 22:13:51 -07:00
James Lambert 944c24095f Start game with intro again 2023-12-04 19:51:28 -07:00
James Lambert a42f8d154c Fix portal being placed outside of surfaces 2023-12-04 19:50:02 -07:00
James Lambert e6e5267dcb Prevent portals from being opened under signs 2023-12-02 21:02:32 -07:00
James Lambert d6910a4e01 Fix rotated box culling bug 2023-12-02 19:43:42 -07:00
James Lambert e32c299941 fix animated objects after small refactor 2023-12-02 15:53:04 -07:00