Example #1
0
// Set up event handlers and load the name into the text control (see below)
// Load the current element name into the text control (see below)
HTMLEventStatus NewElementBodycb(HBROWSER_HANDLE hbrowser, HDOC_HANDLE hdoc, HELEMENT_HANDLE helem, HTMLEvent* event,char * param)
{
    switch (event->type)
    {
    case HTML_EVENT_LOAD:
         SetNewElementHandlers(hbrowser, hdoc, helem);
         NewElementLoadName(hbrowser, hdoc);
         if (DemoModeEnabled)
			StartDemo(hbrowser, hdoc, helem);
    break;
    case HTML_EVENT_TIMER:
	 	if (DemoModeEnabled)
			if (UpdateDemoMode(hbrowser, hdoc, helem)>=0)
				RearmTimer(hbrowser, helem, 0);
		break;
    case HTML_EVENT_UNLOAD:
            break;
    default:
            break;
    }
    return (HTML_EVENT_STATUS_CONTINUE);
}
Example #2
0
bool CMain::GameLoop(){
	int dnum;

	StartDemo();

	if (PLAYDATA_NUM>0){
		CLoad PlayDataLoad;
			char path[256]; strcpy_s(path, "tenyu_data/save");
			PlayDataLoad.LoadPlayData(path, PlayData);
	}

	while(1){
		switch(Title()){
		case TITLE_FIRSTSTART:
			Opening();
			return Playing();

		case TITLE_LOADSTART:
			if (PLAYDATA_NUM>0 && (dnum = ChooseData()) != -1){
				return Playing(dnum);
			}
			break;

		case TITLE_SETTING:
			Setting();
			break;
		
		case TITLE_GAMEEND:
			return false;

		default:
			WarningDx("Warning->Unexpected matter happend [back to title]->GameLoop()", __FILE__, __LINE__);
		}
	}

	return true;
}