Shinya Kitaoka 810553
#pragma once
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "tlevel_io.h"
Toshihiro Shimizu 890ddd
#include "tfile.h"
Toshihiro Shimizu 890ddd
#include <map></map>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifdef DOPO_LO_FACCIAMO
Toshihiro Shimizu 890ddd
class TImageReaderWriterZCC;
Toshihiro Shimizu 890ddd
struct C {
Shinya Kitaoka 120a6e
  C() : m_offset(0), m_size(0), m_lx(0), m_ly(0) {}
Shinya Kitaoka 120a6e
  C(TINT64 offset, long size, int lx, int ly)
Shinya Kitaoka 120a6e
      : m_offset(offset), m_size(size), m_lx(lx), m_ly(ly) {}
Shinya Kitaoka 120a6e
  TINT64 m_offset;
Shinya Kitaoka 120a6e
  long m_size;
Shinya Kitaoka 120a6e
  int m_lx;
Shinya Kitaoka 120a6e
  int m_ly;
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
class TLevelReaderWriterZCC : public TLevelReaderWriter {
Shinya Kitaoka 120a6e
  friend class TImageReaderWriterZCC;
Shinya Kitaoka 120a6e
  TFile m_file;
Shinya Kitaoka 120a6e
  TFile m_indexFile;
Shinya Kitaoka 120a6e
  bool m_initDone;
Shinya Kitaoka 120a6e
  ULONG m_blockSize;
Shinya Kitaoka 120a6e
  std::map<int, c=""> m_map;</int,>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  TLevelReaderWriterZCC(const TFilePath &path, TReaderWriterInfo *winfo);
Shinya Kitaoka 120a6e
  ~TLevelReaderWriterZCC();
Shinya Kitaoka 120a6e
  TImageReaderWriterP getFrameReaderWriter(TFrameId fid);
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  static TLevelReaderWriter *create(const TFilePath &f,
Shinya Kitaoka 120a6e
                                    TReaderWriterInfo *winfo) {
Shinya Kitaoka 120a6e
    return new TLevelReaderWriterZCC(f, winfo);
Shinya Kitaoka 120a6e
  };
Shinya Kitaoka 120a6e
  TLevelP loadInfo();
Shinya Kitaoka 120a6e
  void saveSoundTrack(TSoundTrack *st);
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//------------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
class TReaderWriterInfoZCC : public TReaderWriterInfo {
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  friend TLevelReaderWriterZCC;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  static TReaderWriterInfo *create(const string &ext);
Shinya Kitaoka 120a6e
  ~TReaderWriterInfoZCC();
Shinya Kitaoka 120a6e
  TReaderWriterInfo *clone() const;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
private:
Shinya Kitaoka 120a6e
  TReaderWriterInfoZCC();
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  TReaderWriterInfoZCC(const TReaderWriterInfoZCC &);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  TReaderWriterInfoZCC &operator=(
Shinya Kitaoka 120a6e
      const TReaderWriterInfoZCC &);  // not implemented
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
#endif