HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Linux and that kind of stuff

07-06-2007, 12:57 AM#1
Vexorian
So, I figured some stuff.
- Delphi apps that use SFMPQ work well under WINE, although SFMPQ is kind of slow (under WINE I mean).
- PJASS is probably very easy to port to gcc, considering it is already for mingw
- Warcraft III must be the only game that actually works 100% well on WINE.
- gVim is already native on Linux.

So I have noticed. The most interesting wc3ish stuff to me so far is updating spells, not even making terrain or things like that. There are too many things I could do without the world editor and then test with WINE+wc3. For a couple of overcomplicated things I can even make software, all but terrain.

Thus the conclussion is, that I need a Linux mpq utility, preferably a command line one. I know that such a thing exists otherwise wc3sear.ch wouldn't have moved to that Linux server, so anybody got it?
07-06-2007, 01:43 AM#2
PipeDream
You'll have to write your own wrappers(or maybe I can dig out the code from old grimoire), but:
http://www.zezula.net/en/mpq/stormlib.html
Pretty sure there's also a SFmpq port to linux

BTW, I've compiled PJASS with gcc 3 on linux, works np.
07-06-2007, 07:52 PM#3
SFilip
If it's of any use to you, here's a Delphi unit for StormLibDll I made. All exported functions are there, but it may lack a couple of constants or so.
Hidden information:
Code:
unit StormLib;

interface

uses
  Windows;

type
  PLCID = ^LCID;

  PSFile_Find_Data = ^TSFile_Find_Data;
  TSFile_Find_Data = record
    cFileName: array[0..MAX_PATH] of char;
    szPlainName: PChar;
    lzLocale: LCID;
    dwFileSize, dwFileFlags: DWord;
  end;

  PCompactCB = ^TCompactCB;
  TCompactCB = procedure(lpUserData: Pointer; dwWorkType, dwParam1, dwParam2: DWord);

const
  StormLibPath = 'StormLib.dll';
  SFILE_OPEN_FROM_MPQ = 0;
  SFILE_OPEN_BY_INDEX = 1;
  SFILE_OPEN_LOCAL_FILE = DWord(-1);
  
  MPQ_FILE_COMPRESS_PKWARE=$00000100;
  MPQ_FILE_COMPRESS_MULTI=$00000200;
  MPQ_FILE_ENCRYPTED=$00010000;
  MPQ_FILE_FIXSEED=$00020000;
  MPQ_FILE_REPLACEEXISTING=$80000000;


function SFileSetLocale(lcLocale: LCID): LCID; stdcall; external StormLibPath;
function SFileGetLocale: LCID; stdcall; external StormLibPath;

function SFileCloseArchive(hMPQ: THandle): Bool; stdcall; external StormLibPath;
function SFileOpenFileEx(hMPQ: THandle; const szFileName: PChar; dwSearchScope: DWord; phFile: PHandle): Bool; stdcall; external StormLibPath;
function SFileExtractFile(hMpq: THandle; const szToExtract, szExtracted: PChar): Bool; stdcall; external StormLibPath;
function SFileAddFile(hMPQ: THandle; const szFileName, szArchivedName: PChar; dwFlags: DWord): Bool; stdcall; external StormLibPath;
function SFileAddWave(hMPQ: THandle; const szFileName, szArchivedName: PChar; dwFlags, dwQuality: DWord): Bool; stdcall; external StormLibPath;
function SFileRemoveFile(hMPQ: THandle; const szFileName: PChar): Bool; stdcall; external StormLibPath;
function SFileRenameFile(hMPQ: THandle; const szOldFileName, szNewFileName: PChar): Bool; stdcall; external StormLibPath;
function SFileFindFirstFileEx(hMPQ: THandle; const szMask: PChar; lpFindFileData: PSFile_Find_Data; const szFileList: PChar; bCheckIfExist: Bool): Bool; stdcall; external StormLibPath;
function SFileFindFirstFile(hMPQ: THandle; const szMask: PChar; lpFindFileData: PSFile_Find_Data; const szFileList: PChar): Bool; stdcall; external StormLibPath;
function SFileAddListFile(hMpq: THandle; const szListFile: PChar): Integer; stdcall; external StormLibPath;
function SFileHasFile(hMPQ: THandle; szFileName: PChar): Bool; stdcall; external StormLibPath;
function SFileSetCompactCallback(hMPQ: THandle; CompactCB: PCompactCB; lpData: Pointer): Bool; stdcall; external StormLibPath;
function SFileCompactArchive(hMPQ: THandle; const szListFile: PChar = nil; bReserved: Bool = false): Bool; stdcall; external StormLibPath;
function SFileEnumLocales(hMPQ: THandle; const szFileName: PChar; plcLocales: PLCID; pdwMaxLocales: PDWord; dwSearchScope: DWord = SFILE_OPEN_BY_INDEX): Integer; stdcall; external StormLibPath;
function SListFileFindFirstFile(hMpq: THandle; const szListFile, szMask: PChar; lpFindFileData: PSFile_Find_Data): THandle; stdcall; external StormLibPath;

function SFileOpenArchive(const szMpqName: PChar; dwPriority, dwFlags: DWord; phMPQ: PHandle): Bool; stdcall; external StormLibPath;
function SFileCreateArchiveEx(const szMpqName: PChar; dwCreationDisposition, dwHashTableSize: DWord; phMPQ: PHandle): Bool; stdcall; external StormLibPath;
function SFileGetFileInfo(hMpqOrFile: THandle; dwInfoType: DWord): DWord; stdcall; external StormLibPath;
function SCompCompress(pbOutBuffer: PChar; pdwOutLength: PInteger; pbInBuffer: PChar; dwInLength, uCompressions, nCmpType, nCmpLevel: Integer): Integer; stdcall; external StormLibPath;
function SCompDecompress(pbOutBuffer: PChar; pdwOutLength: PInteger; pbInBuffer: PChar; dwInLength: Integer): Integer; stdcall; external StormLibPath;
function SCompSetDataCompression(nDataCompression: Integer): Integer; stdcall; external StormLibPath;

function SListFileFindNextFile(hFind: THandle; lpFindFileData: PSFile_Find_Data): Bool; stdcall; external StormLibPath;
function SListFileFindClose(hFind: THandle): Bool; stdcall; external StormLibPath;

function SFileFindNextFile(hFind: THandle; lpFindFileData: PSFile_Find_Data): Bool; stdcall; external StormLibPath;
function SFileFindClose(hFind: THandle): Bool; stdcall; external StormLibPath;

function SFileCloseFile(hFile: THandle): Bool; stdcall; external StormLibPath;
function SFileGetFileSize(hFile: THandle; pdwFileSizeHigh: PDWord = nil): DWord; stdcall; external StormLibPath;
function SFileGetFilePos(hFile: THandle; pdwFilePosHigh: PDWord = nil): DWord; stdcall; external StormLibPath;
function SFileSetFilePointer(hFile: THandle; lFilePos: Integer; plFilePosHigh: PInteger; dwMethod: DWord): DWord; stdcall; external StormLibPath;
function SFileReadFile(hFile: THandle; pBuffer: Pointer; dwToRead: DWord; pdwRead: PDWord; lpOverlapped: POVERLAPPED = nil): Bool; stdcall; external StormLibPath;
function SFileSetFileLocale(hFile: THandle; lcNewLocale: LCID): Bool; stdcall; external StormLibPath;
function SFileGetFileName(hFile: THandle; szFileName: PChar): Bool; stdcall; external StormLibPath;

implementation

end.
07-27-2007, 10:55 PM#4
Vexorian
Nice stuff.

Zoxc's editor has proven useful now that it is a wine application that works very well (although you have to thank either borland for doing things the way they do or WINE for supporting VCL apps so damn well)

http://www.wc3campaigns.net/showthre...t=85516&page=8

Now, we only need someone with Delphi knowledge and a lot of free time to adapt jasshelper so it works on this extra editor....

Jasshelper itself works very well, but "taur's studio" is a good tool for those who need the monolythic app and also aid on keeping some data from WE like rects and preplaced units, not to mention that it is a GUI viewer... And very good to extract code from standard maps.

And then we could mess with things like editing terrain...

Screenshot, the font is messed up but I think that's because I did not install any MS font, with some patching done to this editor we could add a font select dialog...
Attached Images
File type: pngPantallazo.png (693.1 KB)
07-28-2007, 12:40 PM#5
darkwulfv
You're running Taur's Mapping Studio 2006... Where do we find that? Wasn't that some big remake of the WE Taur was gonna do? (Including new terrain editor, and so on).
And to stay on topic: It's nice to know at least SOMETHING works on Vista =p
07-28-2007, 01:49 PM#6
moyack
Quote:
Originally Posted by darkwulfv
And to stay on topic: It's nice to know at least SOMETHING works on Vista =p
Vista??.... ehemm.... this is linux, gnome enviromnent to be more precise.
07-28-2007, 01:54 PM#7
PitzerMike
Quote:
Originally Posted by darkwulfv
You're running Taur's Mapping Studio 2006... Where do we find that? Wasn't that some big remake of the WE Taur was gonna do? (Including new terrain editor, and so on).

.. errm .. Zoxc made it and called it Taur's Mapping Studio as a joke. :)
07-28-2007, 03:51 PM#8
darkwulfv
Quote:
Originally Posted by moyack
Vista??.... ehemm.... this is linux, gnome enviromnent to be more precise.
Ooh, crap. Well, they're both non-XP, they categorize as the same thing to me =p
07-28-2007, 04:58 PM#9
Vexorian
Just make sure not to make those mistakes in other places, you might end up murdered if you for example confuse OS/X with vista nearby a horde of apple fans.
07-28-2007, 05:39 PM#10
moyack
Including Pyrogasm XD
07-28-2007, 09:22 PM#11
Pyrogasm
Yeah; I'd basically eat your babies. Over teh interwebz.
07-31-2007, 03:14 AM#12
Vexorian
I basically forgot that Zoxc's editor does not save files.

So back to zero, I'll see if jasscraft or quickfivxer work on wine...
07-31-2007, 04:11 AM#13
PipeDream
Split out the JassHelper GUI, compile a command line interface natively?
07-31-2007, 04:38 AM#14
Vexorian
It would be much easier to type it again from scratch, I am not sure about how well things like kylix work, but a guy that really likes pascal says pascal in linux got a lot of issues.

Retyping it could be fun but... it is unnecessary, at least right now. wine jasshelper.exe pathtocommonj blizzj map.w3x does work...

Zepir's editor seems to be good to tweak some stuff and do some terraining, as long as you get rid of the 3d window very fast else wine gets the rendering bug that also affects world editor...
08-01-2007, 01:50 AM#15
Taur
Quote:
Originally Posted by darkwulfv
You're running Taur's Mapping Studio 2006... Where do we find that? Wasn't that some big remake of the WE Taur was gonna do? (Including new terrain editor, and so on).
And to stay on topic: It's nice to know at least SOMETHING works on Vista =p
ha ha... funny story about that. Zoxc was like what should I name it and I'm like name it Taur's Studio. Zoxc is like okay. Tommorrow I see he actually did it. Never finished it, so he never re-named it :P. So zoxc made it, not me.