changeset 4522:f87721ef89ff draft

(svn r6347) Undo
author tron <tron@openttd.org>
date Sat, 02 Sep 2006 20:34:33 +0000
parents 01852a687b10
children 46380e6da3ae
files gfx.c screenshot.c spritecache.c viewport.c
diffstat 4 files changed, 5 insertions(+), 69 deletions(-) [+]
line wrap: on
line diff
--- a/gfx.c
+++ b/gfx.c
@@ -190,7 +190,7 @@
 
 	// Check clipping first
 	{
-		const DrawPixelInfo *dpi = _cur_dpi;
+		DrawPixelInfo *dpi = _cur_dpi;
 		int t;
 
 		if (x < dpi->left && x2 < dpi->left) return;
@@ -560,7 +560,7 @@
 
 int DoDrawString(const char *string, int x, int y, uint16 real_color)
 {
-	const DrawPixelInfo *dpi = _cur_dpi;
+	DrawPixelInfo *dpi = _cur_dpi;
 	FontSize size = _cur_fontsize;
 	byte c;
 	byte color;
@@ -753,47 +753,6 @@
 			break;
 
 		default:
-#if 0
-			src = src_o;
-			do {
-				int offs = bp->start_x;
-
-				dst = bp->dst;
-				for (src = src_o;; src += num + 2) {
-					skip = src[1];
-					if (skip >= offs) {
-						dst += skip;
-						break;
-					}
-					offs -= skip;
-
-					done = src[0];
-					num = done & 0x7F;
-					if (num > offs) {
-						src += offs;
-						dst += offs;
-						num -= offs;
-						break;
-					}
-				}
-
-				src += 2;
-
-				for (;;) {
-					do {
-						*dst++ = *src++;
-					} while (--num != 0);
-
-					if (done & 0x80) break;
-
-					done = *src++;
-					num = done & 0x7F;
-					dst += *src++;
-				}
-
-				bp->dst += bp->pitch;
-			} while (--bp->height != 0);
-#else
 			do {
 				do {
 					done = src_o[0];
@@ -835,7 +794,6 @@
 
 				bp->dst += bp->pitch;
 			} while (--bp->height != 0);
-#endif
 			break;
 	}
 }
--- a/screenshot.c
+++ b/screenshot.c
@@ -460,7 +460,7 @@
 // generate a large piece of the world
 static void LargeWorldCallback(void *userdata, Pixel *buf, uint y, uint pitch, uint n)
 {
-	const ViewPort* vp = (const ViewPort*)userdata;
+	ViewPort *vp = (ViewPort *)userdata;
 	DrawPixelInfo dpi, *old_dpi;
 	int wx, left;
 
--- a/spritecache.c
+++ b/spritecache.c
@@ -138,30 +138,6 @@
 			}
 		}
 
-#if 1
-		if (sprite->info & 8) {
-			byte* src = sprite->data + sprite->height * 2;
-			uint height = sprite->height;
-
-			do {
-				uint offset;
-				uint len;
-
-				offset = 0;
-				do {
-					uint skip;
-
-					skip = src[1];
-					src[1] = skip - offset;
-					offset = skip;
-
-					len = src[0];
-					src += (len & 0x7F) + 2;
-				} while (!(len & 0x80));
-			} while (--height != 0);
-		}
-#endif
-
 		return sprite;
 	}
 }
--- a/viewport.c
+++ b/viewport.c
@@ -1177,6 +1177,8 @@
 
 		ss = ss->next;
 	} while (ss != NULL);
+
+	_cur_dpi = dpi;
 }
 
 void ViewportDoDraw(const ViewPort *vp, int left, int top, int right, int bottom)