From 93599c1be548fb9938d5da8d45c96e9ece760ea1 Mon Sep 17 00:00:00 2001 From: Darkvater Date: Tue, 24 Oct 2006 23:11:40 +0000 Subject: (svn r6938) -Codechange: Comments, typo, variable naming, whitespace, strecpy and simplification of order_gui (only disable a single widget if not local player, all others aren't visible anyways). --- gfx.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'gfx.c') diff --git a/gfx.c b/gfx.c index e54680453..8ffb5de59 100644 --- a/gfx.c +++ b/gfx.c @@ -33,22 +33,19 @@ static byte _string_colorremap[3]; #define DIRTY_BYTES_PER_LINE (MAX_SCREEN_WIDTH / 64) static byte _dirty_blocks[DIRTY_BYTES_PER_LINE * MAX_SCREEN_HEIGHT / 8]; - - -void memcpy_pitch(void *d, void *s, int w, int h, int spitch, int dpitch) +void memcpy_pitch(void *dst, void *src, int w, int h, int srcpitch, int dstpitch) { - byte *dp = (byte*)d; - byte *sp = (byte*)s; + byte *dstp = (byte*)dst; + byte *srcp = (byte*)src; assert(h >= 0); for (; h != 0; --h) { - memcpy(dp, sp, w); - dp += dpitch; - sp += spitch; + memcpy(dstp, srcp, w); + dstp += dstpitch; + srcp += srcpitch; } } - void GfxScroll(int left, int top, int width, int height, int xo, int yo) { const Pixel *src; @@ -583,7 +580,14 @@ BoundingRect GetStringBoundingBox(const char *str) return br; } - +/** Draw a string at the given coordinates with the given colour + * @param string the string to draw + * @param x offset from left side of the screen, if negative offset from the right side + * @param x offset from top side of the screen, if negative offset from the bottom + * @param real_color colour of the string, see _string_colormap in + * table/palettes.h or docs/ottd-colourtext-palette.png + * @return the x-coordinates where the drawing has finished. If nothing is drawn + * the originally passed x-coordinate is returned */ int DoDrawString(const char *string, int x, int y, uint16 real_color) { DrawPixelInfo *dpi = _cur_dpi; -- cgit v1.2.3-70-g09d2