Skip to content

Commit aec2f72

Browse files
committed
fix error in SFML example when using Collection Of Images tilesets
closes fallahn#26
1 parent 252af6e commit aec2f72

3 files changed

Lines changed: 16 additions & 11 deletions

File tree

ParseTest/ParseTest.vcxproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,12 @@
8787
<WarningLevel>Level3</WarningLevel>
8888
<Optimization>Disabled</Optimization>
8989
<SDLCheck>true</SDLCheck>
90+
<AdditionalIncludeDirectories>..\tmxlite\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
9091
</ClCompile>
92+
<Link>
93+
<AdditionalLibraryDirectories>..\tmxlite\x64\bin\DebugStatic;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
94+
<AdditionalDependencies>libtmxlite-s-d.lib;%(AdditionalDependencies)</AdditionalDependencies>
95+
</Link>
9196
</ItemDefinitionGroup>
9297
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
9398
<ClCompile>
@@ -116,6 +121,7 @@
116121
<FunctionLevelLinking>true</FunctionLevelLinking>
117122
<IntrinsicFunctions>true</IntrinsicFunctions>
118123
<SDLCheck>true</SDLCheck>
124+
<AdditionalIncludeDirectories>..\tmxlite\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
119125
</ClCompile>
120126
<Link>
121127
<EnableCOMDATFolding>true</EnableCOMDATFolding>

SFMLExample/src/SFMLOrthogonalLayer.hpp

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ source distribution.
2828
/*
2929
Creates an SFML drawable from an Orthogonal tmx map layer.
3030
This is an example of drawing with SFML - not all features,
31-
such as tile flipping, are implemented. For a more detailed
32-
implementation, including artifact prevention, see:
33-
https://github.com/fallahn/xygine/blob/master/xygine/src/components/ComponentTileMapLayer.cpp
31+
such as tile flipping, are implemented.
3432
*/
3533

3634
#ifndef SFML_ORTHO_HPP_
@@ -56,15 +54,8 @@ implementation, including artifact prevention, see:
5654
#include <cmath>
5755

5856

59-
60-
6157
class MapLayer final : public sf::Drawable
6258
{
63-
64-
65-
66-
67-
6859
public:
6960

7061

@@ -88,7 +79,7 @@ class MapLayer final : public sf::Drawable
8879
}
8980
else
9081
{
91-
std::cout << "Not a valid othogonal layer, nothing will be drawn." << std::endl;
82+
std::cout << "Not a valid orthogonal layer, nothing will be drawn." << std::endl;
9283
}
9384
}
9485

@@ -136,6 +127,13 @@ class MapLayer final : public sf::Drawable
136127
//go through the tiles and create the appropriate arrays
137128
for (const auto ts : tilesets)
138129
{
130+
if(ts->getImagePath().empty())
131+
{
132+
Logger::log("This example does not support Collection of Images tilesets", Logger::Type::Info);
133+
Logger::log("Chunks using " + ts->getName() + " will not be created", Logger::Type::Info);
134+
continue;
135+
}
136+
139137
bool chunkArrayCreated = false;
140138
auto tileSize = ts->getTileSize();
141139

tmxlite.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ Global
3939
{4C5C8EE4-25F6-4121-B23D-89CD8D9FD74E}.Debug|ARM.ActiveCfg = Debug|Win32
4040
{4C5C8EE4-25F6-4121-B23D-89CD8D9FD74E}.Debug|ARM64.ActiveCfg = Debug|Win32
4141
{4C5C8EE4-25F6-4121-B23D-89CD8D9FD74E}.Debug|x64.ActiveCfg = Debug|x64
42+
{4C5C8EE4-25F6-4121-B23D-89CD8D9FD74E}.Debug|x64.Build.0 = Debug|x64
4243
{4C5C8EE4-25F6-4121-B23D-89CD8D9FD74E}.Debug|x86.ActiveCfg = Debug|Win32
4344
{4C5C8EE4-25F6-4121-B23D-89CD8D9FD74E}.Debug|x86.Build.0 = Debug|Win32
4445
{4C5C8EE4-25F6-4121-B23D-89CD8D9FD74E}.Release|ARM.ActiveCfg = Release|Win32

0 commit comments

Comments
 (0)