Date: | 2012-04-10 22:33:43 (11 years 11 months ago) |
---|---|
Author: | Maarten ter Huurne |
Commit: | b248aaf8089fdd4ac41136f1eef3b8668e24fcc3 |
Message: | Surface cleanup. Use unsigned ints for width and height, like SDL does. We're using the SDL typedefs there after all. Include argument names in header when type name does tell everything. Use whitespace in argument lists. |
Files: |
src/surface.cpp (2 diffs) src/surface.h (1 diff) |
Change Details
src/surface.cpp | ||
---|---|---|
146 | 146 | return blitRight(destination->raw,x,y,w,h,a); |
147 | 147 | } |
148 | 148 | |
149 | int Surface::box(Sint16 x, Sint16 y, Sint16 w, Sint16 h, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { | |
150 | return boxRGBA(raw,x,y,x+w-1,y+h-1,r,g,b,a); | |
149 | int Surface::box(Sint16 x, Sint16 y, Uint16 w, Uint16 h, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { | |
150 | return boxRGBA(raw, x, y, x + w - 1, y + h - 1, r, g, b, a); | |
151 | 151 | } |
152 | int Surface::box(Sint16 x, Sint16 y, Sint16 w, Sint16 h, Uint8 r, Uint8 g, Uint8 b) { | |
153 | SDL_Rect re = {x,y,w,h}; | |
154 | return SDL_FillRect(raw, &re, SDL_MapRGBA(raw->format,r,g,b,255)); | |
152 | int Surface::box(Sint16 x, Sint16 y, Uint16 w, Uint16 h, Uint8 r, Uint8 g, Uint8 b) { | |
153 | SDL_Rect re = { x, y, w, h }; | |
154 | return SDL_FillRect(raw, &re, SDL_MapRGBA(raw->format, r, g, b, 255)); | |
155 | 155 | } |
156 | int Surface::box(Sint16 x, Sint16 y, Sint16 w, Sint16 h, RGBAColor c) { | |
157 | return box(x,y,w,h,c.r,c.g,c.b,c.a); | |
156 | int Surface::box(Sint16 x, Sint16 y, Uint16 w, Uint16 h, RGBAColor c) { | |
157 | return box(x, y, w, h, c.r, c.g, c.b, c.a); | |
158 | 158 | } |
159 | 159 | int Surface::box(SDL_Rect re, RGBAColor c) { |
160 | 160 | return boxRGBA( |
... | ... | |
162 | 162 | ); |
163 | 163 | } |
164 | 164 | |
165 | int Surface::rectangle(Sint16 x, Sint16 y, Sint16 w, Sint16 h, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { | |
166 | return rectangleRGBA(raw,x,y,x+w-1,y+h-1,r,g,b,a); | |
165 | int Surface::rectangle(Sint16 x, Sint16 y, Uint16 w, Uint16 h, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { | |
166 | return rectangleRGBA(raw, x, y, x + w - 1, y + h - 1, r, g, b, a); | |
167 | 167 | } |
168 | int Surface::rectangle(Sint16 x, Sint16 y, Sint16 w, Sint16 h, RGBAColor c) { | |
169 | return rectangle(x,y,w,h,c.r,c.g,c.b,c.a); | |
168 | int Surface::rectangle(Sint16 x, Sint16 y, Uint16 w, Uint16 h, RGBAColor c) { | |
169 | return rectangle(x, y, w, h, c.r, c.g, c.b, c.a); | |
170 | 170 | } |
171 | 171 | int Surface::rectangle(SDL_Rect re, RGBAColor c) { |
172 | return rectangle(re.x,re.y,re.w,re.h,c.r,c.g,c.b,c.a); | |
172 | return rectangle(re.x, re.y, re.w, re.h, c.r, c.g, c.b, c.a); | |
173 | 173 | } |
174 | 174 | |
175 | int Surface::hline(Sint16 x, Sint16 y, Sint16 w, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { | |
176 | return hlineRGBA(raw,x,x+w-1,y,r,g,b,a); | |
175 | int Surface::hline(Sint16 x, Sint16 y, Uint16 w, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { | |
176 | return hlineRGBA(raw, x, x + w - 1, y, r, g, b, a); | |
177 | 177 | } |
178 | 178 | |
179 | 179 | void Surface::clearClipRect() { |
src/surface.h | ||
---|---|---|
72 | 72 | font->write(this, text, x, y, halign, valign); |
73 | 73 | } |
74 | 74 | |
75 | int box(Sint16, Sint16, Sint16, Sint16, Uint8, Uint8, Uint8, Uint8); | |
76 | int box(Sint16, Sint16, Sint16, Sint16, Uint8, Uint8, Uint8); | |
77 | int box(Sint16, Sint16, Sint16, Sint16, RGBAColor); | |
75 | int box(Sint16 x, Sint16 y, Uint16 w, Uint16 h, Uint8 r, Uint8 g, Uint8 b, Uint8 a); | |
76 | int box(Sint16 x, Sint16 y, Uint16 w, Uint16 h, Uint8 r, Uint8 g, Uint8 b); | |
77 | int box(Sint16 x, Sint16 y, Uint16 w, Uint16 h, RGBAColor); | |
78 | 78 | int box(SDL_Rect, RGBAColor); |
79 | int rectangle(Sint16, Sint16, Sint16, Sint16, Uint8, Uint8, Uint8, Uint8); | |
80 | int rectangle(Sint16, Sint16, Sint16, Sint16, RGBAColor); | |
79 | int rectangle(Sint16, Sint16, Uint16, Uint16, Uint8 r, Uint8 g, Uint8 b, Uint8 a); | |
80 | int rectangle(Sint16, Sint16, Uint16, Uint16, RGBAColor); | |
81 | 81 | int rectangle(SDL_Rect, RGBAColor); |
82 | int hline(Sint16, Sint16, Sint16, Uint8, Uint8, Uint8, Uint8); | |
82 | int hline(Sint16 x, Sint16 y, Uint16 h, Uint8 r, Uint8 g, Uint8 b, Uint8 a); | |
83 | 83 | |
84 | 84 | private: |
85 | 85 | Surface(SDL_Surface *raw, bool freeWhenDone); |
Branches:
install_locations
master
opkrun
packages