diff --git a/bin/OpenLara b/bin/OpenLara index 9ab0f13..a705243 100755 Binary files a/bin/OpenLara and b/bin/OpenLara differ diff --git a/src/nix/build.sh b/src/nix/build.sh index 008a4ec..23e0c5b 100755 --- a/src/nix/build.sh +++ b/src/nix/build.sh @@ -1 +1,2 @@ -clang++ -std=c++11 -Os -s -fno-exceptions -fno-rtti main.cpp ../libs/stb_vorbis/stb_vorbis.c -I../ -o../../bin/OpenLara -lX11 -lGL -lm -lpthread -lpulse-simple -lpulse -ffunction-sections -fdata-sections -Wl,--gc-sections +clang++ -std=c++11 -Os -s -fno-exceptions -fno-rtti -ffunction-sections -fdata-sections -Wl,--gc-sections -DNDEBUG main.cpp ../libs/stb_vorbis/stb_vorbis.c -I../ -o../../bin/OpenLara -lX11 -lGL -lm -lpthread -lpulse-simple -lpulse +strip ../../bin/OpenLara --strip-all --remove-section=.comment --remove-section=.note diff --git a/src/nix/main.cpp b/src/nix/main.cpp index ae47095..03577ef 100644 --- a/src/nix/main.cpp +++ b/src/nix/main.cpp @@ -104,6 +104,10 @@ void WndProc(const XEvent &e) { break; case KeyPress : case KeyRelease : + if (e.type == KeyPress && (e.xkey.state & Mod1Mask) && e.xkey.keycode == 36) { + // TODO: windowed <-> fullscreen switch + break; + } Input::setDown(keyToInputKey(e.xkey.keycode), e.type == KeyPress); break; case ButtonPress : @@ -111,12 +115,10 @@ void WndProc(const XEvent &e) { InputKey key = mouseToInputKey(e.xbutton.button); Input::setPos(key, Input::mouse.pos); Input::setDown(key, e.type == ButtonPress); - printf("%d\n", (int)e.xbutton.button); break; } case MotionNotify : Input::setPos(ikMouseL, vec2((float)e.xmotion.x, (float)e.xmotion.y)); - printf("mouse: %d %d\n", (int)e.xmotion.x, (int)e.xmotion.y); break; } } @@ -152,11 +154,6 @@ int main() { Atom WM_DELETE_WINDOW = XInternAtom(dpy, "WM_DELETE_WINDOW", 0); XSetWMProtocols(dpy, wnd, &WM_DELETE_WINDOW, 1); -// XGrabPointer(dpy, wnd, false, -// ButtonPressMask | ButtonReleaseMask | PointerMotionMask | ButtonMotionMask, -// GrabModeAsync, GrabModeAsync, wnd, None, CurrentTime); - XGrabKeyboard(dpy, wnd, false, 1, 1, 0); - sndInit(); Game::init(); diff --git a/src/utils.h b/src/utils.h index ac33f32..d411c7c 100644 --- a/src/utils.h +++ b/src/utils.h @@ -19,7 +19,7 @@ #else #define ASSERT(expr) - #define LOG(...) ((void)0) + #define LOG(...) // #define LOG(...) printf(__VA_ARGS__) #endif @@ -528,4 +528,4 @@ struct Stream { } }; -#endif \ No newline at end of file +#endif