From 75667b81215bdb3896599ec477a256c41fc90436 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Fri, 21 Sep 2012 18:24:57 +0200 Subject: split program into multiple files; switched to C++ --- layer_box.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 layer_box.cpp (limited to 'layer_box.cpp') diff --git a/layer_box.cpp b/layer_box.cpp new file mode 100644 index 0000000..d229833 --- /dev/null +++ b/layer_box.cpp @@ -0,0 +1,29 @@ +#include + +#include +#include + +#include "osc_graphics.h" +#include "layer_box.h" + +void +LayerBox::geo(SDL_Rect geo) +{ + x1 = geo.x; + y1 = geo.y; + x2 = geo.x + geo.w; + y2 = geo.y + geo.h; +} + +void +LayerBox::alpha(float opacity) +{ + a = (Uint8)ceilf(opacity*SDL_ALPHA_OPAQUE); +} + +void +LayerBox::frame(SDL_Surface *target) +{ + boxRGBA(target, x1, y1, x2 ? : target->w, y2 ? : target->h, + r, g, b, a); +} -- cgit v1.2.3