Explorar el Código

Put everything in the "lol" namespace. Better late than never.

legacy
Sam Hocevar sam hace 15 años
padre
commit
8848cf53db
Se han modificado 65 ficheros con 326 adiciones y 0 borrados
  1. +5
    -0
      src/audio.cpp
  2. +5
    -0
      src/audio.h
  3. +5
    -0
      src/bitfield.h
  4. +5
    -0
      src/debugfps.cpp
  5. +5
    -0
      src/debugfps.h
  6. +6
    -0
      src/debugrecord.cpp
  7. +5
    -0
      src/debugrecord.h
  8. +5
    -0
      src/debugsphere.cpp
  9. +5
    -0
      src/debugsphere.h
  10. +5
    -0
      src/debugstats.cpp
  11. +5
    -0
      src/debugstats.h
  12. +5
    -0
      src/dict.cpp
  13. +5
    -0
      src/dict.h
  14. +5
    -0
      src/eglapp.cpp
  15. +5
    -0
      src/eglapp.h
  16. +5
    -0
      src/emitter.cpp
  17. +5
    -0
      src/emitter.h
  18. +5
    -0
      src/entity.cpp
  19. +5
    -0
      src/entity.h
  20. +5
    -0
      src/font.cpp
  21. +5
    -0
      src/font.h
  22. +5
    -0
      src/forge.cpp
  23. +5
    -0
      src/forge.h
  24. +5
    -0
      src/hash.cpp
  25. +5
    -0
      src/hash.h
  26. +5
    -0
      src/input.cpp
  27. +5
    -0
      src/input.h
  28. +5
    -0
      src/layer.cpp
  29. +5
    -0
      src/layer.h
  30. +5
    -0
      src/map.cpp
  31. +5
    -0
      src/map.h
  32. +5
    -0
      src/matrix.cpp
  33. +5
    -0
      src/matrix.h
  34. +5
    -0
      src/numeric.h
  35. +5
    -0
      src/profiler.cpp
  36. +5
    -0
      src/profiler.h
  37. +5
    -0
      src/sample.cpp
  38. +5
    -0
      src/sample.h
  39. +5
    -0
      src/sampler.cpp
  40. +5
    -0
      src/sampler.h
  41. +5
    -0
      src/scene.cpp
  42. +5
    -0
      src/scene.h
  43. +5
    -0
      src/sdlapp.cpp
  44. +5
    -0
      src/sdlapp.h
  45. +5
    -0
      src/sdlinput.cpp
  46. +5
    -0
      src/sdlinput.h
  47. +5
    -0
      src/shader.cpp
  48. +5
    -0
      src/shader.h
  49. +5
    -0
      src/text.cpp
  50. +5
    -0
      src/text.h
  51. +5
    -0
      src/ticker.cpp
  52. +5
    -0
      src/ticker.h
  53. +5
    -0
      src/tiler.cpp
  54. +5
    -0
      src/tiler.h
  55. +5
    -0
      src/tileset.cpp
  56. +5
    -0
      src/tileset.h
  57. +5
    -0
      src/timer.cpp
  58. +5
    -0
      src/timer.h
  59. +5
    -0
      src/video.cpp
  60. +5
    -0
      src/video.h
  61. +5
    -0
      src/world.cpp
  62. +5
    -0
      src/world.h
  63. +5
    -0
      src/worldentity.cpp
  64. +5
    -0
      src/worldentity.h
  65. +5
    -0
      test/matrix.cpp

+ 5
- 0
src/audio.cpp Ver fichero

@@ -21,6 +21,9 @@

#include "core.h"

namespace lol
{

/*
* Public Audio class
*/
@@ -32,3 +35,5 @@ void Audio::Setup(int channels)
#endif
}

} /* namespace lol */


+ 5
- 0
src/audio.h Ver fichero

@@ -19,11 +19,16 @@

#include <stdint.h>

namespace lol
{

class Audio
{
public:
static void Setup(int channels);
};

} /* namespace lol */

#endif // __DH_AUDIO_H__


+ 5
- 0
src/bitfield.h Ver fichero

@@ -18,6 +18,9 @@

#include <stdint.h>

namespace lol
{

template class BitField<unsigned int COUNT>
{
public:
@@ -46,5 +49,7 @@ private:
uint32_t bits[(COUNT + 31) / 32];
};

} /* namespace lol */

#endif // __DH_BITFIELD_H__


+ 5
- 0
src/debugfps.cpp Ver fichero

@@ -17,6 +17,9 @@
#include "core.h"
#include "debugfps.h"

namespace lol
{

/*
* DebugFps implementation class
*/
@@ -104,3 +107,5 @@ DebugFps::~DebugFps()
delete data;
}

} /* namespace lol */


+ 5
- 0
src/debugfps.h Ver fichero

@@ -18,6 +18,9 @@

#include "entity.h"

namespace lol
{

class DebugFpsData;

class DebugFps : public Entity
@@ -33,5 +36,7 @@ private:
DebugFpsData *data;
};

} /* namespace lol */

#endif // __DH_DEBUGFPS_H__


+ 6
- 0
src/debugrecord.cpp Ver fichero

@@ -22,6 +22,9 @@
#include "core.h"
#include "debugrecord.h"

namespace lol
{

/*
* DebugRecord implementation class
*/
@@ -102,3 +105,6 @@ DebugRecord::~DebugRecord()

delete data;
}

} /* namespace lol */


+ 5
- 0
src/debugrecord.h Ver fichero

@@ -18,6 +18,9 @@

#include "entity.h"

namespace lol
{

class DebugRecordData;

class DebugRecord : public Entity
@@ -34,5 +37,7 @@ private:
DebugRecordData *data;
};

} /* namespace lol */

#endif // __DH_DEBUGRECORD_H__


+ 5
- 0
src/debugsphere.cpp Ver fichero

@@ -25,6 +25,9 @@
#include "lolgl.h"
#include "debugsphere.h"

namespace lol
{

/*
* DebugSphere implementation class
*/
@@ -201,3 +204,5 @@ DebugSphere::~DebugSphere()
delete data;
}

} /* namespace lol */


+ 5
- 0
src/debugsphere.h Ver fichero

@@ -18,6 +18,9 @@

#include "entity.h"

namespace lol
{

class DebugSphereData;

class DebugSphere : public Entity
@@ -34,5 +37,7 @@ private:
DebugSphereData *data;
};

} /* namespace lol */

#endif // __DH_DEBUGSPHERE_H__


+ 5
- 0
src/debugstats.cpp Ver fichero

@@ -17,6 +17,9 @@
#include "core.h"
#include "debugstats.h"

namespace lol
{

/*
* DebugStats implementation class
*/
@@ -59,3 +62,5 @@ DebugStats::~DebugStats()
delete data;
}

} /* namespace lol */


+ 5
- 0
src/debugstats.h Ver fichero

@@ -18,6 +18,9 @@

#include "entity.h"

namespace lol
{

class DebugStatsData;

class DebugStats : public Entity
@@ -33,5 +36,7 @@ private:
DebugStatsData *data;
};

} /* namespace lol */

#endif // __DH_DEBUGSTATS_H__


+ 5
- 0
src/dict.cpp Ver fichero

@@ -22,6 +22,9 @@
# define strcasecmp _stricmp
#endif

namespace lol
{

/*
* Dict implementation class
*/
@@ -142,3 +145,5 @@ Entity *Dict::GetEntity(int id)
return data->entities[id];
}

} /* namespace lol */


+ 5
- 0
src/dict.h Ver fichero

@@ -18,6 +18,9 @@

#include "entity.h"

namespace lol
{

class DictData;

class Dict
@@ -36,5 +39,7 @@ private:
DictData *data;
};

} /* namespace lol */

#endif // __DH_DICT_H__


+ 5
- 0
src/eglapp.cpp Ver fichero

@@ -27,6 +27,9 @@
#include "lolgl.h"
#include "eglapp.h"

namespace lol
{

/*
* EGL App implementation class
*/
@@ -189,3 +192,5 @@ EglApp::~EglApp()
free(data);
}

} /* namespace lol */


+ 5
- 0
src/eglapp.h Ver fichero

@@ -18,6 +18,9 @@

#include "matrix.h"

namespace lol
{

class EglAppData;

class EglApp
@@ -32,5 +35,7 @@ private:
EglAppData *data;
};

} /* namespace lol */

#endif // __DH_EGLAPP_H__


+ 5
- 0
src/emitter.cpp Ver fichero

@@ -17,6 +17,9 @@

#include "core.h"

namespace lol
{

/*
* Emitter implementation class
*/
@@ -93,3 +96,5 @@ Emitter::~Emitter()
delete data;
}

} /* namespace lol */


+ 5
- 0
src/emitter.h Ver fichero

@@ -18,6 +18,9 @@

#include "entity.h"

namespace lol
{

class EmitterData;

class Emitter : public Entity
@@ -36,5 +39,7 @@ private:
EmitterData *data;
};

} /* namespace lol */

#endif // __DH_EMITTER_H__


+ 5
- 0
src/entity.cpp Ver fichero

@@ -17,6 +17,9 @@

#include "core.h"

namespace lol
{

/*
* Public Entity class
*/
@@ -66,3 +69,5 @@ void Entity::TickDraw(float deltams)
#endif
}

} /* namespace lol */


+ 5
- 0
src/entity.h Ver fichero

@@ -21,6 +21,9 @@

#include <stdint.h>

namespace lol
{

class Entity
{
friend class Ticker;
@@ -79,5 +82,7 @@ private:
int ref, autorelease, destroy;
};

} /* namespace lol */

#endif // __DH_ENTITY_H__


+ 5
- 0
src/font.cpp Ver fichero

@@ -17,6 +17,9 @@

#include "core.h"

namespace lol
{

/*
* Font implementation class
*/
@@ -85,3 +88,5 @@ vec2i Font::GetSize() const
return data->size;
}

} /* namespace lol */


+ 5
- 0
src/font.h Ver fichero

@@ -18,6 +18,9 @@

#include "entity.h"

namespace lol
{

class FontData;

class Font : public Entity
@@ -40,5 +43,7 @@ private:
FontData *data;
};

} /* namespace lol */

#endif // __DH_FONT_H__


+ 5
- 0
src/forge.cpp Ver fichero

@@ -14,6 +14,9 @@

#include "core.h"

namespace lol
{

/*
* Forge implementation class
*/
@@ -56,3 +59,5 @@ Font *Forge::GetFont(int id)
return (Font *)data->fonts.GetEntity(id);
}

} /* namespace lol */


+ 5
- 0
src/forge.h Ver fichero

@@ -19,6 +19,9 @@

#include "font.h"

namespace lol
{

class Forge
{
public:
@@ -27,5 +30,7 @@ public:
static Font *GetFont(int id);
};

} /* namespace lol */

#endif // __DH_FORGE_H__


+ 5
- 0
src/hash.cpp Ver fichero

@@ -14,6 +14,9 @@

#include "core.h"

namespace lol
{

/*
* Hash implementation class
*/
@@ -56,3 +59,5 @@ uint32_t Hash::Crc32(char const *str)
return ret ^ 0xffffffff;
}

} /* namespace lol */


+ 5
- 0
src/hash.h Ver fichero

@@ -16,11 +16,16 @@
#if !defined __DH_HASH_H__
#define __DH_HASH_H__

namespace lol
{

class Hash
{
public:
static uint32_t Crc32(char const *data);
};

} /* namespace lol */

#endif // __DH_HASH_H__


+ 5
- 0
src/input.cpp Ver fichero

@@ -22,6 +22,9 @@

#include "core.h"

namespace lol
{

/*
* Input implementation class
*/
@@ -174,3 +177,5 @@ void Input::UnsetMouseButton(int index)
}
}

} /* namespace lol */


+ 5
- 0
src/input.h Ver fichero

@@ -18,6 +18,9 @@

#include "matrix.h"

namespace lol
{

class WorldEntity;

class Input
@@ -38,5 +41,7 @@ public:
static void UnsetMouseButton(int index);
};

} /* namespace lol */

#endif // __DH_INPUT_H__


+ 5
- 0
src/layer.cpp Ver fichero

@@ -16,6 +16,9 @@

#include "core.h"

namespace lol
{

Layer::Layer(int w, int h, int z, int o, uint32_t *in_data)
{
width = w;
@@ -56,3 +59,5 @@ int Layer::GetZ()
return altitude;
}

} /* namespace lol */


+ 5
- 0
src/layer.h Ver fichero

@@ -19,6 +19,9 @@

#include <stdint.h>

namespace lol
{

class Layer
{
public:
@@ -34,5 +37,7 @@ private:
uint32_t *data;
};

} /* namespace lol */

#endif // __DH_LAYER_H__


+ 5
- 0
src/map.cpp Ver fichero

@@ -20,6 +20,9 @@

#include "core.h"

namespace lol
{

/*
* Map implementation class
*/
@@ -176,3 +179,5 @@ int Map::GetHeight()
return data->height * 32;
}

} /* namespace lol */


+ 5
- 0
src/map.h Ver fichero

@@ -18,6 +18,9 @@
#if !defined __DH_MAP_H__
#define __DH_MAP_H__

namespace lol
{

class MapData;

class Map
@@ -34,5 +37,7 @@ private:
MapData *data;
};

} /* namespace lol */

#endif // __DH_MAP_H__


+ 5
- 0
src/matrix.cpp Ver fichero

@@ -18,6 +18,9 @@

#include "core.h"

namespace lol
{

static inline float det3(float a, float b, float c,
float d, float e, float f,
float g, float h, float i)
@@ -148,3 +151,5 @@ template<> mat4 mat4::rotate(float theta, float x, float y, float z)
return ret;
}

} /* namespace lol */


+ 5
- 0
src/matrix.h Ver fichero

@@ -18,6 +18,9 @@

#include <cmath>

namespace lol
{

#define VECTOR_OP(elems, op) \
template<typename U> \
inline Vec##elems<T> operator op(Vec##elems<U> const &val) const \
@@ -278,5 +281,7 @@ template <typename T> struct Mat4
typedef Mat4<float> mat4;
typedef Mat4<int> mat4i;

} /* namespace lol */

#endif // __DH_MATRIX_H__


+ 5
- 0
src/numeric.h Ver fichero

@@ -20,6 +20,9 @@
#include <cstdlib>
#include <stdint.h>

namespace lol
{

/* Random float value */
static inline float RandF()
{
@@ -49,5 +52,7 @@ template <typename T> static inline T PotUp(T val)
return val + 1;
}

} /* namespace lol */

#endif // __DH_NUMERIC_H__


+ 5
- 0
src/profiler.cpp Ver fichero

@@ -18,6 +18,9 @@

#include "core.h"

namespace lol
{

/*
* Profiler implementation class
*/
@@ -79,3 +82,5 @@ float Profiler::GetMax(int id)
return data[id].max;
}

} /* namespace lol */


+ 5
- 0
src/profiler.h Ver fichero

@@ -19,6 +19,9 @@

#include <stdint.h>

namespace lol
{

class Profiler
{
public:
@@ -37,5 +40,7 @@ public:
static float GetMax(int id);
};

} /* namespace lol */

#endif // __DH_PROFILER_H__


+ 5
- 0
src/sample.cpp Ver fichero

@@ -23,6 +23,9 @@

#include "core.h"

namespace lol
{

/*
* Sample implementation class
*/
@@ -88,3 +91,5 @@ void Sample::Play()
#endif
}

} /* namespace lol */


+ 5
- 0
src/sample.h Ver fichero

@@ -21,6 +21,9 @@

#include "entity.h"

namespace lol
{

class SampleData;

class Sample : public Entity
@@ -42,5 +45,7 @@ private:
SampleData *data;
};

} /* namespace lol */

#endif // __DH_SAMPLE_H__


+ 5
- 0
src/sampler.cpp Ver fichero

@@ -14,6 +14,9 @@

#include "core.h"

namespace lol
{

/*
* Sampler implementation class
*/
@@ -57,3 +60,5 @@ void Sampler::PlaySample(int id)
sample->Play();
}

} /* namespace lol */


+ 5
- 0
src/sampler.h Ver fichero

@@ -19,6 +19,9 @@

#include <stdint.h>

namespace lol
{

class Sampler
{
public:
@@ -28,5 +31,7 @@ public:
static void PlaySample(int id);
};

} /* namespace lol */

#endif // __DH_SAMPLER_H__


+ 5
- 0
src/scene.cpp Ver fichero

@@ -24,6 +24,9 @@
#include "core.h"
#include "lolgl.h"

namespace lol
{

struct Tile
{
uint32_t prio, code;
@@ -277,3 +280,5 @@ void Scene::Render() // XXX: rename to Blit()
data->ntiles = 0;
}

} /* namespace lol */


+ 5
- 0
src/scene.h Ver fichero

@@ -18,6 +18,9 @@

#include <stdint.h>

namespace lol
{

class SceneData;

class Scene
@@ -36,5 +39,7 @@ private:
SceneData *data;
};

} /* namespace lol */

#endif // __DH_SCENE_H__


+ 5
- 0
src/sdlapp.cpp Ver fichero

@@ -19,6 +19,9 @@
#include "core.h"
#include "sdlapp.h"

namespace lol
{

/*
* SDL App implementation class
*/
@@ -90,3 +93,5 @@ SdlApp::~SdlApp()
free(data);
}

} /* namespace lol */


+ 5
- 0
src/sdlapp.h Ver fichero

@@ -18,6 +18,9 @@

#include "matrix.h"

namespace lol
{

class SdlAppData;

class SdlApp
@@ -32,5 +35,7 @@ private:
SdlAppData *data;
};

} /* namespace lol */

#endif // __DH_SDLAPP_H__


+ 5
- 0
src/sdlinput.cpp Ver fichero

@@ -17,6 +17,9 @@
#include "core.h"
#include "sdlinput.h"

namespace lol
{

/*
* SDL Input implementation class
*/
@@ -88,3 +91,5 @@ SdlInput::~SdlInput()
delete data;
}

} /* namespace lol */


+ 5
- 0
src/sdlinput.h Ver fichero

@@ -18,6 +18,9 @@

#include "entity.h"

namespace lol
{

class SdlInputData;

class SdlInput : public Entity
@@ -33,5 +36,7 @@ private:
SdlInputData *data;
};

} /* namespace lol */

#endif // __DH_SDLINPUT_H__


+ 5
- 0
src/shader.cpp Ver fichero

@@ -23,6 +23,9 @@
#include "core.h"
#include "lolgl.h"

namespace lol
{

/*
* Shader implementation class
*/
@@ -150,3 +153,5 @@ Shader::~Shader()
delete data;
}

} /* namespace lol */


+ 5
- 0
src/shader.h Ver fichero

@@ -16,6 +16,9 @@
#if !defined __DH_SHADER_H__
#define __DH_SHADER_H__

namespace lol
{

class ShaderData;

class Shader
@@ -37,5 +40,7 @@ private:
ShaderData *data;
};

} /* namespace lol */

#endif // __DH_SHADER_H__


+ 5
- 0
src/text.cpp Ver fichero

@@ -18,6 +18,9 @@

#include "core.h"

namespace lol
{

/*
* Text implementation class
*/
@@ -99,3 +102,5 @@ Text::~Text()
delete data;
}

} /* namespace lol */


+ 5
- 0
src/text.h Ver fichero

@@ -18,6 +18,9 @@

#include "entity.h"

namespace lol
{

class TextData;

class Text : public Entity
@@ -45,5 +48,7 @@ private:
TextData *data;
};

} /* namespace lol */

#endif // __DH_TEXT_H__


+ 5
- 0
src/ticker.cpp Ver fichero

@@ -18,6 +18,9 @@

#include "core.h"

namespace lol
{

/*
* Ticker implementation class
*/
@@ -373,3 +376,5 @@ int Ticker::Finished()
return !data->nentities;
}

} /* namespace lol */


+ 5
- 0
src/ticker.h Ver fichero

@@ -21,6 +21,9 @@

#include "entity.h"

namespace lol
{

class Ticker
{
public:
@@ -42,5 +45,7 @@ public:
static int Finished();
};

} /* namespace lol */

#endif // __DH_TICKER_H__


+ 5
- 0
src/tiler.cpp Ver fichero

@@ -16,6 +16,9 @@

#include "core.h"

namespace lol
{

/*
* Tiler implementation class
*/
@@ -128,3 +131,5 @@ void Tiler::BlitTile(uint32_t code, int x, int y, int z, int o,
tileset->BlitTile(code & 0xffff, x, y, z, o, vertex, texture);
}

} /* namespace lol */


+ 5
- 0
src/tiler.h Ver fichero

@@ -19,6 +19,9 @@

#include <stdint.h>

namespace lol
{

class Tiler
{
public:
@@ -33,5 +36,7 @@ public:
float *vertex, float *texture);
};

} /* namespace lol */

#endif // __DH_TILER_H__


+ 5
- 0
src/tileset.cpp Ver fichero

@@ -29,6 +29,9 @@
#include "core.h"
#include "lolgl.h"

namespace lol
{

/*
* TileSet implementation class
*/
@@ -242,3 +245,5 @@ void TileSet::BlitTile(uint32_t id, int x, int y, int z, int o,
}
}

} /* namespace lol */


+ 5
- 0
src/tileset.h Ver fichero

@@ -23,6 +23,9 @@

#include "entity.h"

namespace lol
{

class TileSetData;

class TileSet : public Entity
@@ -48,5 +51,7 @@ private:
TileSetData *data;
};

} /* namespace lol */

#endif // __DH_TILESET_H__


+ 5
- 0
src/timer.cpp Ver fichero

@@ -28,6 +28,9 @@

#include "core.h"

namespace lol
{

/*
* Timer implementation class
*/
@@ -126,3 +129,5 @@ void Timer::WaitMs(float deltams)
(void)data->GetOrWait(deltams, false);
}

} /* namespace lol */


+ 5
- 0
src/timer.h Ver fichero

@@ -16,6 +16,9 @@
#if !defined __DH_TIMER_H__
#define __DH_TIMER_H__

namespace lol
{

class TimerData;

class Timer
@@ -32,5 +35,7 @@ private:
TimerData *data;
};

} /* namespace lol */

#endif // __DH_TIMER_H__


+ 5
- 0
src/video.cpp Ver fichero

@@ -23,6 +23,9 @@
#include "core.h"
#include "lolgl.h"

namespace lol
{

#if defined HAVE_GL_2X || defined HAVE_GLES_2X
Shader *stdshader;
#endif
@@ -233,3 +236,5 @@ int Video::GetHeight()
return v[3];
}

} /* namespace lol */


+ 5
- 0
src/video.h Ver fichero

@@ -19,6 +19,9 @@

#include <stdint.h>

namespace lol
{

class Video
{
public:
@@ -32,5 +35,7 @@ public:
static int GetHeight();
};

} /* namespace lol */

#endif // __DH_VIDEO_H__


+ 5
- 0
src/world.cpp Ver fichero

@@ -19,6 +19,9 @@

#include "core.h"

namespace lol
{

/*
* World implementation class
*/
@@ -74,3 +77,5 @@ int World::GetHeight()
return data->height * 32;
}

} /* namespace lol */


+ 5
- 0
src/world.h Ver fichero

@@ -18,6 +18,9 @@

#include "entity.h"

namespace lol
{

class WorldData;

class World : public Entity
@@ -41,5 +44,7 @@ private:
WorldData *data;
};

} /* namespace lol */

#endif // __DH_WORLD_H__


+ 5
- 0
src/worldentity.cpp Ver fichero

@@ -17,6 +17,9 @@

#include "core.h"

namespace lol
{

/*
* Public WorldEntity class
*/
@@ -44,3 +47,5 @@ void WorldEntity::TickDraw(float deltams)
Entity::TickDraw(deltams);
}

} /* namespace lol */


+ 5
- 0
src/worldentity.h Ver fichero

@@ -18,6 +18,9 @@

#include "entity.h"

namespace lol
{

class WorldEntity : public Entity
{
public:
@@ -40,5 +43,7 @@ protected:
virtual void TickDraw(float deltams);
};

} /* namespace lol */

#endif // __DH_WORLDENTITY_H__


+ 5
- 0
test/matrix.cpp Ver fichero

@@ -19,6 +19,9 @@

#include "core.h"

namespace lol
{

class MatrixTest : public CppUnit::TestCase
{
CPPUNIT_TEST_SUITE(MatrixTest);
@@ -114,3 +117,5 @@ private:

CPPUNIT_TEST_SUITE_REGISTRATION(MatrixTest);

} /* namespace lol */


Cargando…
Cancelar
Guardar