aboutsummaryrefslogtreecommitdiff
path: root/engines/adl/hires2.cpp
diff options
context:
space:
mode:
authorWalter van Niftrik2016-03-14 10:40:51 +0100
committerWalter van Niftrik2016-06-06 20:35:49 +0200
commit0686ba9de8f77a1928d2d7aa4736384eb0715494 (patch)
treeafe3750c8c0f4629cd27b0aa3d119e44801cbafd /engines/adl/hires2.cpp
parent148814b2a6c3dffb53b8d902eb7fcfb68110bea3 (diff)
downloadscummvm-rg350-0686ba9de8f77a1928d2d7aa4736384eb0715494.tar.gz
scummvm-rg350-0686ba9de8f77a1928d2d7aa4736384eb0715494.tar.bz2
scummvm-rg350-0686ba9de8f77a1928d2d7aa4736384eb0715494.zip
ADL: Clean up file error handling
Diffstat (limited to 'engines/adl/hires2.cpp')
-rw-r--r--engines/adl/hires2.cpp18
1 files changed, 4 insertions, 14 deletions
diff --git a/engines/adl/hires2.cpp b/engines/adl/hires2.cpp
index 19f447e8be..3655b2afa8 100644
--- a/engines/adl/hires2.cpp
+++ b/engines/adl/hires2.cpp
@@ -34,10 +34,7 @@ namespace Adl {
void HiRes2Engine::runIntro() const {
Common::File f;
-
- if (!f.open(IDS_HR2_DISK_IMAGE))
- error("Failed to open file '" IDS_HR2_DISK_IMAGE "'");
-
+ openFile(f, IDS_HR2_DISK_IMAGE);
f.seek(IDI_HR2_OFS_INTRO_TEXT);
_display->setMode(DISPLAY_MODE_TEXT);
@@ -55,9 +52,7 @@ void HiRes2Engine::init() {
_graphics = new Graphics_v2(*_display);
Common::File f;
-
- if (!f.open(IDS_HR2_DISK_IMAGE))
- error("Failed to open file '" IDS_HR2_DISK_IMAGE "'");
+ openFile(f, IDS_HR2_DISK_IMAGE);
for (uint i = 0; i < IDI_HR2_NUM_MESSAGES; ++i) {
f.seek(IDI_HR2_OFS_MESSAGES + i * 4);
@@ -97,9 +92,7 @@ void HiRes2Engine::init() {
void HiRes2Engine::initState() {
Common::File f;
-
- if (!f.open(IDS_HR2_DISK_IMAGE))
- error("Failed to open file '" IDS_HR2_DISK_IMAGE "'");
+ openFile(f, IDS_HR2_DISK_IMAGE);
_state.rooms.clear();
f.seek(IDI_HR2_OFS_ROOMS);
@@ -127,10 +120,7 @@ void HiRes2Engine::drawPic(byte pic, Common::Point pos) const {
// Temp hack to show a pic
Common::File f;
-
- if (!f.open(IDS_HR2_DISK_IMAGE))
- error("Failed to open file '" IDS_HR2_DISK_IMAGE "'");
-
+ openFile(f, IDS_HR2_DISK_IMAGE);
f.seek(0x1000);
_graphics->drawPic(f, pos, 0);