mirror of
https://github.com/ondra-novak/gates_of_skeldal.git
synced 2025-07-05 06:00:33 -04:00
windows fixes
This commit is contained in:
parent
1a4b93fe75
commit
41e18e094f
2 changed files with 4 additions and 4 deletions
|
@ -5,7 +5,7 @@ project(skeldal)
|
||||||
find_package(SDL2 REQUIRED)
|
find_package(SDL2 REQUIRED)
|
||||||
|
|
||||||
if (MSVC)
|
if (MSVC)
|
||||||
add_compile_options(/W4 /EHa /DNOMINMAX /J)
|
add_compile_options(/W4 /EHa /DNOMINMAX /D_CRT_SECURE_NO_WARNINGS /J)
|
||||||
set(STANDARD_LIBRARIES "")
|
set(STANDARD_LIBRARIES "")
|
||||||
else()
|
else()
|
||||||
add_compile_options(-Wall -Wextra -Werror -Wno-unused-result -Wno-unused-parameter -Wno-unused-value -Wno-extern-c-compat -funsigned-char)
|
add_compile_options(-Wall -Wextra -Werror -Wno-unused-result -Wno-unused-parameter -Wno-unused-value -Wno-extern-c-compat -funsigned-char)
|
||||||
|
|
|
@ -49,10 +49,10 @@ void new_ddl(std::string ddl_file, std::string path) {
|
||||||
while (iter != end) {
|
while (iter != end) {
|
||||||
const auto &entry = *iter;
|
const auto &entry = *iter;
|
||||||
if (entry.is_regular_file()) {
|
if (entry.is_regular_file()) {
|
||||||
uint32_t sz = entry.file_size();
|
uint32_t sz = static_cast<uint32_t>(entry.file_size());
|
||||||
std::string fname = entry.path().filename().string();
|
std::string fname = entry.path().filename().string();
|
||||||
if (fname.size() <= 12) {
|
if (fname.size() <= 12) {
|
||||||
std::transform(fname.begin(), fname.end(), fname.begin(),[](char c)->char{return std::toupper(c);});
|
std::transform(fname.begin(), fname.end(), fname.begin(),[](char c)->char{return static_cast<char>(std::toupper(c));});
|
||||||
dir.push_back(DirEntry{entry.path(), fname, sz,0});
|
dir.push_back(DirEntry{entry.path(), fname, sz,0});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -67,7 +67,7 @@ void new_ddl(std::string ddl_file, std::string path) {
|
||||||
std::size_t dataofs = 8 + dir.size()*(12+4);
|
std::size_t dataofs = 8 + dir.size()*(12+4);
|
||||||
|
|
||||||
for (auto &x: dir) {
|
for (auto &x: dir) {
|
||||||
x.offset = dataofs;
|
x.offset = static_cast<std::uint32_t>(dataofs);
|
||||||
dataofs+=4+x.size;
|
dataofs+=4+x.size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue