delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/04/26/18:58:07

From: "Peter" <icecoldgames AT hotmail DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Pcx decoding prob or..
Lines: 41
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.3018.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.3018.1300
Message-ID: <kPYF6.224$w82.11790@read2.inet.fi>
Date: Thu, 26 Apr 2001 17:22:24 GMT
NNTP-Posting-Host: 213.28.228.180
X-Trace: read2.inet.fi 988305744 213.28.228.180 (Thu, 26 Apr 2001 20:22:24 EET DST)
NNTP-Posting-Date: Thu, 26 Apr 2001 20:22:24 EET DST
Organization: Sonera corp Internet services
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hi there!

I think have a small problem with my pcx decoding routine or with
dosmemput(). Since the picture looks like being rasterized heavily.

First: my doublebuffer is defined like this

unsigned char *doublebuffer = (unsigned char *)malloc(320*200);

i hope its ok. Then the decoding code is like this: i have a feeling the
error is here but i cant find out what it is. Thanks to anyone who has the
time to help me out. By the way while im at it, is .bmp file encoded with
RLE as .pcx image is?.  I know that .tga doesnt seem to be at least thats
what the tutorials  i've read say..

Thanks alot everyone!
Peter.

int total_bytes,total,totalb; /* should this be long? */
unsigned long count,data; */ or char ? */
totalb = image.width * image.heigth (1 image.ymax - image.ymin);

while(count<=totalb)
{
 data = getc(Data);
 if(data>=192 && data<=255)
  {
  total_bytes = data-192;
  data = getc(Data);
  while(total_bytes-->0)
   {
   doublebuffer[count++] = data;
   }
 }
 else
  {
  doublebuffer[count++] = data;
  }
}


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019