Example #1
0
const char *VideoDriver_Dedicated::Start(const char * const *parm)
{
	int bpp = BlitterFactoryBase::GetCurrentBlitter()->GetScreenDepth();
	_dedicated_video_mem = (bpp == 0) ? NULL : MallocT<byte>(_cur_resolution.width * _cur_resolution.height * (bpp / 8));

	_screen.width  = _screen.pitch = _cur_resolution.width;
	_screen.height = _cur_resolution.height;
	_screen.dst_ptr = _dedicated_video_mem;
	ScreenSizeChanged();
	BlitterFactoryBase::GetCurrentBlitter()->PostResize();

#if defined(WINCE)
	/* WinCE doesn't support console stuff */
#elif defined(WIN32)
	/* For win32 we need to allocate a console (debug mode does the same) */
	CreateConsole();
	CreateWindowsConsoleThread();
	SetConsoleTitle(_T("OpenTTD Dedicated Server"));
#endif

#ifdef __OS2__
	/* For OS/2 we also need to switch to console mode instead of PM mode */
	OS2_SwitchToConsoleMode();
#endif

	DEBUG(driver, 1, "Loading dedicated server");
	return NULL;
}
Example #2
0
/**
 * Size of the application screen changed.
 * Adapt the game screen-size, re-allocate the open windows, and repaint everything
 */
void GameSizeChanged()
{
	_cur_resolution.width  = _screen.width;
	_cur_resolution.height = _screen.height;
	ScreenSizeChanged();
	RelocateAllWindows(_screen.width, _screen.height);
	MarkWholeScreenDirty();
}
Example #3
0
const char *VideoDriver_Null::Start(const char * const *parm)
{
    this->ticks = GetDriverParamInt(parm, "ticks", 1000);
    _screen.width  = _screen.pitch = _cur_resolution.width;
    _screen.height = _cur_resolution.height;
    _screen.dst_ptr = NULL;
    ScreenSizeChanged();

    /* Do not render, nor blit */
    DEBUG(misc, 1, "Forcing blitter 'null'...");
    BlitterFactoryBase::SelectBlitter("null");
    return NULL;
}
Example #4
0
const char *VideoDriver_Null::Start(const char * const *parm)
{
#ifdef _MSC_VER
	/* Disable the MSVC assertion message box. */
	_set_error_mode(_OUT_TO_STDERR);
#endif

	this->ticks = GetDriverParamInt(parm, "ticks", 1000);
	_screen.width  = _screen.pitch = _cur_resolution.width;
	_screen.height = _cur_resolution.height;
	_screen.dst_ptr = NULL;
	ScreenSizeChanged();

	/* Do not render, nor blit */
	DEBUG(misc, 1, "Forcing blitter 'null'...");
	BlitterFactory::SelectBlitter("null");
	return NULL;
}