Advertisement

File Converter

Started by March 10, 2002 10:57 AM
8 comments, last by Quantrizi 22 years, 9 months ago
I am working on a file converter for the following file types: - *.grp - *.bmp - *.gif, and - *.jpg I was wondering if anyone knew how to load images besides the *.bmp files. Or if anyone has the specs for any of these files or anything to help. Thank You, Quantrizi If you care about her/him, you''''ll listen If you love her/him, you''''ll heal his/her wounds If you like her/him, you''''ll do all of the above, and help her/him in need A person who cares is a person who never speaks
Take a look at wotsit.org and programmersheaven.com
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes." - the Laughing Man
Advertisement
quote: Original post by LessBread
Take a look at wotsit.org and programmersheaven.com

I''ve been to both, but I''ll look again. Thanks.



If you care about her/him, you''''ll listen
If you love her/him, you''''ll heal his/her wounds
If you like her/him, you''''ll do all of the above, and help her/him in need

A person who cares is a person who never speaks
two others for your perusal:

www.darwin3d.com
avalon.viewpoint.com

I've also Email'd you source for a VB image engine with all those file formats included.

,Jay

Edit: Spelling.


Edited by - Jason Zelos on March 10, 2002 2:41:27 PM
Your email hates attachments, mail me and I''ll reply with the code to that address.

,Jay
I sent you the e-mail....I need some help on the script though. And why won''t it compile without freezing??!! I should''ve stated this earlier, but I''m using Dev-C++

If you care about her/him, you''''ll listen
If you love her/him, you''''ll heal his/her wounds
If you like her/him, you''''ll do all of the above, and help her/him in need

A person who cares is a person who never speaks
Advertisement
for the *.grp is it by any chance the grp files from either
duke3d
blood
shadow warrior
new world 4
build
legend of the 7 paladins
nam
nam2
or any other build game?

if so it is a Group file. I still have the source code for it lying around on two zip disks somewhere. This thing is a storage container. The graphics for these are in *.art files (except somewhere they called them dat). These are sometimes in the group files. The format is in the readme''s for editart.


Beer - the love catalyst
good ol'' homepage
Beer - the love catalystgood ol' homepage
The are from the game StarCraft made by Blizzard.
Last year i was working on starcraft mods, and I needed to create new grp files to patch into the mpq. Anyway, the grp consists of many files, but there''s always one *.ral file and the other files are always *.bmp images with an encoded pallet. The *.ral file contains image names, like this:

say were looking at the wraith.ral file:
wraith1.bmp
wraith2.bmp
wraith3.bmp

etc.. etc.

There is one program that was made specifically for starcraft editing and making grp''s, its called RetroGRP. search around on starcraft mod sites (www.camsys.org, www.campaigncreations.com, www.infoceptor.com) and see if you can find it. I''m not sure if this will help with your program, but it might get you one step furthor.


Also, i pulled this off of one of the sites mentioned above - i''m not sure if its usefull or not:

The GRP-file-format - used by Blizzard Inc. for StarCraft(TM)-------------------------------------------------------------some notes----------All decriptions below are based on experiences during coding the CV-tool.I''ll give no guaranties for completeness and correction - it works as descripted with at least my tools. Feel free to use that doc at your own risk.Modifications are only allowed after correspondation with the author. Feel freeto contact me at http://www.cs.tu-berlin.de/~mickyk/2XS.html. There you''ll find some C++ classes for use with that format.Thanx for reading this,      TeLAMoN of 2XS in 1998.      (mickyk@cs.tu-berlin.de)The Blizzard GRP-Format-----------------------The GRP''s are used as graphic-formats for Blizzards StarCraft(TM). The GRPis a multiple frame format. There are no signature information available (so you can only check the file-extension for valid files) nor any palette information. After decoding you get a pixel-map which consistsof 8-bit-index-values refering to a local palette.How it works:Header:~~~~~~~Offset         +---------------+    0x0000| L  frame-     | one WORD (2Bytes, Low first) for the number of          | H  count      | following frames         +---------------+   0x0002| L  X-Dim      | one WORD for the X-dimension of the whole frame         | H             |         +---------------+   0x0004| L  Y-Dim      | one WORD for the Y-dimension of the whole frame         | H             |         +---------------+FrameTab:~~~~~~~~~Offset         +---------------+    0x0006| xOffset       | one Byte for the xOffSet of the first frame         +---------------+   0x0007| yOffset       | one Byte for the yOffSet of the first frame         +---------------+   0x0008| ?             | these two Bytes I''ve no idea - maybe you ?!         | ?             |         +---------------+   0x000a| L Offset in   | one DOUBLEWORD (Low first) where we can find         |   the file,   | the frame-data         |   to find the |          | H framedata   |         +---------------+         ...          That block repeates as often as frames are present (see framecount)FrameData:~~~~~~~~~~Offset               +---------------+    | L Offset first| one WORD for the offset, where to find the first               | H line        | line-data   (to get the number of lines-1                +---------------+ for that frame you have to calculate /2)               | L Offset 2.   |               | H line        |               +---------------+               ...               That block repeats until  is reached (the same as the number                of lines are present within this frame)               LineData:~~~~~~~~~Offset                   +---------------+ + | BYTE 1        | Bytestream coded with the following                    +---------------+ algorythm: see below                   | BYTE 2        |                   ...                   | BYTE -1  |                   +---------------+                   +---------------+ + | BYTE 1        | Bytestream                     +---------------+                    | BYTE 2        |                   ...                   | BYTE -1  |                   +---------------+                   ... repeated for all lines...Ok, how we get the whole frame composed ? Well, let''s start:First to say, we start at the lower-right corner of the frame. So a linewill be assembled from right to left. AND don''t forget the xOffset and yOffsetfor the start position. on_Top:If the BYTE we get is >=0x80 (Values in Hex):   -subtract 0x80 from that BYTE and subtract the result from our     current_X_position.     Example: We get 0x85 as value. Subract 0x80 and we get 0x05. If our    current_X_position is 0x43 the new value will be (0x43-0x05) 0x3e.    How it looks in our framebuffer: ( ^ - is the current_X_position)    before:    [... 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 20 10 1f ...]                                                               ^    after:     [... 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 20 10 1f ...]                                                ^elseif the BYTE we get is >0x40:   -subtract 0x40 from that BYTE and store the result as LOOP   -get the next BYTE and put that BYTE LOOP-times into our frame-buffer    Example: We get 0x43. Then LOOP will be 0x03. The next BYTE is 0x62.    Then our framebuffer will look like this:    before:    [... 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 20 10 1f ...]                                                ^    after:     [... 00 00 00 00 00 00 00 62 62 62 00 00 00 00 00 20 10 1f ...]                                       ^elseif the BYTE we get is <0x40:   -put that BYTE into LOOP   -copy the following LOOP BYTES into out framebuffer   Example: The grp looks like ... 06 14 2a 34 3a a1 f1 ... then LOOP will be 0x06   and out framebuffer looks like:    before:    [... 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 20 10 1f ...]                                       ^    after:     [... 00 f1 a1 3a 34 2a 14 62 62 62 00 00 00 00 00 20 10 1f ...]                     ^now get the next BYTE (until the end of the line is reached) and go back to on_Top:.Mhhh, thats all. With that you should be able to read GRP''s. If you don''t want tocode your own C++ classes or routines then you can take a look at http://www.cs.tu-berlin.de/~mickyk/cv.html . There you''ll find some sourcesand maybe an actuall version of these expl. If you have questions orcorrections or whatever else please write a mail.LOF with that expl and remember: REAL CODE IS TIMELESS !!!TeLAMoN of 2XS in 1998 


Hope this helps,
Fuzztrek

¬_¬
Thanks. Yea, I''m working on a StarCraft mod right now to(look at http://www.customc.net/hosted/wdm or http://www.geocities.com/runaway2k1/index.html). That does help.

If you care about her/him, you''''ll listen
If you love her/him, you''''ll heal his/her wounds
If you like her/him, you''''ll do all of the above, and help her/him in need

A person who cares is a person who never speaks

This topic is closed to new replies.

Advertisement