Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 31

Thread: Making a Package for the game? [sounds,graphics]

  1. #21

    Making a Package for the game? [sounds,graphics]

    Strange, it should work. I don't use SDL so I can't test everything, but I know for sure it isn't Abbrevia!

    Is the archive encrypted, or is the file in a subdirectory?

  2. #22

    Making a Package for the game? [sounds,graphics]

    Quote Originally Posted by Robert Kosek
    Strange, it should work. I don't use SDL so I can't test everything, but I know for sure it isn't Abbrevia!

    Is the archive encrypted, or is the file in a subdirectory?
    Yes i checked size of the stream and its exactly same as the file, so all right there.

    The SDL funcion that don't work

    In the other unit(the one that does not support protected zip) exports to Tstringstream and work all right.
    From brazil (:

    Pascal pownz!

  3. #23

    Making a Package for the game? [sounds,graphics]

    It's probably that after extracting the stream from the archive, you need to reset the position back to 0 before passing it to the SDL functions, otherwise it'll just read form the current position.
    <A HREF="http://www.myhpf.co.uk/banner.asp?friend=139328">
    <br /><IMG SRC="http://www.myhpf.co.uk/banners/60x468.gif" BORDER="0">
    <br /></A>

  4. #24

    Making a Package for the game? [sounds,graphics]

    Quote Originally Posted by technomage
    It's probably that after extracting the stream from the archive, you need to reset the position back to 0 before passing it to the SDL functions, otherwise it'll just read form the current position.
    Don't understand nothing, but how can i do that ?
    From brazil (:

    Pascal pownz!

  5. #25

    Making a Package for the game? [sounds,graphics]

    [pascal] RESZIP.Position := 0; // Before "LoadFromStream"[/pascal]

  6. #26

    Making a Package for the game? [sounds,graphics]

    Quote Originally Posted by Robert Kosek
    [pascal] RESZIP.Position := 0; // Before "LoadFromStream"[/pascal]
    YEAHHHH!!
    worked ;]

    Thx for all
    From brazil (:

    Pascal pownz!

  7. #27

    Making a Package for the game? [sounds,graphics]

    Quote Originally Posted by arthurprs
    Quote Originally Posted by Robert Kosek
    Show me your code and the string you're looking for. I'll tell you how to get it right. Wicked Defense uses my zip handler that uses that exact line of code.
    There
    [pascal]procedure Loadresources;
    var
    ZIP: TAbUnZipper;
    RESZIP: TStream;
    a: Cardinal;
    path: string;
    begin
    a := SDL_GetTicks;
    ZIP := TAbUnZipper.Create(nil);
    path := ExtractFileDir(ParamStr(0)) + '\';
    Writeln(path);
    ZIP.OpenArchive(path+'res.zip');
    RESZIP := TStream.Create;
    ZIP.ExtractToStream('minefield.bmp',RESZIP);
    g_minefield := LoadSDLBMPFromStream(RESZIP);
    ZIP.Free;
    RESZIP.free;
    end;
    [/pascal]

    ERROR:
    EstreamError with message 'Tstream.seek not implemented'
    Hi arthurprs,
    the problem here is that you are directly creating a TStream when infact you should be using one of it's descendents, like TMemoryStream for example instead.

    Just try changing the TStream references to TMemoryStream and see if that helps.

    cheers,
    Paul
    Games:
    Seafox


    Pages:
    Syntax Error Software itch.io page

    Online Chess
    http://gameknot.com/#paul_nicholls

  8. #28

    Making a Package for the game? [sounds,graphics]

    Quote Originally Posted by paul_nicholls
    Quote Originally Posted by arthurprs
    Quote Originally Posted by Robert Kosek
    Show me your code and the string you're looking for. I'll tell you how to get it right. Wicked Defense uses my zip handler that uses that exact line of code.
    There
    [pascal]procedure Loadresources;
    var
    ZIP: TAbUnZipper;
    RESZIP: TStream;
    a: Cardinal;
    path: string;
    begin
    a := SDL_GetTicks;
    ZIP := TAbUnZipper.Create(nil);
    path := ExtractFileDir(ParamStr(0)) + '\';
    Writeln(path);
    ZIP.OpenArchive(path+'res.zip');
    RESZIP := TStream.Create;
    ZIP.ExtractToStream('minefield.bmp',RESZIP);
    g_minefield := LoadSDLBMPFromStream(RESZIP);
    ZIP.Free;
    RESZIP.free;
    end;
    [/pascal]

    ERROR:
    EstreamError with message 'Tstream.seek not implemented'
    Hi arthurprs,
    the problem here is that you are directly creating a TStream when infact you should be using one of it's descendents, like TMemoryStream for example instead.

    Just try changing the TStream references to TMemoryStream and see if that helps.

    cheers,
    Paul
    i have followed Jsoftware tip and it worked some time ago,
    then i needed to set .position to 0 after the extraction and it works perfectly.
    From brazil (:

    Pascal pownz!

  9. #29

    Making a Package for the game? [sounds,graphics]

    D'OH! sorry, I didn't read the replies properly ops:

    at least it is working now
    cheers,
    Paul
    Games:
    Seafox


    Pages:
    Syntax Error Software itch.io page

    Online Chess
    http://gameknot.com/#paul_nicholls

  10. #30

    Making a Package for the game? [sounds,graphics]

    Quote Originally Posted by arthurprs
    Quote Originally Posted by Robert Kosek
    Show me your code and the string you're looking for. I'll tell you how to get it right. Wicked Defense uses my zip handler that uses that exact line of code.
    There
    [pascal]procedure Loadresources;
    var
    ZIP: TAbUnZipper;
    RESZIP: TStream;
    a: Cardinal;
    path: string;
    begin
    a := SDL_GetTicks;
    ZIP := TAbUnZipper.Create(nil);
    path := ExtractFileDir(ParamStr(0)) + '\';
    Writeln(path);
    ZIP.OpenArchive(path+'res.zip');
    RESZIP := TStream.Create;
    ZIP.ExtractToStream('minefield.bmp',RESZIP);
    g_minefield := LoadSDLBMPFromStream(RESZIP);
    ZIP.Free;
    RESZIP.free;
    end;
    [/pascal]

    ERROR:
    EstreamError with message 'Tstream.seek not implemented'
    maybe this:

    RESZIP := TStream.Create;
    RESZIP.Seek(0, soFromBeginning);

    seems that is the same of RESZIP.Position := 0;
    Knowledge is power.

Page 3 of 4 FirstFirst 1234 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •