[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [35890] trunk/blender/source: - include for BGE joystick sensor

Campbell Barton ideasman42 at gmail.com
Wed Mar 30 06:58:46 CEST 2011


Revision: 35890
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=35890
Author:   campbellbarton
Date:     2011-03-30 04:58:45 +0000 (Wed, 30 Mar 2011)
Log Message:
-----------
- include for BGE joystick sensor
- remove print from numinput and get rid of some float/double warnings.
- nicer align line-number in text  editor.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_text/text_draw.c
    trunk/blender/source/blender/editors/util/numinput.c
    trunk/blender/source/gameengine/GameLogic/SCA_JoystickSensor.cpp

Modified: trunk/blender/source/blender/editors/space_text/text_draw.c
===================================================================
--- trunk/blender/source/blender/editors/space_text/text_draw.c	2011-03-30 02:59:32 UTC (rev 35889)
+++ trunk/blender/source/blender/editors/space_text/text_draw.c	2011-03-30 04:58:45 UTC (rev 35890)
@@ -1763,7 +1763,7 @@
 			else
 				UI_ThemeColor(TH_TEXT);
 
-			sprintf(linenr, "%d", i + linecount + 1);
+			sprintf(linenr, "%*d", st->linenrs_tot, i + linecount + 1);
 			/* itoa(i + linecount + 1, linenr, 10); */ /* not ansi-c :/ */
 			text_font_draw(st, TXT_OFFSET - 7, y, linenr);
 

Modified: trunk/blender/source/blender/editors/util/numinput.c
===================================================================
--- trunk/blender/source/blender/editors/util/numinput.c	2011-03-30 02:59:32 UTC (rev 35889)
+++ trunk/blender/source/blender/editors/util/numinput.c	2011-03-30 04:58:45 UTC (rev 35890)
@@ -85,7 +85,7 @@
 		else
 			inv[0] = 0;
 
-		if( n->val[i] > 1e10 || n->val[i] < -1e10 )
+		if( n->val[i] > 1e10f || n->val[i] < -1e10f )
 			sprintf(&str[j*20], "%s%.4e%c", inv, n->val[i], cur);
 		else
 			switch (n->ctrl[i]) {
@@ -281,7 +281,7 @@
 			if (!n->ctrl[idx])
 				n->ctrl[idx] = 1;
 
-			if (fabs(n->val[idx]) > 9999999.0f);
+			if (fabsf(n->val[idx]) > 9999999.0f);
 			else if (n->ctrl[idx] == 1) {
 				n->val[idx] *= 10;
 				n->val[idx] += Val;
@@ -303,7 +303,7 @@
 		}
 	}
 	
-	printf("%f\n", n->val[idx]);
+	// printf("%f\n", n->val[idx]);
 
 	/* REDRAW SINCE NUMBERS HAVE CHANGED */
 	return 1;

Modified: trunk/blender/source/gameengine/GameLogic/SCA_JoystickSensor.cpp
===================================================================
--- trunk/blender/source/gameengine/GameLogic/SCA_JoystickSensor.cpp	2011-03-30 02:59:32 UTC (rev 35889)
+++ trunk/blender/source/gameengine/GameLogic/SCA_JoystickSensor.cpp	2011-03-30 04:58:45 UTC (rev 35890)
@@ -38,6 +38,7 @@
 #include "PyObjectPlus.h"
 
 #include <stdio.h>
+#include <stddef.h>
 #include <iostream>
 
 




More information about the Bf-blender-cvs mailing list