Doom monster
Register | User Profile | Member List | F.A.Q | Privacy Policy | New Blog | Search Forums | Forums Home
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Special Interest > XWE > Doom Image format
 
Author
All times are GMT. The time now is 21:05. Post New Thread    Post A Reply
RTC_Marine
Junior Member


Posts: 544
Registered: 06-01


Csabo (or anyone), could you please take a look at this piece of code and tell me what I am doing wrong? I know I am missing some pieces from that code for sure:
http://russell.slipgate.org/text/img-problem.txt

as you see, I haven't done alot of graphics programming. :/

Also, this is the result of the function:
http://russell.slipgate.org/images/prob1.bmp
http://russell.slipgate.org/images/prob2.bmp

any help would be appreciated, thanks.

Old Post 01-17-05 04:15 #
RTC_Marine is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
udderdude
Senior Member


Posts: 1415
Registered: 04-02


Dude, that chaingun like .. melted :X Nice job

Old Post 01-17-05 05:10 #
udderdude is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Csabo
Moderator


Posts: 541
Registered: 02-02


The problem is in the inner loop:

code:
for b := 0 to DPic.Height-1 do begin dStream.Read(pixels,1); TByteArray(Result.ScanLine[b]^)[a] := pixels; end;


This won't work. Instead you need a while loop, which stops when a $FF is reached. Here's an example sequence from an imaginary image. If you can process this, you are in business:

$10 $03 $AA $F1 $F2 $F3 $AA
$20 $05 $AA $F1 $F2 $F3 $F4 $F5 $AA
$FF

$10 means the sequence starts from $10 pixels down. $03 means three pixels will follow, however there's an extra byte in the beginning and end, so the $AA's are ALL skipped, you should ignore those bytes completely. The $Fx values are the actual pixels. Then another 5 pixel sequence from $20, and the then $FF tells you this column is done. Every other pixel in this column is 'undefined' or 'transparent' if you will.

This is the basic doom image format, for 'tall sprites' it's a bit different, but once you have the basic, that change will be easy. Hope this helps.

Old Post 01-20-05 02:22 #
Csabo is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
RTC_Marine
Junior Member


Posts: 544
Registered: 06-01


thanks for your reply :)

after much hair pulling and human sacrifices, I managed to fabricate this:

code:
for a := 0 to DPic.Width-1 do begin dStream.Seek(DPic.ColumnOffsets[a], soFromBeginning); rowstart := 0; while rowstart <> 255 do begin dStream.Read(rowstart,1); if rowstart = 255 then break; dStream.Read(numpixels,1); dStream.Read(dummy,1); for b := 0 to numpixels-1 do begin dStream.Read(pixels,1); TByteArray(Result.ScanLine[b+rowstart]^)[a] := pixels; end; dStream.Read(dummy,1); end; end;


it seems to work, I cant see any visual problems so far. :)

Old Post 01-20-05 07:44 #
RTC_Marine is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Csabo
Moderator


Posts: 541
Registered: 02-02


You got it. XWE's new competitor in the works?

Old Post 01-21-05 01:47 #
Csabo is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
RTC_Marine
Junior Member


Posts: 544
Registered: 06-01


hehe kinda, only this will only be supporting the doom games and will only support vanilla doom - no ports in other words, just trying to make a wintex clone really. :)

Old Post 01-21-05 05:57 #
RTC_Marine is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Bloodshedder
Spellchecker


Posts: 5510
Registered: 03-02


Pray tell, what programming language is that?

Old Post 01-22-05 01:37 #
Bloodshedder is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Csabo
Moderator


Posts: 541
Registered: 02-02


Delphi (Pascal). XWE is written in Delphi as well.

Old Post 01-22-05 02:42 #
Csabo is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
All times are GMT. The time now is 21:05. Post New Thread    Post A Reply
 
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Special Interest > XWE > Doom Image format

Show Printable Version | Email this Page | Subscribe to this Thread

 

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are OFF
[IMG] code is ON
 

< Contact Us - Doomworld >

Powered by: vBulletin Version 2.2.5
Copyright ©2000, 2001, Jelsoft Enterprises Limited.