diff options
Diffstat (limited to 'libwinnie/src')
-rw-r--r-- | libwinnie/src/gfx.cc | 18 | ||||
-rw-r--r-- | libwinnie/src/sdl/gfx.cc | 10 | ||||
-rw-r--r-- | libwinnie/src/sdl/gfx.h | 4 | ||||
-rw-r--r-- | libwinnie/src/wm.cc | 2 |
4 files changed, 15 insertions, 19 deletions
diff --git a/libwinnie/src/gfx.cc b/libwinnie/src/gfx.cc index 0ecf8ed..5aad1b8 100644 --- a/libwinnie/src/gfx.cc +++ b/libwinnie/src/gfx.cc @@ -18,8 +18,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. Author: Eleni Maria Stea <elene.mst@gmail.com> */ -#include <algorithm> #include <inttypes.h> +#include <math.h> #include <stdio.h> #include <string.h> @@ -265,6 +265,18 @@ draw_line(Pixmap *pixmap, int x0, int y0, int x1, int y1, int r, int g, int b) } } +static inline int +min(int x, int y) +{ + return x < y ? x : y; +} + +static inline int +max(int x, int y) +{ + return x > y ? x : y; +} + void draw_polygon( Pixmap *pixmap, int *vpos, int *vtex, int num_verts, int r, int g, int b) @@ -305,8 +317,8 @@ draw_polygon( } } - ystart = std::min(ystart, std::min(y0, y1)); - yend = std::max(yend, std::max(y0, y1)); + ystart = min(ystart, min(y0, y1)); + yend = max(yend, max(y0, y1)); } if (ystart < 0) diff --git a/libwinnie/src/sdl/gfx.cc b/libwinnie/src/sdl/gfx.cc index 644c9d4..bab4e7b 100644 --- a/libwinnie/src/sdl/gfx.cc +++ b/libwinnie/src/sdl/gfx.cc @@ -130,11 +130,6 @@ get_clipping_rect() } void -set_cursor_visibility(bool visible) -{ -} - -void gfx_update(const Rect &upd_rect) { if (SDL_MUSTLOCK(fbsurf)) { @@ -161,11 +156,6 @@ gfx_update(const Rect &upd_rect) } void -wait_vsync() -{ -} - -void get_rgb_order(int *r, int *g, int *b) { *r = fbsurf->format->Rshift / 8; diff --git a/libwinnie/src/sdl/gfx.h b/libwinnie/src/sdl/gfx.h index 36e7e36..b0dfa2e 100644 --- a/libwinnie/src/sdl/gfx.h +++ b/libwinnie/src/sdl/gfx.h @@ -36,12 +36,8 @@ int get_color_depth(); void set_clipping_rect(const Rect &clip_rect); const Rect &get_clipping_rect(); -void set_cursor_visibility(bool visible); - void gfx_update(const Rect &rect); -void wait_vsync(); // vertical synchronization - void get_rgb_order(int *r, int *g, int *b); #endif // GFX_H_ diff --git a/libwinnie/src/wm.cc b/libwinnie/src/wm.cc index 25a7e43..b4983e7 100644 --- a/libwinnie/src/wm.cc +++ b/libwinnie/src/wm.cc @@ -171,8 +171,6 @@ WindowManager::process_windows() } dirty_rects.clear(); - wait_vsync(); - if (!background) { fill_rect(uni, bg_color[0], bg_color[1], bg_color[2]); } else { |