소스 검색

build: rename Map to LevelMap so that we can use Map for the hashmap.

legacy
Sam Hocevar sam 12 년 전
부모
커밋
2a5d9ed4d8
7개의 변경된 파일58개의 추가작업 그리고 21개의 파일을 삭제
  1. +1
    -0
      src/Makefile.am
  2. +4
    -0
      src/core.h
  3. +28
    -0
      src/lol/core/map.h
  4. +1
    -0
      src/lolcore.vcxproj
  5. +3
    -0
      src/lolcore.vcxproj.filters
  6. +11
    -11
      src/map.cpp
  7. +10
    -10
      src/map.h

+ 1
- 0
src/Makefile.am 파일 보기

@@ -18,6 +18,7 @@ liblol_a_SOURCES = \
\
lol/unit.h lol/debug.h \
lol/core/types.h lol/core/array.h lol/core/string.h lol/core/hash.h \
lol/core/map.h \
lol/math/vector.h lol/math/half.h lol/math/real.h lol/math/remez.h \
lol/math/math.h \
\


+ 4
- 0
src/core.h 파일 보기

@@ -75,14 +75,18 @@ static inline int isnan(float f)

// Base types
#include <lol/debug.h>

#include <lol/core/types.h>
#include <lol/core/array.h>
#include <lol/core/string.h>
#include <lol/core/hash.h>
#include <lol/core/map.h>

#include <lol/math/math.h>
#include <lol/math/half.h>
#include <lol/math/real.h>
#include <lol/math/vector.h>

#include "numeric.h"
#include "timer.h"
#include "thread/thread.h"


+ 28
- 0
src/lol/core/map.h 파일 보기

@@ -0,0 +1,28 @@
//
// Lol Engine
//
// Copyright: (c) 2010-2012 Sam Hocevar <sam@hocevar.net>
// This program is free software; you can redistribute it and/or
// modify it under the terms of the Do What The Fuck You Want To
// Public License, Version 2, as published by Sam Hocevar. See
// http://sam.zoy.org/projects/COPYING.WTFPL for more details.
//

//
// The Map class
// -------------
// A very simple Map class.
//

#if !defined __LOL_CORE_MAP_H__
#define __LOL_CORE_MAP_H__

namespace lol
{

template<typename K, typename V> class Map;

} /* namespace lol */

#endif // __LOL_CORE_MAP_H__


+ 1
- 0
src/lolcore.vcxproj 파일 보기

@@ -584,6 +584,7 @@
<ClInclude Include="lolgl.h" />
<ClInclude Include="lol\core\array.h" />
<ClInclude Include="lol\core\hash.h" />
<ClInclude Include="lol\core\map.h" />
<ClInclude Include="lol\core\string.h" />
<ClInclude Include="lol\core\types.h" />
<ClInclude Include="lol\debug.h" />


+ 3
- 0
src/lolcore.vcxproj.filters 파일 보기

@@ -741,6 +741,9 @@
<ClInclude Include="hash.h">
<Filter>src\core</Filter>
</ClInclude>
<ClInclude Include="map.h">
<Filter>src\core</Filter>
</ClInclude>
<ClInclude Include="audio.h">
<Filter>src\...</Filter>
</ClInclude>


+ 11
- 11
src/map.cpp 파일 보기

@@ -25,12 +25,12 @@ namespace lol
{

/*
* Map implementation class
* LevelMap implementation class
*/

class MapData
class LevelMapData
{
friend class Map;
friend class LevelMap;

static int const MAX_TILESETS = 128;

@@ -44,18 +44,18 @@ private:
};

/*
* Public Map class
* Public LevelMap class
*/

Map::Map(char const *path)
: data(new MapData())
LevelMap::LevelMap(char const *path)
: data(new LevelMapData())
{
data->ntilers = 0;
data->width = 0;
data->height = 0;

char tmp[BUFSIZ];
int gids[MapData::MAX_TILESETS];
int gids[LevelMapData::MAX_TILESETS];
uint32_t *tiles = NULL;
int level = 0, orientation = 0, ntiles = 0;

@@ -151,7 +151,7 @@ Map::Map(char const *path)
fclose(fp);
}

Map::~Map()
LevelMap::~LevelMap()
{
for (int i = 0; i < data->ntilers; i++)
Tiler::Deregister(data->tilesets[i]);
@@ -160,18 +160,18 @@ Map::~Map()
delete data;
}

void Map::Render(int x, int y, int z)
void LevelMap::Render(int x, int y, int z)
{
for (int i = 0; i < data->m_layers.Count(); i++)
data->m_layers[i]->Render(x, y, z);
}

int Map::GetWidth()
int LevelMap::GetWidth()
{
return data->width * 32;
}

int Map::GetHeight()
int LevelMap::GetHeight()
{
return data->height * 32;
}


+ 10
- 10
src/map.h 파일 보기

@@ -9,32 +9,32 @@
//

//
// The Map class
// -------------
// A Map object is a collection of Layers and other information (to be
// The LevelMap class
// ------------------
// A LevelMap object is a collection of Layers and other information (to be
// determined later).
//

#if !defined __LOL_MAP_H__
#define __LOL_MAP_H__
#if !defined __LOL_LEVELMAP_H__
#define __LOL_LEVELMAP_H__

namespace lol
{

class MapData;
class LevelMapData;

class Map
class LevelMap
{
public:
Map(char const *path);
~Map();
LevelMap(char const *path);
~LevelMap();

void Render(int x, int y, int z);
int GetWidth();
int GetHeight();

private:
MapData *data;
LevelMapData *data;
};

} /* namespace lol */


불러오는 중...
취소
저장