RTC_Marine Posted January 17, 2005 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. 0 Share this post Link to post
Udderdude Posted January 17, 2005 Dude, that chaingun like .. melted :X Nice job 0 Share this post Link to post
Csabo Posted January 20, 2005 The problem is in the inner loop: 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. 0 Share this post Link to post
RTC_Marine Posted January 20, 2005 thanks for your reply :) after much hair pulling and human sacrifices, I managed to fabricate this: 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. :) 0 Share this post Link to post
Csabo Posted January 21, 2005 You got it. XWE's new competitor in the works? 0 Share this post Link to post
RTC_Marine Posted January 21, 2005 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. :) 0 Share this post Link to post
Bloodshedder Posted January 22, 2005 Pray tell, what programming language is that? 0 Share this post Link to post
Csabo Posted January 22, 2005 Delphi (Pascal). XWE is written in Delphi as well. 0 Share this post Link to post