Thread: Isn't it beautifull :)

  1. #1
    The Earth is not flat. Clyde's Avatar
    Join Date
    Mar 2002
    Posts
    1,403

    Isn't it beautifull :)

    On my screen i see kind of trails left behind when i move the ship forwards and it animates the rockets at the back.

    Could anyone tell me why that happens/ how to avoid it?

    (arrow keys move, Esc exits)

    Oh and im using DDRAW btw.

  2. #2
    Used Registerer jdinger's Avatar
    Join Date
    Feb 2002
    Posts
    1,065
    Trails are generally caused by not repainting what was underneath the moving object. What you can do is copy the RECT that defines where the Ship was into a temp RECT. Blit the portion of the background that was covered by the temp RECT and blit the Ship in it's new position.

  3. #3
    The Earth is not flat. Clyde's Avatar
    Join Date
    Mar 2002
    Posts
    1,403
    I see, what i'm doing at the moment is memory filling the back buffer with 0s, then blitting my ship surface to the back buffer, then flipping.

    Thats why i dont quite understand why im getting trails; the back buffer is totally wiped before a new image is loaded onto it.

    *confused*

    I might add that the trails are not permanent they fade quickly, do you see them when you run it? Perhaps its my monitor.
    Last edited by Clyde; 07-02-2002 at 05:04 PM.

  4. #4
    Has a Masters in B.S.
    Join Date
    Aug 2001
    Posts
    2,263
    what kind of frame rate are you getting?
    ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.

  5. #5
    The Earth is not flat. Clyde's Avatar
    Join Date
    Mar 2002
    Posts
    1,403
    I have no idea, how would i test for frame rate?

  6. #6
    Has a Masters in B.S.
    Join Date
    Aug 2001
    Posts
    2,263
    you need some way of outputting the values...

    // declare these where you need them

    // RealFPS stores last seconds fps
    // framecountis out current fps counter
    int RealFPS = 0,framecount;
    // our timer for each second
    long timetest = 0;

    //later on...

    drawframe();
    framecount++;

    if(timetest < GetTickTime())
    {
    timetest = GetTickTime() + 1000; // set timer for next second
    RealFPS = framecount; // set the FPS
    framecount= 0; // clear the counter
    }

    something like this for a quick fairly accurate check
    ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.

  7. #7
    Registered User red_baron's Avatar
    Join Date
    May 2002
    Posts
    274
    i tried your program i get no trails at all.
    ¿Red Baron?

    "Imagination is more important than knowledge"
    -Albert Einstein (1879-1955)

    Check out my games!

    [code] /* dont forget code tags! */ [/code]

  8. #8
    The Earth is not flat. Clyde's Avatar
    Join Date
    Mar 2002
    Posts
    1,403
    " tried your program i get no trails at all"

    Cool, in that case its probably my lame monitor

    Thanks for the advice on frame-rate counters No-One.

  9. #9
    Registered User
    Join Date
    Feb 2002
    Posts
    98
    could we see the source code for that?

  10. #10
    The Earth is not flat. Clyde's Avatar
    Join Date
    Mar 2002
    Posts
    1,403
    Frame rate is 75ish, my monitor must just suck.

    "could we see the source code for that?"

    Sure, almost all the directx stuff is wrapped up in the functions in t3dlib1.ccp/h.

  11. #11
    The Earth is not flat. Clyde's Avatar
    Join Date
    Mar 2002
    Posts
    1,403
    This is the exe that the above code is for, it includes firing (spacebar).

    It needs to be placed in the same directory as the two bmps in the zip above

    You will also haev to rename the space7.bmp to space9.bmp
    Last edited by Clyde; 07-03-2002 at 09:06 AM.

  12. #12
    Registered User red_baron's Avatar
    Join Date
    May 2002
    Posts
    274
    is the spaceship suppose to look different than before?
    ¿Red Baron?

    "Imagination is more important than knowledge"
    -Albert Einstein (1879-1955)

    Check out my games!

    [code] /* dont forget code tags! */ [/code]

  13. #13
    The Earth is not flat. Clyde's Avatar
    Join Date
    Mar 2002
    Posts
    1,403
    The animation for the thrusters has changed a little otherwise it should be pretty much the same.

    Does it look very different to you?

  14. #14
    Registered User red_baron's Avatar
    Join Date
    May 2002
    Posts
    274
    yes, it looks like its been stretched or something, the ship is wider and the colours more blurred, it has the same colours as the old ship.
    ¿Red Baron?

    "Imagination is more important than knowledge"
    -Albert Einstein (1879-1955)

    Check out my games!

    [code] /* dont forget code tags! */ [/code]

  15. #15
    The Earth is not flat. Clyde's Avatar
    Join Date
    Mar 2002
    Posts
    1,403
    hmm how odd, i didn't notice a change.

    I cant see why that would happen, i guess ill have to peruse my code

Popular pages Recent additions subscribe to a feed