-
Notifications
You must be signed in to change notification settings - Fork 5
/
osufilereader.h
103 lines (79 loc) · 1.72 KB
/
osufilereader.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#pragma once
#include <stdint.h>
#include <prism/datastructures.h>
#include <prism/geometry.h>
typedef int OsuMilliSecond;
typedef struct {
char* mAudioFileName;
OsuMilliSecond mAudioLeadIn;
OsuMilliSecond mPreviewTime;
int mCountdown;
double mStackLeniency;
} OsuFileGeneral;
typedef struct {
int mHPDrainRate;
double mCircleSize;
int mOverallDifficulty;
double mApproachRate;
double mSliderMultiplier;
int mSliderTickRate;
} OsuFileDifficulty;
typedef struct {
OsuMilliSecond mStart;
OsuMilliSecond mEnd;
} OsuEventBreak;
typedef struct {
List mBreaks; // contains OsuEventBreak
} OsuEvents;
typedef struct {
OsuMilliSecond mOffset;
double mMillisecondsPerBeat;
int mMeter;
int mSampleIndex;
int mVolume;
int mInherited;
int mKiaiMode;
} OsuTimingPoint;
typedef struct {
double mR;
double mG;
double mB;
} OsuColor;
#define OSU_TYPE_MASK_HIT_OBJECT (1 << 0)
#define OSU_TYPE_MASK_SLIDER (1 << 1)
#define OSU_TYPE_MASK_NEW_COMBO (1 << 2)
#define OSU_TYPE_MASK_SPINNER (1 << 3)
typedef struct {
int mX;
int mY;
OsuMilliSecond mTime;
uint8_t mType;
uint8_t mHitSound;
} OsuHitObject;
typedef struct {
int mX;
int mY;
OsuMilliSecond mTime;
uint8_t mType;
uint8_t mHitSound;
Vector3DI mEndPosition;
int mRepeat;
double mPixelLength;
} OsuSliderObject;
typedef struct {
int mX;
int mY;
OsuMilliSecond mTime;
uint8_t mType;
uint8_t mHitSound;
OsuMilliSecond mEndTime;
} OsuSpinnerObject;
typedef struct {
OsuFileGeneral mGeneral;
OsuFileDifficulty mDifficulty;
OsuEvents mEvents;
List mOsuTimingPoints; // contains OsuTimingPoint
List mOsuColors; // contains OsuColor
List mOsuHitObjects; // contains OsuHitObject/OsuSpinnerObject/OsuSliderObject
} OsuFile;
OsuFile loadOsuFile(char* tPath);