CVideoHandler.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. #ifndef CVIDEOHANDLEER_H
  2. #define CVIDEOHANDLEER_H
  3. #include "windows.h"
  4. //
  5. //
  6. // protected
  7. // FLib: HINST;
  8. // FLibName: string;
  9. // FFileHandle: HFile;
  10. // function GetCurrentFrame: int; virtual; abstract;
  11. // function GetFramesCount: int; virtual; abstract;
  12. // procedure SetCurrentFrame(v: int); virtual; abstract;
  13. // procedure DoOpen(FileHandle: hFile); virtual; abstract;
  14. // function NormalizeFrame(i:int):int;
  15. // procedure SetPause(v:Boolean); virtual; abstract;
  16. //
  17. // procedure LoadProc(var Proc:Pointer; const ProcName:string);
  18. // public
  19. // Width:pint;
  20. // Height:pint;
  21. // constructor Create(const LibName:string);
  22. // destructor Destroy; override;
  23. // procedure Open(FileHandle:hFile); overload;
  24. // procedure Open(FileName:string); overload;
  25. //// procedure Open(FileData:TRSByteArray); overload;
  26. // procedure SetVolume(i: int); virtual;
  27. // procedure Close; virtual;
  28. // procedure NextFrame; virtual; abstract;
  29. // procedure PreparePic(b:TBitmap); virtual;
  30. // procedure GotoFrame(Index:int; b:TBitmap); virtual;
  31. // function ExtractFrame(b:TBitmap = nil):TBitmap; virtual; abstract;
  32. // function Wait:Boolean; virtual; abstract;
  33. // // Workaround for Bink and Smack thread synchronization bug
  34. // property Frame: int read GetCurrentFrame write SetCurrentFrame;
  35. // property FramesCount: int read GetFramesCount;
  36. // property LibInstance: HINST read FLib;
  37. // property Pause: Boolean write SetPause;
  38. //TRSSmkStruct = packed record
  39. // Version: int;
  40. // Width: int;
  41. // Height: int;
  42. // FrameCount: int;
  43. // mspf: int;
  44. // Unk1: array[0..87] of byte;
  45. // Palette: array[0..775] of byte;
  46. // CurrentFrame: int; // Starting with 0
  47. // // 72 - Øèï
  48. // // 1060 - interesting
  49. // // 1100 - Mute:Bool
  50. //end;
  51. //TRSBinkStruct = packed record
  52. // Width: int;
  53. // Height: int;
  54. // FrameCount: int;
  55. // CurrentFrame: int; // Starting with 1
  56. // LastFrame: int;
  57. // FPSMul: int; // frames/second multiplier
  58. // FPSDiv: int; // frames/second divisor
  59. // Unk1: int;
  60. // Flags: int;
  61. // Unk2: array[0..259] of byte;
  62. // CurrentPlane: int;
  63. // Plane1: ptr;
  64. // Plane2: ptr;
  65. // Unk3: array[0..1] of int;
  66. // YPlaneWidth: int;
  67. // YPlaneHeight: int;
  68. // UVPlaneWidth: int;
  69. // UVPlaneHeight: int;
  70. //end;
  71. struct BINKStruct
  72. {
  73. int width, height, frameCount, lastFrame, currentFrame,
  74. FPSMul, // frames/second multiplier
  75. FPSDiv, // frames/second divisor
  76. unk1, flags, YPlaneWidth, YPlaneHeight, UVPlaneWidth, UVPlaneHeight;
  77. unsigned char unk2[260];
  78. int unk3[2];
  79. void *plane1, *plane2;
  80. };
  81. struct SMKStruct
  82. {
  83. int version, width, height, frameCount, mspf, currentFrame;
  84. unsigned char unk1[88], palette[776];
  85. };
  86. class DLLHandler
  87. {
  88. public:
  89. HINSTANCE dll;
  90. void Instantiate(const char *filename);
  91. const char *GetLibExtension();
  92. void *FindAddress(const char *symbol);
  93. virtual ~DLLHandler();
  94. };
  95. class CBIKHandler
  96. {
  97. public:
  98. DLLHandler ourLib;
  99. std::ifstream str;
  100. int newmode;
  101. BINKStruct data;
  102. unsigned char * buffer;
  103. void * waveOutOpen, * BinkGetError, *BinkOpen, *BinkSetSoundSystem ;
  104. CBIKHandler();
  105. void open(std::string name);
  106. void close();
  107. };
  108. #endif //CVIDEOHANDLEER_H