[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [12348] branches/cloth/blender: svn merge -r 12294:12347 https://svn.blender.org/svnroot/bf-blender/trunk/ blender

Daniel Genrich daniel.genrich at gmx.net
Tue Oct 23 01:05:10 CEST 2007


Revision: 12348
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=12348
Author:   genscher
Date:     2007-10-23 01:05:09 +0200 (Tue, 23 Oct 2007)

Log Message:
-----------
svn merge -r 12294:12347 https://svn.blender.org/svnroot/bf-blender/trunk/blender

Modified Paths:
--------------
    branches/cloth/blender/intern/bmfont/BMF_Api.h
    branches/cloth/blender/intern/bmfont/intern/BMF_Api.cpp
    branches/cloth/blender/intern/bmfont/intern/BMF_BitmapFont.cpp
    branches/cloth/blender/intern/bmfont/intern/BMF_BitmapFont.h
    branches/cloth/blender/projectfiles_vc7/blender/blenkernel/BKE_blenkernel.vcproj
    branches/cloth/blender/release/scripts/console.py
    branches/cloth/blender/release/scripts/export_obj.py
    branches/cloth/blender/release/scripts/scripttemplate_pyconstraint.py
    branches/cloth/blender/source/blender/avi/intern/options.c
    branches/cloth/blender/source/blender/blenkernel/BKE_action.h
    branches/cloth/blender/source/blender/blenkernel/BKE_armature.h
    branches/cloth/blender/source/blender/blenkernel/BKE_bad_level_calls.h
    branches/cloth/blender/source/blender/blenkernel/BKE_blender.h
    branches/cloth/blender/source/blender/blenkernel/BKE_constraint.h
    branches/cloth/blender/source/blender/blenkernel/BKE_image.h
    branches/cloth/blender/source/blender/blenkernel/BKE_object.h
    branches/cloth/blender/source/blender/blenkernel/CMakeLists.txt
    branches/cloth/blender/source/blender/blenkernel/SConscript
    branches/cloth/blender/source/blender/blenkernel/bad_level_call_stubs/stubs.c
    branches/cloth/blender/source/blender/blenkernel/intern/Makefile
    branches/cloth/blender/source/blender/blenkernel/intern/action.c
    branches/cloth/blender/source/blender/blenkernel/intern/armature.c
    branches/cloth/blender/source/blender/blenkernel/intern/constraint.c
    branches/cloth/blender/source/blender/blenkernel/intern/depsgraph.c
    branches/cloth/blender/source/blender/blenkernel/intern/image.c
    branches/cloth/blender/source/blender/blenkernel/intern/object.c
    branches/cloth/blender/source/blender/blenkernel/intern/scene.c
    branches/cloth/blender/source/blender/blenkernel/intern/writeavi.c
    branches/cloth/blender/source/blender/blenkernel/intern/writeffmpeg.c
    branches/cloth/blender/source/blender/blenlib/intern/storage.c
    branches/cloth/blender/source/blender/blenloader/intern/readfile.c
    branches/cloth/blender/source/blender/blenloader/intern/writefile.c
    branches/cloth/blender/source/blender/blenpluginapi/iff.h
    branches/cloth/blender/source/blender/imbuf/IMB_imbuf.h
    branches/cloth/blender/source/blender/imbuf/intern/IMB_imginfo.h
    branches/cloth/blender/source/blender/imbuf/intern/imginfo.c
    branches/cloth/blender/source/blender/imbuf/intern/png.c
    branches/cloth/blender/source/blender/imbuf/intern/rectop.c
    branches/cloth/blender/source/blender/imbuf/intern/thumbs.c
    branches/cloth/blender/source/blender/include/BIF_editconstraint.h
    branches/cloth/blender/source/blender/include/BIF_editsound.h
    branches/cloth/blender/source/blender/include/BSE_time.h
    branches/cloth/blender/source/blender/include/blendef.h
    branches/cloth/blender/source/blender/include/butspace.h
    branches/cloth/blender/source/blender/makesdna/DNA_action_types.h
    branches/cloth/blender/source/blender/makesdna/DNA_constraint_types.h
    branches/cloth/blender/source/blender/makesdna/DNA_scene_types.h
    branches/cloth/blender/source/blender/makesdna/DNA_sequence_types.h
    branches/cloth/blender/source/blender/makesdna/DNA_userdef_types.h
    branches/cloth/blender/source/blender/makesdna/intern/makesdna.c
    branches/cloth/blender/source/blender/python/BPY_extern.h
    branches/cloth/blender/source/blender/python/BPY_interface.c
    branches/cloth/blender/source/blender/python/api2_2x/Constraint.c
    branches/cloth/blender/source/blender/python/api2_2x/Pose.c
    branches/cloth/blender/source/blender/python/api2_2x/doc/Pose.py
    branches/cloth/blender/source/blender/python/api2_2x/euler.c
    branches/cloth/blender/source/blender/python/api2_2x/quat.c
    branches/cloth/blender/source/blender/python/api2_2x/sceneRender.c
    branches/cloth/blender/source/blender/python/api2_2x/sceneSequence.c
    branches/cloth/blender/source/blender/python/api2_2x/vector.c
    branches/cloth/blender/source/blender/quicktime/apple/quicktime_export.c
    branches/cloth/blender/source/blender/src/buttons_object.c
    branches/cloth/blender/source/blender/src/buttons_scene.c
    branches/cloth/blender/source/blender/src/buttons_shading.c
    branches/cloth/blender/source/blender/src/drawipo.c
    branches/cloth/blender/source/blender/src/drawmesh.c
    branches/cloth/blender/source/blender/src/drawobject.c
    branches/cloth/blender/source/blender/src/drawseq.c
    branches/cloth/blender/source/blender/src/drawsound.c
    branches/cloth/blender/source/blender/src/drawtime.c
    branches/cloth/blender/source/blender/src/drawview.c
    branches/cloth/blender/source/blender/src/editarmature.c
    branches/cloth/blender/source/blender/src/editconstraint.c
    branches/cloth/blender/source/blender/src/editipo.c
    branches/cloth/blender/source/blender/src/editipo_mods.c
    branches/cloth/blender/source/blender/src/editmesh_tools.c
    branches/cloth/blender/source/blender/src/editnla.c
    branches/cloth/blender/source/blender/src/editobject.c
    branches/cloth/blender/source/blender/src/editscreen.c
    branches/cloth/blender/source/blender/src/editseq.c
    branches/cloth/blender/source/blender/src/editsima.c
    branches/cloth/blender/source/blender/src/edittime.c
    branches/cloth/blender/source/blender/src/filesel.c
    branches/cloth/blender/source/blender/src/hddaudio.c
    branches/cloth/blender/source/blender/src/header_action.c
    branches/cloth/blender/source/blender/src/header_filesel.c
    branches/cloth/blender/source/blender/src/header_nla.c
    branches/cloth/blender/source/blender/src/header_text.c
    branches/cloth/blender/source/blender/src/header_time.c
    branches/cloth/blender/source/blender/src/header_view3d.c
    branches/cloth/blender/source/blender/src/outliner.c
    branches/cloth/blender/source/blender/src/poseobject.c
    branches/cloth/blender/source/blender/src/seqaudio.c
    branches/cloth/blender/source/blender/src/seqeffects.c
    branches/cloth/blender/source/blender/src/space.c
    branches/cloth/blender/source/blender/src/toolbox.c
    branches/cloth/blender/source/blender/src/transform.c
    branches/cloth/blender/source/blender/src/transform_constraints.c
    branches/cloth/blender/source/blender/src/usiblender.c
    branches/cloth/blender/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
    branches/cloth/blender/source/gameengine/Converter/BL_BlenderDataConversion.cpp
    branches/cloth/blender/source/nan_definitions.mk

Modified: branches/cloth/blender/intern/bmfont/BMF_Api.h
===================================================================
--- branches/cloth/blender/intern/bmfont/BMF_Api.h	2007-10-22 22:50:32 UTC (rev 12347)
+++ branches/cloth/blender/intern/bmfont/BMF_Api.h	2007-10-22 23:05:09 UTC (rev 12348)
@@ -110,6 +110,11 @@
 void BMF_GetFontBoundingBox(BMF_Font* font, int *xmin_r, int *ymin_r, int *xmax_r, int *ymax_r);
 
 /**
+ * Same as GetFontBoundingBox but only returns the height
+ */
+int BMF_GetFontHeight(BMF_Font* font);
+
+/**
  * Convert the given @a font to a texture, and return the GL texture
  * ID of the texture. If the texture ID is bound, text can
  * be drawn using the texture by calling DrawStringTexture.
@@ -134,6 +139,23 @@
  */
 void BMF_DrawStringTexture(BMF_Font* font, char* string, float x, float y, float z);
 
+	/**
+ * Draw the given @a string at the point @a xpos, @a ypos using
+ * char and float buffers.
+ * 
+ * @param string The c-string to draw.
+ * @param xpos The x coordinate to start drawing at.
+ * @param ypos The y coordinate to start drawing at.
+ * @param fgcol The forground color.
+ * @param bgcol The background color.
+ * @param buf Unsigned char image buffer, when NULL to not operate on it.
+ * @param fbuf float image buffer, when NULL to not operate on it.
+ * @param w image buffer width.
+ * @param h image buffer height.
+	 */
+void BMF_DrawStringBuf(BMF_Font* font, char *str, int posx, int posy, float *col, unsigned char *buf, float *fbuf, int w, int h);
+
+
 #ifdef __cplusplus
 }
 #endif

Modified: branches/cloth/blender/intern/bmfont/intern/BMF_Api.cpp
===================================================================
--- branches/cloth/blender/intern/bmfont/intern/BMF_Api.cpp	2007-10-22 22:50:32 UTC (rev 12347)
+++ branches/cloth/blender/intern/bmfont/intern/BMF_Api.cpp	2007-10-22 23:05:09 UTC (rev 12348)
@@ -164,6 +164,12 @@
 	((BMF_BitmapFont*)font)->GetFontBoundingBox(*xmin_r, *ymin_r, *xmax_r, *ymax_r);
 }
 
+int BMF_GetFontHeight(BMF_Font* font)
+{
+	if (!font) return -1;
+	return ((BMF_BitmapFont*)font)->GetFontHeight();
+}
+
 int BMF_GetFontTexture(BMF_Font* font) {
 	if (!font) return -1;
 	return ((BMF_BitmapFont*)font)->GetTexture();
@@ -173,3 +179,8 @@
 	if (!font) return;
 	((BMF_BitmapFont*)font)->DrawStringTexture(string, x, y, z);
 }
+
+void BMF_DrawStringBuf(BMF_Font* font, char *str, int posx, int posy, float *col, unsigned char *buf, float *fbuf, int w, int h) {
+	if (!font) return;
+	((BMF_BitmapFont*)font)->DrawStringBuf(str, posx, posy, col, buf, fbuf, w, h);
+}

Modified: branches/cloth/blender/intern/bmfont/intern/BMF_BitmapFont.cpp
===================================================================
--- branches/cloth/blender/intern/bmfont/intern/BMF_BitmapFont.cpp	2007-10-22 22:50:32 UTC (rev 12347)
+++ branches/cloth/blender/intern/bmfont/intern/BMF_BitmapFont.cpp	2007-10-22 23:05:09 UTC (rev 12348)
@@ -35,6 +35,11 @@
  * Copyright (C) 2001 NaN Technologies B.V.
  */
 
+
+#include <stdio.h>
+
+
+
 #include <string.h>
 
 #ifdef HAVE_CONFIG_H
@@ -115,6 +120,11 @@
 	yMax = m_fontData->ymax;
 }
 
+int BMF_BitmapFont::GetFontHeight( void )
+{
+	return m_fontData->ymax - m_fontData->ymin;
+}
+
 void BMF_BitmapFont::GetStringBoundingBox(char* str, float*llx, float *lly, float *urx, float *ury)
 {
 	unsigned char c;
@@ -229,3 +239,83 @@
 	}
 	glEnd();
 }
+
+#define FTOCHAR(val) val<=0.0f?0: (val>=1.0f?255: (char)(255.0f*val))
+
+
+void BMF_BitmapFont::DrawStringBuf(char *str, int posx, int posy, float *col, unsigned char *buf, float *fbuf, int w, int h)
+{
+	int x, y;
+	
+	if (buf==0 && fbuf==0)
+		return;
+
+	/*offset for font*/
+	posx -= m_fontData->xmin;
+	posy -= m_fontData->ymin;
+	
+	if (buf) {
+		unsigned char colch[3];
+		unsigned char *max, *pixel;
+		unsigned char c;
+		
+		for (x=0; x<3; x++) {
+			colch[x] = FTOCHAR(col[x]);
+		}
+		
+		max = buf + (4 * (w * h));
+		while ((c = (unsigned char) *str++)) {
+			BMF_CharData & cd = m_fontData->chars[c];
+			if (cd.data_offset != -1) { 
+				for (y = 0; y < cd.height; y++) {
+					unsigned char* chrRow = &m_fontData->bitmap_data[cd.data_offset + ((cd.width+7)/8)*y];
+					for (x = cd.xorig; x < cd.width; x++) {
+						pixel = buf + 4 * (((posy + y) * w) + (posx + x));
+						if ((pixel < max) && (pixel > buf)) {
+							int byteIdx = x/8;
+							int bitIdx = 7 - (x%8);
+							
+							if (chrRow[byteIdx]&(1<<bitIdx)) {
+								pixel[0] = colch[0];
+								pixel[1] = colch[1];
+								pixel[2] = colch[2];
+							}
+						}
+					}
+				}
+			}
+			posx += cd.advance;
+		}
+	}
+	
+	if (fbuf) {
+		float *pixel, *max;
+		unsigned char c;
+		int x, y;
+		
+		max = fbuf + (4 * (w * h));
+		
+		while ((c = (unsigned char) *str++)) {
+			BMF_CharData & cd = m_fontData->chars[c];
+			if (cd.data_offset != -1) { 
+				for (y = 0; y < cd.height; y++) {
+					unsigned char* chrRow = &m_fontData->bitmap_data[cd.data_offset + ((cd.width+7)/8)*y];
+					for (x = cd.xorig; x < cd.width; x++) {
+						pixel = fbuf + 4 * (((posy + y - cd.yorig) * w) + (posx + x));
+						if ((pixel < max) && (pixel > fbuf)) {
+							int byteIdx = x/8;
+							int bitIdx = 7 - (x%8);
+							
+							if (chrRow[byteIdx]&(1<<bitIdx)) {
+								pixel[0] = col[0];
+								pixel[1] = col[1];
+								pixel[2] = col[2];
+							}
+						}
+					}
+				}
+			}
+			posx += cd.advance;
+		}
+	}
+}

Modified: branches/cloth/blender/intern/bmfont/intern/BMF_BitmapFont.h
===================================================================
--- branches/cloth/blender/intern/bmfont/intern/BMF_BitmapFont.h	2007-10-22 22:50:32 UTC (rev 12347)
+++ branches/cloth/blender/intern/bmfont/intern/BMF_BitmapFont.h	2007-10-22 23:05:09 UTC (rev 12348)
@@ -79,6 +79,11 @@
 	void GetFontBoundingBox(int & xMin, int & yMin, int & xMax, int & yMax);
 	
 	/**
+	 * Return the bounding box height of the font.
+	 */
+	int GetFontHeight(void);
+	
+	/**
 	 * Returns the bounding box of a string of characters.
 	 * @param font	The font to use.
 	 * @param str	The string.
@@ -113,6 +118,21 @@
 	 */
 	void DrawStringTexture(char* string, float x, float y, float z);
 	
+	/**
+	 * Draw the given @a string at the point @a xpos, @a ypos using
+	 * char and float buffers.
+	 * 
+	 * @param string The c-string to draw.
+	 * @param xpos The x coordinate to start drawing at.
+	 * @param ypos The y coordinate to start drawing at.
+	 * @param col The forground color.
+	 * @param buf Unsigned char image buffer, when NULL to not operate on it.
+	 * @param fbuf float image buffer, when NULL to not operate on it.
+	 * @param w image buffer width.
+	 * @param h image buffer height.
+	 */
+	void DrawStringBuf(char *str, int posx, int posy, float *col, unsigned char *buf, float *fbuf, int w, int h);
+	
 protected:
 	/** Pointer to the font data. */
 	 BMF_FontData* m_fontData;

Modified: branches/cloth/blender/projectfiles_vc7/blender/blenkernel/BKE_blenkernel.vcproj
===================================================================
--- branches/cloth/blender/projectfiles_vc7/blender/blenkernel/BKE_blenkernel.vcproj	2007-10-22 22:50:32 UTC (rev 12347)
+++ branches/cloth/blender/projectfiles_vc7/blender/blenkernel/BKE_blenkernel.vcproj	2007-10-22 23:05:09 UTC (rev 12348)
@@ -73,7 +73,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..\..\lib\windows\zlib\include;..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\decimation\include;..\..\..\..\build\msvc_7\intern\elbeem\include;..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_7\extern\verse\include"
+				AdditionalIncludeDirectories="..\..\..\..\lib\windows\zlib\include;..\..\..\..\build\msvc_7\intern\bmfont\include;..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\decimation\include;..\..\..\..\build\msvc_7\intern\elbeem\include;..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_7\extern\verse\include"
 				PreprocessorDefinitions="_DEBUG;WIN32;_LIB;WITH_FREETYPE2;WITH_VERSE;WITH_OPENEXR"
 				BasicRuntimeChecks="3"
 				RuntimeLibrary="1"
@@ -125,7 +125,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\..\..\lib\windows\zlib\include;..\..\..\..\build\msvc_7\intern\bsp\include;..\..\..\..\build\msvc_7\intern\guardedalloc\include;..\..\..\..\build\msvc_7\intern\decimation\include;..\..\..\..\build\msvc_7\intern\elbeem\include;..\..\..\..\build\msvc_7\intern\iksolver\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_7\extern\verse\include"

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list