Explorar o código

* Ubuntux's patch for Windows (now PreGame runs but we cannot start any game)

mateuszb %!s(int64=16) %!d(string=hai) anos
pai
achega
e88bec607b
Modificáronse 2 ficheiros con 7 adicións e 2 borrados
  1. 4 1
      hch/CDefHandler.cpp
  2. 3 1
      hch/CDefHandler.h

+ 4 - 1
hch/CDefHandler.cpp

@@ -87,7 +87,10 @@ void CDefHandler::openFromMemory(unsigned char *table, std::string name)
 		palette[it].F = 0;
 	}
 
-	p = reinterpret_cast<unsigned char *>(de.blocks);
+	// The SDefEntryBlock starts just after the SDefEntry
+	p = reinterpret_cast<unsigned char *>(&de);
+	p += sizeof(de);
+
 	totalEntries=0;
 	for (unsigned int z=0; z<totalBlocks; z++)
 	{

+ 3 - 1
hch/CDefHandler.h

@@ -47,7 +47,9 @@ struct SDefEntry {
 		unsigned char B;
 	} palette[256];
 
-	struct SDefEntryBlock blocks[];
+	// SDefEntry is followed by a series of SDefEntryBlock
+	// This is commented out because VC++ doesn't accept C99 syntax.
+	//struct SDefEntryBlock blocks[];
 };
 
 // Def entry in file. Integer fields are all little endian and will