mirror of
https://github.com/clangen/musikcube.git
synced 2025-03-14 04:18:36 +00:00
- Added stderr redirect to file (or /dev/null) based on platform and build config
- Added Window::Invalidate() that can be called to force a full refresh
This commit is contained in:
parent
9400c65a61
commit
6ba643a2cc
@ -56,6 +56,8 @@
|
||||
|
||||
#include <boost/chrono.hpp>
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
#ifdef WIN32
|
||||
#undef MOUSE_MOVED
|
||||
#endif
|
||||
@ -196,6 +198,12 @@ int main(int argc, char* argv[])
|
||||
|
||||
#ifndef WIN32
|
||||
setlocale(LC_ALL, "");
|
||||
|
||||
#ifdef DEBUG
|
||||
freopen("/tmp/musikbox.log", "w", stderr);
|
||||
#else
|
||||
freopen("/dev/null", "w", stderr);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
musik::debug::init();
|
||||
@ -267,6 +275,9 @@ int main(int argc, char* argv[])
|
||||
else if (kn == "^D") { /* ctrl+d quits */
|
||||
quit = true;
|
||||
}
|
||||
else if (kn == "ALT_R" || kn == "M-r") {
|
||||
Window::Invalidate();
|
||||
}
|
||||
else if (kn == "KEY_RESIZE") {
|
||||
resizeAt = now() + REDRAW_DEBOUNCE_MS;
|
||||
}
|
||||
|
@ -32,6 +32,11 @@ void Window::WriteToScreen(IInput* input) {
|
||||
}
|
||||
}
|
||||
|
||||
void Window::Invalidate() {
|
||||
wclear(stdscr);
|
||||
drawPending = true;
|
||||
}
|
||||
|
||||
Window::Window(IWindow *parent) {
|
||||
this->frame = this->content = 0;
|
||||
this->framePanel = this->contentPanel = 0;
|
||||
|
@ -51,6 +51,7 @@ namespace cursespp {
|
||||
virtual void SetFocusOrder(int order = -1);
|
||||
|
||||
static void WriteToScreen(IInput* input);
|
||||
static void Invalidate();
|
||||
|
||||
protected:
|
||||
IWindow* GetParent() const;
|
||||
|
Loading…
x
Reference in New Issue
Block a user