fix: dos fallos tontos
This commit is contained in:
+4
-12
@@ -5,19 +5,11 @@
|
||||
#include "texture.h"
|
||||
|
||||
Texture::Texture(SDL_Renderer *renderer)
|
||||
{
|
||||
renderer_ = renderer;
|
||||
texture_ = nullptr;
|
||||
width_ = 0;
|
||||
height_ = 0;
|
||||
}
|
||||
: renderer_(renderer), texture_(nullptr), width_(0), height_(0) {}
|
||||
|
||||
Texture::Texture(SDL_Renderer *renderer, std::string file_path)
|
||||
: renderer_(renderer), texture_(nullptr), width_(0), height_(0)
|
||||
{
|
||||
renderer_ = renderer;
|
||||
texture_ = nullptr;
|
||||
width_ = 0;
|
||||
height_ = 0;
|
||||
loadFromFile(file_path);
|
||||
}
|
||||
|
||||
@@ -65,7 +57,7 @@ bool Texture::loadFromFile(std::string file_path)
|
||||
SDL_Surface *loaded_surface = SDL_CreateSurfaceFrom(width, height, pixel_format, (void *)data, pitch);
|
||||
if (loaded_surface == nullptr)
|
||||
{
|
||||
std::cout << "Unable to load image " << file_path.c_str() << std::endl;
|
||||
std::cout << "Unable to load image " << file_path << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -73,7 +65,7 @@ bool Texture::loadFromFile(std::string file_path)
|
||||
new_texture = SDL_CreateTextureFromSurface(renderer_, loaded_surface);
|
||||
if (new_texture == nullptr)
|
||||
{
|
||||
std::cout << "Unable to create texture from " << file_path.c_str() << "! SDL Error: " << SDL_GetError() << std::endl;
|
||||
std::cout << "Unable to create texture from " << file_path << "! SDL Error: " << SDL_GetError() << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user