Skip to content

Commit

Permalink
Update Chart Conventor
Browse files Browse the repository at this point in the history
  • Loading branch information
LittleYang0531 committed May 26, 2024
1 parent 5f553f3 commit 11be344
Show file tree
Hide file tree
Showing 139 changed files with 17 additions and 14,414 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ dist/*
!dist/thumbnail.jpg
!dist/banner.jpg
!dist/EngineTutorialData
emsdk
main
17 changes: 8 additions & 9 deletions convert.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ string fromSirius(string text, double chartOffset, double bgmOffset = 0) {
single["data"][0]["name"] = "#BEAT"; single["data"][0]["value"] = 0;
single["data"][1]["name"] = "#BPM"; single["data"][1]["value"] = 60;
res.append(single);
double lastTime[13][13]; double lastEighthTime[13][13]; int lastType[13][13], total = 0;
for (int i = 0; i < 13; i++) for (int j = 0; j < 13; j++) lastTime[i][j] = 0, lastEighthTime[i][j] = 0, lastType[i][j] = 0;
double lastEighthTime[13][13]; int total = 0;
for (int i = 0; i < 13; i++) for (int j = 0; j < 13; j++) lastEighthTime[i][j] = 0;
for (int i = 0; i < notes.size(); i++) {
// 提前处理 Sirius HoldEnd;
while (holdEnd.size() && (*holdEnd.begin()).endTime <= notes[i].startTime) {
Expand Down Expand Up @@ -220,8 +220,6 @@ string fromSirius(string text, double chartOffset, double bgmOffset = 0) {
total++;
} break;
case Hold: case CriticalHold: case ScratchHold: case ScratchCriticalHold: {
lastTime[x.leftLane][x.leftLane + x.laneLength - 1] = x.startTime;
lastType[x.leftLane][x.leftLane + x.laneLength - 1] = x.type;
holdEnd.insert(x);
} break;
case Sound: case ScratchSound: {
Expand All @@ -230,7 +228,7 @@ string fromSirius(string text, double chartOffset, double bgmOffset = 0) {
single["data"][0]["name"] = "beat"; single["data"][0]["value"] = x.startTime;
single["data"][1]["name"] = "lane"; single["data"][1]["value"] = x.leftLane;
single["data"][2]["name"] = "laneLength"; single["data"][2]["value"] = x.laneLength;
single["data"][3]["name"] = "holdType"; single["data"][3]["value"] = lastType[x.leftLane][x.leftLane + x.laneLength - 1];
single["data"][3]["name"] = "holdType"; single["data"][3]["value"] = Sound ? Hold : ScratchHold;
total++;
} break;
case SoundPurple: {
Expand All @@ -250,7 +248,8 @@ string fromSirius(string text, double chartOffset, double bgmOffset = 0) {
single["data"][0]["name"] = "beat"; single["data"][0]["value"] = x.startTime;
single["data"][1]["name"] = "lane"; single["data"][1]["value"] = x.leftLane;
single["data"][2]["name"] = "laneLength"; single["data"][2]["value"] = x.laneLength;
single["data"][3]["name"] = "holdType"; single["data"][3]["value"] = lastType[x.leftLane][x.leftLane + x.laneLength - 1];
// 历史遗留代码了,这个属性现在应该不需要了 2024.5.27
single["data"][3]["name"] = "holdType"; single["data"][3]["value"] = 0;
total++;
} break;
case None: {
Expand All @@ -276,19 +275,19 @@ string fromSirius(string text, double chartOffset, double bgmOffset = 0) {
if (x.type == Hold || x.type == CriticalHold) {
single["archetype"] = "Sirius Hold End";
single["data"][0]["name"] = "beat"; single["data"][0]["value"] = x.endTime;
single["data"][1]["name"] = "stBeat"; single["data"][1]["value"] = lastTime[x.leftLane][x.leftLane + x.laneLength - 1];
single["data"][1]["name"] = "stBeat"; single["data"][1]["value"] = x.startTime;
single["data"][2]["name"] = "lane"; single["data"][2]["value"] = x.leftLane;
single["data"][3]["name"] = "laneLength"; single["data"][3]["value"] = x.laneLength;
total++;
} else {
single["archetype"] = "Sirius Scratch Hold End";
single["data"][0]["name"] = "beat"; single["data"][0]["value"] = x.endTime;
single["data"][1]["name"] = "stBeat"; single["data"][1]["value"] = lastTime[x.leftLane][x.leftLane + x.laneLength - 1];
single["data"][1]["name"] = "stBeat"; single["data"][1]["value"] = x.startTime;
single["data"][2]["name"] = "lane"; single["data"][2]["value"] = x.leftLane;
single["data"][3]["name"] = "laneLength"; single["data"][3]["value"] = x.laneLength;
single["data"][4]["name"] = "scratchLength"; single["data"][4]["value"] = x.scratchLength;
total++;
} lastTime[x.leftLane][x.leftLane + x.laneLength - 1] = 0; res.append(single);
} res.append(single);
addSyncLine(x.endTime, x.leftLane, x.laneLength);
}

Expand Down
4 changes: 3 additions & 1 deletion emake
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ emcc emscripten.cpp -o libsirius.js -s MODULARIZE -s EXPORT_ES6=1\
-sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE=['$stringToNewUTF8','$UTF8ToString']\
-sEXPORTED_RUNTIME_METHODS=['stringToNewUTF8','UTF8ToString']\
-fwasm-exceptions -sASSERTIONS\
-sALLOW_MEMORY_GROWTH -g -O3
-I./emsdk/include -L./emsdk/lib \
-sALLOW_MEMORY_GROWTH -g -O3 \
-ljsoncpp
6 changes: 3 additions & 3 deletions emscripten.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ vector<string> explode(const char* seperator, const char* source) {
return res;
}

#include"modules/json.h"
#include"modules/buffer.h"
#include"modules/gzip.h"
#include"sonolus/modules/json.h"
#include"sonolus/modules/buffer.h"
#include"sonolus/modules/gzip.h"
#include"convert.h"

#ifndef EM_PORT_API
Expand Down
81 changes: 0 additions & 81 deletions engine_decrypted/configuration/options.cpp

This file was deleted.

70 changes: 0 additions & 70 deletions engine_decrypted/configuration/ui.cpp

This file was deleted.

61 changes: 0 additions & 61 deletions engine_decrypted/data/archetype/CriticalHoldStart.cpp

This file was deleted.

60 changes: 0 additions & 60 deletions engine_decrypted/data/archetype/CriticalNote.cpp

This file was deleted.

Loading

0 comments on commit 11be344

Please sign in to comment.