Results 1 to 7 of 7

Thread: Weird problem #2

  1. #1

    Weird problem #2

    What, oh what is this.. I had to reinstall my Windows XP and so everything else; Delphi too, and Asphyre there.. well, it worked well, but I seem to have problems with graphics.

    So, I do remember to initialize the AsphyreDevice before using it. AsphyreTimer makes Dev.Render and Dev.Flip so the screen is black, untill..

    I load images to AsphyreImages with this:
    Code:
    procedure Tform1.AddImage(img:string; where:TAsphyreImages; tolerance:integer);
    var
      sad:TBitmap;
      wi,he:variant;
    begin
      sad := TBitmap.Create;
      sad.LoadFromFile(img);
      wi := sad.Width; he := sad.Height;
      with where.Add do
      begin
        Quality    := aqHigh;
        AlphaLevel := alFull;
        PatternSize:= Point(wi, he);
        Size       := Point(wi, he);
        VisibleSize:= Point(wi, he);
        LoadFromBitmap(sad, true, 0, tolerance);
        Name := (extractfilename(img));
      end;
    end;

    ..and it throws error; right now the code where Access violation- error points is this (DXBase.pas):

    Code:
    function DXTexFormatAvail(Format: TD3DFormat; Usage: Cardinal): Boolean;
    begin
     Result:= Succeeded(Direct3D.CheckDeviceFormat(D3DADAPTER_DEFAULT,
      D3DDEVTYPE_HAL, PresentParams.BackBufferFormat, Usage, D3DRTYPE_TEXTURE,
      Format));
    end;
    What's the problem? I do everything right but.. :(
    Making ultimate rpg with thousands of years and every time new random history, people, world....

  2. #2

    Weird problem #2

    Why are you loading from the disk instead of the ASDb image records? That lets you define sprite sheets over the rather brute-force methodology you're attempting right now.

    You might not want to use the variants there for width and height, just assign them directly.

  3. #3

    Weird problem #2

    Quote Originally Posted by Robert Kosek
    Why are you loading from the disk instead of the ASDb image records? That lets you define sprite sheets over the rather brute-force methodology you're attempting right now.
    Yep, this is already been discussed. I want to load images straight from disc; not records or those ASD-files; just plain images on disk, easy to be edited anytime by anyone.. well, it's truly welcomed if there is some better way than this, just want to load them from disc :)


    Quote Originally Posted by Robert Kosek
    You might not want to use the variants there for width and height, just assign them directly.
    Yup, and there's no Sad.Free; but it'll work here in the forum; I bet everyone understands.
    Making ultimate rpg with thousands of years and every time new random history, people, world....

  4. #4

    Weird problem #2

    Well isn't it funny. FIRST I loaded pictures, THEN I initialized the Device - and that's too late.

    It now initializes the Device BEFORE loading images.

    Problem solved, thanks anyway. This seems to be quite quiet place nowadays :) More members, don't let this forum die!
    Making ultimate rpg with thousands of years and every time new random history, people, world....

  5. #5

    Weird problem #2

    Glad to hear that you solved your problem. Do you still use Asphyre 3 ?

    \\

  6. #6

    Weird problem #2

    Uhm..sorry for posting second post but I wanted to edit my post and I can't do this. Why is that?

  7. #7

    Weird problem #2

    I noticed it too; seems to be that there's no possibility to edit own messages.. :(


    ..yes, I got it working. eXtreme 3, that's what I use since I have Delphi 7 which isn't supported by Asphyre 4.

    Now I'm trying to get some kind of TextOut- procedure to function proberly.
    Making ultimate rpg with thousands of years and every time new random history, people, world....

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
  •