mirror of
https://github.com/jorio/Pomme.git
synced 2024-05-29 04:41:30 +00:00
Remove superfluous SDL dependencies
This commit is contained in:
parent
46599c1780
commit
9c223defc2
|
@ -1,42 +1,20 @@
|
||||||
#include "PommeDebug.h"
|
#include "PommeDebug.h"
|
||||||
|
#include <cstring>
|
||||||
#include <SDL.h>
|
|
||||||
#include <sstream>
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
void ImplementMe(const char* fn, std::string msg, int severity)
|
void ImplementMe(const char* fn, std::string msg, int severity)
|
||||||
{
|
{
|
||||||
if (severity >= 0)
|
std::stringstream ss;
|
||||||
{
|
ss << "[TODO] \x1b[1m" << fn << "\x1b[22m";
|
||||||
std::stringstream ss;
|
|
||||||
ss << "[TODO] \x1b[1m" << fn << "\x1b[22m";
|
if (!msg.empty())
|
||||||
if (!msg.empty())
|
ss << ": " << msg;
|
||||||
{
|
|
||||||
ss << ": " << msg;
|
auto str = ss.str();
|
||||||
}
|
std::cerr << (severity > 0 ? "\x1b[31m" : "\x1b[33m") << str << "\x1b[0m\n";
|
||||||
auto str = ss.str();
|
|
||||||
std::cerr << (severity > 0 ? "\x1b[31m" : "\x1b[33m") << str << "\x1b[0m\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (severity >= 2)
|
if (severity >= 2)
|
||||||
{
|
throw std::runtime_error(str);
|
||||||
std::stringstream ss;
|
|
||||||
ss << fn << "()";
|
|
||||||
if (!msg.empty()) ss << "\n" << msg;
|
|
||||||
|
|
||||||
auto str = ss.str();
|
|
||||||
|
|
||||||
int mbflags = SDL_MESSAGEBOX_ERROR;
|
|
||||||
if (severity == 0) mbflags = SDL_MESSAGEBOX_INFORMATION;
|
|
||||||
if (severity == 1) mbflags = SDL_MESSAGEBOX_WARNING;
|
|
||||||
|
|
||||||
SDL_ShowSimpleMessageBox(mbflags, "Source port TODO", str.c_str(), nullptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (severity >= 2)
|
|
||||||
{
|
|
||||||
abort();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Pomme::FourCCString(uint32_t fourCC, char filler)
|
std::string Pomme::FourCCString(uint32_t fourCC, char filler)
|
||||||
|
@ -49,9 +27,8 @@ std::string Pomme::FourCCString(uint32_t fourCC, char filler)
|
||||||
{
|
{
|
||||||
char c = (fourCC >> shift) & 0xFF;
|
char c = (fourCC >> shift) & 0xFF;
|
||||||
|
|
||||||
// Replace any non-alphanumeric character with the filler character.
|
// Replace symbols to make suitable for use as filename
|
||||||
// This ensures that the resulting string is suitable for use as a filename.
|
if (!isalnum(c) && !strchr("!#$%&'()+,-.;=@[]^_`{}", c))
|
||||||
if (!isalnum(c))
|
|
||||||
c = filler;
|
c = filler;
|
||||||
|
|
||||||
stringBuffer[i] = c;
|
stringBuffer[i] = c;
|
||||||
|
|
|
@ -6,7 +6,6 @@ extern "C"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "PommeTypes.h"
|
#include "PommeTypes.h"
|
||||||
#include <SDL_opengl.h>
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
typedef float TQ3Float32;
|
typedef float TQ3Float32;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user