diff --git a/osufs/osufs.xcodeproj/project.pbxproj b/osufs/osufs.xcodeproj/project.pbxproj index e09370d78dafeca03deb00d86a3d1ef9fd210c88..3ff9fb0aaa51f1e05e511d5bada03d6671635cab 100644 --- a/osufs/osufs.xcodeproj/project.pbxproj +++ b/osufs/osufs.xcodeproj/project.pbxproj @@ -629,6 +629,9 @@ 201233671FCD4F4400FCBFC8 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ADDRESS_SANITIZER_CONTAINER_OVERFLOW = YES; + CLANG_UNDEFINED_BEHAVIOR_SANITIZER_INTEGER = YES; + CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES; CODE_SIGN_STYLE = Automatic; PRODUCT_NAME = "$(TARGET_NAME)"; }; @@ -637,6 +640,9 @@ 201233681FCD4F4400FCBFC8 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ADDRESS_SANITIZER_CONTAINER_OVERFLOW = YES; + CLANG_UNDEFINED_BEHAVIOR_SANITIZER_INTEGER = YES; + CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES; CODE_SIGN_STYLE = Automatic; PRODUCT_NAME = "$(TARGET_NAME)"; }; diff --git a/osufs/osufs/osu.cpp b/osufs/osufs/osu.cpp index 2fea11bd0271db14b6be47e5e29b1bcb93f1db71..85a03135f158144caffd0630359f89109dc67a01 100644 --- a/osufs/osufs/osu.cpp +++ b/osufs/osufs/osu.cpp @@ -195,6 +195,8 @@ osu_song osu_read_osu(const char *filename, mdev *dev, osu_meta *meta, memset(&ret, 0xcc, sizeof(ret)); strncpy(ret.magic, "DEAD", 4); + ret.combo_colors_start = 0; + ret.storyboard = NULL; sprintf(line, "%s/%s", cont->dirname, filename); @@ -279,7 +281,7 @@ int osu_parse_general(char *line, osu_song *song, return 1; } // AudioFilename (String) specifies the location of the audio file relative to the current folder. - if (strcasecmp(key, "AudioFilename") == 0) { + if (0 && strcasecmp(key, "AudioFilename") == 0) { if (cont->fs.find(val) == cont->fs.end()) { printf("Allocating storage for audio %s\n", val); uint32_t addr = meta->available_block; @@ -479,6 +481,7 @@ int osu_parse_difficulty(char *line, osu_song *song, int osu_parse_events(char *line, osu_song *song, mdev *dev, osu_meta *meta, osu_dir *cont) { // Events section is in CSV format + return 0; switch (line[0]) { case '0': { // Background image @@ -538,11 +541,24 @@ int osu_parse_colors(char *line, osu_song *song, return 1; } - if (strncasecmp(key, "Combo",5) != 0) { + int r, g, b; + + if (strncasecmp(key, "SliderBody", 10) == 0) { + if (sscanf(val, "%d,%d,%d", &r, &g, &b) != 3) { + fprintf(stderr, "Warning: bad SliderBody color: %s\n", val); + return 1; + } + song->combo_slider_color[0] = r; + song->combo_slider_color[1] = g; + song->combo_slider_color[2] = b; + return 0; + } + + if (strncasecmp(key, "Combo", 5) != 0) { return 0; } - int n = key[6] - '1', r, g, b; + int n = key[5] - '1'; if (sscanf(val, "%d,%d,%d", &r, &g, &b) != 3) { fprintf(stderr, "Warning: bad combo color: %s\n", val); return 1; diff --git a/osufs/osufs/osu_object_analyze/osu_object_parser.cpp b/osufs/osufs/osu_object_analyze/osu_object_parser.cpp index d26440c24c8077378191022c740ab0a9d068ab80..71468572d0598eef27b04ff99f58c5626f915699 100644 --- a/osufs/osufs/osu_object_analyze/osu_object_parser.cpp +++ b/osufs/osufs/osu_object_analyze/osu_object_parser.cpp @@ -74,7 +74,7 @@ int osu_parse_hit_object(char* line, osu_song* song){ break; } //update count and data block - if (song->storyboard){ + if (!song->storyboard){ song->storyboard = (uint8_t *) malloc(4+4+32*temp_c); *((uint32_t*)(song->storyboard)) = 0b01110010011001010110000101101100; *((uint32_t*)(song->storyboard)+1) = temp_c; @@ -89,7 +89,9 @@ int osu_parse_hit_object(char* line, osu_song* song){ return 0; } -void string_split(char* dup, const char* delim, vector<string> & v){ +void string_split(char* line, const char* delim, vector<string> & v){ + char dup[1024]; + strncpy(dup, line, 1024); char * token = strtok(dup, delim); while(token != NULL){ v.push_back(string(token)); diff --git a/osufs/osufs/osufs.h b/osufs/osufs/osufs.h index 7a97d15664adaf681d296bcfebc4da71883782e5..a4b2458c5295aad0cc84876f89f4f3ffbc592321 100644 --- a/osufs/osufs/osufs.h +++ b/osufs/osufs/osufs.h @@ -228,11 +228,13 @@ extern "C" { uint16_t stack_leniency; // 78 - 79 //for analyze side only - uint8_t combo_colors_count; // 80 - 80 - uint8_t combo_colors_start; // 81 - 81 - uint8_t *storyboard; // 82 - 89 + uint8_t *storyboard; // 80 - 87 + uint8_t combo_colors_count; // 88 + uint8_t combo_colors_start; // 89 + uint8_t combo_slider_color[3]; // 90 - 92 - char _padding[230]; // 90 - 319 + + char _padding[227]; // 93 - 319 char title[64]; // 320 - 383 char artist[64]; // 384 - 447