diff options
| author | Cameron Cawley | 2019-09-19 16:11:58 +0100 | 
|---|---|---|
| committer | Cameron Cawley | 2019-09-19 19:46:59 +0100 | 
| commit | a6aea5c20113fab23f58d3bdd2047fab7e3e2169 (patch) | |
| tree | 2002de16c1a25ba6be6ba8d029e14c8800c5cb40 | |
| parent | 281c292d676322623352606d327f1d26673df32e (diff) | |
| download | scummvm-rg350-a6aea5c20113fab23f58d3bdd2047fab7e3e2169.tar.gz scummvm-rg350-a6aea5c20113fab23f58d3bdd2047fab7e3e2169.tar.bz2 scummvm-rg350-a6aea5c20113fab23f58d3bdd2047fab7e3e2169.zip  | |
ADL: Support using any pixel format for the display
| -rw-r--r-- | engines/adl/adl.cpp | 3 | ||||
| -rw-r--r-- | engines/adl/display_a2.cpp | 6 | 
2 files changed, 6 insertions, 3 deletions
diff --git a/engines/adl/adl.cpp b/engines/adl/adl.cpp index baf14ea466..9bd0011c5f 100644 --- a/engines/adl/adl.cpp +++ b/engines/adl/adl.cpp @@ -731,6 +731,9 @@ void AdlEngine::gameLoop() {  Common::Error AdlEngine::run() {  	_display = Display_A2_create(); +	if (!_display) +		return Common::kUnsupportedColorMode; +  	_console = new Console(this);  	_display->init(); diff --git a/engines/adl/display_a2.cpp b/engines/adl/display_a2.cpp index 773bfb21f8..4e25fbd495 100644 --- a/engines/adl/display_a2.cpp +++ b/engines/adl/display_a2.cpp @@ -651,8 +651,8 @@ static Display_A2 *Display_A2_create_helper() {  }  Display_A2 *Display_A2_create() { -	initGraphics(Display_A2::kGfxWidth * 2, Display_A2::kGfxHeight * 2, new Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0)); -	debugN(1, "Initialized graphics with format: %s\n", g_system->getScreenFormat().toString().c_str()); +	initGraphics(Display_A2::kGfxWidth * 2, Display_A2::kGfxHeight * 2, nullptr); +	debugN(1, "Initialized graphics with format: %s", g_system->getScreenFormat().toString().c_str());  	const uint bpp = g_system->getScreenFormat().bytesPerPixel; @@ -661,7 +661,7 @@ Display_A2 *Display_A2_create() {  	else if (bpp == 2)  		return Display_A2_create_helper<uint16>();  	else -		error("Graphics format uses %d bytes per pixel", bpp);		 +		return nullptr;  }  } // End of namespace Adl  | 
