[Remove] My god! I was so stupid two years ago. Kill a shed load of unneeded namespaces.

This commit is contained in:
Rtch90 2013-12-13 02:49:26 +00:00
parent 2c00325c29
commit 4c0654e148
24 changed files with 21 additions and 119 deletions

View File

@ -42,25 +42,7 @@ HEADERS += ../src/Actor/Player.h \
../src/System/Debug.h \
../src/System/ResourceManager.h \
../src/System/Convert/str2int.h \
../src/System/Filesystem/SCpak.h \
../src/System/Filesystem/RlePackedFileWrapper.h \
../src/System/Filesystem/IOapi.h \
../src/System/Filesystem/FileTimestampChecker.h \
../src/System/Convert/ConvertType.h \
../src/System/Filesystem/OutputCompressedFileStream.h \
../src/System/Filesystem/InputCompressedFileStream.h \
../src/System/Filesystem/ZipPackage.h \
../src/System/Filesystem/InputStream.h \
../src/System/Filesystem/OutputStream.h \
../src/System/Filesystem/EmptyBuffer.h \
../src/System/Filesystem/IFileList.h \
../src/System/Filesystem/IFilePackage.h \
../src/System/Filesystem/FileList.h \
../src/System/Filesystem/InputFileStream.h \
../src/System/Filesystem/FilePackageManager.h \
../src/System/Filesystem/InputStreamWrapper.h \
../src/System/Filesystem/MemoryStream.h \
../src/System/Filesystem/Checksum.h \
../src/Texture/Texture.h \
../src/Sound/Music.h \
../src/TMXParser/base64.h \
@ -112,21 +94,6 @@ SOURCES += ../src/Actor/Player.cpp \
../src/Sprite/Sprite.cpp \
../src/System/Debug.cpp \
../src/System/Convert/str2int.cpp \
../src/System/Filesystem/SCpak.cpp \
../src/System/Filesystem/RlePackedFileWrapper.cpp \
../src/System/Filesystem/FileTimestampChecker.cpp \
../src/System/Filesystem/OutputCompressedFileStream.cpp \
../src/System/Filesystem/InputCompressedFileStream.cpp \
../src/System/Filesystem/ZipPackage.cpp \
../src/System/Filesystem/InputStream.cpp \
../src/System/Filesystem/OutputStream.cpp \
../src/System/Filesystem/FileList.cpp \
../src/System/Filesystem/InputFileStream.cpp \
../src/System/Filesystem/FilePackageManager.cpp \
../src/System/Filesystem/InputStreamWrapper.cpp \
../src/System/Filesystem/MemoryStream.cpp \
../src/System/Filesystem/SCCopyFile.cpp \
../src/System/Filesystem/Checksum.cpp \
../src/Texture/Texture.cpp \
../src/Sound/Music.cpp \
../src/Actor/NPC.cpp \

View File

@ -2,12 +2,8 @@
#include <string.h>
#include "../System/Debug.h"
#include "../System/Filesystem/InputStreamWrapper.h"
#include "AnimationSequence.h"
using saracraft::util::Debug;
using namespace saracraft::filesystem;
/*
* Load and read a sequence file for an animating sprite then
* stores the result so you can call the sprites animation at any time.
@ -47,7 +43,7 @@ void AnimationSequence::ReadFile(void) {
fseek(file, 0, SEEK_END);
int fileSize = ftell(file);
rewind(file);
String name;
char* temp = new char[fileSize + 1];
temp[fileSize] = 0;

View File

@ -9,8 +9,6 @@
#define ENDOFLINE 59
#define SPACE 32
using saracraft::util::String;
struct Animation {
String _animationID;
int frameBegin;

View File

@ -1,7 +1,5 @@
#include "Slot.h"
using saracraft::util::Debug;
Slot::Slot(void) {
_triggered = false;
_selected = false;

View File

@ -3,8 +3,6 @@
#include "../System/Debug.h"
#include "Font.h"
using saracraft::util::Debug;
Font::Font(void) {
_texture = 0;
_spaceWidth = 0;
@ -105,13 +103,13 @@ void Font::RenderText(int xOffset, int yOffset, const char* text) {
glBegin(GL_QUADS);
const int textLength = strlen(text);
int x = 0;
int y = 0;
for(int i = 0; i < textLength; i++) {
char c = text[i];
if(c == ' ') {
x += _spaceWidth;
continue;
@ -132,14 +130,14 @@ void Font::RenderText(int xOffset, int yOffset, const char* text) {
glVertex2i(
charInfo.xOffset + x + xOffset,
charInfo.yOffset + y + yOffset);
glTexCoord2f(
charInfo.uvX + charInfo.uvW,
charInfo.uvY);
glVertex2i(
charInfo.xOffset + x + charInfo.width + xOffset,
charInfo.yOffset + y + yOffset);
glTexCoord2f(
charInfo.uvX + charInfo.uvW,
charInfo.uvY + charInfo.uvH);
@ -165,7 +163,7 @@ void Font::RenderText(int xOffset, int yOffset, const char* text) {
void Font::TextSize(const char* text, int& width, int& height) {
width = 0;
height = _lineSkip;
int textLength = strlen(text);
for(int i = 0; i < textLength; i++) {
char c = text[i];

View File

@ -1,8 +1,6 @@
#include <string.h>
#include "Input.h"
using saracraft::util::Debug;
static mouse_t mouse;
static keyboard_t keyboard;

View File

@ -20,8 +20,6 @@
#endif
#endif
using saracraft::util::Debug;
Level::Level(Game* game) {
_game = game;
_width = 0;

View File

@ -3,8 +3,6 @@
#include "../System/String.h"
#include "../Math/Vec2.h"
using saracraft::util::String;
class Warp {
public:
Warp(void);

View File

@ -21,8 +21,6 @@
#include "Game.h"
#include "TitleScreen.h"
using saracraft::util::Debug;
Game::Game(void) {
_level = new Level(this);
_player = new Player(_level);

View File

@ -20,8 +20,6 @@
#include "../Global/Constants.h"
#include "../System/Debug.h"
using saracraft::util::Debug;
void Destroy(void) {
TTF_Quit();
Mix_CloseAudio();

View File

@ -2,7 +2,7 @@
#include "Music.h"
saracraft::util::ResourceManager<Music> musicManager;
ResourceManager<Music> musicManager;
Music::Music() : Resource() {
_music = NULL;

View File

@ -4,8 +4,8 @@
struct _Mix_Music;
class Music : public saracraft::util::Resource {
template<class T> friend class saracraft::util::ResourceManager;
class Music : public Resource {
template<class T> friend class ResourceManager;
public:
Music();
@ -21,4 +21,4 @@ private:
struct _Mix_Music* _music;
};
extern saracraft::util::ResourceManager<Music> musicManager;
extern ResourceManager<Music> musicManager;

View File

@ -2,7 +2,7 @@
#include "SoundEffect.h"
saracraft::util::ResourceManager<SoundEffect> sfxManager;
ResourceManager<SoundEffect> sfxManager;
SoundEffect::SoundEffect() {
_chunk = NULL;

View File

@ -4,8 +4,8 @@
struct Mix_Chunk;
class SoundEffect : public saracraft::util::Resource {
template<class T> friend class saracraft::util::ResourceManager;
class SoundEffect : public Resource {
template<class T> friend class ResourceManager;
public:
SoundEffect();
@ -22,4 +22,4 @@ private:
Mix_Chunk* _chunk;
};
extern saracraft::util::ResourceManager<SoundEffect> sfxManager;
extern ResourceManager<SoundEffect> sfxManager;

View File

@ -5,9 +5,6 @@
#include <cassert>
#endif
namespace saracraft {
namespace util {
template<class T>
struct ConvertBase {
enum { charCount = sizeof(T) };
@ -49,6 +46,3 @@ struct ConvertTo: private ConvertBase<T> {
};
typedef unsigned short uint16_t;
} // Namespace util.
} // Namespace saracraft.

View File

@ -1,12 +1,7 @@
#pragma once
namespace saracraft {
namespace util {
extern char* int2str(int value);
extern int str2int(const char* string);
extern int str2int_errno(void);
extern char* time2str(int secs); // hh:mm::ss.
} // Namespace util.
} // Namespace saracraft.

View File

@ -8,9 +8,6 @@
using namespace std;
namespace saracraft {
namespace util {
// ===================================================================
// The Debug log allows us to display ever piece of data that
// populates our class components, anything that is loaded, serialized,
@ -103,6 +100,3 @@ void Debug::closeLog(void) {
delete logger;
logger = NULL;
}
} // End of namespace util.
} // End of namespace saracraft.

View File

@ -3,9 +3,6 @@
#include <fstream>
#include "string"
namespace saracraft {
namespace util {
class Debug {
public:
Debug(bool logToFile);
@ -16,14 +13,11 @@ public:
void message(const char *msg, ...);
static bool openLog(bool logToFile);
static void closeLog(void);
static Debug *logger;
private:
private:
std::ofstream _logFile;
};
} // Namespace util.
} // Namespace saracraft.
#endif // _DEBUG_H_

View File

@ -5,9 +5,6 @@
#include "../System/String.h"
namespace saracraft {
namespace util {
class Resource {
public:
virtual bool Load(const std::string& filename) = 0;
@ -99,6 +96,3 @@ public:
private:
ResourceMap m_resources;
};
} // Namespace util.
} // Namespace saracraft.

View File

@ -5,9 +5,6 @@
#include "String.h"
#define _CRT_SECURE_NO_WARNINGS
namespace saracraft {
namespace util {
String::String(void) {
_string = new char[1];
_string[0] = 0;
@ -62,7 +59,7 @@ void String::Format(const char* format, ...) {
_length = 4095;
_string = new char[_length + 1];
memset(_string, 0, _length + 1);
va_list vlist;
va_start(vlist, format);
@ -153,6 +150,3 @@ String String::operator+(const String& value) const {
String::operator const char*() const {
return _string;
}
} // End of namespace util.
} // End of namespace saracraft.

View File

@ -1,9 +1,6 @@
#pragma once
#define _CRT_SECURE_NO_WARNINGS
namespace saracraft {
namespace util {
class String {
public:
String(void);
@ -37,6 +34,3 @@ private:
char* _string;
int _length;
};
} // Namespace util.
} // Namespace saracraft.

View File

@ -11,9 +11,7 @@ using namespace std;
#define GL_BGRA_EXT 0x80E1
#endif
using saracraft::util::Debug;
saracraft::util::ResourceManager<Texture> textureManager;
ResourceManager<Texture> textureManager;
static GLuint boundTexture = 0;

View File

@ -27,8 +27,8 @@ void BindTexture(GLuint texID);
#include "../System/ResourceManager.h"
class Texture : public saracraft::util::Resource {
template<class T> friend class saracraft::util::ResourceManager;
class Texture : public Resource {
template<class T> friend class ResourceManager;
public:
Texture();
@ -46,4 +46,4 @@ private:
int height;
};
extern saracraft::util::ResourceManager<Texture> textureManager;
extern ResourceManager<Texture> textureManager;

View File

@ -4,8 +4,6 @@
#include "../System/String.h"
#include "../Font/Font.h"
using saracraft::util::String;
class Button {
public:
Button(void);