Browse Source

minor improves

Denis Muratshin 11 years ago
parent
commit
a04a60e288

+ 2 - 2
.hg_archival.txt

@@ -1,5 +1,5 @@
 repo: b6d71054df5712e643a0685bc3ba54b123db5729
-node: c70117fc450dc4d9fa187e0bc46d386bbcb6b542
+node: a0a8325e4887450b4a891f567d9b663b5665ea68
 branch: default
 latesttag: oldrender
-latesttagdistance: 213
+latesttagdistance: 217

BIN
doc.zip


+ 1 - 0
oxygine/src/AnimationFrame.h

@@ -43,6 +43,7 @@ namespace oxygine
 		const Diffuse&	getDiffuse() const {return _diffuse;}
 
 		void			setSrcRect(const RectF &r){_srcRect = r;}
+		void			setDestRect(const RectF &r){_destRect = r;}
 		
 
 	private:

+ 2 - 0
oxygine/src/core/NativeTexture.h

@@ -29,6 +29,8 @@ namespace oxygine
 		virtual void swap(NativeTexture *) = 0;
 
 		virtual void setLinearFiltration(bool enable) = 0;
+		/**set wrap mode as clamp2edge or repeat (tiling)*/
+		virtual void setWrapMode(bool clamp2edge) = 0;
 		virtual void updateRegion(int x, int y, const ImageData &data) = 0;
 		virtual void apply(const Rect *rect = 0) = 0;
 

+ 5 - 2
oxygine/src/core/STDFileSystem.cpp

@@ -103,7 +103,7 @@ namespace oxygine
 		int _openedFiles = 0;
 		oxHandle* oxFileOpen(const char* filename, const char* mode)
 		{
-			//log::messageln("oxFileOpen %s", filename);
+			LOGD("oxFileOpen %s", filename);
 			oxHandle *h = oxFileOpen_(filename, mode);
 			if (h)
 				_openedFiles++;
@@ -198,7 +198,10 @@ namespace oxygine
 			char norm[512];
 			path::normalize(_path.c_str(), norm);			
 			_path = norm;
-			_path += "/";
+			if (!_path.empty() && _path[_path.size() - 1] != '/')
+			{
+				_path += "/";
+			}			
 		}
 
 

+ 14 - 2
oxygine/src/core/gl/NativeTextureGLES.cpp

@@ -86,8 +86,8 @@ namespace oxygine
 		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, f);
 		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, f);
 
-		glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );
-		glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );
+		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
 
 		NativeTextureGLES::created++;
         
@@ -197,6 +197,18 @@ namespace oxygine
         CHECKGL();
 	}
 
+	void NativeTextureGLES::setWrapMode(bool clamp2edge)
+	{
+		glBindTexture(GL_TEXTURE_2D, _id);
+
+		unsigned int f = clamp2edge ? GL_CLAMP_TO_EDGE : GL_REPEAT;
+
+		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, f);
+		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, f);
+
+		CHECKGL();
+	}
+
 	void NativeTextureGLES::release()
 	{
 		if (_id)

+ 1 - 0
oxygine/src/core/gl/NativeTextureGLES.h

@@ -25,6 +25,7 @@ namespace oxygine
 		void unlock();
 
 		void setLinearFiltration(bool enable);
+		void setWrapMode(bool clamp2edge);
 
 		void updateRegion(int x, int y, const ImageData &data);
 		void apply(const Rect *rect = 0);

+ 4 - 1
oxygine/src/res/Resources.cpp

@@ -146,6 +146,8 @@ namespace oxygine
 				path = xml_name.substr(0, i + 1);
 			}
 		}
+
+		path = "";
 		
 		FS_LOG("step0");
 		file::buffer fb;
@@ -224,7 +226,8 @@ namespace oxygine
 					if (!strcmp(attr.name(), "path"))
 					{
 						path = getPath(path.c_str(), attr.value());
-						path += "/";
+						if (!path.empty())
+							path += "/";
 					}
 					if (!strcmp(attr.name(), "load"))
 					{