Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,17 @@ set (PROJECT_SRC "${CMAKE_SOURCE_DIR}/src/api/_bsa_handle_int.cpp"
"${CMAKE_SOURCE_DIR}/src/api/genericbsa.cpp"
"${CMAKE_SOURCE_DIR}/src/api/libbsa.cpp"
"${CMAKE_SOURCE_DIR}/src/api/tes3bsa.cpp"
"${CMAKE_SOURCE_DIR}/src/api/tes4bsa.cpp")
"${CMAKE_SOURCE_DIR}/src/api/tes4bsa.cpp"
"${CMAKE_SOURCE_DIR}/src/api/ssebsa.cpp")

set (PROJECT_HEADERS "${CMAKE_SOURCE_DIR}/include/libbsa/libbsa.h"
"${CMAKE_SOURCE_DIR}/src/api/_bsa_handle_int.h"
"${CMAKE_SOURCE_DIR}/src/api/bsa_asset.h"
"${CMAKE_SOURCE_DIR}/src/api/error.h"
"${CMAKE_SOURCE_DIR}/src/api/genericbsa.h"
"${CMAKE_SOURCE_DIR}/src/api/tes3bsa.h"
"${CMAKE_SOURCE_DIR}/src/api/tes4bsa.h")
"${CMAKE_SOURCE_DIR}/src/api/tes4bsa.h"
"${CMAKE_SOURCE_DIR}/src/api/ssebsa.h")

set (TEST_SRC "${CMAKE_SOURCE_DIR}/src/test/main.cpp")

Expand Down
3 changes: 3 additions & 0 deletions src/api/_bsa_handle_int.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "_bsa_handle_int.h"
#include "tes3bsa.h"
#include "tes4bsa.h"
#include "ssebsa.h"

#include <boost/algorithm/string.hpp>

Expand All @@ -34,6 +35,8 @@ _bsa_handle_int::_bsa_handle_int(const boost::filesystem::path& path) :
extAssetsNum(0) {
if (tes3::BSA::IsBSA(path))
bsa = new tes3::BSA(path);
else if (sse::BSA::IsBSA(path))
bsa = new sse::BSA(path);
else
bsa = new tes4::BSA(path);
}
Expand Down
4 changes: 3 additions & 1 deletion src/api/libbsa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "genericbsa.h"
#include "tes3bsa.h"
#include "tes4bsa.h"
#include "ssebsa.h"
#include "error.h"

#include <bitset>
Expand Down Expand Up @@ -67,6 +68,7 @@ const unsigned int LIBBSA_RETURN_MAX = LIBBSA_ERROR_PARSE_FAIL;
const unsigned int LIBBSA_VERSION_TES3 = 0x00000001;
const unsigned int LIBBSA_VERSION_TES4 = 0x00000002;
const unsigned int LIBBSA_VERSION_TES5 = 0x00000004;
const unsigned int LIBBSA_VERSION_SSE = 0x00000005;
/* Use only one compression flag. */
const unsigned int LIBBSA_COMPRESS_LEVEL_0 = 0x00000010;
const unsigned int LIBBSA_COMPRESS_LEVEL_1 = 0x00000020;
Expand Down Expand Up @@ -173,7 +175,7 @@ LIBBSA unsigned int bsa_save(bsa_handle bh,
return c_error(LIBBSA_ERROR_INVALID_ARGS, "Morrowind BSAs cannot be compressed.");

//Check that the version flag is valid.
std::bitset<3> version(flags & (LIBBSA_VERSION_TES3 | LIBBSA_VERSION_TES4 | LIBBSA_VERSION_TES5));
std::bitset<3> version(flags & (LIBBSA_VERSION_TES3 | LIBBSA_VERSION_TES4 | LIBBSA_VERSION_TES5 | LIBBSA_VERSION_SSE));
if (version.none())
return c_error(LIBBSA_ERROR_INVALID_ARGS, "Must specify one version.");
if (version.count() > 1)
Expand Down
Loading