Quantcast
Channel: Embarcadero Community - Embarcadero Community
Viewing all articles
Browse latest Browse all 1888

Application->ProcessMessages is not working on Android for Tokyo 10.2 build 2004

$
0
0

Short version:
In Tokyo, for Android only (Samsung S8), Application->ProcessMessages() is not processing user input (button taps, image taps, etc.). Berlin does/did work. Also, it works when compiling to Win32.

Medium version:
I have an Android game that I was developing in Berlin (I stepped away from the project for a while and picked up on it again today). Berlin decided that my registration limit has been exceeded (off-topic, but that is very frustrating in and of itself - motherboard/CPU died and Berlin refused to run afterward). I have a VM with latest Tokyo (build 2004), but didn't want to port this game over to Tokyo yet because I suspected that there would be issues. There are issues... Long story short, the game worked in Berlin, but not in Tokyo. The game that was on my phone was working (built in Berlin). The new deployment does not. Anyone else having this issue? I would love to go back to Berlin, but, alas, registration issues until someone at Embarcadero increases the limit again.

Additional info:
The game loop has a heart beat. Before, during, and when finished with the beat, Application->ProcessMessages is called in order to check for user input (fire button clicked, move button, pause button, etc.). I realize that a timer approach could be used, but I don't want to rewrite code that was working. Is this intentional or a bug? Any thoughts?

Relevant code:

//---------------------------
void CHMAGameEngine::Start(TFormHMAGame *formDisp)
{
int startTick, currentTick, sleepTimeMS;
CHMAPlayer playerGUI;

	this->PGameState = GS_Running;

	while (this->PGameState != GS_Stopped)
	{
		startTick = this->GetTickCountMS();


		formDisp->ProcessInputs(&playerGUI); //has process messages - not working in Tokyo

                //do a bunch of stuff....

		if (this->PGameState == GS_Stopped)
			break;

		//process the player from the inputs
		ProcessPlayer(&playerGUI);

                //do a bunch of stuff....

		formDisp->UpdateMapDisplay();

                //process messages until this heartbeat is over
		do
		{
			Sleep(10);
			Application->ProcessMessages(); //not working here either

			currentTick = this->GetTickCountMS();
			sleepTimeMS = this->PBeatTimeMS - (currentTick - startTick);
		}
		while (sleepTimeMS > 0);

		//pause if needed
		while (this->PGameState == GS_Paused)
		{
			Sleep(15);
			formDisp->CheckForResumeMessageFromUser();
		}
	}
}
//------------------------------------

 


Viewing all articles
Browse latest Browse all 1888

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>