Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PRINCE: graphic routines moved to separate file
- Loading branch information
Kamil Zbróg
committed
Oct 13, 2013
1 parent
fb26275
commit dce5c87
Showing
6 changed files
with
114 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#include "prince/graphics.h" | ||
|
||
#include "prince/prince.h" | ||
|
||
#include "graphics/palette.h" | ||
|
||
namespace Prince { | ||
|
||
GraphicsMan::GraphicsMan(PrinceEngine *vm) : _vm(vm), _changed(false) | ||
{ | ||
initGraphics(640, 480, true); | ||
} | ||
|
||
void GraphicsMan::update() | ||
{ | ||
if (_changed) | ||
{ | ||
_vm->_system->copyRectToScreen((byte*)_roomBackground->getBasePtr(0,0), 640, 0, 0, 640, 480); | ||
|
||
_vm->_system->updateScreen(); | ||
} | ||
} | ||
|
||
void GraphicsMan::setPalette(const byte *palette) | ||
{ | ||
_vm->_system->getPaletteManager()->setPalette(palette, 0, 256); | ||
} | ||
|
||
void GraphicsMan::change() | ||
{ | ||
_changed = true; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* ScummVM - Graphic Adventure Engine | ||
* | ||
* ScummVM is the legal property of its developers, whose names | ||
* are too numerous to list here. Please refer to the COPYRIGHT | ||
* file distributed with this source distribution. | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* as published by the Free Software Foundation; either version 2 | ||
* of the License, or (at your option) any later version. | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
* | ||
*/ | ||
|
||
#ifndef PRINCE_GRAPHICS_H | ||
#define PRINCE_GRAPHICS_H | ||
|
||
#include "graphics/surface.h" | ||
|
||
|
||
namespace Prince { | ||
|
||
class PrinceEngine; | ||
|
||
class GraphicsMan | ||
{ | ||
public: | ||
GraphicsMan(PrinceEngine *vm); | ||
|
||
void update(); | ||
|
||
void change(); | ||
|
||
void setPalette(const byte *palette); | ||
|
||
Graphics::Surface *_backScreen; | ||
const Graphics::Surface *_roomBackground; | ||
|
||
private: | ||
|
||
PrinceEngine *_vm; | ||
|
||
bool _changed; | ||
byte _palette[3 * 256]; | ||
Graphics::Surface *_frontScreen; | ||
}; | ||
|
||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
MODULE := engines/prince | ||
|
||
MODULE_OBJS = \ | ||
graphics.o \ | ||
mhwanh.o \ | ||
detection.o \ | ||
font.o \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters