Tile animations implemented. Fix off-by-one error with tileset identification.

pull/28/head
sigonasr2 1 year ago
parent d8a1e99d74
commit 195364e0ab
  1. 665
      Crawler/ClassDiagram2.cd
  2. BIN
      Crawler/ClassDiagram2.png
  3. 80
      Crawler/Crawler.cpp
  4. 7
      Crawler/Crawler.h
  5. 1
      Crawler/Crawler.vcxproj
  6. 1
      Crawler/Crawler.vcxproj.filters
  7. 10
      Crawler/Map.h
  8. 3
      Crawler/TMXParser.h
  9. 8
      Crawler/TSXParser.h
  10. 2
      Crawler/Version.h
  11. 5
      Crawler/assets/config/configuration.txt

@ -0,0 +1,665 @@
<?xml version="1.0" encoding="utf-8"?>
<ClassDiagram MajorVersion="1" MinorVersion="1">
<Class Name="Crawler" Collapsed="true">
<Position X="3.5" Y="13.75" Width="1.5" />
<TypeIdentifier>
<HashCode>OihgwhJkUjgrCYAAVgEdFoQkBECSBhEDncMJIEmEYAg=</HashCode>
<FileName>Crawler.h</FileName>
</TypeIdentifier>
</Class>
<Class Name="Effect" Collapsed="true">
<Position X="13.75" Y="3.5" Width="1.5" />
<TypeIdentifier>
<HashCode>BAAAAAQAQAgEAAAEAIBAAAAAAAAEAAAAAAgAgAAACAA=</HashCode>
<FileName>C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\um\gdipluseffects.h</FileName>
</TypeIdentifier>
</Class>
<Class Name="LightningBoltEmitter" Collapsed="true">
<Position X="6.5" Y="13.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAEAAIAAABAAABAAAAAAAAAAAAAAEAI=</HashCode>
<FileName>Emitter.h</FileName>
</TypeIdentifier>
</Class>
<Class Name="olc::Decal" Collapsed="true">
<Position X="20.75" Y="1.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAQAAAAAAAAQAAAAAAAAAAAAABAAAAAAUAEAAAAAAgA=</HashCode>
<FileName>olcPixelGameEngine.h</FileName>
</TypeIdentifier>
</Class>
<Class Name="olc::GDIPlusStartup" Collapsed="true">
<Position X="26" Y="1.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAEBAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>olcPixelGameEngine.h</FileName>
</TypeIdentifier>
</Class>
<Class Name="olc::ImageLoader" Collapsed="true">
<Position X="11" Y="9.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAIAAAAAAAAAAAACAAAAAAAAAAIAAgAAAAAAAAAA=</HashCode>
<FileName>olcPixelGameEngine.h</FileName>
</TypeIdentifier>
</Class>
<Class Name="olc::ImageLoader_GDIPlus" Collapsed="true">
<Position X="13.25" Y="10.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAIAAAAAAAAAAAAAAAAIAAAAAAAAAgAAAAAAACAA=</HashCode>
<FileName>olcPixelGameEngine.h</FileName>
</TypeIdentifier>
</Class>
<Class Name="olc::ImageLoader_LibPNG" Collapsed="true">
<Position X="8.75" Y="10.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAABIAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAA=</HashCode>
<FileName>olcPixelGameEngine.h</FileName>
</TypeIdentifier>
</Class>
<Class Name="olc::ImageLoader_STB" Collapsed="true">
<Position X="11" Y="10.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAABA=</HashCode>
<FileName>olcPixelGameEngine.h</FileName>
</TypeIdentifier>
</Class>
<Class Name="olc::PGEX" Collapsed="true">
<Position X="0.5" Y="12.5" Width="1.5" />
<TypeIdentifier>
<HashCode>gAAAAAAAABAIAACAAAAgAAAAAAAAAAAAAAAAAAAAgAA=</HashCode>
<FileName>olcPixelGameEngine.h</FileName>
</TypeIdentifier>
</Class>
<Class Name="olc::PixelGameEngine" Collapsed="true">
<Position X="3.5" Y="12.5" Width="1.5" />
<TypeIdentifier>
<HashCode>S5fpQ8sYZfjd1v02mw8U0Ed9QaLH2ByFmPRdWNHpuzs=</HashCode>
<FileName>olcPixelGameEngine.h</FileName>
</TypeIdentifier>
</Class>
<Class Name="olc::Platform" Collapsed="true">
<Position X="5.25" Y="3.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAIgAAAEAAAABAAAAAAAACAIAAAAAAAAQAEiAAACAA=</HashCode>
<FileName>olcPixelGameEngine.h</FileName>
</TypeIdentifier>
</Class>
<Class Name="olc::Platform_Emscripten" Collapsed="true">
<Position X="9.75" Y="4.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAIgAAAEQACAQAAAAAAhACAIAQAAAAAAYAEiAAAAAA=</HashCode>
<FileName>olcPixelGameEngine.h</FileName>
</TypeIdentifier>
</Class>
<Class Name="olc::Platform_GLUT" Collapsed="true">
<Position X="0.75" Y="4.75" Width="1.5" />
<TypeIdentifier>
<HashCode>gAgIgAAAEAQAAAAAAAAAAACAJAAAQAAAAQAEiAAAAAA=</HashCode>
<FileName>olcPixelGameEngine.h</FileName>
</TypeIdentifier>
</Class>
<Class Name="olc::Platform_Headless" Collapsed="true">
<Position X="3" Y="4.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAIgAAAEAAAAAAAAAAAAACAIAAAAAAAAQAEiAAAAAA=</HashCode>
<FileName>olcPixelGameEngine.h</FileName>
</TypeIdentifier>
</Class>
<Class Name="olc::Platform_Linux" Collapsed="true">
<Position X="5.25" Y="4.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAIgSAAEAAAgAAAAAAAAACAICgAAAAAAUAEiAAAAAA=</HashCode>
<FileName>olcPixelGameEngine.h</FileName>
</TypeIdentifier>
</Class>
<Class Name="olc::Platform_Windows" Collapsed="true">
<Position X="7.5" Y="4.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAIgEAAEAAAABAAAAAAAAOAIAAAAAAAAUAEiAAAAQA=</HashCode>
<FileName>olcPixelGameEngine.h</FileName>
</TypeIdentifier>
</Class>
<Class Name="olc::Renderable" Collapsed="true">
<Position X="17.25" Y="2.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAQAgAAAAAQAAAAAAAAAAAgAAAAAAEAQEAAAAAAAAAA=</HashCode>
<FileName>olcPixelGameEngine.h</FileName>
</TypeIdentifier>
</Class>
<Class Name="olc::Renderer" Collapsed="true">
<Position X="3" Y="9.5" Width="1.5" />
<TypeIdentifier>
<HashCode>SAAgAAAAAIBASAAACAAAAgAAAAAEAIBAAIBAAAEACgA=</HashCode>
<FileName>olcPixelGameEngine.h</FileName>
</TypeIdentifier>
</Class>
<Class Name="olc::Renderer_Headless" Collapsed="true">
<Position X="0.75" Y="10.75" Width="1.5" />
<TypeIdentifier>
<HashCode>SAAAAAAAAIBASAAACAAAAgAAAAAEAIBAAIBAAAEAAgA=</HashCode>
<FileName>olcPixelGameEngine.h</FileName>
</TypeIdentifier>
</Class>
<Class Name="olc::Renderer_OGL10" Collapsed="true">
<Position X="3" Y="10.75" Width="1.5" />
<TypeIdentifier>
<HashCode>SAAAASAAQIBASCAACAAAAgAAAAAGAIBAAMJUAAEAAgA=</HashCode>
<FileName>olcPixelGameEngine.h</FileName>
</TypeIdentifier>
</Class>
<Class Name="olc::Renderer_OGL33" Collapsed="true">
<Position X="5.25" Y="10.75" Width="1.5" />
<TypeIdentifier>
<HashCode>SCghAyFBQIBWSCIAGAAAIgABQAAGBJhBAsJMEEEACgg=</HashCode>
<FileName>olcPixelGameEngine.h</FileName>
</TypeIdentifier>
</Class>
<Class Name="olc::ResourcePack" Collapsed="true">
<Position X="19" Y="2.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAgAAAAAEAAAIAAIBAIAgAAAAAAAAAAAACgIAIAAA=</HashCode>
<FileName>olcPixelGameEngine.h</FileName>
</TypeIdentifier>
</Class>
<Class Name="olc::Sprite" Collapsed="true">
<Position X="22.5" Y="2.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAABABBAEAAQgAQBQAAAAABAAAAAIAAQAAEAAgAAEAI=</HashCode>
<FileName>olcPixelGameEngine.h</FileName>
</TypeIdentifier>
</Class>
<Class Name="olc::TileTransformedView" Collapsed="true">
<Position X="0.5" Y="15.25" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAABAAAAAAAEAAAAAEAAAAAAAIAAAAEAIA=</HashCode>
<FileName>olcPGEX_TransformedView.h</FileName>
</TypeIdentifier>
</Class>
<Class Name="olc::TransformedView" Collapsed="true">
<Position X="0.5" Y="13.75" Width="1.5" />
<TypeIdentifier>
<HashCode>ABXBQAQAAFAGAzQACAMCyEQSUAAECDAQAsDE4AAIAog=</HashCode>
<FileName>olcPGEX_TransformedView.h</FileName>
</TypeIdentifier>
</Class>
<Class Name="olc::utils::Camera2D" Collapsed="true">
<Position X="20.75" Y="0.5" Width="1.5" />
<TypeIdentifier>
<HashCode>JDQCAAACoCBAAhIBBAAAAAiAAAgAECAAAAIAAXAAARY=</HashCode>
<FileName>olcUTIL_Camera2D.h</FileName>
</TypeIdentifier>
</Class>
<Class Name="olc::utils::datafile" Collapsed="true">
<Position X="22.5" Y="0.5" Width="1.5" />
<TypeIdentifier>
<HashCode>EgACAAIAMCAAAAIIAEAABAAgAQEAACAAAAACCAGAAIA=</HashCode>
<FileName>olcUTIL_DataFile.h</FileName>
</TypeIdentifier>
</Class>
<Class Name="olc::utils::datafiledoubledata" Collapsed="true">
<Position X="24.25" Y="0.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAIAAAAAAAAAAAAAAEAAAAAAEAAAAAAAAQAAAAAAA=</HashCode>
<FileName>olcUTIL_DataFile.h</FileName>
</TypeIdentifier>
</Class>
<Class Name="olc::utils::datafilefloatdata" Collapsed="true">
<Position X="26" Y="0.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAEAAAAAAECAAAAAAAQAAAAAAA=</HashCode>
<FileName>olcUTIL_DataFile.h</FileName>
</TypeIdentifier>
</Class>
<Class Name="olc::utils::datafileintdata" Collapsed="true">
<Position X="17.25" Y="1.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAEAAAAAAUAAAAAAAAQAAAAAAA=</HashCode>
<FileName>olcUTIL_DataFile.h</FileName>
</TypeIdentifier>
</Class>
<Class Name="olc::utils::datafilestringdata" Collapsed="true">
<Position X="19" Y="1.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAgAAAAAAAAAAAAAAAEAAAAAAEAAAAAAAAQAAAAAAA=</HashCode>
<FileName>olcUTIL_DataFile.h</FileName>
</TypeIdentifier>
</Class>
<Class Name="olc::utils::Animate2D::Animation&lt;StatesEnum&gt;" Collapsed="true">
<Position X="19" Y="0.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAEAAAAAEABAAAgIAAAAAAAAAAAAAAAAAABAAACAA=</HashCode>
<FileName>olcUTIL_Animate2D.h</FileName>
</TypeIdentifier>
</Class>
<Class Name="olc::utils::Animate2D::Frame" Collapsed="true">
<Position X="22.5" Y="1.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAEAAAEAAAAAIE=</HashCode>
<FileName>olcUTIL_Animate2D.h</FileName>
</TypeIdentifier>
</Class>
<Class Name="olc::utils::Animate2D::FrameSequence" Collapsed="true">
<Position X="24.25" Y="1.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAEAAAACAAAAEAAAAABAAAEAAAAAAAAEAAgBAAAAA=</HashCode>
<FileName>olcUTIL_Animate2D.h</FileName>
</TypeIdentifier>
</Class>
<Class Name="safemap&lt;T, O&gt;" Collapsed="true">
<Position X="20.75" Y="2.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAEAAAABAAEAAAAAAAAAAAAAEAAAAAAAAAAAAAAAA=</HashCode>
<FileName>safemap.h</FileName>
</TypeIdentifier>
</Class>
<Class Name="sig::Animation" Collapsed="true">
<Position X="17.25" Y="0.5" Width="1.5" />
<TypeIdentifier>
<HashCode>ACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAA=</HashCode>
<FileName>Animation.h</FileName>
</TypeIdentifier>
</Class>
<Class Name="TMXParser" Collapsed="true">
<Position X="24.25" Y="2.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAEAABYQAAAAAEAAAAACABIAAAKAAAAAAAAAA=</HashCode>
<FileName>TMXParser.h</FileName>
</TypeIdentifier>
</Class>
<Class Name="TSXParser" Collapsed="true">
<Position X="26" Y="2.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAIAAAAEEAAAAAAAAAAAAAAAAAAAAAAAIgAACAAQAAA=</HashCode>
<FileName>TSXParser.h</FileName>
</TypeIdentifier>
</Class>
<Struct Name="Ability" Collapsed="true">
<Position X="17.25" Y="3.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAABAAAAAAAAwACABAAAAAAACAEAAACAAAAAAAAAAA=</HashCode>
<FileName>Ability.h</FileName>
</TypeIdentifier>
</Struct>
<Struct Name="AnimationData" Collapsed="true">
<Position X="19" Y="3.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAEAAAAAAAAAEAAAAAAAAAAAAAAA=</HashCode>
<FileName>Animation.h</FileName>
</TypeIdentifier>
</Struct>
<Struct Name="Arrow" Collapsed="true">
<Position X="9.75" Y="7.75" Width="1.5" />
<TypeIdentifier>
<HashCode>CAQAQAAAAAABAAAAAIgAAAAAAAAAAAAAAAgAAAAAAAA=</HashCode>
<FileName>BulletTypes.h</FileName>
</TypeIdentifier>
</Struct>
<Struct Name="Buff" Collapsed="true">
<Position X="22.5" Y="3.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAIAAAAAAAAAAAAAAAAAAAABCAAAAAAAAAAAAAA=</HashCode>
<FileName>Buff.h</FileName>
</TypeIdentifier>
</Struct>
<Struct Name="Bullet" Collapsed="true">
<Position X="5.25" Y="6.5" Width="1.5" />
<TypeIdentifier>
<HashCode>CgREEAAACAAAggAAIKgABYACAAAAABAMAEAAgQBQAgA=</HashCode>
<FileName>Bullet.h</FileName>
</TypeIdentifier>
</Struct>
<Struct Name="CastInfo" Collapsed="true">
<Position X="24.25" Y="3.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAABAAAEAAAAAIAACAAAAAA=</HashCode>
<FileName>Player.h</FileName>
</TypeIdentifier>
</Struct>
<Struct Name="ChargedArrow" Collapsed="true">
<Position X="0.75" Y="7.75" Width="1.5" />
<TypeIdentifier>
<HashCode>CAQAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAABAAAAAAAE=</HashCode>
<FileName>BulletTypes.h</FileName>
</TypeIdentifier>
</Struct>
<Struct Name="DamageNumber" Collapsed="true">
<Position X="26" Y="3.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAgAAAAAIAAAwAAAAAAAAIACAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>DamageNumber.h</FileName>
</TypeIdentifier>
</Struct>
<Struct Name="Emitter" Collapsed="true">
<Position X="6.5" Y="12.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAQAAAgAAAAAAAAAAAAAABAABAAAAACIAAgAAAAAAAA=</HashCode>
<FileName>Emitter.h</FileName>
</TypeIdentifier>
</Struct>
<Struct Name="EnergyBolt" Collapsed="true">
<Position X="5.25" Y="7.75" Width="1.5" />
<TypeIdentifier>
<HashCode>CAQAAAAACAAAAAAAAAgAAAAAAAAEAAAAAAAAAAAAAAA=</HashCode>
<FileName>BulletTypes.h</FileName>
</TypeIdentifier>
</Struct>
<Struct Name="FireBolt" Collapsed="true">
<Position X="7.5" Y="7.75" Width="1.5" />
<TypeIdentifier>
<HashCode>CAQAAAAAAAAAAAAAAAgAAAAAAAAEAAAAAAAAAAAQAAA=</HashCode>
<FileName>BulletTypes.h</FileName>
</TypeIdentifier>
</Struct>
<Struct Name="LayerTag" Collapsed="true">
<Position X="22.5" Y="4.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAACAAAAAAAAAAAAAAAAAAAgAAACAAAAAAAAAAAAA=</HashCode>
<FileName>TMXParser.h</FileName>
</TypeIdentifier>
</Struct>
<Struct Name="LightningBolt" Collapsed="true">
<Position X="3" Y="7.75" Width="1.5" />
<TypeIdentifier>
<HashCode>CAQAAAAAAAAAAAAAAAgAAAAAAAAkAAAAAAAAAAAAAAA=</HashCode>
<FileName>BulletTypes.h</FileName>
</TypeIdentifier>
</Struct>
<Struct Name="Map" Collapsed="true">
<Position X="24.25" Y="4.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAQAAAQAAAAQAAACAAAAAAAAAAAAAAAACACAAEAAAAA=</HashCode>
<FileName>TMXParser.h</FileName>
</TypeIdentifier>
</Struct>
<Struct Name="MapTag" Collapsed="true">
<Position X="26" Y="4.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAIAAAAAAQAQAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>TMXParser.h</FileName>
</TypeIdentifier>
</Struct>
<Struct Name="Meteor" Collapsed="true">
<Position X="12.5" Y="4.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAQAAAAAAAAAQgAAAAEAAAAAAAAAAAAAAAAAAACAAAA=</HashCode>
<FileName>Effect.h</FileName>
</TypeIdentifier>
</Struct>
<Struct Name="Monster" Collapsed="true">
<Position X="17.25" Y="5.75" Width="1.5" />
<Compartments>
<Compartment Name="Nested Types" Collapsed="false" />
</Compartments>
<NestedTypes>
<Struct Name="Monster::STRATEGY" Collapsed="true">
<TypeIdentifier>
<NewMemberFileName>Monster.h</NewMemberFileName>
</TypeIdentifier>
</Struct>
</NestedTypes>
<TypeIdentifier>
<HashCode>FSSAFFAEAKB4CxYAIKAOBIgBIYYC8gAEikFMCRCwkgE=</HashCode>
<FileName>Monster.h</FileName>
</TypeIdentifier>
</Struct>
<Struct Name="MonsterData" Collapsed="true">
<Position X="19" Y="5.75" Width="1.5" />
<TypeIdentifier>
<HashCode>EAAACGAAsABAAQEQAIAAgAAQAAAEECAQgABAAiAQIkA=</HashCode>
<FileName>Monster.h</FileName>
</TypeIdentifier>
</Struct>
<Struct Name="MonsterSpawner" Collapsed="true">
<Position X="20.75" Y="5.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAIQAAAAAAAAIgIAIgAAAAAAAAAAAgBAgAAgAA=</HashCode>
<FileName>Monster.h</FileName>
</TypeIdentifier>
</Struct>
<Struct Name="olc::DecalInstance" Collapsed="true">
<Position X="17.25" Y="4.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AgAAAACAAAAAAACAAAAAAIAAAAAQBAAAAAgAAAAAAgA=</HashCode>
<FileName>olcPixelGameEngine.h</FileName>
</TypeIdentifier>
</Struct>
<Struct Name="olc::HWButton" Collapsed="true">
<Position X="19" Y="4.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAgAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAgA=</HashCode>
<FileName>olcPixelGameEngine.h</FileName>
</TypeIdentifier>
</Struct>
<Struct Name="olc::LayerDesc" Collapsed="true">
<Position X="20.75" Y="4.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AkAIAAAAAAAAABAABQAACAAAAAABQAAAAAAAAAAAAAA=</HashCode>
<FileName>olcPixelGameEngine.h</FileName>
</TypeIdentifier>
</Struct>
<Struct Name="olc::Pixel" Collapsed="true">
<Position X="24.25" Y="5.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAIAAAAAAAAAAAAAABAQAAAAAAAAAAAAAgAAAAAAA=</HashCode>
<FileName>olcPixelGameEngine.h</FileName>
</TypeIdentifier>
</Struct>
<Struct Name="olc::ResourceBuffer" Collapsed="true">
<Position X="17.25" Y="6.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAIAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAA=</HashCode>
<FileName>olcPixelGameEngine.h</FileName>
</TypeIdentifier>
</Struct>
<Struct Name="olc::utils::Animate2D::AnimationState" Collapsed="true">
<Position X="20.75" Y="3.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAA=</HashCode>
<FileName>olcUTIL_Animate2D.h</FileName>
</TypeIdentifier>
</Struct>
<Struct Name="Pathfinding" Collapsed="true">
<Position X="22.5" Y="5.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAQAEAAgAAAAAAAAAAAAAQAAAAAAAIAA=</HashCode>
<FileName>Pathfinding.h</FileName>
</TypeIdentifier>
</Struct>
<Struct Name="Player" Collapsed="true">
<Position X="6.5" Y="0.5" Width="1.5" />
<TypeIdentifier>
<HashCode>EO9g1XQE4IJq4TbQBqAlYY0RO0YCNkh05FFEjTtkojQ=</HashCode>
<FileName>Player.h</FileName>
</TypeIdentifier>
</Struct>
<Struct Name="PrecastData" Collapsed="true">
<Position X="26" Y="5.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAIAAAAAAAEAIAAAAABAAAAAAAAAAAgAAAAAAA=</HashCode>
<FileName>Ability.h</FileName>
</TypeIdentifier>
</Struct>
<Struct Name="PulsatingFire" Collapsed="true">
<Position X="14.75" Y="4.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAQBAAAAAAAAAgAAAAAAAEAAAAAAAAAAAAAAEAAAAAE=</HashCode>
<FileName>Effect.h</FileName>
</TypeIdentifier>
</Struct>
<Struct Name="Ranger" Collapsed="true">
<Position X="3.25" Y="1.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAkAwQEAQAAIqQBQAAAEIAQACAAEMgAABAAEAAkgAgA=</HashCode>
<FileName>Player.h</FileName>
</TypeIdentifier>
</Struct>
<Struct Name="SpawnerTag" Collapsed="true">
<Position X="19" Y="6.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAQAAIAAAAAIAAAAAAAAAAACAAAAAAAAAAAAA=</HashCode>
<FileName>TMXParser.h</FileName>
</TypeIdentifier>
</Struct>
<Struct Name="Thief" Collapsed="true">
<Position X="7.75" Y="1.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAkAwQEAYAAIoQBQAAAEIAQACAAEMgAABAAEAAkgAgA=</HashCode>
<FileName>Player.h</FileName>
</TypeIdentifier>
</Struct>
<Struct Name="TileCollisionData" Collapsed="true">
<Position X="20.75" Y="6.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>Map.h</FileName>
</TypeIdentifier>
</Struct>
<Struct Name="TileGroup" Collapsed="true">
<Position X="22.5" Y="6.75" Width="1.5" />
<TypeIdentifier>
<HashCode>CDAAAAAISAgAAAAAAAAAAAAAAgAAACAAAAkAADAAQAA=</HashCode>
<FileName>Map.h</FileName>
</TypeIdentifier>
</Struct>
<Struct Name="TileRenderData" Collapsed="true">
<Position X="24.25" Y="6.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAEAAAAAAAAAAAAAIAAQAAAAAAAIAAAAAAAAAA=</HashCode>
<FileName>Map.h</FileName>
</TypeIdentifier>
</Struct>
<Struct Name="Tileset" Collapsed="true">
<Position X="26" Y="6.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAIAAAgAAAAAAgAAAAIAAAQAAAAAAAAAABAAAAAA=</HashCode>
<FileName>TSXParser.h</FileName>
</TypeIdentifier>
</Struct>
<Struct Name="TilesetData" Collapsed="true">
<Position X="17.25" Y="7.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAgAAAAAAAAAAAAAAAAIAAAAAAAAAAIAAEAQIAAAA=</HashCode>
<FileName>Map.h</FileName>
</TypeIdentifier>
</Struct>
<Struct Name="TilesheetData" Collapsed="true">
<Position X="19" Y="7.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAIAAAAAAAAAA=</HashCode>
<FileName>Crawler.h</FileName>
</TypeIdentifier>
</Struct>
<Struct Name="Trapper" Collapsed="true">
<Position X="1" Y="1.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAkAwQEAQAAIoQBQAAAEIAQECAAEMgAABAAEAAkgAgA=</HashCode>
<FileName>Player.h</FileName>
</TypeIdentifier>
</Struct>
<Struct Name="Warrior" Collapsed="true">
<Position X="12.25" Y="1.75" Width="1.5" />
<TypeIdentifier>
<HashCode>ACkAgQEAQAAIoQBQAAAEAAQACAAEIgAAAAAEAAkAAgA=</HashCode>
<FileName>Player.h</FileName>
</TypeIdentifier>
</Struct>
<Struct Name="Witch" Collapsed="true">
<Position X="10" Y="1.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAkAwQEAQAAIoQBQAAAEKAQACAAEMgAABAAEAAkgAgA=</HashCode>
<FileName>Player.h</FileName>
</TypeIdentifier>
</Struct>
<Struct Name="Wizard" Collapsed="true">
<Position X="5.5" Y="1.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAkAwQEAQAAIoQBQAAAEIAQACAAEMgAABAIEAAkgAgA=</HashCode>
<FileName>Player.h</FileName>
</TypeIdentifier>
</Struct>
<Struct Name="XMLTag" Collapsed="true">
<Position X="20.75" Y="7.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AACAACAgACAAAIAAAAAAAAAAAAAAACAAAAAQAAAAQAA=</HashCode>
<FileName>TMXParser.h</FileName>
</TypeIdentifier>
</Struct>
<Enum Name="Attribute" Collapsed="true">
<Position X="17.25" Y="9" Width="1.5" />
<TypeIdentifier>
<HashCode>AQQBgAAAAAoAAIAAAAAAAAIAJAAAAACAAAAAAAAAAAI=</HashCode>
<FileName>MonsterAttribute.h</FileName>
</TypeIdentifier>
</Enum>
<Enum Name="BuffType" Collapsed="true">
<Position X="19" Y="9" Width="1.5" />
<TypeIdentifier>
<HashCode>AAgAIAAAAAAAAAAAAAAAAAAAAEAgAAAAAAAAAAAAAAA=</HashCode>
<FileName>Buff.h</FileName>
</TypeIdentifier>
</Enum>
<Enum Name="Class" Collapsed="true">
<Position X="20.75" Y="9" Width="1.5" />
<TypeIdentifier>
<HashCode>AACAAAAAAAAAAAAAAAgAAAAEAAggAAAAAAAAAAAACAA=</HashCode>
<FileName>Class.h</FileName>
</TypeIdentifier>
</Enum>
<Enum Name="MapName" Collapsed="true">
<Position X="17.25" Y="9.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAABAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>Map.h</FileName>
</TypeIdentifier>
</Enum>
<Enum Name="MonsterAnimation" Collapsed="true">
<Position X="19" Y="9.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAEAAAAAAAAgAAACAAAAAAAQAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>Monster.h</FileName>
</TypeIdentifier>
</Enum>
<Enum Name="olc::DecalMode" Collapsed="true">
<Position X="22.5" Y="9" Width="1.5" />
<TypeIdentifier>
<HashCode>AAgAAAAAACCAAAAAABAAAIAAAAAAAAAAAAAgAAAABAA=</HashCode>
<FileName>olcPixelGameEngine.h</FileName>
</TypeIdentifier>
</Enum>
<Enum Name="olc::DecalStructure" Collapsed="true">
<Position X="24.25" Y="9" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAACAAAAAAAAAAAAAIAAAAEQAAAAAAAAAAAAAAA=</HashCode>
<FileName>olcPixelGameEngine.h</FileName>
</TypeIdentifier>
</Enum>
<Enum Name="olc::Key" Collapsed="true">
<Position X="26" Y="9" Width="1.5" />
<TypeIdentifier>
<HashCode>IgBKPCYRIAQCigCAAQAAwU8kkgMKYJhzAAAAvv//YQE=</HashCode>
<FileName>olcPixelGameEngine.h</FileName>
</TypeIdentifier>
</Enum>
<Enum Name="olc::rcode" Collapsed="true">
<Position X="20.75" Y="9.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAgCA=</HashCode>
<FileName>olcPixelGameEngine.h</FileName>
</TypeIdentifier>
</Enum>
<Enum Name="olc::utils::Animate2D::Style" Collapsed="true">
<Position X="24.25" Y="9.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAQAAAAAAAAACAAAAAAAAICAAAAAAA=</HashCode>
<FileName>olcUTIL_Animate2D.h</FileName>
</TypeIdentifier>
</Enum>
<Enum Name="State::State" Collapsed="true">
<Position X="22.5" Y="9.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAABAQCAAgCAACABABEBKAgACAAAABAgAAAAAAAA=</HashCode>
<FileName>State.h</FileName>
</TypeIdentifier>
</Enum>
<Font Name="Segoe UI" Size="9" />
</ClassDiagram>

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 KiB

@ -213,8 +213,8 @@ void Crawler::HandleUserInput(float fElapsedTime){
int truncatedPlayerY=int(player->GetY())/24;
int tileID=layer.tiles[truncatedPlayerY][truncatedPlayerX];
TilesheetData dat=GetTileSheet(GetCurrentLevel(),tileID);
if (dat.tileset.staircaseTiles.find(tileID)!=dat.tileset.staircaseTiles.end()){
return dat.tileset.staircaseTiles[tileID].data["value"];
if (dat.tileset->staircaseTiles.find(tileID)!=dat.tileset->staircaseTiles.end()){
return dat.tileset->staircaseTiles[tileID].data["value"];
}
}
return std::string("NONE");
@ -522,6 +522,32 @@ void Crawler::PopulateRenderLists(std::vector<Monster*>&monstersBeforeLower,std:
std::sort(monstersAfterLower.begin(),monstersAfterLower.end(),[](Monster*m1,Monster*m2){return m1->GetPos().y<m2->GetPos().y;});
}
void Crawler::RenderTile(vi2d pos,TilesheetData tileSheet,int tileSheetIndex,vi2d tileSheetPos){
if(tileSheet.tileset->animationData.count(tileSheetIndex)){
int animationDuration_ms=tileSheet.tileset->animationData[tileSheetIndex].size()*"animation_tile_precision"_I;
int animatedIndex=tileSheet.tileset->animationData[tileSheetIndex][int(fmod(levelTime*1000,animationDuration_ms)/"animation_tile_precision"_I)];
int tileSheetWidth=tileSheet.tileset->tileset->Sprite()->width/24;
int tileSheetX=animatedIndex%tileSheetWidth;
int tileSheetY=animatedIndex/tileSheetWidth;
view.DrawPartialDecal(pos*24,{24,24},tileSheet.tileset->tileset->Decal(),vi2d{tileSheetX,tileSheetY}*24,{24,24});
}else{
view.DrawPartialDecal(pos*24,{24,24},tileSheet.tileset->tileset->Decal(),tileSheetPos*24,{24,24});
}
}
void Crawler::RenderTile(TileRenderData&tileSheet,Pixel col){
if(tileSheet.tileSheet.tileset->animationData.count(tileSheet.tileID)){
int animationDuration_ms=tileSheet.tileSheet.tileset->animationData[tileSheet.tileID].size()*"animation_tile_precision"_I;
int animatedIndex=tileSheet.tileSheet.tileset->animationData[tileSheet.tileID][int(fmod(levelTime*1000,animationDuration_ms)/"animation_tile_precision"_I)];
int tileSheetWidth=tileSheet.tileSheet.tileset->tileset->Sprite()->width/24;
int tileSheetX=animatedIndex%tileSheetWidth;
int tileSheetY=animatedIndex/tileSheetWidth;
view.DrawPartialDecal(tileSheet.pos,{24,24},tileSheet.tileSheet.tileset->tileset->Decal(),vi2d{tileSheetX,tileSheetY},{24,24},col);
}else{
view.DrawPartialDecal(tileSheet.pos,{24,24},tileSheet.tileSheet.tileset->tileset->Decal(),tileSheet.tileSheetPos,{24,24},col);
}
}
void Crawler::RenderWorld(float fElapsedTime){
Clear({100,180,100});
LayerTag*bridgeLayer=nullptr;
@ -548,17 +574,17 @@ void Crawler::RenderWorld(float fElapsedTime){
int tileID=layer.tiles[y][x]-1;
if(tileID!=-1){
TilesheetData tileSheet=GetTileSheet(currentLevel,tileID);
int tileSheetWidth=tileSheet.tileset.tileset->Sprite()->width/24;
int tileSheetHeight=tileSheet.tileset.tileset->Sprite()->height/24;
int tileSheetWidth=tileSheet.tileset->tileset->Sprite()->width/24;
int tileSheetHeight=tileSheet.tileset->tileset->Sprite()->height/24;
int tileSheetIndex=tileID-(tileSheet.firstgid-1);
int tileSheetX=tileSheetIndex%tileSheetWidth;
int tileSheetY=tileSheetIndex/tileSheetWidth;
if(!IsForegroundTile(tileSheet,tileSheetIndex)&&!IsUpperForegroundTile(tileSheetIndex)){
view.DrawPartialDecal(vi2d{x,y}*24,{24,24},tileSheet.tileset.tileset->Decal(),vi2d{tileSheetX,tileSheetY}*24,{24,24});
RenderTile({x,y},tileSheet,tileSheetIndex,{tileSheetX,tileSheetY});
}
if("debug_collision_boxes"_I){
if(tileSheet.tileset.collision.find(tileSheetIndex)!=tileSheet.tileset.collision.end()){
geom2d::rect<int>collision=tileSheet.tileset.collision[tileSheetIndex].collision;
if(tileSheet.tileset->collision.find(tileSheetIndex)!=tileSheet.tileset->collision.end()){
geom2d::rect<int>collision=tileSheet.tileset->collision[tileSheetIndex].collision;
view.FillRectDecal(vi2d{x,y}*24+collision.pos,collision.size,{0,0,0,128});
view.DrawRectDecal(vi2d{x,y}*24+collision.pos,collision.size,GREY);
}
@ -655,7 +681,7 @@ void Crawler::RenderWorld(float fElapsedTime){
group.fadeFactor=std::max(group.fadeFactor-fElapsedTime,0.f);
}
for(TileRenderData&tile:group.GetTiles()){
view.DrawPartialDecal(tile.pos,{24,24},tile.tileset,tile.tileSheetPos,{24,24},{255,255,255,uint8_t(255-group.fadeFactor/TileGroup::FADE_TIME*TileGroup::FADE_AMT)});
RenderTile(tile,{255,255,255,uint8_t(255-group.fadeFactor/TileGroup::FADE_TIME*TileGroup::FADE_AMT)});
}
}
}
@ -668,12 +694,12 @@ void Crawler::RenderWorld(float fElapsedTime){
int tileID=bridgeLayer->tiles[y][x]-1;
if(tileID!=-1){
TilesheetData tileSheet=GetTileSheet(currentLevel,tileID);
int tileSheetWidth=tileSheet.tileset.tileset->Sprite()->width/24;
int tileSheetHeight=tileSheet.tileset.tileset->Sprite()->height/24;
int tileSheetWidth=tileSheet.tileset->tileset->Sprite()->width/24;
int tileSheetHeight=tileSheet.tileset->tileset->Sprite()->height/24;
int tileSheetIndex=tileID-(tileSheet.firstgid-1);
int tileSheetX=tileSheetIndex%tileSheetWidth;
int tileSheetY=tileSheetIndex/tileSheetWidth;
view.DrawPartialDecal(vi2d{x,y}*24,{24,24},tileSheet.tileset.tileset->Decal(),vi2d{tileSheetX,tileSheetY}*24,{24,24},{255,255,255,uint8_t(255-bridgeFadeFactor/TileGroup::FADE_TIME*TileGroup::FADE_AMT)});
view.DrawPartialDecal(vi2d{x,y}*24,{24,24},tileSheet.tileset->tileset->Decal(),vi2d{tileSheetX,tileSheetY}*24,{24,24},{255,255,255,uint8_t(255-bridgeFadeFactor/TileGroup::FADE_TIME*TileGroup::FADE_AMT)});
#ifdef DEBUG_COLLISIONS
if(tileSheet.tileset.collision.find(tileSheetIndex)!=tileSheet.tileset.collision.end()){
geom2d::rect<int>collision=tileSheet.tileset.collision[tileSheetIndex].collision;
@ -718,7 +744,7 @@ void Crawler::RenderWorld(float fElapsedTime){
group.fadeFactor=std::max(group.fadeFactor-fElapsedTime,0.f);
}
for(TileRenderData&tile:group.GetTiles()){
view.DrawPartialDecal(tile.pos,{24,24},tile.tileset,tile.tileSheetPos,{24,24},{255,255,255,uint8_t(255-group.fadeFactor/TileGroup::FADE_TIME*TileGroup::FADE_AMT)});
RenderTile(tile,{255,255,255,uint8_t(255-group.fadeFactor/TileGroup::FADE_TIME*TileGroup::FADE_AMT)});
}
}
#pragma endregion
@ -937,8 +963,8 @@ void Crawler::LoadLevel(MapName map){
int tileID=layer.tiles[y][x]-1;
if(tileID!=-1){
TilesheetData tileSheet=GetTileSheet(currentLevel,tileID);
int tileSheetWidth=tileSheet.tileset.tileset->Sprite()->width/24;
int tileSheetHeight=tileSheet.tileset.tileset->Sprite()->height/24;
int tileSheetWidth=tileSheet.tileset->tileset->Sprite()->width/24;
int tileSheetHeight=tileSheet.tileset->tileset->Sprite()->height/24;
int tileSheetIndex=tileID-(tileSheet.firstgid-1);
int realTileSheetIndex=(tileID%1000000)-(tileSheet.firstgid-1);
int tileSheetX=realTileSheetIndex%tileSheetWidth;
@ -961,13 +987,13 @@ void Crawler::LoadLevel(MapName map){
if(!loopAll&&&layer==&layer2){layer2ID++;continue;};
int tileID=layer2.tiles[pos.y][pos.x]-1;
TilesheetData tileSheet=GetTileSheet(currentLevel,tileID%1000000);
int tileSheetWidth=tileSheet.tileset.tileset->Sprite()->width/24;
int tileSheetHeight=tileSheet.tileset.tileset->Sprite()->height/24;
int tileSheetWidth=tileSheet.tileset->tileset->Sprite()->width/24;
int tileSheetHeight=tileSheet.tileset->tileset->Sprite()->height/24;
int tileSheetIndex=tileID-(tileSheet.firstgid-1);
int realTileSheetIndex=(tileID%1000000)-(tileSheet.firstgid-1);
int tileSheetX=realTileSheetIndex%tileSheetWidth;
int tileSheetY=realTileSheetIndex/tileSheetWidth;
TileRenderData tile={tileSheet.tileset.tileset->Decal(),vi2d{pos.x,pos.y}*24,vi2d{tileSheetX,tileSheetY}*24,layer2ID};
TileRenderData tile={tileSheet,vi2d{pos.x,pos.y}*24,vi2d{tileSheetX,tileSheetY}*24,realTileSheetIndex,layer2ID};
if(IsForeground(tileSheet,tileSheetIndex)){
foregroundTilesIncluded.insert({pos.x,pos.y});
group.InsertTile(tile);
@ -996,7 +1022,7 @@ void Crawler::LoadLevel(MapName map){
groups.push_back(group);
}
};
TileRenderData tile={tileSheet.tileset.tileset->Decal(),vi2d{x,y}*24,vi2d{tileSheetX,tileSheetY}*24,layerID};
TileRenderData tile={tileSheet,vi2d{x,y}*24,vi2d{tileSheetX,tileSheetY}*24,realTileSheetIndex,layerID};
SetupTileGroups([&](TilesheetData sheet,int tileID){return IsForegroundTile(sheet,tileID);},tile,foregroundTilesAdded,foregroundTileGroups);
SetupTileGroups([&](TilesheetData sheet,int tileID){return IsUpperForegroundTile(tileID);},tile,upperForegroundTilesAdded,upperForegroundTileGroups);
#pragma endregion
@ -1047,7 +1073,7 @@ bool Crawler::IsUpperForegroundTile(int tileID){
}
bool Crawler::IsForegroundTile(TilesheetData sheet,int tileID){
return sheet.tileset.foregroundTiles.find(tileID)!=sheet.tileset.foregroundTiles.end();
return sheet.tileset->foregroundTiles.find(tileID)!=sheet.tileset->foregroundTiles.end();
}
TilesheetData Crawler::GetTileSheet(MapName map,int tileID){
@ -1055,18 +1081,18 @@ TilesheetData Crawler::GetTileSheet(MapName map,int tileID){
if(tileData.size()==1){
size_t slashMarkerSourceDir = tileData[0].data["source"].find_last_of('/');
std::string baseSourceDir=tileData[0].data["source"].substr(slashMarkerSourceDir+1);
return {MAP_TILESETS["assets/maps/"+baseSourceDir],1};
return {&MAP_TILESETS["assets/maps/"+baseSourceDir],1};
} else {
for (int i=1;i<tileData.size();i++){
if(tileID<stoi(tileData[i].data["firstgid"])){
if(tileID<stoi(tileData[i].data["firstgid"])-1){
size_t slashMarkerSourceDir = tileData[i-1].data["source"].find_last_of('/');
std::string baseSourceDir=tileData[i-1].data["source"].substr(slashMarkerSourceDir+1);
return {MAP_TILESETS["assets/maps/"+baseSourceDir],stoi(tileData[i-1].data["firstgid"])};
return {&MAP_TILESETS["assets/maps/"+baseSourceDir],stoi(tileData[i-1].data["firstgid"])};
}
}
size_t slashMarkerSourceDir = tileData[tileData.size()-1].data["source"].find_last_of('/');
std::string baseSourceDir=tileData[tileData.size()-1].data["source"].substr(slashMarkerSourceDir+1);
return {MAP_TILESETS["assets/maps/"+baseSourceDir],stoi(tileData[tileData.size()-1].data["firstgid"])};
return {&MAP_TILESETS["assets/maps/"+baseSourceDir],stoi(tileData[tileData.size()-1].data["firstgid"])};
}
}
@ -1096,8 +1122,8 @@ geom2d::rect<int>Crawler::GetTileCollision(MapName map,vf2d pos,bool upperLevel)
if(upperLevel&&bridgeLayerIndex!=-1){
int tileID=MAP_DATA[map].LayerData[bridgeLayerIndex].tiles[int(pos.y)/24][int(pos.x)/24]-1;
if(tileID!=-1){
if (GetTileSheet(map,tileID%1000000).tileset.collision.find(tileID%1000000-GetTileSheet(map,tileID%1000000).firstgid+1)!=GetTileSheet(map,tileID%1000000).tileset.collision.end()){
return GetTileSheet(map,tileID%1000000).tileset.collision[tileID%1000000-GetTileSheet(map,tileID%1000000).firstgid+1].collision;
if (GetTileSheet(map,tileID%1000000).tileset->collision.find(tileID%1000000-GetTileSheet(map,tileID%1000000).firstgid+1)!=GetTileSheet(map,tileID%1000000).tileset->collision.end()){
return GetTileSheet(map,tileID%1000000).tileset->collision[tileID%1000000-GetTileSheet(map,tileID%1000000).firstgid+1].collision;
}
return NO_COLLISION;
}
@ -1108,8 +1134,8 @@ geom2d::rect<int>Crawler::GetTileCollision(MapName map,vf2d pos,bool upperLevel)
auto HasNoClass=[&](){return layer.tag.data.find("class")==layer.tag.data.end();};
if(HasNoClass()&&counter!=bridgeLayerIndex){
int tileID=layer.tiles[int(pos.y)/24][int(pos.x)/24]-1;
if(tileID!=-1&&GetTileSheet(map,tileID%1000000).tileset.collision.find(tileID%1000000-GetTileSheet(map,tileID%1000000).firstgid+1)!=GetTileSheet(map,tileID%1000000).tileset.collision.end()){
geom2d::rect<int>collisionRect=GetTileSheet(map,tileID%1000000).tileset.collision[tileID%1000000-GetTileSheet(map,tileID%1000000).firstgid+1].collision;
if(tileID!=-1&&GetTileSheet(map,tileID%1000000).tileset->collision.find(tileID%1000000-GetTileSheet(map,tileID%1000000).firstgid+1)!=GetTileSheet(map,tileID%1000000).tileset->collision.end()){
geom2d::rect<int>collisionRect=GetTileSheet(map,tileID%1000000).tileset->collision[tileID%1000000-GetTileSheet(map,tileID%1000000).firstgid+1].collision;
if(foundRect.pos==NO_COLLISION.pos&&foundRect.size==NO_COLLISION.size){
foundRect=collisionRect;
}else{

@ -12,11 +12,6 @@
#include "TMXParser.h"
#include "olcUTIL_DataFile.h"
struct TilesheetData{
TilesetData&tileset;
int firstgid;
};
class Crawler : public olc::PixelGameEngine
{
friend class sig::Animation;
@ -112,6 +107,8 @@ public:
datafiledoubledata GetDoubleList(std::string key);
static void OutputDebugInfo(const char*key,std::size_t len);
void InitializeLevels();
void RenderTile(vi2d pos,TilesheetData tileSheet,int tileSheetIndex,vi2d tileSheetPos);
void RenderTile(TileRenderData&tileSheet,Pixel col);
struct TileGroupData{
vi2d tilePos;

@ -327,6 +327,7 @@
<ClCompile Include="Wizard.cpp" />
</ItemGroup>
<ItemGroup>
<None Include="ClassDiagram2.cd" />
<None Include="cpp.hint" />
</ItemGroup>
<ItemGroup>

@ -242,6 +242,7 @@
</ItemGroup>
<ItemGroup>
<None Include="cpp.hint" />
<None Include="ClassDiagram2.cd" />
</ItemGroup>
<ItemGroup>
<Text Include="InitialConcept.txt">

@ -20,13 +20,19 @@ struct TilesetData{
std::map<int,XMLTag>upperForegroundTiles;
std::map<int,TileCollisionData>collision;
std::map<int,XMLTag>staircaseTiles;
std::map<int,std::vector<std::pair<int,int>>> animationData;
std::map<int,std::vector<int>>animationData;
};
struct TilesheetData{
TilesetData*tileset;
int firstgid;
};
struct TileRenderData{
Decal*tileset;
TilesheetData tileSheet;
vi2d pos;
vi2d tileSheetPos;
int tileID;
int layerID;
};

@ -331,6 +331,9 @@ typedef std::map<std::string,std::vector<geom2d::rect<int>>> ZoneData;
continueSpawnerLoop:
continue;
}
std::sort(parsedMapInfo.TilesetData.begin(),parsedMapInfo.TilesetData.end(),[](XMLTag&t1,XMLTag&t2){return t1.GetInteger("firstgid")<t2.GetInteger("firstgid");});
std::cout<<"Parsed Map Data:\n"<<parsedMapInfo<<"\n";
}
#endif

@ -4,6 +4,7 @@
#include "TMXParser.h"
#include "Map.h"
#include "olcUTIL_Geometry2D.h"
#include "olcUTIL_DataFile.h"
using namespace olc;
@ -13,7 +14,7 @@ struct Tileset{
std::map<int,XMLTag> UpperForegroundTileData;
std::map<int,TileCollisionData> CollisionData;
std::map<int,XMLTag> StaircaseData;
std::map<int,std::vector<std::pair<int,int>>> AnimationData;
std::map<int,std::vector<int>> AnimationData;
friend std::ostream& operator << (std::ostream& os, Tileset& rhs);
};
@ -104,7 +105,10 @@ class TSXParser{
previousTagID=newTag.GetInteger("id");
} else
if (newTag.tag=="frame"){
parsedTilesetInfo.AnimationData[previousTagID].push_back({newTag.GetInteger("tileid"),newTag.GetInteger("duration")});
//The way animation data is stored is every "animation_tile_precision" ms indicating which frame we should be on.
for(int i=0;i<newTag.GetInteger("duration")/"animation_tile_precision"_I;i++){
parsedTilesetInfo.AnimationData[previousTagID].push_back(newTag.GetInteger("tileid"));
}
} else
if (newTag.tag=="property"&&staircaseTag=="tile"){
parsedTilesetInfo.StaircaseData[previousTagID]=newTag;

@ -2,7 +2,7 @@
#define VERSION_MAJOR 0
#define VERSION_MINOR 2
#define VERSION_PATCH 0
#define VERSION_BUILD 1201
#define VERSION_BUILD 1225
#define stringify(a) stringify_(a)
#define stringify_(a) #a

@ -37,4 +37,7 @@ debug_player_info = 0
debug_collision_boxes = 0
# Shows pathfinding debugging
debug_pathfinding = 0
debug_pathfinding = 0
# ms precision of animation tile caching.
animation_tile_precision = 50
Loading…
Cancel
Save