mirror of
https://github.com/aimrebirth/tools.git
synced 2026-04-15 01:43:25 +00:00
Fix OS X build.
This commit is contained in:
parent
dea9368cd3
commit
d76c25bd7a
6 changed files with 12 additions and 4 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1 +1,2 @@
|
||||||
win*
|
win*
|
||||||
|
build
|
||||||
|
|
@ -17,6 +17,8 @@ if (MSVC)
|
||||||
|
|
||||||
#set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
|
#set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
|
||||||
#set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
|
#set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
|
||||||
|
else()
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11")
|
||||||
endif(MSVC)
|
endif(MSVC)
|
||||||
|
|
||||||
include_directories(dep/dbmgr/include)
|
include_directories(dep/dbmgr/include)
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
include_directories(common)
|
include_directories(common)
|
||||||
|
|
||||||
|
if (WIN32)
|
||||||
file(GLOB unpaker_src "unpaker/*")
|
file(GLOB unpaker_src "unpaker/*")
|
||||||
add_executable(unpaker ${unpaker_src})
|
add_executable(unpaker ${unpaker_src})
|
||||||
|
|
||||||
if (WIN32)
|
|
||||||
file(GLOB db_extractor_src "db_extractor/*")
|
file(GLOB db_extractor_src "db_extractor/*")
|
||||||
add_executable(db_extractor ${db_extractor_src})
|
add_executable(db_extractor ${db_extractor_src})
|
||||||
target_link_libraries(db_extractor common)
|
target_link_libraries(db_extractor common)
|
||||||
|
|
|
||||||
|
|
@ -63,9 +63,10 @@ struct storage
|
||||||
|
|
||||||
storage read_mmo(string fn)
|
storage read_mmo(string fn)
|
||||||
{
|
{
|
||||||
|
buffer f(readFile(fn));
|
||||||
storage s;
|
storage s;
|
||||||
s.name = fn;
|
s.name = fn;
|
||||||
s.load(buffer(readFile(fn)));
|
s.load(f);
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ void tm2tga(string fn)
|
||||||
dst.write(uint8_t((hi << 4) | hi));
|
dst.write(uint8_t((hi << 4) | hi));
|
||||||
}
|
}
|
||||||
|
|
||||||
transform(fn.begin(), fn.end(), fn.begin(), tolower);
|
transform(fn.begin(), fn.end(), fn.begin(), ::tolower);
|
||||||
fn = fn.substr(0, fn.rfind(".tm")) + ".tga";
|
fn = fn.substr(0, fn.rfind(".tm")) + ".tga";
|
||||||
writeFile(fn, dst.getBuf());
|
writeFile(fn, dst.getBuf());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -124,16 +124,20 @@ void segment::decompress(int segment_id)
|
||||||
load_segment();
|
load_segment();
|
||||||
|
|
||||||
if (flags & 0xC)
|
if (flags & 0xC)
|
||||||
|
{
|
||||||
if (flags & 0x4)
|
if (flags & 0x4)
|
||||||
decode_f1((char*)decoded, size2, (char*)encoded);
|
decode_f1((char*)decoded, size2, (char*)encoded);
|
||||||
else
|
else
|
||||||
decode_f2((char*)decoded, size2, (char*)encoded);
|
decode_f2((char*)decoded, size2, (char*)encoded);
|
||||||
|
}
|
||||||
if (flags & 0x3)
|
if (flags & 0x3)
|
||||||
|
{
|
||||||
if (flags & 0x1)
|
if (flags & 0x1)
|
||||||
decode_f3((char*)encoded, size1, (char*)decoded);
|
decode_f3((char*)encoded, size1, (char*)decoded);
|
||||||
else
|
else
|
||||||
decode_f4((char*)encoded, size1, (char*)decoded, segment_id * header_size);
|
decode_f4((char*)encoded, size1, (char*)decoded, segment_id * header_size);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void pak::load(FILE *f)
|
void pak::load(FILE *f)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue