forked from jaildesigner-jailgames/jaildoctors_dilemma
Quitados todos los printf menos uno
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include "texture.h"
|
||||
#define STB_IMAGE_IMPLEMENTATION
|
||||
#include "stb_image.h"
|
||||
#include <iostream>
|
||||
|
||||
// Constructor
|
||||
Texture::Texture(SDL_Renderer *renderer, std::string path)
|
||||
@@ -32,7 +33,7 @@ Texture::~Texture()
|
||||
// Carga una imagen desde un fichero
|
||||
bool Texture::loadFromFile(std::string path, SDL_Renderer *renderer)
|
||||
{
|
||||
const std::string filename = path.substr(path.find_last_of("\\/") + 1);
|
||||
const std::string filename = path.substr(path.find_last_of("\\/") + 1);
|
||||
int req_format = STBI_rgb_alpha;
|
||||
int width, height, orig_format;
|
||||
unsigned char *data = stbi_load(path.c_str(), &width, &height, &orig_format, req_format);
|
||||
@@ -43,7 +44,7 @@ bool Texture::loadFromFile(std::string path, SDL_Renderer *renderer)
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Image loaded: %s\n", filename.c_str());
|
||||
std::cout << "Image loaded: " << filename.c_str() << std::endl;
|
||||
}
|
||||
|
||||
int depth, pitch;
|
||||
@@ -71,7 +72,7 @@ bool Texture::loadFromFile(std::string path, SDL_Renderer *renderer)
|
||||
SDL_Surface *loadedSurface = SDL_CreateRGBSurfaceWithFormatFrom((void *)data, width, height, depth, pitch, pixel_format);
|
||||
if (loadedSurface == nullptr)
|
||||
{
|
||||
printf("Unable to load image %s!\n", path.c_str());
|
||||
std::cout << "Unable to load image " << path.c_str() << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -79,7 +80,7 @@ bool Texture::loadFromFile(std::string path, SDL_Renderer *renderer)
|
||||
newTexture = SDL_CreateTextureFromSurface(renderer, loadedSurface);
|
||||
if (newTexture == nullptr)
|
||||
{
|
||||
printf("Unable to create texture from %s! SDL Error: %s\n", path.c_str(), SDL_GetError());
|
||||
std::cout << "Unable to create texture from " << path.c_str() << "! SDL Error: " << SDL_GetError() << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -104,7 +105,7 @@ bool Texture::createBlank(SDL_Renderer *renderer, int width, int height, SDL_Tex
|
||||
texture = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_RGBA8888, access, width, height);
|
||||
if (texture == nullptr)
|
||||
{
|
||||
printf("Unable to create blank texture! SDL Error: %s\n", SDL_GetError());
|
||||
std::cout << "Unable to create blank texture! SDL Error: " << SDL_GetError() << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user