Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cutscene (demo) support for Wind Waker #717

Merged
merged 103 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from 84 commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
c153a82
Add STB as a loadable ResType
themikelester Nov 1, 2024
999971e
Workable starting point for JStudio, STB parsing, and ZWW Demo handling
themikelester Nov 1, 2024
af5aa90
JStudio WIP updates
themikelester Nov 1, 2024
58aa532
dDemo lifecycle improvements
themikelester Nov 2, 2024
7a91c1d
FVB Parsing starting point
themikelester Nov 2, 2024
568abdd
Finished implementing TCameraAdaptor. Values are being fed all the wa…
themikelester Nov 2, 2024
51d52ed
Added transformations to TControl. Demos can now have an origin and r…
themikelester Nov 2, 2024
281aeac
Small cleanup
themikelester Nov 3, 2024
b5494b6
Fix a bug in FunctionValue_ListParameter::getValue() that would produ…
themikelester Nov 3, 2024
4e982a5
Demo timing changes. Now respects NoClip pause, and matches the origi…
themikelester Nov 3, 2024
d3c3b07
Hook up dDemo_manager_c in d_s_play
themikelester Nov 3, 2024
3cbaba1
Hackily hook up cutscene loading in CreateScene. "Opening Cutscene" i…
themikelester Nov 3, 2024
88fb002
Slightly less hacky way of loading cutscenes
themikelester Nov 3, 2024
a288138
Allow the FPSCamera to take control when a demo is paused
themikelester Nov 3, 2024
bbbfe34
Remove the demo camera when done. Only override camera params which h…
themikelester Nov 3, 2024
c775333
Move roomStatus into the new dStage_roomControl_c class
themikelester Nov 5, 2024
bad3ec0
Fetch a Stage's Demo archive when it is loaded
themikelester Nov 5, 2024
bb7eaf4
Add dRes_control_c.getObjectResByName()
themikelester Nov 5, 2024
a4839b9
DemoDesc now contains the filename property, which Demo Events use to…
themikelester Nov 5, 2024
9f51dfd
Imported the list of all demo events (with all their parameters) in W…
themikelester Nov 5, 2024
7442f4c
If a Stage has demos, add a new UI panel. Click on one in the list wi…
themikelester Nov 5, 2024
443302e
Fix demo rotation. The imported data is in degrees, we expect radians
themikelester Nov 5, 2024
76f8a68
Add "Title Screen" stage to the Outset Island section
themikelester Nov 5, 2024
8f3cab6
Added correct room and layer information for all demos
themikelester Nov 7, 2024
f671292
Defer loading of Demo arcs until a cutscene is played
themikelester Nov 7, 2024
d808ae5
Tested counter.stb, the only demo expected to be a Stage resource
themikelester Nov 7, 2024
f8795fc
Fix starting a cutscene while another is playing
themikelester Nov 7, 2024
aa79c6f
Added support for STB control sequences, used suspend demos while wai…
themikelester Nov 7, 2024
fb1c7df
JStudio: Implement FunctionValue_Constant
themikelester Nov 8, 2024
9424e85
JStudio: Implemented interpolateNone
themikelester Nov 8, 2024
65feeb5
Implement (untested) FunctionValue_Composite
themikelester Nov 8, 2024
fe7f6d4
Implement EPrepareOp.ObjSetByIdx (tested) and ObjSetByName (untested)
themikelester Nov 8, 2024
3e1a67e
Reorganized and named some cutscenes
themikelester Nov 8, 2024
b89f0aa
Reorganized FunctionValues to be grouped with their corresponding TOb…
themikelester Nov 8, 2024
ee823e9
Implemented FunctionValue_Hermite (untested)
themikelester Nov 8, 2024
22649ff
Added shimmed Actor-related STB types
themikelester Nov 9, 2024
161bf2b
Framework: Added fopAcM_searchFromName
themikelester Nov 9, 2024
18654d0
Demo: Implemented JSGFindObject for Actors
themikelester Nov 9, 2024
f83ca2f
JStudio: Starting point for TActorAdaptor implementation
themikelester Nov 9, 2024
40a70cb
Implemented most TActorAdaptor functions
themikelester Nov 9, 2024
dcf8641
Implemented dDemo_actor_c getter/setter functions
themikelester Nov 9, 2024
ab3ee10
Implement process_paragraph_reserved_() and do_data()
themikelester Nov 9, 2024
524896a
Implemented (untested) TActorAdaptor::adaptor_do_update()
themikelester Nov 10, 2024
908fd32
JStudio: Fix bug in linear interpolation data access
themikelester Nov 10, 2024
65c9aaf
Add dRes_control_c::getObjectResByID()
themikelester Nov 10, 2024
1e41295
Fix bug in setMorf that failed to support a morfFrames value of 0
themikelester Nov 11, 2024
94b1d82
JStudio: Confirm that adaptor_do_ANIMATION is working as expected
themikelester Nov 11, 2024
6f24e8d
d_demo: Added support for specifying a startFrame when playing demos
themikelester Nov 11, 2024
17777ff
d_demo: Added checkEnable and getMorfParam
themikelester Nov 11, 2024
ab81cde
d_demo: Fix frame counts
themikelester Nov 11, 2024
09c05f4
d_demo: Added dDemo_setDemoData
themikelester Nov 11, 2024
a7cd2d3
Add optional start frame to DemoDesc
themikelester Nov 11, 2024
34d84bd
d_demo: Fix bug in dDemo_setDemoData() which cause played animations …
themikelester Nov 11, 2024
b0ea173
JStudio: Add toggleable logging for actor sequences
themikelester Nov 11, 2024
c6f7a6c
JStudio: Fix bug where Immediate and Time values were ints instead of…
themikelester Nov 11, 2024
6f82a59
JStudio: Allow adaptor_do_*() functions to read data as an int or float
themikelester Nov 11, 2024
904f6b0
JStudio: Improve logging output
themikelester Nov 11, 2024
738bd32
JStudio: Fix camera roll and fov being swapped
themikelester Nov 11, 2024
0fb528f
Move demo camera assignment and added support for FovY, Near, and Far
themikelester Nov 11, 2024
42d7748
JStudio: Wire up Actor anim_frame, anim_transition, and texAnim_frame…
themikelester Nov 12, 2024
fcf862d
d_demo: Adjust animation frame step to account for non-1 dt
themikelester Nov 12, 2024
b5a2de1
JStudio: Renamed TEOperationData to EDataOp
themikelester Nov 12, 2024
208c465
Demo actors now store their name, and report it via JSGGetName for lo…
themikelester Nov 12, 2024
1453a61
JStudio: A more general approavh to logging. Adaptor now has a loggin…
themikelester Nov 12, 2024
1e3a764
JStudio: Rename debug logging function
themikelester Nov 12, 2024
8c5f9c2
JStudio: Unify formatting of all enums
themikelester Nov 12, 2024
0a5d120
d_demo: Implement JSGGetViewTargetPosition()
themikelester Nov 12, 2024
79193cb
JStudio: Remove some vestigial TODOs
themikelester Nov 12, 2024
573f44f
d_demo: Convert STB rotations into short radians
themikelester Nov 13, 2024
953f23c
New actor: d_a_npc_ls1 (Aryll, Little Sister). Moved out of LegacyActor
themikelester Nov 13, 2024
abac1fa
Aryll: Create and parent hand models
themikelester Nov 13, 2024
45c19d1
Aryll: Added telescope and parented to hand
themikelester Nov 13, 2024
f9956b6
Aryll: Added some basic idle animation support
themikelester Nov 13, 2024
b7b98d8
d_demo: Fix issue with actors not clearing their demoActorID when dem…
themikelester Nov 13, 2024
4dcaf0f
Aryll: Simplified the idle animation logic
themikelester Nov 13, 2024
621498a
JStudio: Small cleanup
themikelester Nov 13, 2024
83dc13c
JStudio: Fix demo asserting due to uninitialized animMode
themikelester Nov 13, 2024
ccb08a5
JStudio: Fix Hermite interpolation
themikelester Nov 13, 2024
d4c18c4
Remove frameStart offset from the Awaken demo
themikelester Nov 13, 2024
98f3829
New icon for the "Cutscenes" UI element (a play button)
themikelester Nov 13, 2024
8939ad8
d_demo: Added camera roll support
themikelester Nov 14, 2024
83fb861
JStudio: disable logging by default
themikelester Nov 14, 2024
b0c82a5
Autoplay demo if it is added to the SceneDesc
themikelester Nov 14, 2024
7beebc5
d_demo: Add exported ActorFlags enum
themikelester Nov 15, 2024
56de067
JStudio: Remove all 'm' prefixes from member names
themikelester Nov 17, 2024
552ae08
d_demo: Remove 'm' prefix from all member variables
themikelester Nov 17, 2024
fda16a9
d_demo: Remove 'm' from member of DemoActor
themikelester Nov 17, 2024
ee17e47
JStudio: `public` before all member variables
themikelester Nov 18, 2024
b308084
d_demo: `public` before all member variables
themikelester Nov 18, 2024
d2439d1
Use `| null` for optional members/params instead of `?`
themikelester Nov 18, 2024
471fe65
JStudio: Use enum stringification rather than const enums and mapping…
themikelester Nov 18, 2024
b4759fc
Remove old comment regarding `removeTexMtxAnimator` usage
themikelester Nov 18, 2024
2d9d5f3
Use `interface` instead of `class` for data-only types
themikelester Nov 18, 2024
0ef39a0
Merged cM__Deg2Short into cM_deg2s (the game's original name)
themikelester Nov 18, 2024
22edf01
Merge branch 'master' into stb
themikelester Nov 18, 2024
b5ee2b0
JStudio: Use type discriminators to simplify/improve paragraph data h…
themikelester Nov 18, 2024
bfeb6d9
Demos are now selected the same as Scenes.
themikelester Nov 18, 2024
0e495ab
Remove demo UI panels
themikelester Nov 18, 2024
f504613
Small cleanup
themikelester Nov 18, 2024
9adf369
Move most cutscenes to a separate demoDesc list
themikelester Nov 18, 2024
42e74d6
Disable mouse input when cutscene is playing
themikelester Nov 21, 2024
86326f5
d_demo cleanup
themikelester Nov 21, 2024
29efd76
Small cleanup
themikelester Nov 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,999 changes: 1,999 additions & 0 deletions src/Common/JSYSTEM/JStudio.ts

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions src/ZeldaWindWaker/Grass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ function checkGroundY(globals: dGlobals, roomIdx: number, pos: vec3) {
}

function setColorFromRoomNo(globals: dGlobals, materialParams: MaterialParams, roomNo: number): void {
colorCopy(materialParams.u_Color[ColorKind.C0], globals.roomStatus[roomNo].tevStr.colorC0);
colorCopy(materialParams.u_Color[ColorKind.C1], globals.roomStatus[roomNo].tevStr.colorK0);
colorCopy(materialParams.u_Color[ColorKind.C0], globals.roomCtrl.status[roomNo].tevStr.colorC0);
colorCopy(materialParams.u_Color[ColorKind.C1], globals.roomCtrl.status[roomNo].tevStr.colorK0);
}

function distanceCull(camPos: ReadonlyVec3, objPos: ReadonlyVec3, maxDist = 20000) {
Expand Down Expand Up @@ -397,7 +397,7 @@ export class FlowerPacket {
}

private drawRoom(globals: dGlobals, roomIdx: number, renderInstManager: GfxRenderInstManager, viewerInput: ViewerRenderInput): void {
if (!globals.roomStatus[roomIdx].visible)
if (!globals.roomCtrl.status[roomIdx].visible)
return;

if (this.rooms[roomIdx].length === 0)
Expand Down Expand Up @@ -719,7 +719,7 @@ export class TreePacket {
}

private drawRoom(globals: dGlobals, roomIdx: number, renderInstManager: GfxRenderInstManager, viewerInput: ViewerRenderInput, device: GfxDevice) {
if (!globals.roomStatus[roomIdx].visible)
if (!globals.roomCtrl.status[roomIdx].visible)
return;

const room = this.rooms[roomIdx];
Expand Down Expand Up @@ -1016,7 +1016,7 @@ export class GrassPacket {
}

private drawRoom(globals: dGlobals, roomIdx: number, renderInstManager: GfxRenderInstManager, viewerInput: ViewerRenderInput): void {
if (!globals.roomStatus[roomIdx].visible)
if (!globals.roomCtrl.status[roomIdx].visible)
return;

const room = this.rooms[roomIdx];
Expand Down
210 changes: 195 additions & 15 deletions src/ZeldaWindWaker/Main.ts

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions src/ZeldaWindWaker/SComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,14 @@ export function cM_rndFX(max: number): number {
return 2.0 * (max * (Math.random() - 0.5));
}

export function cM_deg2s(deg: number): number {
return deg * 182.04445;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This already exists as cM__Deg2Short. I need to fix the names on those.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I should have spotted that. OK I've renamed cM__Deg2Short to cM_deg2s (so that it's easier to compare with the decomp). I only had to change one use case. I left the rest as they're named now. I hope that's what you had in mind.

}

export function cM_sht2d(rad: number) {
return rad * 0.005493164;
}

export function cM_atan2s(y: number, x: number): number {
return cM__Rad2Short(Math.atan2(y, x));
}
Expand Down
304 changes: 276 additions & 28 deletions src/ZeldaWindWaker/d_a.ts

Large diffs are not rendered by default.

Loading