changeset 3038:fa8665a91729

subtitles looked bad here (inverted colors sometimes) looked like values wrapped around the byte (not sure of the side effects but subtitles look good now)
author pl
date Tue, 20 Nov 2001 21:45:07 +0000
parents 3fc9a8b9f178
children 80189681c02b
files spudec.c
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/spudec.c	Tue Nov 20 20:46:39 2001 +0000
+++ b/spudec.c	Tue Nov 20 21:45:07 2001 +0000
@@ -153,7 +153,11 @@
       len = this->width - x;
     /* FIXME have to use palette and alpha map*/
     memset(this->image + y * this->width + x, cmap[color], len);
-    memset(this->aimage + y * this->width + x, alpha[color], len);
+    if (alpha[color] < cmap[color]) {
+      memset(this->aimage + y * this->width + x, 1, len);
+    } else {
+      memset(this->aimage + y * this->width + x, alpha[color] - cmap[color], len);
+    }
     x += len;
     if (x >= this->width) {
       next_line(this);