Finished JSON system. Cleaned up some things
This commit is contained in:
@@ -7,8 +7,6 @@
|
||||
#include <map>
|
||||
#include <utility>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
using namespace std;
|
||||
using nlohmann::json;
|
||||
|
||||
@@ -18,13 +16,13 @@ bool init_sdl()
|
||||
{
|
||||
if (SDL_Init(SDL_INIT_VIDEO) < 0)
|
||||
{
|
||||
printf("SDL could not initialize! SDL - %s\n", SDL_GetError());
|
||||
cout << "SDL could not initialize! SDL - " << SDL_GetError() << endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (0 != TTF_Init())
|
||||
{
|
||||
printf("Could not init TTF! SDL - %s\n", SDL_GetError());
|
||||
cout << "Could not init TTF! SDL - " << SDL_GetError() << endl;
|
||||
SDL_Quit();
|
||||
return false;
|
||||
}
|
||||
@@ -32,7 +30,7 @@ bool init_sdl()
|
||||
int img_flags = IMG_Init(IMG_INIT_JPG | IMG_INIT_PNG | IMG_INIT_TIF);
|
||||
if (img_flags != (IMG_INIT_JPG | IMG_INIT_PNG | IMG_INIT_TIF))
|
||||
{
|
||||
printf("Could not init IMG! SDL - %s\n", SDL_GetError());
|
||||
cout << "Could not init IMG! SDL - " << SDL_GetError() << endl;
|
||||
TTF_Quit();
|
||||
SDL_Quit();
|
||||
return false;
|
||||
@@ -71,7 +69,7 @@ TTF_Font* get_font(const string& filename, int size)
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Could not open font '%s' with size %d\n", filename.c_str(), size);
|
||||
cout << "Could not open font '"<< filename << "' with size " << size << endl;
|
||||
}
|
||||
return font;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user