mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-08 20:24:47 -04:00
Merge branch 'main' into 26-04-01-quick-transform
This commit is contained in:
@@ -8429,11 +8429,4 @@ inline daAlink_c* daAlink_getAlinkActorClass() {
|
||||
return (daAlink_c*)dComIfGp_getLinkPlayer();
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
namespace dusk::tweaks {
|
||||
extern bool FastIronBoots;
|
||||
extern bool QuickTransform;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* D_A_D_A_ALINK_H */
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
#ifndef D_A_MOVIE_PLAYER_H
|
||||
#define D_A_MOVIE_PLAYER_H
|
||||
|
||||
#if !TARGET_PC
|
||||
#include <thp.h>
|
||||
#else
|
||||
#include <atomic>
|
||||
#endif
|
||||
#include "f_op/f_op_actor.h"
|
||||
#include "d/d_drawlist.h"
|
||||
|
||||
@@ -11,6 +15,85 @@ struct daMP_THPReadBuffer {
|
||||
BOOL isValid;
|
||||
};
|
||||
|
||||
#if TARGET_PC
|
||||
// Copying here because thp.h is probably erroneous in the dolphin lib,
|
||||
// and it's kind of a problem being there (Aurora owns the headers).
|
||||
// TODO: Move this stuff in decomp?
|
||||
typedef struct THPAudioRecordHeader {
|
||||
BE(u32) offsetNextChannel;
|
||||
BE(u32) sampleSize;
|
||||
BE(s16) lCoef[8][2];
|
||||
BE(s16) rCoef[8][2];
|
||||
BE(s16) lYn1;
|
||||
BE(s16) lYn2;
|
||||
BE(s16) rYn1;
|
||||
BE(s16) rYn2;
|
||||
} THPAudioRecordHeader;
|
||||
|
||||
typedef struct THPAudioDecodeInfo {
|
||||
u8* encodeData;
|
||||
u32 offsetNibbles;
|
||||
u8 predictor;
|
||||
u8 scale;
|
||||
s16 yn1;
|
||||
s16 yn2;
|
||||
} THPAudioDecodeInfo;
|
||||
|
||||
typedef struct THPTextureSet {
|
||||
u8* ytexture;
|
||||
u8* utexture;
|
||||
u8* vtexture;
|
||||
s32 frameNumber;
|
||||
} THPTextureSet;
|
||||
|
||||
typedef struct THPAudioBuffer {
|
||||
s16* buffer;
|
||||
s16* curPtr;
|
||||
u32 validSample;
|
||||
} THPAudioBuffer;
|
||||
|
||||
typedef struct THPVideoInfo {
|
||||
BE(u32) xSize;
|
||||
BE(u32) ySize;
|
||||
BE(u32) videoType;
|
||||
} THPVideoInfo;
|
||||
|
||||
typedef struct THPAudioInfo {
|
||||
BE(u32) sndChannels;
|
||||
BE(u32) sndFrequency;
|
||||
BE(u32) sndNumSamples;
|
||||
BE(u32) sndNumTracks;
|
||||
} THPAudioInfo;
|
||||
|
||||
typedef struct THPFrameCompInfo {
|
||||
BE(u32) numComponents;
|
||||
u8 frameComp[16];
|
||||
} THPFrameCompInfo;
|
||||
|
||||
typedef struct THPHeader {
|
||||
/* 0x00 */ char magic[4];
|
||||
/* 0x04 */ BE(u32) version;
|
||||
/* 0x08 */ BE(u32) bufsize;
|
||||
/* 0x0C */ BE(u32) audioMaxSamples;
|
||||
/* 0x10 */ BE(f32) frameRate;
|
||||
/* 0x14 */ BE(u32) numFrames;
|
||||
/* 0x18 */ BE(u32) firstFrameSize;
|
||||
/* 0x1C */ BE(u32) movieDataSize;
|
||||
/* 0x20 */ BE(u32) compInfoDataOffsets;
|
||||
/* 0x24 */ BE(u32) offsetDataOffsets;
|
||||
/* 0x28 */ BE(u32) movieDataOffsets;
|
||||
/* 0x2C */ BE(u32) finalFrameDataOffsets;
|
||||
} THPHeader;
|
||||
|
||||
static u32 THPAudioDecode(s16* audioBuffer, u8* audioFrame, s32 flag);
|
||||
static s32 __THPAudioGetNewSample(THPAudioDecodeInfo* info);
|
||||
static void __THPAudioInitialize(THPAudioDecodeInfo* info, u8* ptr);
|
||||
|
||||
#define THP_AUDIO_BUFFER_COUNT 3
|
||||
#define THP_READ_BUFFER_COUNT 10
|
||||
#define THP_TEXTURE_SET_COUNT 3
|
||||
#endif
|
||||
|
||||
struct daMP_THPPlayer {
|
||||
/* 0x000 */ DVDFileInfo fileInfo;
|
||||
/* 0x03C */ THPHeader header;
|
||||
@@ -34,7 +117,11 @@ struct daMP_THPPlayer {
|
||||
/* 0x0C8 */ s64 retaceCount;
|
||||
/* 0x0D0 */ s32 prevCount;
|
||||
/* 0x0D4 */ s32 curCount;
|
||||
#if TARGET_PC
|
||||
/* 0x0D8 */ std::atomic<s32> videoDecodeCount;
|
||||
#else
|
||||
/* 0x0D8 */ s32 videoDecodeCount;
|
||||
#endif
|
||||
/* 0x0DC */ f32 curVolume;
|
||||
/* 0x0E0 */ f32 targetVolume;
|
||||
/* 0x0E4 */ f32 deltaVolume;
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
#ifndef DUSK_LAYOUT_H
|
||||
#define DUSK_LAYOUT_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
namespace dusk {
|
||||
|
||||
/**
|
||||
* Helper struct for laying things out on the screen. Represents a rectangle via two corner
|
||||
* positions.
|
||||
*/
|
||||
struct LayoutRect {
|
||||
f32 PosX;
|
||||
f32 PosY;
|
||||
f32 PosX2;
|
||||
f32 PosY2;
|
||||
|
||||
[[nodiscard]] constexpr f32 Width() const {
|
||||
return PosX2 - PosX;
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr f32 Height() const {
|
||||
return PosY2 - PosY;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates the position to render one rectangle inside another, centered and maintaining aspect ratio.
|
||||
*/
|
||||
[[nodiscard]] static LayoutRect FitRectInRect(
|
||||
f32 widthOuter,
|
||||
f32 heightOuter,
|
||||
f32 widthInner,
|
||||
f32 heightInner);
|
||||
};
|
||||
}
|
||||
|
||||
#endif // DUSK_LAYOUT_H
|
||||
@@ -617,5 +617,8 @@ static const auto gameRegions = std::to_array({
|
||||
MapEntry("Cutscene: Hyrule Castle Throne Room", "R_SP301", {
|
||||
{0, {0, 20, 100}},
|
||||
}),
|
||||
MapEntry("Title screen movie map", "S_MV000", {
|
||||
{0, {0, 1}},
|
||||
}),
|
||||
})
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user