changeset 2352:8a49cf25fb88

Moving zlib wrappers to separate headers
author Grumpy7
date Wed, 09 Apr 2014 21:51:06 +0200
parents 12a935783629
children bb9f180d50f6
files AudioPlayer.cpp Build/Visual Studio 2012/World of Might and Magic.vcxproj Build/Visual Studio 2012/World of Might and Magic.vcxproj.filters Indoor.cpp LOD.cpp Outdoor.cpp Render.cpp SaveLoad.cpp Texture.cpp ZlibWrapper.cpp ZlibWrapper.h mm7_data.cpp mm7_unsorted_subs.h
diffstat 13 files changed, 36 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/AudioPlayer.cpp	Wed Apr 09 21:49:35 2014 +0200
+++ b/AudioPlayer.cpp	Wed Apr 09 21:51:06 2014 +0200
@@ -2,6 +2,7 @@
 
 #include "mm7_unsorted_subs.h"
 #include <string>
+#include "ZlibWrapper.h"
 
 #include "mm7_data.h"
 #include "VideoPlayer.h"
--- a/Build/Visual Studio 2012/World of Might and Magic.vcxproj	Wed Apr 09 21:49:35 2014 +0200
+++ b/Build/Visual Studio 2012/World of Might and Magic.vcxproj	Wed Apr 09 21:51:06 2014 +0200
@@ -247,6 +247,7 @@
     <ClCompile Include="..\..\Viewport.cpp" />
     <ClCompile Include="..\..\Vis.cpp" />
     <ClCompile Include="..\..\Weather.cpp" />
+    <ClCompile Include="..\..\ZlibWrapper.cpp" />
     <ClCompile Include="..\..\_deleted.cpp" />
   </ItemGroup>
   <ItemGroup>
@@ -501,6 +502,7 @@
     <ClInclude Include="..\..\Viewport.h" />
     <ClInclude Include="..\..\Vis.h" />
     <ClInclude Include="..\..\Weather.h" />
+    <ClInclude Include="..\..\ZlibWrapper.h" />
   </ItemGroup>
   <ItemGroup>
     <None Include="..\..\lib\legacy_dx\d3dvec.inl" />
--- a/Build/Visual Studio 2012/World of Might and Magic.vcxproj.filters	Wed Apr 09 21:49:35 2014 +0200
+++ b/Build/Visual Studio 2012/World of Might and Magic.vcxproj.filters	Wed Apr 09 21:51:06 2014 +0200
@@ -387,6 +387,7 @@
     <ClCompile Include="..\..\MediaPlayer.cpp" />
     <ClCompile Include="..\..\OurMath.cpp" />
     <ClCompile Include="..\..\Registry.cpp" />
+    <ClCompile Include="..\..\ZlibWrapper.cpp" />
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\Level\Decoration.h" />
@@ -960,6 +961,7 @@
       <Filter>UI\Books</Filter>
     </ClInclude>
     <ClInclude Include="..\..\GUIButton.h" />
+    <ClInclude Include="..\..\ZlibWrapper.h" />
   </ItemGroup>
   <ItemGroup>
     <None Include="..\..\Player.swig" />
--- a/Indoor.cpp	Wed Apr 09 21:49:35 2014 +0200
+++ b/Indoor.cpp	Wed Apr 09 21:51:06 2014 +0200
@@ -1,5 +1,6 @@
 #define _CRT_SECURE_NO_WARNINGS
 #include "ErrorHandling.h"
+#include "ZlibWrapper.h"
 #include "mm7_unsorted_subs.h"
 #include "LightmapBuilder.h"
 #include "DecalBuilder.h"
--- a/LOD.cpp	Wed Apr 09 21:49:35 2014 +0200
+++ b/LOD.cpp	Wed Apr 09 21:51:06 2014 +0200
@@ -5,6 +5,7 @@
 #include "PaletteManager.h"
 #include "Viewport.h"
 #include "mm7_data.h"
+#include "ZlibWrapper.h"
 
 #include "mm7_data.h"
 #include "mm7_unsorted_subs.h"
--- a/Outdoor.cpp	Wed Apr 09 21:49:35 2014 +0200
+++ b/Outdoor.cpp	Wed Apr 09 21:51:06 2014 +0200
@@ -37,6 +37,7 @@
 #include "GUIWindow.h"
 #include "Level/Decoration.h"
 #include "OurMath.h"
+#include "ZlibWrapper.h"
 
 MapStartPoint uLevel_StartingPointType; // weak
 
--- a/Render.cpp	Wed Apr 09 21:49:35 2014 +0200
+++ b/Render.cpp	Wed Apr 09 21:51:06 2014 +0200
@@ -1,5 +1,6 @@
 #define _CRT_SECURE_NO_WARNINGS
 #include "mm7_unsorted_subs.h"
+#include "ZlibWrapper.h"
 #include "ErrorHandling.h"
 
 #include "Render.h"
--- a/SaveLoad.cpp	Wed Apr 09 21:49:35 2014 +0200
+++ b/SaveLoad.cpp	Wed Apr 09 21:51:06 2014 +0200
@@ -3,6 +3,7 @@
 #include <direct.h>
 #include "mm7_unsorted_subs.h"
 #include "ErrorHandling.h"
+#include "ZlibWrapper.h"
 
 #include "SaveLoad.h"
 #include "BSPModel.h"
--- a/Texture.cpp	Wed Apr 09 21:49:35 2014 +0200
+++ b/Texture.cpp	Wed Apr 09 21:51:06 2014 +0200
@@ -7,6 +7,7 @@
 #include "PaletteManager.h"
 #include "Render.h"
 #include "ErrorHandling.h"
+#include "ZlibWrapper.h"
 
 #include "mm7_data.h"
 #include "mm7_unsorted_subs.h"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ZlibWrapper.cpp	Wed Apr 09 21:51:06 2014 +0200
@@ -0,0 +1,18 @@
+
+namespace zlib
+{
+#include "lib\zlib\zlib.h"
+  int MemUnzip(void *dest, unsigned int *destLen, const void *source, unsigned int sourceLen)
+  {
+    //return uncompress((zlib::Bytef *)dest, (zlib::uLongf *)destLen, (zlib::Bytef *)source, sourceLen);
+    return uncompress((Bytef *)dest, (uLongf *)destLen, (Bytef *)source, sourceLen);
+    return 0;
+  }
+
+  int MemZip(void *dest, unsigned int *destLen, void *source, unsigned int sourceLen)
+  {
+    //return compress((zlib::Bytef *)dest, (zlib::uLongf *)destLen, (zlib::Bytef *)source, sourceLen);
+    return compress((Bytef *)dest, (uLongf *)destLen, (Bytef *)source, sourceLen);
+    return 0;
+  }
+};
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ZlibWrapper.h	Wed Apr 09 21:51:06 2014 +0200
@@ -0,0 +1,7 @@
+#pragma once
+
+namespace zlib
+{
+  int MemZip(void *dest, unsigned int *destLen, void *source, unsigned int sourceLen);
+  int MemUnzip(void *dest, unsigned int *destLen, const void *source, unsigned int sourceLen);
+};
\ No newline at end of file
--- a/mm7_data.cpp	Wed Apr 09 21:49:35 2014 +0200
+++ b/mm7_data.cpp	Wed Apr 09 21:51:06 2014 +0200
@@ -294,23 +294,6 @@
 
 
 
-namespace zlib
-{
-  #include "lib\zlib\zlib.h"
-  int MemUnzip(void *dest, unsigned int *destLen, const void *source, unsigned int sourceLen)
-  {
-    //return uncompress((zlib::Bytef *)dest, (zlib::uLongf *)destLen, (zlib::Bytef *)source, sourceLen);
-    return uncompress((Bytef *)dest, (uLongf *)destLen, (Bytef *)source, sourceLen);
-    return 0;
-  }
-
-  int MemZip(void *dest, unsigned int *destLen, void *source, unsigned int sourceLen)
-  {
-    //return compress((zlib::Bytef *)dest, (zlib::uLongf *)destLen, (zlib::Bytef *)source, sourceLen);
-    return compress((Bytef *)dest, (uLongf *)destLen, (Bytef *)source, sourceLen);
-    return 0;
-  }
-};
 
 #include "stru314.h"
 #include "stru367.h"
--- a/mm7_unsorted_subs.h	Wed Apr 09 21:49:35 2014 +0200
+++ b/mm7_unsorted_subs.h	Wed Apr 09 21:51:06 2014 +0200
@@ -137,9 +137,3 @@
     *p++ = value;
 }
 
-
-namespace zlib
-{
-  int MemZip(void *dest, unsigned int *destLen, void *source, unsigned int sourceLen);
-  int MemUnzip(void *dest, unsigned int *destLen, const void *source, unsigned int sourceLen);
-};
\ No newline at end of file