diff --git a/examples/Old_Mine.mts b/examples/Old_Mine.mts index cd52197..c30f4e8 100644 Binary files a/examples/Old_Mine.mts and b/examples/Old_Mine.mts differ diff --git a/mtsedit-i686-win.zip b/mtsedit-i686-win.zip index e75e785..78b59ce 100644 Binary files a/mtsedit-i686-win.zip and b/mtsedit-i686-win.zip differ diff --git a/mtsedit-x86_64-linux.tgz b/mtsedit-x86_64-linux.tgz index c89ca9a..cd29139 100644 Binary files a/mtsedit-x86_64-linux.tgz and b/mtsedit-x86_64-linux.tgz differ diff --git a/src/Makefile b/src/Makefile index c820876..997eca8 100644 --- a/src/Makefile +++ b/src/Makefile @@ -76,7 +76,8 @@ install: $(TARGET) install -m 755 -g bin $(TARGET) /usr/bin @mkdir -p /usr/share/mtsedit cp ../data/* /usr/share/mtsedit - cp -r ../mt-mod/mtsedit ~/.minetest/mods + cp ../etc/mtsedit.desktop /usr/share/applications + cp ../etc/mtsedit.png /usr/share/icons/hicolor/32x32/apps package: ifeq ("$(PACKAGE)","Linux") @@ -93,15 +94,15 @@ ifeq ("$(PACKAGE)","Win") @cp $(TARGET).exe MTSEdit/$(TARGET).exe @cp $(MINGWSDL)/i686-w64-mingw32/bin/SDL2.dll MTSEdit/SDL2.dll @cp -r ../data MTSEdit/data - zip ../$(TARGET)-i686-win.zip MTSEdit + zip -r ../$(TARGET)-i686-win.zip MTSEdit @rm -rf MTSEdit else @mkdir MTSEdit.app MTSEdit.app/Contents MTSEdit.app/Contents/MacOS MTSEdit.app/Contents/Resources - @cp $(TARGET) MTSEdir.app/Contents/MacOS - @cp ../etc/Info.list MTSEdit.app/Contents + @cp $(TARGET) MTSEdit.app/Contents/MacOS + @cp ../etc/Info.plist MTSEdit.app/Contents @cp ../etc/mtsedit.icns MTSEdit.app/Contents/Resources @cp -r ../data MTSEdit.app/Contents/Resources - zip ../$(TARGET)-intel-macosx.zip MTSEdit + zip -r ../$(TARGET)-intel-macosx.zip MTSEdit.app @rm -rf MTSEdit.app endif endif diff --git a/src/edit.c b/src/edit.c index 0b84faa..d0ae1da 100644 --- a/src/edit.c +++ b/src/edit.c @@ -417,9 +417,7 @@ void edit_key(SDL_Event *event) case SDLK_PERIOD: edit_zoomin(); break; case SDLK_BACKSPACE: case SDLK_DELETE: - case SDLK_SPACE: - brush_place(event->key.keysym.sym == SDLK_SPACE && !shift ? palette[activeblock] : 0); - break; + case SDLK_SPACE: brush_place(event->key.keysym.sym == SDLK_SPACE && !shift ? palette[activeblock] : 0); break; case SDLK_RETURN: brush_floodfill(!shift ? palette[activeblock] : 0); break; case SDLK_z: hist_undo(); break; case SDLK_y: hist_redo(); break; diff --git a/src/sdl.c b/src/sdl.c index baa5a2e..cb6ad81 100644 --- a/src/sdl.c +++ b/src/sdl.c @@ -341,7 +341,7 @@ int sdlmain(int opt) unsigned char *icondata; char *fn, *title; int iw = 0, ih = 0, len, i, j, k, l; - SDL_Event event; + SDL_Event event, lookahead; /* this is tricky, because extern wouldn't know sizeof() */ if(opt) return instmod(binary_mtsedit, sizeof(binary_mtsedit)); @@ -413,6 +413,14 @@ int sdlmain(int opt) /* main loop */ while (!quitting) { if (SDL_WaitEvent(&event)) { + /* check if we have multiple mouse motion events in the queue, only serve the last */ + if(event.type == SDL_MOUSEMOTION) { + lookahead.type = 0; + while(SDL_PollEvent(&lookahead) && lookahead.type == SDL_MOUSEMOTION) + memcpy(&event, &lookahead, sizeof(SDL_Event)); + if(lookahead.type && lookahead.type != SDL_MOUSEMOTION) + SDL_PushEvent(&lookahead); + } switch (event.type) { /* window events */ case SDL_QUIT: quitting = 1; break;