aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute/BPackage.cpp
diff options
context:
space:
mode:
authorEinar Johan Trøan Sømåen2012-03-13 18:07:41 +0100
committerEinar Johan Trøan Sømåen2012-06-02 12:42:08 +0200
commit84fd9d0daca1846829b077aa18a7634df5e5ef9e (patch)
treed227a02bcc4cf147040428e5d098fd70d0ee45d2 /engines/wintermute/BPackage.cpp
parenta5d992d513cc21c643a09410fdccbe26cbd8592f (diff)
downloadscummvm-rg350-84fd9d0daca1846829b077aa18a7634df5e5ef9e.tar.gz
scummvm-rg350-84fd9d0daca1846829b077aa18a7634df5e5ef9e.tar.bz2
scummvm-rg350-84fd9d0daca1846829b077aa18a7634df5e5ef9e.zip
WINTERMUTE: Add in the Particle-stuff, now everything links, and the AdGame-constructor starts.
Diffstat (limited to 'engines/wintermute/BPackage.cpp')
-rw-r--r--engines/wintermute/BPackage.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/engines/wintermute/BPackage.cpp b/engines/wintermute/BPackage.cpp
index d5ae12fa84..2193999e2c 100644
--- a/engines/wintermute/BPackage.cpp
+++ b/engines/wintermute/BPackage.cpp
@@ -30,6 +30,7 @@
#include "BPackage.h"
#include "BGame.h"
#include "BFileManager.h"
+#include "common/file.h"
namespace WinterMute {
//////////////////////////////////////////////////////////////////////
@@ -66,26 +67,26 @@ HRESULT CBPackage::Open() {
//////////////////////////////////////////////////////////////////////////
HRESULT CBPackage::Close() {
- if (m_File) fclose(m_File);
+ delete m_File;
m_File = NULL;
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CBPackage::Read(FILE *file, uint32 offset, byte *buffer, uint32 size) {
+HRESULT CBPackage::Read(Common::File *file, uint32 offset, byte *buffer, uint32 size) {
HRESULT ret;
if (FAILED(ret = Open())) return ret;
else {
- if (fseek(file, offset, SEEK_SET)) return E_FAIL;
- if (fread(buffer, size, 1, file) != 1) return E_FAIL;
+ if (file->seek(offset, SEEK_SET)) return E_FAIL;
+ if (file->read(buffer, size) != 1) return E_FAIL;
else return S_OK;
}
}
//////////////////////////////////////////////////////////////////////////
-FILE *CBPackage::GetFilePointer() {
- FILE *file = Game->m_FileManager->OpenPackage(m_Name);
+Common::File *CBPackage::GetFilePointer() {
+ Common::File *file = Game->m_FileManager->OpenPackage(m_Name);
if (!file) {
Game->m_FileManager->RequestCD(m_CD, m_Name, "");
file = Game->m_FileManager->OpenPackage(m_Name);
@@ -94,8 +95,8 @@ FILE *CBPackage::GetFilePointer() {
}
//////////////////////////////////////////////////////////////////////////
-void CBPackage::CloseFilePointer(FILE*& file) {
- if (file) fclose(file);
+void CBPackage::CloseFilePointer(Common::File*& file) {
+ delete file;
file = NULL;
}