diff options
author | Paul Gilbert | 2011-12-31 16:36:09 +1100 |
---|---|---|
committer | Strangerke | 2012-04-06 08:18:55 +0200 |
commit | 4837636386e1bcad9fb33e1b16d7345c28047d3c (patch) | |
tree | 830e1ddf464ece25770b82fbe4b6dd8f4b4cb7ac /engines/mortevielle/taffich.cpp | |
parent | fd243358d3e2aaa48da4d4ea8a1080b1ecdd6f15 (diff) | |
download | scummvm-rg350-4837636386e1bcad9fb33e1b16d7345c28047d3c.tar.gz scummvm-rg350-4837636386e1bcad9fb33e1b16d7345c28047d3c.tar.bz2 scummvm-rg350-4837636386e1bcad9fb33e1b16d7345c28047d3c.zip |
MORTEVIELLE: Converted some of the file accesses to use Common::File
Diffstat (limited to 'engines/mortevielle/taffich.cpp')
-rw-r--r-- | engines/mortevielle/taffich.cpp | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/engines/mortevielle/taffich.cpp b/engines/mortevielle/taffich.cpp index 6969cf6aea..1a20a1b9f9 100644 --- a/engines/mortevielle/taffich.cpp +++ b/engines/mortevielle/taffich.cpp @@ -25,6 +25,7 @@ * Copyright (c) 1988-1989 Lankhor */ +#include "common/file.h" #include "common/str.h" #include "mortevielle/mouse.h" #include "mortevielle/taffich.h" @@ -35,29 +36,31 @@ namespace Mortevielle { void chardes(Common::String nom, float passe, int long_) { int i, p, l; byte b; - untyped_file f; + Common::File f; /* debug('chardes'); */ - assign(f, nom); - /*$i-*/ - reset(f); + if (!f.open(nom)) + error("Missing file %s", nom.c_str()); + testfi(); p = 0; while (passe > 127) { p = p + 1; passe = passe - 128; } - if (p != 0) seek(f, p); + if (p != 0) + f.seek(p); p = trunc(passe); l = long_ + p; i = 0; while (l > 0) { - blockread(f, mem[0x6000 + i], 1); + f.read(mem[0x6000 + i], 1); testfi(); l = l - 128; i = i + 128; } - close(f); + f.close(); + for (i = p; i <= long_ + p; i ++) mem[0x7000 + i - p] = mem[0x6000 + i]; /*$i+*/ } @@ -65,31 +68,33 @@ void chardes(Common::String nom, float passe, int long_) { void charani(Common::String nom, float passe, int long_) { int i, p, l; byte b; - untyped_file f; + Common::File f; /* debug('charani'); */ - assign(f, nom); - /*$i-*/ - reset(f); + if (!f.open(nom)) + error("Missing file - %s", nom.c_str()); + testfi(); p = 0; while (passe > 127) { passe = passe - 128; p = p + 1; } - if (p != 0) seek(f, p); + if (p != 0) + f.seek(p); + p = trunc(passe); l = long_ + p; i = 0; while (l > 0) { - blockread(f, mem[0x6000 + i], 1); + f.read(mem[0x6000 + i], 1); testfi(); l = l - 128; i = i + 128; } - close(f); + f.close(); + for (i = p; i <= long_ + p; i ++) mem[0x7314 + i - p] = mem[0x6000 + i]; - /*$i+*/ } void taffich() { |