aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2020-11-05 20:52:53 +0100
committerShauren <shauren.trinity@gmail.com>2020-12-08 18:16:46 +0100
commit6b6d5aff0530d43875572edc9616bc788ed8a26c (patch)
tree8d0ad02913e4b625b2b2c26d3daff9b8a354360c /src
parent5095bcbf1cf57dae0e58e1d1251b566952352047 (diff)
Dep/CascLib: Update to ladislav-zezula/CascLib@737a8705b5b8f7ce3917f5d5ff9767b18de1285e
Diffstat (limited to 'src')
-rw-r--r--src/tools/extractor_common/CascHandles.cpp12
-rw-r--r--src/tools/map_extractor/System.cpp8
-rw-r--r--src/tools/vmap4_extractor/cascfile.cpp12
-rw-r--r--src/tools/vmap4_extractor/vmapexport.cpp2
4 files changed, 17 insertions, 17 deletions
diff --git a/src/tools/extractor_common/CascHandles.cpp b/src/tools/extractor_common/CascHandles.cpp
index d4d1cd28da6..868c4af27c5 100644
--- a/src/tools/extractor_common/CascHandles.cpp
+++ b/src/tools/extractor_common/CascHandles.cpp
@@ -63,10 +63,10 @@ CASC::Storage* CASC::Storage::Open(boost::filesystem::path const& path, uint32 l
HANDLE handle = nullptr;
if (!::CascOpenStorageEx(nullptr, &args, false, &handle))
{
- DWORD lastError = GetLastError(); // support checking error set by *Open* call, not the next *Close*
+ DWORD lastError = GetCascError(); // support checking error set by *Open* call, not the next *Close*
printf("Error opening casc storage '%s': %s\n", path.string().c_str(), HumanReadableCASCError(lastError));
CascCloseStorage(handle);
- SetLastError(lastError);
+ SetCascError(lastError);
return nullptr;
}
@@ -116,12 +116,12 @@ CASC::File* CASC::Storage::OpenFile(char const* fileName, uint32 localeMask, boo
HANDLE handle = nullptr;
if (!::CascOpenFile(_handle, fileName, localeMask, openFlags, &handle))
{
- DWORD lastError = GetLastError(); // support checking error set by *Open* call, not the next *Close*
+ DWORD lastError = GetCascError(); // support checking error set by *Open* call, not the next *Close*
if (printErrors)
fprintf(stderr, "Failed to open '%s' in CASC storage: %s\n", fileName, HumanReadableCASCError(lastError));
CascCloseFile(handle);
- SetLastError(lastError);
+ SetCascError(lastError);
return nullptr;
}
@@ -137,12 +137,12 @@ CASC::File* CASC::Storage::OpenFile(uint32 fileDataId, uint32 localeMask, bool p
HANDLE handle = nullptr;
if (!::CascOpenFile(_handle, CASC_FILE_DATA_ID(fileDataId), localeMask, openFlags, &handle))
{
- DWORD lastError = GetLastError(); // support checking error set by *Open* call, not the next *Close*
+ DWORD lastError = GetCascError(); // support checking error set by *Open* call, not the next *Close*
if (printErrors)
fprintf(stderr, "Failed to open 'FileDataId %u' in CASC storage: %s\n", fileDataId, HumanReadableCASCError(lastError));
CascCloseFile(handle);
- SetLastError(lastError);
+ SetCascError(lastError);
return nullptr;
}
diff --git a/src/tools/map_extractor/System.cpp b/src/tools/map_extractor/System.cpp
index 2378e1d72c2..74e3c604b8b 100644
--- a/src/tools/map_extractor/System.cpp
+++ b/src/tools/map_extractor/System.cpp
@@ -235,7 +235,7 @@ void TryLoadDB2(char const* name, DB2CascFileSource* source, DB2FileLoader* db2,
}
catch (std::exception const& e)
{
- printf("Fatal error: Invalid %s file format! %s\n%s\n", name, CASC::HumanReadableCASCError(GetLastError()), e.what());
+ printf("Fatal error: Invalid %s file format! %s\n%s\n", name, CASC::HumanReadableCASCError(GetCascError()), e.what());
exit(1);
}
}
@@ -1215,7 +1215,7 @@ bool ExtractDB2File(uint32 fileDataId, char const* cascFileName, int locale, boo
DB2CascFileSource source(CascStorage, fileDataId, false);
if (!source.IsOpen())
{
- printf("Unable to open file %s in the archive for locale %s: %s\n", cascFileName, localeNames[locale], CASC::HumanReadableCASCError(GetLastError()));
+ printf("Unable to open file %s in the archive for locale %s: %s\n", cascFileName, localeNames[locale], CASC::HumanReadableCASCError(GetCascError()));
return false;
}
@@ -1351,7 +1351,7 @@ void ExtractCameraFiles()
++count;
}
else
- printf("Unable to open file %u in the archive: %s\n", cameraFileDataId, CASC::HumanReadableCASCError(GetLastError()));
+ printf("Unable to open file %u in the archive: %s\n", cameraFileDataId, CASC::HumanReadableCASCError(GetCascError()));
}
printf("Extracted %u camera files\n", count);
@@ -1407,7 +1407,7 @@ void ExtractGameTables()
++count;
}
else
- printf("Unable to open file %s in the archive: %s\n", gt.Name, CASC::HumanReadableCASCError(GetLastError()));
+ printf("Unable to open file %s in the archive: %s\n", gt.Name, CASC::HumanReadableCASCError(GetCascError()));
}
printf("Extracted %u files\n\n", count);
diff --git a/src/tools/vmap4_extractor/cascfile.cpp b/src/tools/vmap4_extractor/cascfile.cpp
index 2b1bb31cba7..35be390b397 100644
--- a/src/tools/vmap4_extractor/cascfile.cpp
+++ b/src/tools/vmap4_extractor/cascfile.cpp
@@ -28,8 +28,8 @@ CASCFile::CASCFile(std::shared_ptr<CASC::Storage const> casc, const char* filena
std::unique_ptr<CASC::File> file(casc->OpenFile(filename, CASC_LOCALE_ALL_WOW, false));
if (!file)
{
- if (warnNoExist || GetLastError() != ERROR_FILE_NOT_FOUND)
- fprintf(stderr, "Can't open %s: %s\n", filename, CASC::HumanReadableCASCError(GetLastError()));
+ if (warnNoExist || GetCascError() != ERROR_FILE_NOT_FOUND)
+ fprintf(stderr, "Can't open %s: %s\n", filename, CASC::HumanReadableCASCError(GetCascError()));
eof = true;
return;
}
@@ -46,8 +46,8 @@ CASCFile::CASCFile(std::shared_ptr<CASC::Storage const> casc, uint32 fileDataId,
std::unique_ptr<CASC::File> file(casc->OpenFile(fileDataId, CASC_LOCALE_ALL_WOW, false));
if (!file)
{
- if (warnNoExist || GetLastError() != ERROR_FILE_NOT_FOUND)
- fprintf(stderr, "Can't open %s: %s\n", description.c_str(), CASC::HumanReadableCASCError(GetLastError()));
+ if (warnNoExist || GetCascError() != ERROR_FILE_NOT_FOUND)
+ fprintf(stderr, "Can't open %s: %s\n", description.c_str(), CASC::HumanReadableCASCError(GetCascError()));
eof = true;
return;
}
@@ -60,7 +60,7 @@ void CASCFile::init(CASC::File* file, const char* description)
int64 fileSize = file->GetSize();
if (fileSize == -1)
{
- fprintf(stderr, "Can't open %s, failed to get size: %s!\n", description, CASC::HumanReadableCASCError(GetLastError()));
+ fprintf(stderr, "Can't open %s, failed to get size: %s!\n", description, CASC::HumanReadableCASCError(GetCascError()));
eof = true;
return;
}
@@ -71,7 +71,7 @@ void CASCFile::init(CASC::File* file, const char* description)
buffer = new char[size];
if (!file->ReadFile(buffer, size, &read) || size != read)
{
- fprintf(stderr, "Can't read %s, size=%u read=%u: %s\n", description, uint32(size), uint32(read), CASC::HumanReadableCASCError(GetLastError()));
+ fprintf(stderr, "Can't read %s, size=%u read=%u: %s\n", description, uint32(size), uint32(read), CASC::HumanReadableCASCError(GetCascError()));
eof = true;
return;
}
diff --git a/src/tools/vmap4_extractor/vmapexport.cpp b/src/tools/vmap4_extractor/vmapexport.cpp
index f633347f387..d3407beb895 100644
--- a/src/tools/vmap4_extractor/vmapexport.cpp
+++ b/src/tools/vmap4_extractor/vmapexport.cpp
@@ -484,7 +484,7 @@ int main(int argc, char ** argv)
}
catch (std::exception const& e)
{
- printf("Fatal error: Invalid Map.db2 file format! %s\n%s\n", CASC::HumanReadableCASCError(GetLastError()), e.what());
+ printf("Fatal error: Invalid Map.db2 file format! %s\n%s\n", CASC::HumanReadableCASCError(GetCascError()), e.what());
exit(1);
}