Fix linux build.

This commit is contained in:
lzwdgc 2021-02-15 15:56:24 +03:00
parent dc8733dd49
commit 2ca07e9b11
8 changed files with 37 additions and 15 deletions

View file

@ -21,6 +21,7 @@
#include <stdexcept>
#include <stdio.h>
#include <string.h>
const int build_version = 0
//#include <version.h.in>

View file

@ -18,10 +18,15 @@
#include "common.h"
#include <primitives/exceptions.h>
#ifdef _WIN32
#include <Windows.h>
#endif
std::string str2utf8(const std::string &codepage_str, int cp)
{
#ifdef _WIN32
auto utf16_str = str2utf16(codepage_str, cp);
int utf8_size = WideCharToMultiByte(CP_UTF8, 0, utf16_str.c_str(),
utf16_str.length(), nullptr, 0,
@ -31,10 +36,14 @@ std::string str2utf8(const std::string &codepage_str, int cp)
utf16_str.length(), &utf8_str[0], utf8_size,
nullptr, nullptr);
return utf8_str;
#else
SW_UNIMPLEMENTED;
#endif
}
std::wstring str2utf16(const std::string &codepage_str, int cp)
{
#ifdef _WIN32
int size;
std::wstring utf16_str;
@ -45,4 +54,7 @@ std::wstring str2utf16(const std::string &codepage_str, int cp)
codepage_str.length(), &utf16_str[0], size);
return utf16_str;
#else
SW_UNIMPLEMENTED;
#endif
}

View file

@ -23,10 +23,12 @@
#include <primitives/filesystem.h>
#include <assert.h>
#include <deque>
#include <vector>
#include <assert.h>
#include <limits.h>
template <class T>
class mat
{

View file

@ -1,9 +1,10 @@
#pragma once
#include <stdint.h>
#include "buffer.h"
#include <stdint.h>
#include <string.h>
#pragma pack(push, 1)
// http://paulbourke.net/dataformats/tga/

View file

@ -18,6 +18,8 @@
#include "types.h"
#include <string.h>
void weather::load(const buffer &b)
{
READ_STRING(b, name);

View file

@ -29,6 +29,13 @@
#include <variant>
// if we move this inside MechGroup, compilation error - default ctor is deleted
struct MechGroup_unk_type01
{
uint32_t unk0 = 0;
float unk1 = 0;
};
struct MechGroup
{
std::string name;
@ -39,13 +46,7 @@ struct MechGroup
// probably an old field
std::string org_ru;
struct unk_type01
{
uint32_t unk0 = 0;
float unk1 = 0;
};
std::variant<unk_type01, std::vector<uint32_t>, uint32_t> type_data;
std::variant<MechGroup_unk_type01, std::vector<uint32_t>, uint32_t> type_data;
bool hidden;
@ -64,7 +65,7 @@ struct MechGroup
case 0:
case 1:
{
unk_type01 t;
MechGroup_unk_type01 t;
READ(b, t.unk0);
READ(b, t.unk1);
type_data = t;

View file

@ -18,12 +18,14 @@
#include "mpj.h"
#include <primitives/filesystem.h>
#include <algorithm>
#include <assert.h>
#include <fstream>
#include <iomanip>
#include <primitives/filesystem.h>
#include <string.h>
segment *segment::create_segment(const buffer &b)
{

7
sw.cpp
View file

@ -50,8 +50,9 @@ void build(Solution &s)
script2txt += cpp20;
script2txt.setRootDirectory("src/script2txt");
script2txt += "pub.lzwdgc.Polygon4.DataManager.schema-master"_dep;
gen_flex_bison_pair("org.sw.demo.lexxmark.winflexbison"_dep, script2txt, "LALR1_CPP_VARIANT_PARSER", "script2txt");
script2txt.CompileOptions.push_back("/Zc:__cplusplus");
gen_flex_bison_pair("org.sw.demo.lexxmark.winflexbison"_dep, script2txt, "LALR1_CPP_VARIANT_PARSER", "script2txt");
if (script2txt.getCompilerType() == CompilerType::MSVC)
script2txt.CompileOptions.push_back("/Zc:__cplusplus");
auto &model = tools.addStaticLibrary("model");
model += cpp20;
@ -67,7 +68,7 @@ void build(Solution &s)
auto &mod_converter = add_exe("mod_converter");
mod_converter += model;
path sdk = "d:/arh/apps/Autodesk/FBX/FBX SDK/2019.0";
path sdk = "d:/arh/apps/Autodesk/FBX/FBX SDK/2020.2";
mod_converter += IncludeDirectory(sdk / "include");
String cfg = "release";
if (mod_converter.getBuildSettings().Native.ConfigurationType == ConfigurationType::Debug)