Skip to content

Commit

Permalink
Speed Option
Browse files Browse the repository at this point in the history
  • Loading branch information
LittleYang0531 committed Jan 18, 2024
1 parent 6899fb0 commit 7ae768d
Show file tree
Hide file tree
Showing 22 changed files with 52 additions and 12 deletions.
Binary file modified dist/EngineConfiguration
Binary file not shown.
Binary file modified dist/EngineData
Binary file not shown.
Binary file modified dist/EngineWatchData
Binary file not shown.
23 changes: 17 additions & 6 deletions engine/configuration/options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ class Options {

int Mirror = 0; // Supported
int NoteSpeed = 1; // Supported
int Hidden = 2; // Supported
int SplitRandom = 3;
int SplitLine = 4; // Supported
int SyncLine = 5; // Supported
int LockAspectRatio = 6; // Supported
int ExtraWidth = 7; // Supoorted
int Speed = 2;
int Hidden = 3; // Supported
int SplitRandom = 4;
int SplitLine = 5; // Supported
int SyncLine = 6; // Supported
int LockAspectRatio = 7; // Supported
int ExtraWidth = 8; // Supoorted
}Options;

auto options = defineOptions<class Options>({
Expand All @@ -29,6 +30,16 @@ auto options = defineOptions<class Options>({
min: 1,
max: 25,
step: 0.1,
}, {
name: NameText.LevelSpeed,
scope: Scope,
standard: 0,
type: OptionType.Slider,
def: 1,
min: 0.5,
max: 2,
step: 0.05,
unit: UnitText.Percentage,
}, {
name: NameText.VerticalStageCover,
scope: Scope,
Expand Down
5 changes: 3 additions & 2 deletions engine/constants.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ let splitLine = LevelOption.get(Options.SplitLine);
let syncLine = LevelOption.get(Options.SyncLine);
let lockAspectRatio = LevelOption.get(Options.LockAspectRatio);
let extraWidth = LevelOption.get(Options.ExtraWidth);
let levelSpeed = LevelOption.get(Options.Speed);
#elif preview
let mirror, speed, hidden, splitRandom, splitLine, syncLine, lockAspectRatio, extraWidth;
let mirror, speed, hidden, splitRandom, splitLine, syncLine, lockAspectRatio, extraWidth, levelSpeed;
#endif

#if play || watch
Expand Down Expand Up @@ -100,7 +101,7 @@ class judgline {
let rtY = ltY;
}judgline;

let appearTime = (7.4 / speed);
let appearTime = 7.4 / speed;
let noteSpeed = stage.h / appearTime;

let t = If(
Expand Down
1 change: 1 addition & 0 deletions engine/play/FlickNote.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class FlickNote : public Archetype {

SonolusApi preprocess() {
FUNCBEGIN
beat = beat / levelSpeed;
IF (mirror) lane = 14 - lane - laneLength; FI
enLane = lane + laneLength - 1;
inputTimeMin = beat - judgment.bad + RuntimeEnvironment.get(3);
Expand Down
7 changes: 7 additions & 0 deletions engine/play/SplitLine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ class SplitLine: public Archetype {

SonolusApi spawnOrder() { return 1000 + beat - splitLineAnimationStart + appearTime; }
SonolusApi shouldSpawn() { return times.now > beat - splitLineAnimationStart; }

SonolusApi preprocess() {
FUNCBEGIN
beat = beat / levelSpeed;
endBeat = endBeat / levelSpeed;
return VOID;
}

SonolusApi updateSequential() {
FUNCBEGIN
Expand Down
5 changes: 1 addition & 4 deletions engine/play/SyncLine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,11 @@ class SyncLine: public Archetype {

SonolusApi preprocess() {
FUNCBEGIN
beat = beat / levelSpeed;
IF (mirror) {
// for (auto x : nodesContainer.top()) cout << x << endl;
// cout << allocatorSize[EntityDataId] << endl;
var tmp = left;
// cout << left.offset << " " << right.offset << endl;
left = 13 - right;
right = 13 - tmp;
// for (auto x : nodesContainer.top()) cout << x << endl;
} FI
return VOID;
}
Expand Down
1 change: 1 addition & 0 deletions engine/play/flatNotes/FlatNote.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class FlatNote : public Archetype {

SonolusApi preprocess() {
FUNCBEGIN
beat = beat / levelSpeed;
IF (mirror) lane = 14 - lane - laneLength; FI
// cout << lane.offset << endl;
enLane = lane + laneLength - 1;
Expand Down
1 change: 1 addition & 0 deletions engine/play/holdNotes/HoldEighth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class SiriusHoldEighth: public Archetype {

SonolusApi preprocess() {
FUNCBEGIN
beat = beat / levelSpeed;
IF (mirror) lane = 14 - lane - laneLength; FI
enLane = lane + laneLength - 1;
inputTimeMin = beat - judgment.bad + RuntimeEnvironment.get(3);
Expand Down
2 changes: 2 additions & 0 deletions engine/play/holdNotes/HoldEnd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ class SiriusHoldEnd: public Archetype {

SonolusApi preprocess() {
FUNCBEGIN
beat = beat / levelSpeed;
stBeat = stBeat / levelSpeed;
IF (mirror) lane = 14 - lane - laneLength; FI
enLane = lane + laneLength - 1;
inputTimeMin = beat - judgment.bad + RuntimeEnvironment.get(3);
Expand Down
2 changes: 2 additions & 0 deletions engine/play/holdNotes/ScratchHoldEnd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ class SiriusScratchHoldEnd: public Archetype {

SonolusApi preprocess() {
FUNCBEGIN
beat = beat / levelSpeed;
stBeat = stBeat / levelSpeed;
IF (mirror) lane = 14 - lane - laneLength; scratchLength = -1 * scratchLength; FI
enLane = lane + laneLength - 1;
inputTimeMin = beat - judgment.bad + RuntimeEnvironment.get(3);
Expand Down
1 change: 1 addition & 0 deletions engine/play/holdNotes/Sound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class SiriusSound: public Archetype {

SonolusApi preprocess() {
FUNCBEGIN
beat = beat / levelSpeed;
IF (mirror) lane = 14 - lane - laneLength; FI
enLane = lane + laneLength - 1;
inputTimeMin = beat - judgment.bad + RuntimeEnvironment.get(3);
Expand Down
1 change: 1 addition & 0 deletions engine/watch/FlickNote.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

SonolusApi preprocess() {
FUNCBEGIN
beat = beat / levelSpeed;
IF (mirror) lane = 14 - lane - laneLength; FI
enLane = lane + laneLength - 1;
Set(EntityInputId, 0, beat);
Expand Down
7 changes: 7 additions & 0 deletions engine/watch/SplitLine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ class SplitLine: public Archetype {

SonolusApi spawnTime() { return beat - splitLineAnimationStart; }
SonolusApi despawnTime() { return endBeat + splitLineAnimationEnd; }

SonolusApi preprocess() {
FUNCBEGIN
beat = beat / levelSpeed;
endBeat = endBeat / levelSpeed;
return VOID;
}

SonolusApi updateSequential() {
FUNCBEGIN
Expand Down
1 change: 1 addition & 0 deletions engine/watch/SyncLine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class SyncLine: public Archetype {

SonolusApi preprocess() {
FUNCBEGIN
beat = beat / levelSpeed;
IF (LevelOption.get(Options.Mirror)) {
var tmp = left;
left = 13 - right;
Expand Down
1 change: 1 addition & 0 deletions engine/watch/flatNotes/FlatNote.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

SonolusApi preprocess() {
FUNCBEGIN
beat = beat / levelSpeed;
IF (mirror) lane = 14 - lane - laneLength; FI
enLane = lane + laneLength - 1;
Set(EntityInputId, 0, beat);
Expand Down
1 change: 1 addition & 0 deletions engine/watch/holdNotes/HoldEighth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

SonolusApi preprocess() {
FUNCBEGIN
beat = beat / levelSpeed;
IF (mirror) lane = 14 - lane - laneLength; FI
enLane = lane + laneLength - 1;
Set(EntityInputId, 0, beat);
Expand Down
2 changes: 2 additions & 0 deletions engine/watch/holdNotes/HoldEnd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

SonolusApi preprocess() {
FUNCBEGIN
beat = beat / levelSpeed;
stBeat = stBeat / levelSpeed;
IF (mirror) lane = 14 - lane - laneLength; FI
enLane = lane + laneLength - 1;
Set(EntityInputId, 0, beat);
Expand Down
2 changes: 2 additions & 0 deletions engine/watch/holdNotes/ScratchHoldEnd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

SonolusApi preprocess() {
FUNCBEGIN
beat = beat / levelSpeed;
stBeat = stBeat / levelSpeed;
IF (mirror) lane = 14 - lane - laneLength; scratchLength = -1 * scratchLength; FI
enLane = lane + laneLength - 1;
scratchLane = If(scratchLength >= 0, lane, enLane + scratchLength + 1);
Expand Down
1 change: 1 addition & 0 deletions engine/watch/holdNotes/Sound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

SonolusApi preprocess() {
FUNCBEGIN
beat = beat / levelSpeed;
IF (mirror) lane = 14 - lane - laneLength; FI
enLane = lane + laneLength - 1;
Set(EntityInputId, 0, beat);
Expand Down
Binary file modified main
Binary file not shown.

0 comments on commit 7ae768d

Please sign in to comment.