Beispiel #1
0
	void Client::Update()
	{
        if(!curtime) {
            gets2c();
            if(self.clientnum>=0) sendAllMessages(false);
            return;
        }
        gets2c();
        if(self.clientnum>=0) sendAllMessages();
	}
Beispiel #2
0
void KGameProcessIO::sendMessage(QDataStream &stream,int msgid, quint32 receiver, quint32 sender)
{
  sendAllMessages(stream, msgid, receiver, sender, true);
}
Beispiel #3
0
Common::Error BuriedEngine::run() {
	_console = new BuriedConsole(this);

#ifndef USE_ICONV
	// The Japanese version needs iconv support
	if (getLanguage() == Common::JA_JPN)
		return Common::Error(Common::kUnknownError, "No iconv support available");
#endif

	if (isTrueColor()) {
		initGraphics(640, 480, true, 0);

		if (_system->getScreenFormat().bytesPerPixel == 1)
			return Common::kUnsupportedColorMode;
	} else {
		initGraphics(640, 480, true);
	}

	if (isWin95()) {
		_mainEXE = new DatabasePE();
		_library = new DatabasePE();
	} else if (isCompressed()) {
		_mainEXE = new DatabaseNECompressed();
		_library = new DatabaseNECompressed();
	} else {
		_mainEXE = new DatabaseNE();

		// Demo only uses the main EXE
		if (!isDemo())
			_library = new DatabaseNE();
	}

	if (!_mainEXE->load(getEXEName()))
		error("Failed to load main EXE '%s'", getEXEName().c_str());

	if (_library && !_library->load(getLibraryName()))
		error("Failed to load library DLL '%s'", getLibraryName().c_str());

	syncSoundSettings();

	_gfx = new GraphicsManager(this);
	_sound = new SoundManager(this);
	_mainWindow = new FrameWindow(this);
	_mainWindow->showWindow(Window::kWindowShow);

	if (isDemo()) {
		((FrameWindow *)_mainWindow)->showTitleSequence();
		((FrameWindow *)_mainWindow)->showMainMenu();
	} else {
		bool doIntro = true;

		if (ConfMan.hasKey("save_slot")) {
			uint32 gameToLoad = ConfMan.getInt("save_slot");
			doIntro = (loadGameState(gameToLoad).getCode() != Common::kNoError);

			// If the trial version tries to load a game without a time
			// zone that's part of the trial version, force the intro.
			if (isTrial() && !((FrameWindow *)_mainWindow)->getMainChildWindow())
				doIntro = true;
		}

		// Play the intro only if we're starting from scratch
		if (doIntro)
			((FrameWindow *)_mainWindow)->showClosingScreen();
	}

	while (!shouldQuit()) {
		updateVideos();

		pollForEvents();

		sendAllMessages();

		_gfx->updateScreen();
		_system->delayMillis(10);
	}

	return Common::kNoError;
}