Skip to main content
GameDev.net gamedev.net
🔒 Locked

Blank screen problems

Started by BlackVoid Mar 9, 2006 at 9:20 AM 0 replies 2.2k views
Original Post
BlackVoid
BlackVoid
Hello All, We are developing a complex game that is not far from completion and we ran into a big problem that we have been unable to solve for weeks now. This is Delphi 7 on Windows XP. The game is a turn-based strategy game that has two parts: strategy and tactical battles. Both use the same type of interface (standard forms on top of a DirectDraw surface). The strategy part is a form that we call GamesForm. When the user finishes a turn, the AI executes its turn. During this time regular calls are made to our screen refresh routine and everything works fine. When the AI finishes its move, complex calculations modify the supply levels of the armies. After this, a form pops up informing the user of events of the current week. This form regularly came up BEHIND the GamesForm and this preventsed the user from progressing. I have browsed thru the groups and the net and tried some solutions for this. The only solution that has worked is to call Application.Processmessages in our loops. However this caused another problem, which only happens in some cases, but it is totally reproduceable. If the AI initiates a tactical battle we bring up a new form that also has a DirectDraw surface. The tactical battle can be played and finished, the GamesForm and the strategy map comes up alright, but when the AI finishes its turn the code arrives at the supply calculation routine. The first call here to Application.Processmessages freezes the game for 5-10 minutes and the map disappears for this time. We have now tried evertything we could think of, with no results. We need a solution for either of the above problems. Thank you, Bulcsu Varhegyi
BlackVoid
BlackVoid
I was doing some debugging. After the AIs turn, the code returns to the main form's Showmodal procedure and there this line makes the screen go blank:
Application.HandleMessage;

When we do not make calls to processmessages, I assume this happens, because the queue is full of messages?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.