Quantcast

Jump to content

» «
Photo

[REL] Yet another IMG Editor -- Spark

51 replies to this topic
aru
  • aru

    *poof*

  • Feroci
  • Joined: 20 Jun 2005
  • None

#1

Posted 24 June 2005 - 04:06 AM Edited by aru, 12 September 2009 - 08:06 PM.

Since I'm not maintaining this software anymore... source code is now provided.

Source (GPL): here

A few things were started but never completed... including rebuilding. See spark.txt for the milestones I had. smile.gif

---

I know there are a couple of IMG editors out there... so why another one?
Well, a couple of reasons...

1. New files get added to the end of the IMG file, which means the archive will get bigger and bigger in size... until you rebuild it. But what happens to the space that was reclaimed from deleted files?
2. The concept of keeping the layout state of the archive in memory. What this pretty much means is that you should be able to add new files or delete files from an IMG file without worrying about (a) accidental overwrites of existing files, (b) accidental deletion of existing files. Unless you ask to save, nothing is saved.
3. Integration with other Windows programs... Drag and drop from Explorer (or even winzip/winrar) into a IMG file?

I have been writing a simple IMG editor (named Spark) that takes these factors into account. It's only for GTA:SA for now... it doesn't support the old archive format. As I haven't tested it as much as I would have liked to, and since it doesn't have all the features I want it to have, I'm just going to release it here as a beta.

Some Screenshots:

user posted image

user posted image

Current Features:

- User friendly interface
- Open, save, and create new IMG archives for GTA San Andreas
(older version of the IMG format from GTA3 and Vice City are not
supported currently)
- Sort files by name, offset or size.
- View files in a detailed view, list view or iconic view
(Note: Iconic view might be slow for large files such as gta3.img)
- Search for files in archive directly from the toolbar.
- Automatically reuses space left over from previously deleted files
reducing the need to rebuild archives.
- Maintians the layout state of the archive in memory allowing you
to add/remove/delete files without committing directly to disk.
Nothing is saved until you say you want it to be saved!
- Drag and drop support from and to Explorer, and any other program
that supports drag and drop of files.
- Some limits to prevent accidental drag and drop of the all the files
in the archive.

Some things that are not supported yet... but planning to add support for them soon:
- Association with .IMG files
- In-place archive rebuilding

Download Here

Source Code

Any suggestions, comments, etc are welcome smile.gif .

aad
  • aad

    3d artist

  • Feroci
  • Joined: 15 Mar 2004
  • None

#2

Posted 24 June 2005 - 06:30 AM

I never saw an build in txd viewer in an img tool so i would like that if you could make a small addon in this for viewing and browsing the txd files at the same time this time it will speed up searching for cool textures.

satasha
  • satasha

    Rodent Boy

  • Members
  • Joined: 25 Apr 2005

#3

Posted 24 June 2005 - 09:21 AM

Sort by type would be helpful. Congrats on your prog!

BenMillard
  • BenMillard

    aka Cerbera

  • Members
  • Joined: 22 Jun 2002
  • United-Kingdom

#4

Posted 24 June 2005 - 02:06 PM Edited by Cerbera, 24 June 2005 - 02:15 PM.

Some very good ideas and a pretty design too! smile.gif

Presenting the contents of the IMG in an Explorer-like folder view is an inspired piece of interfacing. Making the right-click menu mimmick some of the features of Explorer and generally making this tool operate like an extended Explorer form could really help newcomers get an easy introduction to installing modifications. Things like "Arrange Icons > Name/Date/Modified/Size" and "View > Icons/List/Details" in the right-click menu would make this a fantastically easy tool to work with.

Not saving the file until the user selected Save or Save As... is a sorely missed feature. Would you be coding much of an Edit > Undo feature for this?

Looks like you are using C++ or C# perhaps? In VB6, the drag-drop code is handled by a pair of OLE (Object Linking and Embedding) events of the main form.
CODE
Private Sub Form_OLEDragOver(Data As DataObject _
, Effect As Long, Button As Integer, Shift As Integer _
, x As Single, y As Single, State As Integer)
On Error Resume Next 'very basic error handling

'Determine what is being dragged over the form:
If Data.GetFormat(vbCFFiles) = True Then 'data is file list:
   Effect = vbDropEffectCopy And Effect 'inform source of intentions
Else 'data is not file list:
   Effect = vbDropEffectNone 'inform source of intentions
End If

End Sub

Private Sub Form_OLEDragDrop(Data As DataObject _
, Effect As Long, Button As Integer, Shift As Integer _
, x As Single, y As Single)
On Error Resume Next 'very basic error handling
Dim i As Long 'used with looping
Dim FileItem As Variant 'used to loop through Data collection

'Prepare for operation:
Screen.MousePointer = vbHourglass 'change cursor
Call mnuViewData_Click(0) 'Standard Data view

'Test what has just been dropped onto the form:
If Data.GetFormat(vbCFFiles) = True Then 'data is file list:
   For Each FileItem In Data.Files 'loop through them all:
       'Test if this item is actually a folder:
       If FSO.FileExists(FileItem) = True Then 'valid file path:
           Call ReadFile(FileItem) 'open the file
           
           'Recover from operation:
           Me.Caption = "CFG Studio - [" _
           & FSO.GetAbsolutePathName(FileItem) & "]"
           Screen.MousePointer = vbNormal 'return cursor
           Exit Sub 'stop subprocedure here
       Else 'invalid file path:
           'do nothing
       End If
   Next FileItem
Else 'data is not file list:
   'do nothing
End If

'Recover from operation:
Screen.MousePointer = vbNormal 'return cursor

End Sub
That's the way I am using it. FSO is the "File System Object" scripting library. It's fairly readable and I always write lots of comments in my code, so you might be able to find equivalent events and commands in the language you are using?

Automatically detecting and supporting GTA3 and GTAVC IMG formats would be a real bonus for the modern modifying scene, since all three editions are still worked with by many people.

Jackington
  • Jackington

    Rat

  • Members
  • Joined: 04 Feb 2005

#5

Posted 24 June 2005 - 05:41 PM

It dosent work cryani.gif cryani.gif cryani.gif cryani.gif cryani.gif cryani.gif cryani.gif cryani.gif .

This is the second img editing tool Iv tried and NONE OF THEM WORK!!!! cryani.gif cryani.gif

When I click on spark.exe, or open the program in any way, it says "application failed to initalize properly (this is a long number which I can't rememba) Click OK to terminate application"

What shall I do? Please help!

I am so angry.gif angry.gif angry.gif angry.gif at this because I cant get this, a single program, to initialize!!!

Stretchnutter
  • Stretchnutter

    Also known as Racer_S

  • Members
  • Joined: 15 Jun 2002

#6

Posted 24 June 2005 - 11:48 PM

lol... i like your interface style aru, just likemy iRipper program, but more aimed toward just GTASA .... mine was designed for several titles with 'structured' archives... gtasa just has a huge list.. something my program cant handle too well tounge.gif

anyway, great job!

aru
  • aru

    *poof*

  • Feroci
  • Joined: 20 Jun 2005
  • None

#7

Posted 25 June 2005 - 06:11 AM Edited by aru, 12 September 2009 - 08:05 PM.

aad: I wrote up a quick TXD loader and a DXT decoder.

user posted image

Doesn't work with all the txd files yet... I'm going to fix up it first before releasing the update smile.gif

I had to decode the txd file over again since I couldn't find the txd specifications on the forum... it got deleted when the forum was prunned for archives... anyone still have a copy of it?

satasha: That shouldn't be a problem. I think I can add that.

Cerbera: Yup, I'm doing something very similar for drag and drop. It's written completely in C# though. GTA3 and VC will come on later... the current object model of the program is such that it's not such a big issue adding new formats. Undo... possible, but I would have to think about it.

Jackington: You probabbly need the .NET framework. Read the requirements section of the readme.txt file.

aru
  • aru

    *poof*

  • Feroci
  • Joined: 20 Jun 2005
  • None

#8

Posted 25 June 2005 - 10:58 PM

New version... Added TXD Preview support plus a bit more. Here's the new features list:

Version: 0.9.2002

- Sort by file type

- "Arrange Icons By" menu in the View menu

- New "Explorer" view for previewing files inside archives

- Explorer preview support for San Andreas TXD files

- File association support (Manual association required)

For previewing TXD files, click on View -> Explorer. smile.gif

Download Here


DiCanio
  • DiCanio

    Foot Soldier

  • Members
  • Joined: 22 Jul 2002

#9

Posted 26 June 2005 - 12:57 AM

looking great
nice to be able to see TXDs

keep up the good work smile.gif

Marklund
  • Marklund

    GTAStunter

  • Members
  • Joined: 28 Jan 2005

#10

Posted 02 July 2005 - 11:47 PM

cookie.gif

Now that's great!
How's it going with it? Would be awsome with a dff viewer in it.

LeeDFXP
  • LeeDFXP

    Snitch

  • Members
  • Joined: 31 May 2004

#11

Posted 03 July 2005 - 07:53 PM

awesome job m8, gonna test it out now wink.gif

aru
  • aru

    *poof*

  • Feroci
  • Joined: 20 Jun 2005
  • None

#12

Posted 04 July 2005 - 04:45 AM

QUOTE (Marklund @ Jul 2 2005, 18:47)
cookie.gif

Now that's great!
How's it going with it? Would be awsome with a dff viewer in it.

I could... if someone can give me a file format description for the SA dff files.

Vercetti Gangsta
  • Vercetti Gangsta

    Li'l G Loc

  • Members
  • Joined: 12 Jan 2004

#13

Posted 04 July 2005 - 08:48 AM

Very nice job! Could you also do it VC & GTA3 compatible?

YeTi
  • YeTi

    S'up Bitches?

  • Andolini Mafia Family
  • Joined: 28 Mar 2005

#14

Posted 04 July 2005 - 08:55 AM

Cool good work. I'll try it out later.

gtasanandreasmaster
  • gtasanandreasmaster

    SAN ANDREAS !!!!!!!!!!&a

  • BUSTED!
  • Joined: 13 Jan 2005

#15

Posted 04 July 2005 - 04:25 PM

it aint workin for me cryani.gif
get this error

user posted image

aru
  • aru

    *poof*

  • Feroci
  • Joined: 20 Jun 2005
  • None

#16

Posted 04 July 2005 - 05:05 PM

QUOTE (gtasanandreasmaster @ Jul 4 2005, 11:25)
it aint workin for me cryani.gif
get this error

user posted image

You need the .NET framework. Read the "Requirements" section of the readme.txt file.

Ways to get it:
- Windows Update (http://www.windowsupdate.com)
- Direct Download:
http://www.microsoft...&displaylang=en


gtasanandreasmaster
  • gtasanandreasmaster

    SAN ANDREAS !!!!!!!!!!&a

  • BUSTED!
  • Joined: 13 Jan 2005

#17

Posted 04 July 2005 - 05:20 PM

thx will this affect the way any of my other progs work?

aru
  • aru

    *poof*

  • Feroci
  • Joined: 20 Jun 2005
  • None

#18

Posted 05 July 2005 - 11:15 AM

QUOTE (gtasanandreasmaster @ Jul 4 2005, 12:20)
thx will this affect the way any of my other progs work?

Shouldn't really... it's an official MS update.

gtasanandreasmaster
  • gtasanandreasmaster

    SAN ANDREAS !!!!!!!!!!&a

  • BUSTED!
  • Joined: 13 Jan 2005

#19

Posted 05 July 2005 - 03:21 PM

kk shud be no probs if it is a ms update

Voodooman
  • Voodooman

    v00d00m4n

  • Members
  • Joined: 28 Jul 2005

#20

Posted 29 July 2005 - 12:24 PM

Cool tool, and will be realy cool with embeded DFF viewer (maybe textured).
Thx again for console version.
And how about 2 recompile it using Visual Studio 6 to aboid framework adiction?

changmail
  • changmail

    Player Hater

  • Members
  • Joined: 25 Jul 2003

#21

Posted 29 July 2005 - 12:34 PM

I use this tool ALL the time, its so much quicker and easier then IMGTool! (through IMGTool is still good colgate.gif ) i bloody love it!

A DFF viewer would be really good cool.gif

BenMillard
  • BenMillard

    aka Cerbera

  • Members
  • Joined: 22 Jun 2002
  • United-Kingdom

#22

Posted 29 July 2005 - 01:41 PM

I've tried it out and this is a really promising start. smile.gif

Some things you might consider adding:-
  1. Status bar panels to show information a bit like Windows Explorer. File size, last modified date and similar stuff for the selected file. Also, including a total number of files in the archive on the right would be useful.
  2. An actual "Find" dialogue window. I must've clicked Edit > Find and CTRL+F about five times before I realised all it did was place the insertion point in the toolbar search box. tounge.gif By using a proper Find form you can show a list results with exact matches at the top and partial matches added afterwards. Files in the IMG have some obscure names and there's an insane number of files, so allowing partial matches would really help locate things.
  3. If possible, making the search box right-aligned in the toolbar to match web browsers like FireFox, IE7b1, Opera and so on. MS Office programs often have a box on the right for searching help, so it would be a more conventional position for it.
  4. I think an XML settings file for two values is a bit overkill! Just a simple INI format would be better since it would allow semi-advanced and advanced users to change the values manually.
  5. Recent files list. Just an array of four menu items placed above the "Exit" menu and a suitable set of entries in the settings file, shouldn't be too hard.
  6. Saving the last values for window size, position and state. Make sure that the restored down size does not get overwritten by maximised and minimised sizes. I know how to do this in VB6 so if you can't figure it out, just ask and I can run you through the event sequence to acheive it. smile.gif
  7. Switching to the full hourglass cursor (Screen.MousePointer = vbHourglass) before doing any long processing. This includes searching, import/export, Open, Save, changing views, changing sort order, etc. Just a line at the start of the process to change the cursor and another at the end is all it takes and it helps the user see that something really is happening.
  8. If you can, display an "Ascending" or "Descending" arrow in the title bars of the "Details" view to show which value and in which direction the data is being sorted by.
  9. If the control allows it, alternate row colouring in "Details" view.
  10. Being able to zoom in on texture previews would be useful.
  11. When in explorer view, show a prominent message stating that a file cannot be loaded if it cannot be loaded.

These little touches will help make this already good program even better.

aru
  • aru

    *poof*

  • Feroci
  • Joined: 20 Jun 2005
  • None

#23

Posted 29 July 2005 - 04:32 PM

Cerbera, there are a few reasons why this tool is still in 0.9x and not 1.0 yet... and you covered most of them such as MRUD, search dialog, etc. This is only something I work on during my freetime, so updates will be slow. The config xml file is a .NET standard for configuration settings, and thus... why I'm using it... there's a lot more you can do with that .config file... not just save settings smile.gif .

Voodooman, I can't recompile without the .NET framework. The program is coded in C#, and it uses some builtin classes from the .NET framework... and there's no native C# compiler out there yet.

DFF support... erm.... hhmmm... suicidal.gif too much code to write.

changmail
  • changmail

    Player Hater

  • Members
  • Joined: 25 Jul 2003

#24

Posted 30 July 2005 - 03:08 PM

Is there any chance you can make the import remember the last folder used and not opened? if that makes sense biggrin.gif

I'll try and explain better

When you first load spark up and open gta3.img, and when you goto import a file it opens the SA folder, so I then have to go and find my mods folder then import! it would be so much easier if it just remembered my mods folder biggrin.gif

Hope that makes sense... it does in my head tounge2.gif Keep up the great work cookie.gif

dertyjerzian
  • dertyjerzian

    I have a custom member title. I call it "Solid Snake"

  • BUSTED!
  • Joined: 08 Jun 2005

#25

Posted 30 July 2005 - 04:01 PM

He's wondering if you can add a folder configuration line. sh*t, 4 folders would be great to pick from in a drop down favorites menu that's configurable... Then, it's a matter of clicks for mods users, and more of a cinch for mods creators.

Voodooman
  • Voodooman

    v00d00m4n

  • Members
  • Joined: 28 Jul 2005

#26

Posted 31 July 2005 - 10:34 AM

QUOTE (aru @ Jul 29 2005, 16:32)
Cerbera, there are a few reasons why this tool is still in 0.9x and not 1.0 yet... and you covered most of them such as MRUD, search dialog, etc. This is only something I work on during my freetime, so updates will be slow. The config xml file is a .NET standard for configuration settings, and thus... why I'm using it... there's a lot more you can do with that .config file... not just save settings smile.gif .

Voodooman, I can't recompile without the .NET framework. The program is coded in C#, and it uses some builtin classes from the .NET framework... and there's no native C# compiler out there yet.

DFF support... erm.... hhmmm... suicidal.gif too much code to write.

i have same problem with Visual studio 2005 when i importing VS 6 code or VB 6 code it convert old classes 2 .NET framework 2.0 classes, and that real sux, not for me my hardware and software allways up 2 date but i know that some PC owners still have dialup connection and using win 98 and NT 4 (.net framework 2.0 still not available for win 9X and NT 4) and when i compilin my application thats very funny that with 1-5 megs tool somebody will need 2 download 25-40 megs runtimes of .net platform. Im found 2 ways how 2 avoid it (both not so easy) first using of borland C++ (not aplicable for VB projects) and second is total disasembling (decompilation)-> not very fast analyzing -> code remaking -> and then assembling of new not framework adicted tool) also Framework makin hard 2 porting win apps 2 other plarforms (looks like thats another step of microsot 2 kill or just 2 make less popular other platforms than "WINPC") (((
and bout dff u can work together with Leon Gaiazov (he from Montreal, Quebec, Canada, so im think he will help u - his fellow countryman)
Thats his site with contact information:
http://www.gaiazov.com
He made exelent DFF Viewer (SA/VC/GTA3 compotible) and Lightwave DFF Exporter plugin so try 2 speek with him about integration of his viewer in SPARK (i think that after that his Name and im waiting for new release with img 1 support ))
(oh by the way look again please at my topic bout console img tool)

aru
  • aru

    *poof*

  • Feroci
  • Joined: 20 Jun 2005
  • None

#27

Posted 01 August 2005 - 11:44 PM

Well.. it only needs .NET Framework 1.1... it doesnt use any 2.0 specific features... but still, yes.. there's a 20mb one time download. And its not possible compile C# programs with a C++ compiler.. the two are quite different, so borland C++ is out of the question. Also it's not really true that MS is trying to make a "WINPC". Spark should run under Linux/BSD through the Mono framework, although I havent really tried it out. The .NET executables are compiled to a virtual pc instruction set (kinda like Java)... which makes them quite portable.

Saving folder paths for import/export -- should be possible. Will add to todo list for next release. For now you could just make shortcuts to the mod folder/GTA folder in your favorites and access them through that.

Karcus
  • Karcus

    Square Civilian

  • Members
  • Joined: 05 Jul 2005

#28

Posted 02 August 2005 - 01:39 AM

.Net Framework slows my pc down during boot and with some internet progs. I tried it with ATI's CCC driver for my card and its slow and uneccesary. Of course that was early on, they probably worked the kinks out of it.
Until more programs require it or I find a really good program I want that uses it, I will have to protest against it at this moment. Just my preference, tiss all.

But your program sounds awesome. Keep it up.

dertyjerzian
  • dertyjerzian

    I have a custom member title. I call it "Solid Snake"

  • BUSTED!
  • Joined: 08 Jun 2005

#29

Posted 02 August 2005 - 03:37 AM

QUOTE (Karcus @ Aug 1 2005, 20:39)
.Net Framework slows my pc down during boot and with some internet progs. I tried it with ATI's CCC driver for my card and its slow and uneccesary. Of course that was early on, they probably worked the kinks out of it.
Until more programs require it or I find a really good program I want that uses it, I will have to protest against it at this moment. Just my preference, tiss all.

But your program sounds awesome. Keep it up.

you need to update it completely, I think twice...

Voodooman
  • Voodooman

    v00d00m4n

  • Members
  • Joined: 28 Jul 2005

#30

Posted 04 August 2005 - 07:10 PM

ok, so how about DFF support did u contact this guy?




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users