Some reordering in the directory.
This breaks the build.
This commit is contained in:
parent
9aa245caca
commit
59801755cc
8 changed files with 0 additions and 0 deletions
56
src/asciimap_parser.hpp
Normal file
56
src/asciimap_parser.hpp
Normal file
|
@ -0,0 +1,56 @@
|
|||
#ifndef idB6D0694FDF6B4902A244C7A51C9727FE
|
||||
#define idB6D0694FDF6B4902A244C7A51C9727FE
|
||||
|
||||
#define BOOST_SPIRIT_USE_PHOENIX_V3
|
||||
#include <boost/config/warning_disable.hpp>
|
||||
#include <boost/spirit/include/qi.hpp>
|
||||
#include <boost/spirit/include/support_istream_iterator.hpp>
|
||||
#include <boost/spirit/include/support_line_pos_iterator.hpp>
|
||||
#include <boost/spirit/repository/include/qi_iter_pos.hpp>
|
||||
#include <boost/spirit/include/support_multi_pass.hpp>
|
||||
#include <boost/spirit/include/phoenix.hpp>
|
||||
#include <boost/spirit/include/phoenix_stl.hpp>
|
||||
|
||||
namespace dk { namespace implem {
|
||||
struct get_line_f {
|
||||
template <typename> struct result { typedef size_t type; };
|
||||
template <typename I> size_t operator()(const I& parStart, const I& parPosIter) const {
|
||||
return boost::spirit::get_column(parStart, parPosIter) - 1;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename I, typename T>
|
||||
struct AsciiMapGrammar : boost::spirit::qi::grammar<I, std::vector<T>()> {
|
||||
explicit AsciiMapGrammar ( const I& parItStart );
|
||||
|
||||
boost::spirit::qi::rule<I, std::vector<T>()> start;
|
||||
std::vector<int> lengths;
|
||||
boost::phoenix::function<get_line_f> getline;
|
||||
boost::spirit::qi::int_parser<T, 10, 1, 1> digit_int;
|
||||
};
|
||||
|
||||
template <typename I, typename T>
|
||||
AsciiMapGrammar<I, T>::AsciiMapGrammar (const I& parItStart) :
|
||||
AsciiMapGrammar::base_type(start)
|
||||
{
|
||||
using boost::phoenix::push_back;
|
||||
using boost::spirit::qi::_1;
|
||||
using boost::spirit::qi::eol;
|
||||
using boost::spirit::qi::eoi;
|
||||
using boost::spirit::qi::raw;
|
||||
using boost::phoenix::begin;
|
||||
using boost::spirit::qi::int_parser;
|
||||
|
||||
start %= *digit_int %
|
||||
raw[
|
||||
eol
|
||||
][push_back(boost::phoenix::ref(lengths), getline(boost::phoenix::val(parItStart), begin(_1)))]
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
}} //namespace dk::implem
|
||||
|
||||
#undef BOOST_SPIRIT_USE_PHOENIX_V3
|
||||
|
||||
#endif
|
|
@ -1 +0,0 @@
|
|||
#include "doorkeeper.hpp"
|
|
@ -1,12 +0,0 @@
|
|||
#ifndef idFEDC74BA6A4345AD8D76106228CB2E89
|
||||
#define idFEDC74BA6A4345AD8D76106228CB2E89
|
||||
|
||||
#if !defined(NDEBUG)
|
||||
# define DATA_PATH "@CMAKE_SOURCE_DIR@"
|
||||
#else
|
||||
# define DATA_PATH ""
|
||||
#endif
|
||||
|
||||
#define APP_NAME "@PROJECT_NAME@"
|
||||
|
||||
#endif
|
49
src/main.cpp
49
src/main.cpp
|
@ -1,49 +0,0 @@
|
|||
#include "doorkeeper.hpp"
|
||||
#include "doorkeeperConfig.h"
|
||||
#include "platform.h"
|
||||
#include "platformstrings.h"
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <memory>
|
||||
|
||||
int main() {
|
||||
typedef dk::Tyler<2> Tiler;
|
||||
typedef std::unique_ptr<std::ifstream> ifstreamptr;
|
||||
|
||||
std::cout << "Welcome to " << APP_NAME << ' ' << DK_DEVICE_STRING << " version for " << DK_OS_STRING << ' ' << DK_ARCH_STRING << ' ' << DK_BIT_STRING;
|
||||
#if defined(DK_ARM)
|
||||
std::cout << ' ' << DK_ARM_FAMILY_STRING << ' ' << DK_ARM_ARCH_STRING;
|
||||
#endif
|
||||
std::cout << '\n';
|
||||
|
||||
Tiler tiler(Tiler::coords(10, 6), Tiler::coords(64));
|
||||
|
||||
const std::string map1(DATA_PATH"/test.map");
|
||||
const std::string map2(DATA_PATH"/test_2.map");
|
||||
|
||||
std::cout << "Loading " << map1 << '\n';
|
||||
auto bottom_layer = &tiler.push_layer<int>(dk::Layer<int, 2>::streamer_type(ifstreamptr(new std::ifstream(map1))));
|
||||
//std::cout << "Loading " << map2 << '\n';
|
||||
//tiler.push_layer<char>(dk::Layer<char, 2>::streamer_type(ifstreamptr(new std::ifstream(map2))), dk::Vector<int, 2>(2));
|
||||
|
||||
dk::Viewport<2> viewport(tiler, Tiler::coords(0), Tiler::coords(10, 6));
|
||||
dk::Viewport<2> viewport_small(tiler, Tiler::coords(1), Tiler::coords(9, 5));
|
||||
{
|
||||
int col = 0;
|
||||
const auto tilecount = bottom_layer->count();
|
||||
for (auto tile : *bottom_layer) {
|
||||
std::cout << tile;
|
||||
++col;
|
||||
if (col == tilecount.x()) {
|
||||
col = 0;
|
||||
std::cout << '\n';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if !defined(NDEBUG)
|
||||
std::cout << "Map size: " << tiler.map_size() << '\n';
|
||||
#endif
|
||||
std::cout << "Total tiles: " << tiler.tiles_count() << '\n';
|
||||
return 0;
|
||||
}
|
152
src/platform.h
152
src/platform.h
|
@ -1,152 +0,0 @@
|
|||
#ifndef id054C8BCA27C84EAA825922EC0A4F3317
|
||||
#define id054C8BCA27C84EAA825922EC0A4F3317
|
||||
|
||||
#if defined(__GNUC__)
|
||||
# include <endian.h>
|
||||
#else
|
||||
# error "Please add endianness detection for your compiler"
|
||||
#endif
|
||||
|
||||
#define DK_ARM_ARCH_6 0
|
||||
#define DK_ARM_ARCH_6J 1
|
||||
#define DK_ARM_ARCH_6K 2
|
||||
#define DK_ARM_ARCH_6Z 3
|
||||
#define DK_ARM_ARCH_6ZK 4
|
||||
#define DK_ARM_ARCH_6T2 5
|
||||
#define DK_ARM_ARCH_7 6
|
||||
#define DK_ARM_ARCH_7A 7
|
||||
#define DK_ARM_ARCH_7R 8
|
||||
#define DK_ARM_ARCH_7M 9
|
||||
#define DK_ARM_ARCH_7S 10
|
||||
|
||||
#if defined(__ANDROID__)
|
||||
# define DK_POSIX
|
||||
# define DK_ANDROID
|
||||
# define DK_MOBILE
|
||||
#elif defined(SAILFISHOS)
|
||||
# define DK_POSIX
|
||||
# define DK_SAILFISHOS
|
||||
# define DK_MOBILE
|
||||
#elif defined(__gnu_linux__) || defined(__linux__) || defined(linux)
|
||||
# define DK_POSIX
|
||||
# define DK_LINUX
|
||||
# define DK_PC
|
||||
#elif defined(_WIN16) || defined(_WIN32) || defined(_WIN64) || \
|
||||
defined(__WIN32__) || defined(__TOS_WIN__) || defined(__WINDOWS__)
|
||||
# if defined(_WIN32) || defined(__WIN32__)
|
||||
# define DK_WIN32
|
||||
# endif
|
||||
# define DK_WINDOWS
|
||||
# define DK_PC
|
||||
#else
|
||||
# error "Unknown platform"
|
||||
#endif
|
||||
|
||||
#if defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || \
|
||||
defined(__x86_64) || defined(_M_X64) || defined(_M_AMD64)
|
||||
# define DK_X86_64
|
||||
# define DK_64_BIT
|
||||
#elif defined(__arm__)
|
||||
# if defined(__ARMEL__) && __ARMEL__ == 1
|
||||
# define DK_ARM_EL
|
||||
# else
|
||||
# define DK_ARM_HF
|
||||
# endif
|
||||
|
||||
# if defined(__ARM_ARCH_6__)
|
||||
# define DK_ARM_ARCH DK_ARM_ARCH_6
|
||||
# elif defined(__ARM_ARCH_6J__)
|
||||
# define DK_ARM_ARCH DK_ARM_ARCH_6J
|
||||
# elif defined(__ARM_ARCH_6K__)
|
||||
# define DK_ARM_ARCH DK_ARM_ARCH_6K
|
||||
# elif defined(__ARM_ARCH_6Z__)
|
||||
# define DK_ARM_ARCH DK_ARM_ARCH_6Z
|
||||
# elif defined(__ARM_ARCH_6ZK__)
|
||||
# define DK_ARM_ARCH DK_ARM_ARCH_6ZK
|
||||
# elif defined(__ARM_ARCH_6T2__)
|
||||
# define DK_ARM_ARCH DK_ARM_ARCH_6T2
|
||||
# elif defined(__ARM_ARCH_7__)
|
||||
# define DK_ARM_ARCH DK_ARM_ARCH_7
|
||||
# elif defined(__ARM_ARCH_7A__)
|
||||
# define DK_ARM_ARCH DK_ARM_ARCH_7A
|
||||
# elif defined(__ARM_ARCH_7R__)
|
||||
# define DK_ARM_ARCH DK_ARM_ARCH_7R
|
||||
# elif defined(__ARM_ARCH_7M__)
|
||||
# define DK_ARM_ARCH DK_ARM_ARCH_7M
|
||||
# elif defined(__ARM_ARCH_7S__)
|
||||
# define DK_ARM_ARCH DK_ARM_ARCH_7S
|
||||
# else
|
||||
# error "Unknown ARM version"
|
||||
# endif
|
||||
# define DK_32_BIT
|
||||
# define DK_ARM
|
||||
#elif defined(_M_ARM)
|
||||
# if _M_ARM != 6 && _M_ARM != 7
|
||||
# error "Unknown ARM version"
|
||||
# endif
|
||||
# if _M_ARM == 6
|
||||
# define DK_ARM_ARCH DK_ARM_ARCH_6
|
||||
# elif _M_ARM == 7
|
||||
# define DK_ARM_ARC DK_ARM_ARCH_7
|
||||
# endif
|
||||
# define DK_32_BIT
|
||||
# define DK_ARM
|
||||
#elif defined(__TARGET_ARCH_ARM)
|
||||
# if __TARGET_ARCH_ARM != 6 && __TARGET_ARCH_ARM != 7
|
||||
# error "Unknown ARM version"
|
||||
# endif
|
||||
# define DK_ARM_VERSION __TARGET_ARCH_ARM
|
||||
# define DK_32_BIT
|
||||
# define DK_ARM
|
||||
#elif defined(__aarch64__)
|
||||
# define DK_ARM
|
||||
# define DK_64_BIT
|
||||
#elif defined(i386) || defined(__i386) || defined(__i386__) || \
|
||||
defined(__i486__) || defined(__i586__) || defined(__i686__) || \
|
||||
defined(_M_I86) || defined(_M_IX86) || defined(_X86_) || defined(__INTEL__)
|
||||
# define DK_X86
|
||||
# define DK_32_BIT
|
||||
#elif defined(__ia64__) || defined(_IA64) || defined(__IA64__) || \
|
||||
defined(_M_IA64) || defined(__itanium__)
|
||||
# define DK_IA64
|
||||
# define DK_64_BIT
|
||||
#else
|
||||
# error "Unknown architecture"
|
||||
#endif
|
||||
|
||||
#if defined(DK_ARM_ARCH)
|
||||
# if DK_ARM_ARCH == DK_ARM_ARCH_6 || DK_ARM_ARCH == DK_ARM_ARCH_6J || \
|
||||
DK_ARM_ARCH == DK_ARM_ARCH_6K || DK_ARM_ARCH == DK_ARM_ARCH_6Z || \
|
||||
DK_ARM_ARCH == DK_ARM_ARCH_6ZK || DK_ARM_ARCH == DK_ARM_ARCH_6T2
|
||||
# define DK_ARM_VERSION 6
|
||||
# elif DK_ARM_ARCH == DK_ARM_ARCH_7 || DK_ARM_ARCH == DK_ARM_ARCH_7A || \
|
||||
DK_ARM_ARCH == DK_ARM_ARCH_7R || DK_ARM_ARCH == DK_ARM_ARCH_7M || \
|
||||
DK_ARM_ARCH == DK_ARM_ARCH_7S
|
||||
# define DK_ARM_VERSION 7
|
||||
# else
|
||||
# error "Unknown ARM version"
|
||||
# endif
|
||||
# if defined(__GNUC__)
|
||||
# if defined(__ARM_PCS_VFP)
|
||||
# define DK_ARM_HARDFLOAT
|
||||
# elif defined(__ARM_PCS)
|
||||
# define DK_ARM_SOFTFLOAT
|
||||
# else
|
||||
# error "Unkown floating point mode"
|
||||
# endif
|
||||
# else
|
||||
# error "Unknown compiler"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(__ARMEB__) || \
|
||||
(defined(__BYTE_ORDER) && __BYTE_ORDER == __BIG_ENDIAN)
|
||||
# define DK_BIG_ENDIAN
|
||||
#elif defined(__ARMEL__) || \
|
||||
(defined(__BYTE_ORDER) && __BYTE_ORDER == __LITTLE_ENDIAN)
|
||||
# define DK_LITTLE_ENDIAN
|
||||
#else
|
||||
# error "Unknown endianness"
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -1,88 +0,0 @@
|
|||
#ifndef id2802AD0DCAF7443CA095A5AAF417015E
|
||||
#define id2802AD0DCAF7443CA095A5AAF417015E
|
||||
|
||||
#define STR1_LOC(x) #x
|
||||
#define STRINGIZE(x) STR1_LOC(x)
|
||||
|
||||
#if defined(DK_64_BIT)
|
||||
# define DK_BIT_STRING "64-bit"
|
||||
#elif defined(DK_32_BIT)
|
||||
# define DK_BIT_STRING "32-bit"
|
||||
#else
|
||||
# error "No registry size defined"
|
||||
#endif
|
||||
|
||||
#if defined(DK_ARM)
|
||||
# if defined(DK_32_BIT)
|
||||
# if defined(DK_LITTLE_ENDIAN)
|
||||
# define DK_ARCH_STRING "ARMv" STRINGIZE(DK_ARM_VERSION) " (v" \
|
||||
STRINGIZE(DK_ARM_VERSION) "l)"
|
||||
# elif defined(DK_BIG_ENDIAN)
|
||||
# define DK_ARCH_STRING "ARMv" STRINGIZE(DK_ARM_VERSION) " (v" \
|
||||
STRINGIZE(DK_ARM_VERSION) "b)"
|
||||
# else
|
||||
# error "Unkonwn endianness"
|
||||
# endif
|
||||
# else
|
||||
# define DK_ARCH_STRING "ARM"
|
||||
# error "Never tested, please make sure this branch is correct"
|
||||
# endif
|
||||
#elif defined(DK_X86)
|
||||
# define DK_ARCH_STRING "x86"
|
||||
#elif defined(DK_X86_64)
|
||||
# define DK_ARCH_STRING "amd64"
|
||||
#elif defined(DK_IA64)
|
||||
# define DK_ARCH_STRING "ia64"
|
||||
#else
|
||||
# error "No architecture defined"
|
||||
#endif
|
||||
|
||||
#if defined(DK_LINUX)
|
||||
# define DK_OS_STRING "Linux"
|
||||
#elif defined(DK_WINDOWS)
|
||||
# define DK_OS_STRING "Windows"
|
||||
#elif defined(DK_ANDROID)
|
||||
# define DK_OS_STRING "Android"
|
||||
#endif
|
||||
|
||||
#if defined(DK_PC)
|
||||
# define DK_DEVICE_STRING "PC"
|
||||
#elif defined(DK_MOBILE)
|
||||
# define DK_DEVICE_STRING "Mobile"
|
||||
#else
|
||||
# error "No device type defined"
|
||||
#endif
|
||||
|
||||
#if defined(DK_ARM_ARCH)
|
||||
# if DK_ARM_ARCH == DK_ARM_ARCH_6 || DK_ARM_ARCH == DK_ARM_ARCH_6J
|
||||
# define DK_ARM_FAMILY_STRING "ARM11"
|
||||
# define DK_ARM_ARCH_STRING "ARMv6"
|
||||
# elif DK_ARM_ARCH == DK_ARM_ARCH_6Z
|
||||
# define DK_ARM_FAMILY_STRING "ARM11"
|
||||
# define DK_ARM_ARCH_STRING "ARMv6Z"
|
||||
# elif DK_ARM_ARCH == DK_ARM_ARCH_6K
|
||||
# define DK_ARM_FAMILY_STRING "ARM11"
|
||||
# define DK_ARM_ARCH_STRING "ARMv6K"
|
||||
# elif DK_ARM_ARCH == DK_ARM_ARCH_6ZK
|
||||
# error "Missing data - please fill in"
|
||||
# elif DK_ARM_ARCH == DK_ARM_ARCH_6T2
|
||||
# define DK_ARM_FAMILY_STRING "ARM11"
|
||||
# define DK_ARM_ARCH_STRING "ARMv6T2"
|
||||
# elif DK_ARM_ARCH == DK_ARM_ARCH_7
|
||||
# error "Missing data - please fill in"
|
||||
# elif DK_ARM_ARCH == DK_ARM_ARCH_7M
|
||||
# define DK_ARM_FAMILY_STRING "Cortex-M"
|
||||
# define DK_ARM_ARCH_STRING "ARMv7-M"
|
||||
# elif DK_ARM_ARCH == DK_ARM_ARCH_7R
|
||||
# define DK_ARM_FAMILY_STRING "Cortex-R"
|
||||
# define DK_ARM_ARCH_STRING "ARMv7-R"
|
||||
# elif DK_ARM_ARCH == DK_ARM_ARCH_7A
|
||||
# define DK_ARM_FAMILY_STRING "Cortex-A"
|
||||
# define DK_ARM_ARCH_STRING "ARMv7-A"
|
||||
# elif DK_ARM_ARCH == DK_ARM_ARCH_7S
|
||||
# define DK_ARM_FAMILY_STRING "Apple-A6"
|
||||
# define DK_ARM_ARCH_STRING "ARMv7-A"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue