Skip to content

Commit

Permalink
GOT: Change blitFrom to simpleBlitFrom
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster authored and bluegr committed Jan 12, 2025
1 parent dc3e805 commit 7e77e80
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 41 deletions.
2 changes: 1 addition & 1 deletion engines/got/views/credits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ void Credits::draw() {
// Draw scroll background
Graphics::ManagedSurface bg = _G(gfx)[42];
s.clear(*(byte *)bg.getPixels());
s.blitFrom(bg, Common::Point(0, 24));
s.simpleBlitFrom(bg, Common::Point(0, 24));

int creditNum = _frameCtr / CREDIT_TIME;
int subNum = _frameCtr % CREDIT_TIME;
Expand Down
16 changes: 8 additions & 8 deletions engines/got/views/dialogs/dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,21 @@ void Dialog::draw() {
assert((s.w % 16) == 0 && (s.h % 16) == 0);

// Draw four corners
s.blitFrom(_G(bgPics)[192], Common::Point(0, 0));
s.blitFrom(_G(bgPics)[193], Common::Point(_bounds.width() - 16, 0));
s.blitFrom(_G(bgPics)[194], Common::Point(0, _bounds.height() - 16));
s.blitFrom(_G(bgPics)[195], Common::Point(_bounds.width() - 16, _bounds.height() - 16));
s.simpleBlitFrom(_G(bgPics)[192], Common::Point(0, 0));
s.simpleBlitFrom(_G(bgPics)[193], Common::Point(_bounds.width() - 16, 0));
s.simpleBlitFrom(_G(bgPics)[194], Common::Point(0, _bounds.height() - 16));
s.simpleBlitFrom(_G(bgPics)[195], Common::Point(_bounds.width() - 16, _bounds.height() - 16));

// Draw top/bottom horizontal lines
for (int x = 16; x < _bounds.width() - 16; x += 16) {
s.blitFrom(_G(bgPics)[196], Common::Point(x, 0));
s.blitFrom(_G(bgPics)[197], Common::Point(x, _bounds.height() - 16));
s.simpleBlitFrom(_G(bgPics)[196], Common::Point(x, 0));
s.simpleBlitFrom(_G(bgPics)[197], Common::Point(x, _bounds.height() - 16));
}

// Draw left/right vertical lines
for (int y = 16; y < _bounds.height() - 16; y += 16) {
s.blitFrom(_G(bgPics)[198], Common::Point(0, y));
s.blitFrom(_G(bgPics)[199], Common::Point(_bounds.width() - 16, y));
s.simpleBlitFrom(_G(bgPics)[198], Common::Point(0, y));
s.simpleBlitFrom(_G(bgPics)[199], Common::Point(_bounds.width() - 16, y));
}
}

Expand Down
2 changes: 1 addition & 1 deletion engines/got/views/dialogs/high_scores.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ void HighScores::draw() {

for (int col = 0, xp = 0; col < 10; ++col, xp += 32) {
for (int yp = 0; yp < 240; yp += 32)
s.blitFrom(_G(gfx)[26], Common::Point(xp, yp));
s.simpleBlitFrom(_G(gfx)[26], Common::Point(xp, yp));
}

// Draw the dialog frame
Expand Down
4 changes: 2 additions & 2 deletions engines/got/views/dialogs/say.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ void Say::draw() {
GfxSurface s = getSurface();

if (_item)
s.blitFrom(_G(objects)[_item], Common::Point(160, 17));
s.simpleBlitFrom(_G(objects)[_item], Common::Point(160, 17));

const char *p = _content;
const char *endP = _content + _contentLength;
Expand Down Expand Up @@ -108,7 +108,7 @@ void Say::draw() {
x += 8;
}

s.blitFrom(_speakerIcon[_picIndex], Common::Point(120, 17));
s.simpleBlitFrom(_speakerIcon[_picIndex], Common::Point(120, 17));

if (_waitForResponse == WAIT_MORE)
s.print(Common::Point(184, 86), "More...", 15);
Expand Down
4 changes: 2 additions & 2 deletions engines/got/views/dialogs/select_item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ void SelectItem::draw() {
for (int l = 0; l < 7; l++, b = b << 1) {
if (_G(thor_info).inventory & b) {
if (l < 6)
s.blitFrom(_G(objects)[l + 26],
s.simpleBlitFrom(_G(objects)[l + 26],
Common::Point(82 - 56 + (l * _HRZSP), 72 - 48));
else
s.blitFrom(_G(objects)[_G(thor_info).object + 10],
s.simpleBlitFrom(_G(objects)[_G(thor_info).object + 10],
Common::Point(82 - 56 + (l * _HRZSP), 72 - 48));
}
}
Expand Down
4 changes: 2 additions & 2 deletions engines/got/views/dialogs/select_option.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ void SelectOption::draw() {
if (_smackCtr > 0) {
// Selecting an item
int xp = 8 + 2 * (_smackCtr < 3 ? (_smackCtr + 1) : (6 - _smackCtr));
s.blitFrom(_G(hampic)[0], Common::Point(xp, 24 + (_selectedItem * 16)));
s.simpleBlitFrom(_G(hampic)[0], Common::Point(xp, 24 + (_selectedItem * 16)));
} else {
// Normal animated cursor
s.blitFrom(_G(hampic)[_hammerFrame],
s.simpleBlitFrom(_G(hampic)[_hammerFrame],
Common::Point(8, 24 + (_selectedItem * 16)));
}
}
Expand Down
32 changes: 16 additions & 16 deletions engines/got/views/game_content.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void GameContent::draw() {
if (_G(gameMode) == MODE_THUNDER) {
GfxSurface win = getSurface();
win.clear();
win.blitFrom(s, _moveDelta);
win.simpleBlitFrom(s, _moveDelta);
} else if (_G(gameMode) == MODE_LIGHTNING) {
drawLightning(s);

Expand All @@ -75,38 +75,38 @@ void GameContent::draw() {

switch (_G(transitionDir)) {
case DIR_LEFT:
win.blitFrom(s, Common::Rect(320 - _transitionPos, 0, 320, 192),
win.simpleBlitFrom(s, Common::Rect(320 - _transitionPos, 0, 320, 192),
Common::Point(0, 0));
win.blitFrom(_surface, Common::Rect(0, 0, 320 - _transitionPos, 192),
win.simpleBlitFrom(_surface, Common::Rect(0, 0, 320 - _transitionPos, 192),
Common::Point(_transitionPos, 0));
break;
case DIR_RIGHT:
win.blitFrom(_surface, Common::Rect(_transitionPos, 0, 320, 192),
win.simpleBlitFrom(_surface, Common::Rect(_transitionPos, 0, 320, 192),
Common::Point(0, 0));
win.blitFrom(s, Common::Rect(0, 0, _transitionPos, 192),
win.simpleBlitFrom(s, Common::Rect(0, 0, _transitionPos, 192),
Common::Point(320 - _transitionPos, 0));
break;
case DIR_UP:
win.blitFrom(s, Common::Rect(0, 192 - _transitionPos, 320, 192),
win.simpleBlitFrom(s, Common::Rect(0, 192 - _transitionPos, 320, 192),
Common::Point(0, 0));
win.blitFrom(_surface, Common::Rect(0, 0, 320, 192 - _transitionPos),
win.simpleBlitFrom(_surface, Common::Rect(0, 0, 320, 192 - _transitionPos),
Common::Point(0, _transitionPos));
break;
case DIR_DOWN:
win.blitFrom(_surface, Common::Rect(0, _transitionPos, 320, 192),
win.simpleBlitFrom(_surface, Common::Rect(0, _transitionPos, 320, 192),
Common::Point(0, 0));
win.blitFrom(s, Common::Rect(0, 0, 320, _transitionPos),
win.simpleBlitFrom(s, Common::Rect(0, 0, 320, _transitionPos),
Common::Point(0, 192 - _transitionPos));
break;
case DIR_PHASED:
win.blitFrom(_surface); // Copy old surface
win.simpleBlitFrom(_surface); // Copy old surface

// Copy the randomly chosen blocks over from new scene
for (int i = 0; i < 240; ++i) {
int x = (i * 16) % 320;
int y = ((i * 16) / 320) * 16;
if (_phased[i])
win.blitFrom(s, Common::Rect(x, y, x + 16, y + 16), Common::Point(x, y));
win.simpleBlitFrom(s, Common::Rect(x, y, x + 16, y + 16), Common::Point(x, y));
}
break;
default:
Expand Down Expand Up @@ -230,8 +230,8 @@ void GameContent::drawBackground(GfxSurface &s) {
for (int x = 0; x < TILES_X; x++) {
if (_G(scrn).icon[y][x] != 0) {
const Common::Point pt(x * TILE_SIZE, y * TILE_SIZE);
s.blitFrom(_G(bgPics)[_G(scrn).bg_color], pt);
s.blitFrom(_G(bgPics)[_G(scrn).icon[y][x]], pt);
s.simpleBlitFrom(_G(bgPics)[_G(scrn).bg_color], pt);
s.simpleBlitFrom(_G(bgPics)[_G(scrn).icon[y][x]], pt);
}
}
}
Expand All @@ -243,7 +243,7 @@ void GameContent::drawObjects(GfxSurface &s) {
int p = (y * TILES_X) + x;

if (_G(object_map)[p]) {
s.blitFrom(_G(objects)[_G(object_map)[p] - 1],
s.simpleBlitFrom(_G(objects)[_G(object_map)[p] - 1],
Common::Point(x * TILE_SIZE, y * TILE_SIZE));
}
}
Expand All @@ -262,7 +262,7 @@ void GameContent::drawActors(GfxSurface &s) {

const Graphics::ManagedSurface &frame = actor_ptr->pic[actor_ptr->dir]
[actor_ptr->frame_sequence[actor_ptr->next]];
s.blitFrom(frame, Common::Point(actor_ptr->x, actor_ptr->y));
s.simpleBlitFrom(frame, Common::Point(actor_ptr->x, actor_ptr->y));
}

// Move to the next actor
Expand All @@ -278,7 +278,7 @@ void GameContent::drawActors(GfxSurface &s) {
}

if (_G(gameMode) == MODE_THOR_DIES && _deathCtr >= DEATH_THRESHOLD)
s.blitFrom(_G(objects)[10], Common::Point(_G(thor)->x, _G(thor)->y));
s.simpleBlitFrom(_G(objects)[10], Common::Point(_G(thor)->x, _G(thor)->y));
}

void GameContent::drawBossHealth(GfxSurface &s) {
Expand Down
6 changes: 3 additions & 3 deletions engines/got/views/game_status.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void GameStatus::draw() {

// Draw the status background
const Graphics::ManagedSurface &status = _G(status)[0];
s.blitFrom(status);
s.simpleBlitFrom(status);

// Draw the elements
displayHealth(s);
Expand Down Expand Up @@ -101,9 +101,9 @@ void GameStatus::displayItem(GfxSurface &s) {

if (_G(thor_info).item) {
if (_G(thor_info).item == 7)
s.blitFrom(_G(objects)[_G(thor_info).object + 10], Common::Point(280, 8));
s.simpleBlitFrom(_G(objects)[_G(thor_info).object + 10], Common::Point(280, 8));
else
s.blitFrom(_G(objects)[_G(thor_info).item + 25], Common::Point(280, 8));
s.simpleBlitFrom(_G(objects)[_G(thor_info).item + 25], Common::Point(280, 8));
}
}

Expand Down
2 changes: 1 addition & 1 deletion engines/got/views/splash_screen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ void SplashScreen::draw() {
// Display background. The rest of the logo animation will be
// done in the frame routines called from tick
s.clear();
s.blitFrom(_G(gfx)[92], Common::Point(0, 24));
s.simpleBlitFrom(_G(gfx)[92], Common::Point(0, 24));
}
}

Expand Down
8 changes: 4 additions & 4 deletions engines/got/views/story.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ bool Story::msgFocus(const FocusMessage &msg) {
Gfx::Pics pics(Common::String::format("OPENP%d", i + 1));
pics.load();

_surface.blitFrom(pics[0], Common::Point(0, i * 40));
_surface.simpleBlitFrom(pics[0], Common::Point(0, i * 40));
}

// Set up the story text
Expand Down Expand Up @@ -93,9 +93,9 @@ bool Story::msgFocus(const FocusMessage &msg) {

// Final two glyphs
Gfx::Pics glyphs("STORYPIC", 262);
_surface.blitFrom(glyphs[0], Common::Point(146, 64));
_surface.simpleBlitFrom(glyphs[0], Common::Point(146, 64));
if (_G(area) == 1)
_surface.blitFrom(glyphs[1], Common::Point(24, 88 + 240));
_surface.simpleBlitFrom(glyphs[1], Common::Point(24, 88 + 240));

// Play the opening music
music_play("OPENSONG", 1);
Expand All @@ -114,7 +114,7 @@ void Story::draw() {
GfxSurface s = getSurface();

// Draw the currently visible part of the surface
s.blitFrom(_surface, Common::Rect(0, _yp, 320, _yp + 240),
s.simpleBlitFrom(_surface, Common::Rect(0, _yp, 320, _yp + 240),
Common::Point(0, 0));
}

Expand Down
2 changes: 1 addition & 1 deletion engines/got/views/title_background.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void TitleBackground::draw() {

for (int col = 0, xp = 0; col < 10; ++col, xp += 32) {
for (int yp = 0; yp < 240; yp += 32)
s.blitFrom(_G(gfx)[26], Common::Point(xp, yp));
s.simpleBlitFrom(_G(gfx)[26], Common::Point(xp, yp));
}
}

Expand Down

0 comments on commit 7e77e80

Please sign in to comment.