X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fmousecursor.cpp;h=91f727bebac1e307a5570927c11cc9a95efe8730;hb=8649bd473126548ff289351cb425beddb29f4e07;hp=f7a5993a4e7419d9d42fe87b3b89b2f9ed0e2063;hpb=2c78a029e3c7915c34011ac12f2ad07d5a46e0df;p=supertux.git diff --git a/src/mousecursor.cpp b/src/mousecursor.cpp index f7a5993a4..91f727beb 100644 --- a/src/mousecursor.cpp +++ b/src/mousecursor.cpp @@ -15,7 +15,7 @@ MouseCursor::MouseCursor(std::string cursor_file, int frames) { - texture_load(&cursor,cursor_file.c_str(),USE_ALPHA); + cursor = new Surface(cursor_file, USE_ALPHA); cur_state = MC_NORMAL; cur_frame = 0; @@ -29,7 +29,7 @@ MouseCursor::MouseCursor(std::string cursor_file, int frames) MouseCursor::~MouseCursor() { - texture_free(&cursor); + delete cursor; SDL_ShowCursor(SDL_ENABLE); } @@ -48,8 +48,8 @@ void MouseCursor::draw() { int x,y,w,h; Uint8 ispressed = SDL_GetMouseState(&x,&y); - w = cursor.w / tot_frames; - h = cursor.h / MC_STATES_NB; + w = cursor->w / tot_frames; + h = cursor->h / MC_STATES_NB; if(ispressed &SDL_BUTTON(1) || ispressed &SDL_BUTTON(2)) { if(cur_state != MC_CLICK) @@ -73,5 +73,5 @@ void MouseCursor::draw() timer.start(MC_FRAME_PERIOD); } - texture_draw_part(&cursor, w*cur_frame, h*cur_state , x, y, w, h); + cursor->draw_part(w*cur_frame, h*cur_state , x, y, w, h); }