コード例 #1
0
ファイル: mouse_cursor.cpp プロジェクト: 86400/scummvm
CMouseCursor::CMouseCursor(CScreenManager *screenManager) :
		_screenManager(screenManager), _cursorId(CURSOR_HOURGLASS), _hideCounter(0),
		_hiddenCount(0), _cursorSuppressed(false), _setCursorCount(0), _inputEnabled(true), _fieldE8(0) {
	loadCursorImages();
	setCursor(CURSOR_ARROW);
	CursorMan.showMouse(true);
}
コード例 #2
0
ファイル: isoeng.cpp プロジェクト: danmats/focraft
Isoeng::Isoeng(char* caption) {
	int img_init;

	srand(time(NULL));
	m_x = m_y = x_offset = y_offset = 0;

	/*	initialize SDL`*/
	putenv("SDL_VIDEO_WINDOW_POS");
	putenv("SDL_VIDEO_CENTERED=1");
	if(SDL_Init(SDL_INIT_EVERYTHING) < 0) {
		err = new char[256];
		sprintf(err, "Unable to initialize SDL: %s", SDL_GetError());
		throw CException("isoeng.cpp", err);
	}
	
	/* create main window SDL drawing surface */
	window_main = SDL_SetVideoMode(WM_WIDTH, WM_HEIGHT, 32, SDL_DOUBLEBUF);
	if(window_main == NULL) {
		err = new char[256];
		sprintf(err, "Unable to set %dx%d video mode: %s", WM_WIDTH, WM_HEIGHT, SDL_GetError());
		throw CException("isoeng.cpp", err);
	}
	SDL_WM_SetCaption(caption, caption);

	/* initialize SDL_Image */
	img_init = IMG_Init(IMG_INIT_PNG);
	if((img_init & IMG_INIT_PNG) != IMG_INIT_PNG) {
		err = new char[256];
		sprintf(err, "Failed to initialize PNG support: %s", IMG_GetError());
		throw CException("isoeng.cpp", err);
	}

	loadCursorImages();
	loadTileImages();
	IMG_Quit();

	createSurfaces();
	alive = true;
}
コード例 #3
0
CMouseCursor::CMouseCursor(CScreenManager *screenManager) : 
		_screenManager(screenManager), _cursorId(CURSOR_HOURGLASS),
		_setCursorCount(0), _fieldE4(0), _fieldE8(0) {
	loadCursorImages();
	setCursor(CURSOR_ARROW);
}