#include "setup.h"
#include "texture.h"
-void (*texture_load) (texture_type* ptexture, char * file, int use_alpha);
-void (*texture_load_part) (texture_type* ptexture, char * file, int x, int y, int w, int h, int use_alpha);
-void (*texture_free) (texture_type* ptexture);
-void (*texture_draw) (texture_type* ptexture, float x, float y, int update);
-void (*texture_draw_bg) (texture_type* ptexture, int update);
-void (*texture_draw_part) (texture_type* ptexture, float sx, float sy, float x, float y, float w, float h, int update);
+void (*texture_load) (texture_type* ptexture, const std::string& file, int use_alpha);
+void (*texture_load_part)(texture_type* ptexture, const std::string& file, int x, int y, int w, int h, int use_alpha);
+void (*texture_free) (texture_type* ptexture);
+void (*texture_draw) (texture_type* ptexture, float x, float y, bool update);
+void (*texture_draw_bg) (texture_type* ptexture, bool update);
+void (*texture_draw_part)(texture_type* ptexture, float sx, float sy, float x, float y, float w, float h, bool update);
void texture_setup(void)
}
#ifndef NOOPENGL
-void texture_load_gl(texture_type* ptexture, char * file, int use_alpha)
+void texture_load_gl(texture_type* ptexture, const std::string& file, int use_alpha)
{
texture_load_sdl(ptexture,file,use_alpha);
texture_create_gl(ptexture->sdl_surface,&ptexture->gl_texture);
}
-void texture_load_part_gl(texture_type* ptexture, char * file, int x, int y, int w, int h, int use_alpha)
+void texture_load_part_gl(texture_type* ptexture, const std::string& file, int x, int y, int w, int h, int use_alpha)
{
texture_load_part_sdl(ptexture,file,x,y,w,h,use_alpha);
texture_create_gl(ptexture->sdl_surface,&ptexture->gl_texture);
glDeleteTextures(1, &ptexture->gl_texture);
}
-void texture_draw_gl(texture_type* ptexture, float x, float y, int update)
+void texture_draw_gl(texture_type* ptexture, float x, float y, bool update)
{
float pw = power_of_two(ptexture->w);
float ph = power_of_two(ptexture->h);
glDisable(GL_BLEND);
}
-void texture_draw_bg_gl(texture_type* ptexture, int update)
+void texture_draw_bg_gl(texture_type* ptexture, bool update)
{
float pw = power_of_two(ptexture->w);
float ph = power_of_two(ptexture->h);
glDisable(GL_TEXTURE_2D);
}
-void texture_draw_part_gl(texture_type* ptexture,float sx, float sy, float x, float y, float w, float h, int update)
+void texture_draw_part_gl(texture_type* ptexture,float sx, float sy, float x, float y, float w, float h, bool update)
{
float pw = power_of_two(ptexture->w);
float ph = power_of_two(ptexture->h);
}
#endif
-void texture_load_sdl(texture_type* ptexture, char * file, int use_alpha)
+void texture_load_sdl(texture_type* ptexture, const std::string& file, int use_alpha)
{
SDL_Surface * temp;
- temp = IMG_Load(file);
+ temp = IMG_Load(file.c_str());
if (temp == NULL)
st_abort("Can't load", file);
}
-void texture_load_part_sdl(texture_type* ptexture, char * file, int x, int y, int w, int h, int use_alpha)
+void texture_load_part_sdl(texture_type* ptexture, const std::string& file, int x, int y, int w, int h, int use_alpha)
{
SDL_Rect src;
SDL_Surface * temp;
SDL_Surface * conv;
- temp = IMG_Load(file);
+ temp = IMG_Load(file.c_str());
if (temp == NULL)
st_abort("Can't load", file);
#endif
}
-void texture_draw_sdl(texture_type* ptexture, float x, float y, int update)
+void texture_draw_sdl(texture_type* ptexture, float x, float y, bool update)
{
SDL_Rect dest;
}
-void texture_draw_bg_sdl(texture_type* ptexture, int update)
+void texture_draw_bg_sdl(texture_type* ptexture, bool update)
{
SDL_Rect dest;
SDL_UpdateRect(screen, dest.x, dest.y, dest.w, dest.h);
}
-void texture_draw_part_sdl(texture_type* ptexture, float sx, float sy, float x, float y, float w, float h, int update)
+void texture_draw_part_sdl(texture_type* ptexture, float sx, float sy, float x, float y, float w, float h, bool update)
{
SDL_Rect src, dest;