Panda3D
|
00001 // Filename: physxFileStream.h 00002 // Created by: enn0x (11Oct09) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #ifndef PHYSXFILESTREAM_H 00016 #define PHYSXFILESTREAM_H 00017 00018 #include "pandabase.h" 00019 #include "virtualFile.h" 00020 #include "filename.h" 00021 00022 #include "physx_includes.h" 00023 00024 //////////////////////////////////////////////////////////////////// 00025 // Class : PhysxFileStream 00026 // Description : 00027 //////////////////////////////////////////////////////////////////// 00028 class EXPCL_PANDAPHYSX PhysxFileStream : public NxStream { 00029 00030 public: 00031 PhysxFileStream(const Filename &fn, bool load); 00032 virtual ~PhysxFileStream(); 00033 00034 virtual NxU8 readByte() const; 00035 virtual NxU16 readWord() const; 00036 virtual NxU32 readDword() const; 00037 virtual float readFloat() const; 00038 virtual double readDouble() const; 00039 virtual void readBuffer(void *buffer, NxU32 size) const; 00040 00041 virtual NxStream &storeByte(NxU8 b); 00042 virtual NxStream &storeWord(NxU16 w); 00043 virtual NxStream &storeDword(NxU32 d); 00044 virtual NxStream &storeFloat(NxReal f); 00045 virtual NxStream &storeDouble(NxF64 f); 00046 virtual NxStream &storeBuffer(const void *buffer, NxU32 size); 00047 00048 private: 00049 00050 // write 00051 FILE* _fp; 00052 00053 // read 00054 PT(VirtualFile) _vf; 00055 istream *_in; 00056 }; 00057 00058 #endif // PHYSXFILESTREAM_H