Ejemplo n.º 1
0
void OSystem_Wii::hideOverlay() {
	_mouseX = _gameWidth / 2;
	_mouseY = _gameHeight / 2;
	_overlayVisible = false;
	updateScreenResolution();
	gfx_tex_set_bilinear_filter(&_texMouse, _bilinearFilter);
}
Ejemplo n.º 2
0
void OSystem_Wii::showOverlay() {
	_mouseX = _overlayWidth / 2;
	_mouseY = _overlayHeight / 2;
	_overlayVisible = true;
	updateScreenResolution();
	gfx_tex_set_bilinear_filter(&_texMouse, true);
}
Ejemplo n.º 3
0
void OSystem_Wii::switchVideoMode(int mode) {
	static const struct {
		gfx_video_mode_t mode;
		bool filter;
	} map[] = {
		{ GFX_MODE_DEFAULT, false },
		{ GFX_MODE_DEFAULT, true },
		{ GFX_MODE_DS, false },
		{ GFX_MODE_DS, true }
	};

	if (_gameHeight > 240) {
		if (mode == gmDoubleStrike)
			mode = gmStandard;
		else if (mode == gmDoubleStrikeFiltered)
			mode = gmStandardFiltered;
	}

	printf("switchVideoMode %d\n", mode);

	if (map[_actualGraphicsMode].mode != map[mode].mode) {
		GXRModeObj obj;

		gfx_video_deinit();
		gfx_video_get_modeobj(&obj, GFX_STANDARD_AUTO, map[mode].mode);
		gfx_video_init(&obj);
		gfx_init();
		gfx_con_init(NULL);
	}

	_actualGraphicsMode = mode;

	_bilinearFilter = map[mode].filter;
	gfx_tex_set_bilinear_filter(&_texGame, _bilinearFilter);
	gfx_tex_set_bilinear_filter(&_texMouse, _bilinearFilter);

	u16 usx, usy;
	if (map[mode].mode == GFX_MODE_DS) {
		usx = ConfMan.getInt("wii_video_ds_underscan_x",
								Common::ConfigManager::kApplicationDomain);
		usy = ConfMan.getInt("wii_video_ds_underscan_y",
								Common::ConfigManager::kApplicationDomain);
	} else {
		usx = ConfMan.getInt("wii_video_default_underscan_x",
								Common::ConfigManager::kApplicationDomain);
		usy = ConfMan.getInt("wii_video_default_underscan_y",
								Common::ConfigManager::kApplicationDomain);
	}

	gfx_set_underscan(usx, usy);
	gfx_coords(&_coordsOverlay, &_texOverlay, GFX_COORD_FULLSCREEN);
	gfx_coords(&_coordsGame, &_texGame, GFX_COORD_FULLSCREEN);
	updateScreenResolution();
}
Ejemplo n.º 4
0
void MapEditor::resizeGL(int w, int h)
{
    std::cout<<"W: "<<w<<" H: "<<h<<std::endl;

    updateScreenResolution(w,h);
    glLoadIdentity();
    glViewport( 0,0,w,h) ;


    std::cout<<imgScale<<std::endl;

    glMatrixMode( GL_PROJECTION );


    glOrtho( -ortho, ortho, -ortho, ortho, -1, 1);
    glMatrixMode( GL_MODELVIEW );


}
Ejemplo n.º 5
0
void OSystem_Wii::initSize(uint width, uint height,
							const Graphics::PixelFormat *format) {
	bool update = false;
	gfx_tex_format_t tex_format;

#ifdef USE_RGB_COLOR
	Graphics::PixelFormat newFormat;

	if (format)
		newFormat = *format;
	else
		newFormat = Graphics::PixelFormat::createFormatCLUT8();

	if (newFormat.bytesPerPixel > 2)
		newFormat = Graphics::PixelFormat::createFormatCLUT8();

	if (_pfGame != newFormat) {
		_pfGame = newFormat;
		update = true;
	}
#endif

	uint newWidth, newHeight;
	if (_pfGame.bytesPerPixel > 1) {
		newWidth = ROUNDUP(width, 4);
		newHeight = ROUNDUP(height, 4);
	} else {
		newWidth = ROUNDUP(width, 8);
		newHeight = ROUNDUP(height, 4);
	}

	if (_gameWidth != newWidth || _gameHeight != newHeight) {
		assert((newWidth <= 640) && (newHeight <= 480));

		if (width != newWidth || height != newHeight)
			printf("extending texture for compability: %ux%u -> %ux%u\n",
					width, height, newWidth, newHeight);

		_gameWidth = newWidth;
		_gameHeight = newHeight;
		update = true;
	}

	if (_gameRunning) {
		switchVideoMode(_configGraphicsMode);

		if (_arCorrection && (_gameWidth == 320) && (_gameHeight == 200))
			gfx_set_ar(320.0 / 240.0);
		else
			gfx_set_ar(f32(_gameWidth) / f32(_gameHeight));
	}

	if (update) {
		free(_gamePixels);

		tex_format = GFX_TF_PALETTE_RGB565;

#ifdef USE_RGB_COLOR
		if (_pfGame.bytesPerPixel > 1) {
			tex_format = GFX_TF_RGB565;
			_pfGameTexture = _pfRGB565;
		}

		printf("initSize %u*%u*%u (%u%u%u -> %u%u%u match: %d)\n",
				_gameWidth, _gameHeight, _pfGame.bytesPerPixel * 8,
				8 - _pfGame.rLoss, 8 - _pfGame.gLoss, 8 - _pfGame.bLoss,
				8 - _pfGameTexture.rLoss, 8 - _pfGameTexture.gLoss,
				8 - _pfGameTexture.bLoss, _pfGame == _pfGameTexture);

		_gamePixels = (u8 *) memalign(32, _gameWidth * _gameHeight *
										_pfGame.bytesPerPixel);
		memset(_gamePixels, 0, _gameWidth * _gameHeight *
				_pfGame.bytesPerPixel);
#else
		printf("initSize %u*%u\n", _gameWidth, _gameHeight);

		_gamePixels = (u8 *) memalign(32, _gameWidth * _gameHeight);
		memset(_gamePixels, 0, _gameWidth * _gameHeight);
#endif

		if (!gfx_tex_init(&_texGame, tex_format, TLUT_GAME,
					_gameWidth, _gameHeight)) {
			printf("could not init the game texture\n");
			::abort();
		}

		gfx_tex_set_bilinear_filter(&_texGame, _bilinearFilter);
		gfx_coords(&_coordsGame, &_texGame, GFX_COORD_FULLSCREEN);

		updateScreenResolution();
	}
}