VERSIÓ 1.3.15
- [NEW] mouse.dblclick() - [FIX] de vegades no pillava be la rodeta del ratolí - [NEW] sys.dir() torna el contingut del directori primer les carpetes, i tot ordenat alfabèticament - [WIP] Treballant en ferramentes
This commit is contained in:
16
mini.cpp
16
mini.cpp
@@ -112,6 +112,7 @@ Uint8 key_just_pressed = 0;
|
||||
int mouse_x, mouse_y, mouse_wheel;
|
||||
Uint32 mouse_buttons;
|
||||
uint8_t mouse_just_pressed = 0;
|
||||
bool double_click = false;
|
||||
bool mouse_discard = false;
|
||||
|
||||
SDL_Gamepad *gamepad = NULL;
|
||||
@@ -479,8 +480,9 @@ int main(int argc,char*argv[]){
|
||||
key_just_pressed = 0;
|
||||
pad_just_pressed = SDL_GAMEPAD_BUTTON_INVALID;
|
||||
mouse_just_pressed = 0;
|
||||
mouse_wheel = 0;
|
||||
double_click = false;
|
||||
while(!should_exit) {
|
||||
mouse_wheel = 0;
|
||||
if (update_mode==UPDATE_WAIT) SDL_WaitEvent(NULL);
|
||||
else if (update_mode==UPDATE_TIMEOUT) SDL_WaitEventTimeout(NULL, timeout);
|
||||
while(SDL_PollEvent(&mini_eve)) {
|
||||
@@ -522,7 +524,11 @@ int main(int argc,char*argv[]){
|
||||
if (mouse_discard)
|
||||
mouse_discard = false;
|
||||
else
|
||||
mouse_just_pressed = mini_eve.button.button;
|
||||
if (mini_eve.button.clicks==2 && mini_eve.button.button==SDL_BUTTON_LEFT) {
|
||||
double_click = true;
|
||||
} else {
|
||||
mouse_just_pressed = mini_eve.button.button;
|
||||
}
|
||||
}
|
||||
if (mini_eve.type == SDL_EVENT_MOUSE_WHEEL) {
|
||||
mouse_wheel = mini_eve.wheel.y;
|
||||
@@ -558,6 +564,8 @@ int main(int argc,char*argv[]){
|
||||
if (beats>0)beats--;
|
||||
key_just_pressed = 0;
|
||||
mouse_just_pressed = 0;
|
||||
double_click = false;
|
||||
mouse_wheel = 0;
|
||||
pad_just_pressed = SDL_GAMEPAD_BUTTON_INVALID;
|
||||
}
|
||||
SDL_SetRenderTarget(mini_ren, mini_shadertex);
|
||||
@@ -1313,6 +1321,10 @@ bool mbtnp(uint8_t i) {
|
||||
return mouse_just_pressed == i;
|
||||
}
|
||||
|
||||
bool doubleclick() {
|
||||
return double_click;
|
||||
}
|
||||
|
||||
void mdiscard() {
|
||||
mouse_discard = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user