- if(ispressed &SDL_BUTTON(1) || ispressed &SDL_BUTTON(2))
- {
- if(cur_state != MC_CLICK)
- {
- state_before_click = cur_state;
- cur_state = MC_CLICK;
- }
- }
- else
- {
- if(cur_state == MC_CLICK)
- cur_state = state_before_click;
- }
-
- if(timer.get_left() < 0 && tot_frames > 1)
- {
- cur_frame++;
- if(cur_frame++ >= tot_frames)
- cur_frame = 0;
-
- timer.start(MC_FRAME_PERIOD);
+ if(ispressed &SDL_BUTTON(1) || ispressed &SDL_BUTTON(2)) {
+ if(cur_state != MC_CLICK) {
+ state_before_click = cur_state;
+ cur_state = MC_CLICK;