Mirage Source

Free ORPG making software.
It is currently Sun Apr 28, 2024 4:25 pm

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Sun Jun 07, 2009 12:37 pm 
Offline
Newbie

Joined: Sat Sep 22, 2007 1:31 pm
Posts: 23
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


Top
 Profile  
 
PostPosted: Sun Jun 07, 2009 12:56 pm 
Offline
Pro
User avatar

Joined: Tue Apr 22, 2008 2:15 am
Posts: 597
don't have a loop inside the main loop, just have a check each time the normal loop passes through.

Code:
If BlckScrnTimer <= GetTickCount
    DD_BackBuffer.SetFillColor RGB(0, 0, 0)
    Call DD_BackBuffer.DrawBox(0, 0, (MAX_MAPX + 1) * PIC_X, (MAX_MAPY + 1) * PIC_Y)
End If


And then if you want to start the blackscreen:

Code:
BlckScrnTimer = GetTickCount + 2000 ' Two seconds.


Hope this helps.


Top
 Profile  
 
PostPosted: Sun Jun 07, 2009 9:21 pm 
Offline
Persistant Poster
User avatar

Joined: Thu Mar 29, 2007 10:30 pm
Posts: 1510
Location: Virginia, USA
Google Talk: hpmccloud@gmail.com
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.

_________________
Nean wrote:
Yes harold. Give it to me.

Image
Image


Top
 Profile  
 
PostPosted: Mon Jun 08, 2009 10:48 am 
Offline
Newbie

Joined: Sat Sep 22, 2007 1:31 pm
Posts: 23
thanks for the help guys I've got it working now with out draining fps to 0 :lol:


Top
 Profile  
 
PostPosted: Mon Jun 08, 2009 8:58 pm 
Offline
Persistant Poster
User avatar

Joined: Thu Mar 29, 2007 10:30 pm
Posts: 1510
Location: Virginia, USA
Google Talk: hpmccloud@gmail.com
Using my method should make the FPS go up exceptionally :P

_________________
Nean wrote:
Yes harold. Give it to me.

Image
Image


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group