mirror of
https://github.com/izzy2lost/Diddy-Kong-Racing.git
synced 2026-06-19 01:16:26 -07:00
Fixed segfault issue with dkr_extractor
This commit is contained in:
@@ -17,7 +17,7 @@ namespace fs = std::experimental::filesystem;
|
||||
|
||||
const std::string CONFIG_EXTENSION = ".config.json";
|
||||
|
||||
const std::string ROM_EXTENSIONS[3] = { ".z64", ".v64", ".n64" };
|
||||
const std::string ROM_EXTENSIONS[] = { ".z64", ".v64", ".n64", ".rom" };
|
||||
|
||||
std::string outDirectory;
|
||||
std::string currentCategory;
|
||||
@@ -101,9 +101,9 @@ int main(int argc, char* argv[]) {
|
||||
|
||||
for (const auto & entry : fs::directory_iterator(baseromsDirectory)){
|
||||
std::string filename = entry.path().string();
|
||||
//if(ends_with_rom_extension(filename)) {
|
||||
if(ends_with_rom_extension(filename)) {
|
||||
roms.push_back(ROM(filename));
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
bool completedAnExtraction = false;
|
||||
|
||||
@@ -35,10 +35,10 @@ ExtractTextures::ExtractTextures(std::vector<uint8_t> data, ROM& rom, std::strin
|
||||
int textureSize = get_texture_size(width, height, textureFormat);
|
||||
|
||||
std::vector<uint8_t> texHeader(texData.begin() + dataOffset, texData.begin() + dataOffset + TEX_HEADER_SIZE);
|
||||
std::vector<uint8_t> texData(texData.begin() + dataOffset + TEX_HEADER_SIZE, texData.begin() + dataOffset + textureSize);
|
||||
std::vector<uint8_t> texData2(texData.begin() + dataOffset + TEX_HEADER_SIZE, texData.begin() + dataOffset + textureSize);
|
||||
|
||||
process_texture(texHeader, texData);
|
||||
combinedTexturesData.insert(combinedTexturesData.end(), texData.begin(), texData.end());
|
||||
process_texture(texHeader, texData2);
|
||||
combinedTexturesData.insert(combinedTexturesData.end(), texData2.begin(), texData2.end());
|
||||
|
||||
dataOffset += textureSize;
|
||||
totalHeight += texHeader[1];
|
||||
|
||||
Reference in New Issue
Block a user