summaryrefslogtreecommitdiff
path: root/3dc/win95/ILBM_ext.cpp
diff options
context:
space:
mode:
authorRebellion Developments <rebellion@nomail>2000-03-16 11:25:00 +0100
committerPatryk Obara <dreamer.tan@gmail.com>2019-08-19 05:45:17 +0200
commit218ca90543758a20ac326e444ca0643174ca7384 (patch)
tree16bfe3e5307f9f515489000f28728224291a0e3b /3dc/win95/ILBM_ext.cpp
Import Aliens vs Predator - Gold (Build 116)
Source code release, imported from: https://www.gamefront.com/games/aliens-vs-predator-3/file/avp-gold-complete-source-code All text files were converted to Unix format.
Diffstat (limited to '3dc/win95/ILBM_ext.cpp')
-rw-r--r--3dc/win95/ILBM_ext.cpp87
1 files changed, 87 insertions, 0 deletions
diff --git a/3dc/win95/ILBM_ext.cpp b/3dc/win95/ILBM_ext.cpp
new file mode 100644
index 0000000..e1d8a4d
--- /dev/null
+++ b/3dc/win95/ILBM_ext.cpp
@@ -0,0 +1,87 @@
+#include "ILBM_ext.hpp"
+
+IFF_IMPLEMENT_DYNCREATE("ILBM","TRAN",IlbmTranChunk)
+IFF_IMPLEMENT_DYNCREATE("ILBM","ALPH",IlbmAlphChunk)
+IFF_IMPLEMENT_DYNCREATE("MIPM","CONT",MipmContChunk)
+IFF_IMPLEMENT_DYNCREATE("ILBM","S3TC",IlbmS3tcChunk)
+IFF_IMPLEMENT_DYNCREATE("MIPM","FLAG",MipmFlagChunk)
+
+namespace IFF
+{
+ void IlbmTranChunk::Serialize(Archive * pArchv)
+ {
+ pArchv->Transfer(eTransType);
+ pArchv->Transfer(xPos);
+ pArchv->Transfer(yPos);
+ pArchv->Transfer(rgb);
+ }
+
+ void IlbmAlphChunk::Serialize(Archive * pArchv)
+ {
+ pArchv->Transfer(width);
+ pArchv->Transfer(height);
+ pArchv->Transfer(nBitPlanes);
+ pArchv->Transfer(eCompression);
+
+ IlbmBodyChunk::Serialize(pArchv);
+ }
+
+ bool IlbmAlphChunk::GetHeaderInfo() const
+ {
+ IlbmBodyChunk::nWidth = width;
+ IlbmBodyChunk::eCompression = eCompression;
+ IlbmBodyChunk::nBitPlanes = nBitPlanes;
+ return true;
+ }
+
+ void MipmContChunk::Serialize(Archive * pArchv)
+ {
+ pArchv->Transfer(nMipMaps);
+ pArchv->Transfer(eFilter);
+ }
+
+ void MipmFlagChunk::Serialize(Archive * pArchv)
+ {
+ pArchv->Transfer(flags);
+ }
+
+ IlbmS3tcChunk::IlbmS3tcChunk()
+ {
+ m_idCk = "S3TC";
+
+ pData = NULL;
+ dataSize = 0;
+ }
+
+ IlbmS3tcChunk::~IlbmS3tcChunk()
+ {
+ if(pData) delete [] pData;
+ pData = NULL;
+ }
+
+ void IlbmS3tcChunk::Serialize(Archive * pArchv)
+ {
+ pArchv->Transfer(flags);
+ pArchv->Transfer(fourCC);
+ pArchv->Transfer(redWeight);
+ pArchv->Transfer(blueWeight);
+ pArchv->Transfer(greenWeight);
+ pArchv->Transfer(width);
+ pArchv->Transfer(height);
+
+ pArchv->Transfer(dataSize);
+
+ if (pArchv->m_bIsLoading)
+ {
+ if(pData) delete [] pData;
+ pData = new UBYTE[dataSize];
+ }
+
+ UBYTE *pDataPos = pData;
+ for(unsigned i=0;i<dataSize;i++)
+ {
+ pArchv->Transfer(*pDataPos++);
+ }
+ }
+
+} \ No newline at end of file