Browse Source

small upgrade

mateuszb 18 years ago
parent
commit
1896733ea6
3 changed files with 9 additions and 2 deletions
  1. 5 0
      CAmbarCendamo.cpp
  2. 1 0
      CAmbarCendamo.h
  3. 3 2
      SDL_Extensions.cpp

+ 5 - 0
CAmbarCendamo.cpp

@@ -1922,3 +1922,8 @@ CCreatureSet CAmbarCendamo::readCreatureSet(int pos, int number)
 	}
 	return ret;
 }
+
+void CAmbarCendamo::processMap()
+{
+	//for(int j=0;)
+}

+ 1 - 0
CAmbarCendamo.h

@@ -29,6 +29,7 @@ public:
 	int readNormalNr (int pos, int bytCon=4, bool cyclic = false); //read number from bytCon bytes starting from pos position in buffer ; if cyclic is true, number is treated as it were signed number with bytCon bytes
 	void teceDef (); // create files with info about defs
 	void deh3m(); // decode file, results are stored in map
+	void processMap(); //choose castles, creatures, resources, artifacts...
 	void loadDefs();
 	EDefType getDefType(DefInfo& a); //returns type of object in def
 	CCreatureSet readCreatureSet(int pos, int number = 7); //reads creature set in most recently encountered format; reades number units (default is 7)

+ 3 - 2
SDL_Extensions.cpp

@@ -348,7 +348,8 @@ SDL_Surface * CSDL_Ext::alphaTransform(SDL_Surface *src)
 		for(int yy=0; yy<src->format->palette->ncolors; ++yy)
 		{
 			SDL_Color cur = *(src->format->palette->colors+yy);
-			if(cur.r == 255 && cur.b == 255)
+			//if(cur.r == 255 && cur.b == 255)
+			if(yy==1 || yy==2 || yy==3 || yy==4 || yy==8)
 			{
 				SDL_Color shadow;
 				shadow.b = shadow.g = shadow.r = 0;
@@ -375,7 +376,7 @@ SDL_Surface * CSDL_Ext::alphaTransform(SDL_Surface *src)
 				}
 				SDL_SetColors(src, &shadow, yy, 1);
 			}
-			if((cur.g == 255 && cur.b == 255) || (cur.r == 255 && cur.g == 0 && cur.b == 0))
+			if(yy==0 || (cur.r == 255 && cur.g == 0 && cur.b == 0))
 			{
 				SDL_Color transp;
 				transp.b = transp.g = transp.r = 0;