aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorbjörn Andersson2004-01-11 16:27:36 +0000
committerTorbjörn Andersson2004-01-11 16:27:36 +0000
commitefb03e002407a452577c7838ca3074abe1b07b24 (patch)
tree3695867f62dbdc648fa01757f9894da5cbaf13b6
parentcf0a73f913174599c7c28d910ecd87229fd62afd (diff)
downloadscummvm-rg350-efb03e002407a452577c7838ca3074abe1b07b24.tar.gz
scummvm-rg350-efb03e002407a452577c7838ca3074abe1b07b24.tar.bz2
scummvm-rg350-efb03e002407a452577c7838ca3074abe1b07b24.zip
Changed dumpRes() to use the File class. (Untested.)
svn-id: r12321
-rw-r--r--sword1/resman.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/sword1/resman.cpp b/sword1/resman.cpp
index 09699305d0..fb41e648f4 100644
--- a/sword1/resman.cpp
+++ b/sword1/resman.cpp
@@ -144,12 +144,14 @@ void *ResMan::openFetchRes(uint32 id) {
void ResMan::dumpRes(uint32 id) {
char outn[30];
sprintf(outn, "DUMP%08X.BIN", id);
- FILE *outf = fopen( outn, "wb");
- resOpen(id);
- MemHandle *memHandle = resHandle(id);
- fwrite(memHandle->data, 1, memHandle->size, outf);
- fclose(outf);
- resClose(id);
+ File outf;
+ if (outf.open(outn, "", File::kFileWriteMode)) {
+ resOpen(id);
+ MemHandle *memHandle = resHandle(id);
+ outf.write(memHandle->data, memHandle->size);
+ outf.close();
+ resClose(id);
+ }
}
Header *ResMan::lockScript(uint32 scrID) {