<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.9.7" xml:lang="en-US">
  <compounddef id="d8/d44/ResourceManager_8cpp" kind="file" language="C++">
    <compoundname>ResourceManager.cpp</compoundname>
    <includes refid="db/d16/ResourceManager_8hpp" local="yes">ResourceManager.hpp</includes>
    <includes local="no">iterator</includes>
    <includes local="no">iostream</includes>
    <includes local="no">unordered_map</includes>
    <includes local="no">SDL.h</includes>
    <incdepgraph>
      <node id="2">
        <label>ResourceManager.hpp</label>
        <link refid="db/d16/ResourceManager_8hpp_source"/>
        <childnode refid="3" relation="include">
        </childnode>
        <childnode refid="4" relation="include">
        </childnode>
        <childnode refid="5" relation="include">
        </childnode>
      </node>
      <node id="1">
        <label>src/ResourceManager.cpp</label>
        <link refid="d8/d44/ResourceManager_8cpp"/>
        <childnode refid="2" relation="include">
        </childnode>
        <childnode refid="6" relation="include">
        </childnode>
        <childnode refid="7" relation="include">
        </childnode>
        <childnode refid="4" relation="include">
        </childnode>
        <childnode refid="3" relation="include">
        </childnode>
      </node>
      <node id="3">
        <label>SDL.h</label>
      </node>
      <node id="7">
        <label>iostream</label>
      </node>
      <node id="6">
        <label>iterator</label>
      </node>
      <node id="5">
        <label>string</label>
      </node>
      <node id="4">
        <label>unordered_map</label>
      </node>
    </incdepgraph>
    <briefdescription>
    </briefdescription>
    <detaileddescription>
    </detaileddescription>
    <programlisting>
<codeline lineno="1"><highlight class="preprocessor">#include<sp/>&quot;ResourceManager.hpp&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;iterator&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;iostream&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="4"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;unordered_map&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="5"><highlight class="normal"></highlight></codeline>
<codeline lineno="6"><highlight class="normal"></highlight><highlight class="preprocessor">#if<sp/>defined(LINUX)<sp/>||<sp/>defined(MINGW)</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="7"><highlight class="normal"></highlight><highlight class="preprocessor"><sp/><sp/><sp/><sp/>#include<sp/>&lt;SDL2/SDL.h&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="8"><highlight class="normal"></highlight><highlight class="preprocessor">#else<sp/></highlight><highlight class="comment">//<sp/>This<sp/>works<sp/>for<sp/>Mac</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="9"><highlight class="normal"></highlight><highlight class="preprocessor"><sp/><sp/><sp/><sp/>#include<sp/>&lt;SDL.h&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="10"><highlight class="normal"></highlight><highlight class="preprocessor">#endif</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="11"><highlight class="normal"></highlight></codeline>
<codeline lineno="12" refid="de/d6b/classResourceManager_1a3b32babd2e81909bbd90d7f2d566fadb" refkind="member"><highlight class="normal"><ref refid="de/d6b/classResourceManager_1a3b32babd2e81909bbd90d7f2d566fadb" kindref="member">ResourceManager::ResourceManager</ref>(){}</highlight></codeline>
<codeline lineno="13"><highlight class="normal"><ref refid="de/d6b/classResourceManager_1a3b32babd2e81909bbd90d7f2d566fadb" kindref="member">ResourceManager::ResourceManager</ref>(<ref refid="de/d6b/classResourceManager" kindref="compound">ResourceManager</ref><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal">&amp;){}</highlight></codeline>
<codeline lineno="14"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>ResourceManager::operator=(<ref refid="de/d6b/classResourceManager" kindref="compound">ResourceManager</ref><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal">&amp;<sp/>rhs){}</highlight></codeline>
<codeline lineno="15"><highlight class="normal"></highlight></codeline>
<codeline lineno="16" refid="de/d6b/classResourceManager_1a98b11a6302bf0db4ffc81eea70512ee2" refkind="member"><highlight class="normal"><ref refid="de/d6b/classResourceManager" kindref="compound">ResourceManager</ref><sp/>&amp;<ref refid="de/d6b/classResourceManager_1a98b11a6302bf0db4ffc81eea70512ee2" kindref="member">ResourceManager::GetInstance</ref>()</highlight></codeline>
<codeline lineno="17"><highlight class="normal">{</highlight></codeline>
<codeline lineno="18"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/><ref refid="de/d6b/classResourceManager" kindref="compound">ResourceManager</ref>*<sp/>instance<sp/>=<sp/></highlight><highlight class="keyword">new</highlight><highlight class="normal"><sp/><ref refid="de/d6b/classResourceManager_1a3b32babd2e81909bbd90d7f2d566fadb" kindref="member">ResourceManager</ref>();</highlight></codeline>
<codeline lineno="19"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>*instance;</highlight></codeline>
<codeline lineno="20"><highlight class="normal">}</highlight></codeline>
<codeline lineno="21"><highlight class="normal"></highlight></codeline>
<codeline lineno="22" refid="de/d6b/classResourceManager_1a5b5534fbba6f619d50c8b4896ec7c768" refkind="member"><highlight class="normal">SDL_Surface*<sp/><ref refid="de/d6b/classResourceManager_1a5b5534fbba6f619d50c8b4896ec7c768" kindref="member">ResourceManager::LoadResource</ref>(std::string<sp/>image_filename){</highlight></codeline>
<codeline lineno="23"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">auto</highlight><highlight class="normal"><sp/>search<sp/>=<sp/>surfaces.find(image_filename);</highlight></codeline>
<codeline lineno="24"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal">(search<sp/>!=<sp/>surfaces.end()){</highlight></codeline>
<codeline lineno="25"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/><ref refid="de/d6b/classResourceManager_1a71c603bdc173cfe704788a0fbfe2ac7e" kindref="member">GetResource</ref>(image_filename);</highlight></codeline>
<codeline lineno="26"><highlight class="normal"><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="27"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>SDL_Surface*<sp/>surface<sp/>=<sp/>SDL_LoadBMP(image_filename.c_str());</highlight></codeline>
<codeline lineno="28"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>surfaces.insert(std::make_pair(image_filename,<sp/>surface));</highlight></codeline>
<codeline lineno="29"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>surfaces[image_filename];</highlight></codeline>
<codeline lineno="30"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="31"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">nullptr</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="32"><highlight class="normal">}</highlight></codeline>
<codeline lineno="33"><highlight class="normal"></highlight></codeline>
<codeline lineno="34"><highlight class="normal"></highlight><highlight class="comment">//<sp/>TODO<sp/>SPRINT<sp/>1<sp/>(April<sp/>5):<sp/>Create<sp/>LoadResource<sp/>overload<sp/>for<sp/>audio<sp/>files</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="35"><highlight class="normal"></highlight></codeline>
<codeline lineno="36" refid="de/d6b/classResourceManager_1a71c603bdc173cfe704788a0fbfe2ac7e" refkind="member"><highlight class="normal">SDL_Surface*<sp/><ref refid="de/d6b/classResourceManager_1a71c603bdc173cfe704788a0fbfe2ac7e" kindref="member">ResourceManager::GetResource</ref>(std::string<sp/>key){</highlight></codeline>
<codeline lineno="37"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>surfaces[key];</highlight></codeline>
<codeline lineno="38"><highlight class="normal">}</highlight></codeline>
<codeline lineno="39"><highlight class="normal"></highlight></codeline>
<codeline lineno="40" refid="de/d6b/classResourceManager_1ae5ed3ee26a3de63a04d4bb6542d5bbb0" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="de/d6b/classResourceManager_1ae5ed3ee26a3de63a04d4bb6542d5bbb0" kindref="member">ResourceManager::ShutDown</ref>()<sp/>{</highlight></codeline>
<codeline lineno="41"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal">(</highlight><highlight class="keyword">auto</highlight><highlight class="normal"><sp/>surface<sp/>:<sp/>surfaces)<sp/>{</highlight></codeline>
<codeline lineno="42"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>SDL_FreeSurface(surface.second);</highlight></codeline>
<codeline lineno="43"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="44"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="45"><highlight class="normal">}</highlight></codeline>
    </programlisting>
    <location file="src/ResourceManager.cpp"/>
  </compounddef>
</doxygen>
