Mirage Source
blting to the screen for x seconds - Printable Version

+- Mirage Source (https://mirage-engine.uk/forums)
+-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61)
+--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18)
+---- Forum: Programming (https://mirage-engine.uk/forums/forumdisplay.php?fid=24)
+----- Forum: Visual Basic 6 (https://mirage-engine.uk/forums/forumdisplay.php?fid=32)
+----- Thread: blting to the screen for x seconds (/showthread.php?tid=2845)



blting to the screen for x seconds - zidsal - 07-06-2009

I'm trying to make it so in my game it will blt the screen black for a second or 2 in game. Currently however the blting last what is a like a mili second. I've tried to just get the game to keep blting to the screen until the loops broken by gettickcount but with no such luck.


Do Until x = True 'infinite loop
DD_BackBuffer.SetFillColor RGB(0, 0, 0)
Call DD_BackBuffer.DrawBox(0, 0, (MAX_MAPX + 1) * PIC_X, (MAX_MAPY + 1) * PIC_Y)

If GetTickCount > tint + 2000 Then ' breaks the loop after 2 seconds
tint = GetTickCount
Exit Do
End If
Loop

any help on the matter would be great

thanks
zidsal


Re: blting to the screen for x seconds - Pbcrazy - 07-06-2009

don't have a loop inside the main loop, just have a check each time the normal loop passes through.

[code]
If BlckScrnTimer


Re: blting to the screen for x seconds - GIAKEN - 07-06-2009

Instead, make it not call the Render_Graphics sub, which will stop drawing everything and only show black...which would have the same effect but better. So:

Code:
Public tmrStop As Long

.........

If tmrStop < GetTickCount Then Render_Graphics

Then where you want to make everything black, enter this code:

Code:
tmrStop = GetTickCount + 2000

And that will make everything black for 2 seconds.


Re: blting to the screen for x seconds - zidsal - 08-06-2009

thanks for the help guys I've got it working now with out draining fps to 0 :lol:


Re: blting to the screen for x seconds - GIAKEN - 08-06-2009

Using my method should make the FPS go up exceptionally Tongue