Page 6 of 7 FirstFirst ... 4567 LastLast
Results 51 to 60 of 63

Thread: Loading DX Textures in an imagelist - which is the fastest?

  1. #51

    Loading DX Textures in an imagelist - which is the fastest?

    Hi Sly!

    Exported all imagelists to your format and changed everything in my game to your loading method.

    Now again the old problem:



    Looks like it is not transparent or transparent color is wrong?
    I hope it is no bigger problem? Loading pretty fast...

    Any idea? I'll examine...

    Firle

  2. #52

    Loading DX Textures in an imagelist - which is the fastest?

    Hello Sly,

    this both does not help:

    imagelistmenu.ImageList.Items[0].TransparentColor:=clblack;
    imagelistmenu.ImageList.Items[0].Transparent:=true;

    or

    imagelistmenu.ImageList.Items[0].SetTransparentColor(clblack);
    imagelistmenu.ImageList.Items[0].Transparent:=true;

    Firle

  3. #53

    Loading DX Textures in an imagelist - which is the fastest?

    One more thing: I kept the Imagelistwhatever.Init after LoadfromFiledata, if I don't use it anymore I get an error when drawing my GUI, the GUI items are drawn with Draw4Col. If I throw the Init out, I get an error there, if I keep it it is working (except of transparency).

    It would be perfect if I get a fix for that transparency and perhaps you could alter my sample to Draw4Col to see if it is a simple thing to change or if I should still use init.

    Thanks a lot,
    Firle

  4. #54

    Loading DX Textures in an imagelist - which is the fastest?

    Hi Sly,

    reading all the thread again I found this one:

    The ImageListEditor won't be able to open the picture because the Picture property is empty. There is no point having the image in Picture as well as a texture. That is a waste of memory. Is there a way around it in the ImageListEditor? Can you draw the texture instead of using the Picture property?

    To fix the crash, try adding these lines at the top of TImageListCollection.LoadFromStreamData.
    Code:
    TOmegaImageList(Owner).FRenderer.OmegaScreen := TOmegaImageList(Owner).OmegaScreen;
    TOmegaImageList(Owner).FRenderer.Init;


    That is something that TOmegaImageList.Init did but I forgot to do. I didn't notice it because I was using TImageListItem.Draw, not Draw4Col.
    Okay, now it even works without the init and Draw4Col is also perfect now.

    Only the transparency problem remains. Still examining. :shock:

    Firle

  5. #55

    Loading DX Textures in an imagelist - which is the fastest?

    Transparency problem is not always. Just in some cases.

    Drawing my cursor:

    Code:
    procedure TCommandoForm.Draw_Mouse;
    begin
      if xenscreen.FullScreen then ImageListmenu.ImageList.Items[0].Draw(mouse.CursorPos.X,mouse.CursorPos.y,0,0,0,1,1,255,255,255,255,round(nwatertimer),bmnormal)
      else ImageListmenu.ImageList.Items[0].Draw(
      (mouse.CursorPos.X-CommandoForm.Left)*xenscreen.Width div CommandoForm.Width
      ,(mouse.CursorPos.y-CommandoForm.Top)*xenscreen.Width div CommandoForm.Width,0,0,0,1,1,255,255,255,255,round(nwatertimer),bmnormal);
    end;
    Strange. In other cases it is working, and before I used your method it was also working. Cannot be a big problem, must be a minor one. :roll:

    Firle

  6. #56

    Loading DX Textures in an imagelist - which is the fastest?

    This is a strange one. I will have to have a look at it, but I won't be able to get to it before the weekend. I am performing in a dance concert and we have rehearsals Wednesday and Thursday night, with the performances on Friday night, Saturday afternoon and Saturday night.

  7. #57

    Loading DX Textures in an imagelist - which is the fastest?

    Hi Sly,

    sounds cool. Good luck on your dance contest! :mrgreen:

    I'll look myself into it. If this is the only place, no problem.

    I'll do some tests now and let you know the next days, thanks!

    Firle

  8. #58

    Loading DX Textures in an imagelist - which is the fastest?

    The mouse cursor seems to be the only place where this is a problem, everything else if just fine! Great!

    The only thing is that the alpha-channel is not working anymore. But this is a minor problem, I only use it for one special imagelist and I can load it the old way.

    Seems it is working fine

    Firle

  9. #59

    Loading DX Textures in an imagelist - which is the fastest?

    Hi Sly,

    did you change anything else but these methods?

    OmegaImageList.ImageList.LoadFromFileData(Filename : String);
    OmegaImageList.ImageList.LoadFromStreamData(Stream : TStream);
    OmegaImageList.ImageList.SaveToFileData(Filename: String);
    OmegaImageList.ImageList.SaveToStreamData(Stream: TStream);
    So one minor thing is the alpha channel of the images, it is gone. You can simply create some alpha channel for a png image when loading an old imagelist (the one with the sample or your own) with png images, then press one of the both alpha creation buttons in the imagelisteditor.
    You can save and load it, it is still there, if you export it to your format it is gone.

    This is just a minor problem, if you can fix it would be good, if not or if loading takes longer then or something I would use the old format for imagelists with alpha and your new format for all others.

    I will now again open a topic in DelphiSanctuary and try to get your changes into the CVS. Thanks again,

    Firle

  10. #60

    Loading DX Textures in an imagelist - which is the fastest?

    I think they were the only methods that I added/changed.

    I will have a closer look at the alpha channel problem.

Page 6 of 7 FirstFirst ... 4567 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
  •