- include for BGE joystick sensor
authorCampbell Barton <ideasman42@gmail.com>
Wed, 30 Mar 2011 04:58:45 +0000 (04:58 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 30 Mar 2011 04:58:45 +0000 (04:58 +0000)
- remove print from numinput and get rid of some float/double warnings.
- nicer align line-number in text  editor.

source/blender/editors/space_text/text_draw.c
source/blender/editors/util/numinput.c
source/gameengine/GameLogic/SCA_JoystickSensor.cpp

index 6ba047d..2601d1f 100644 (file)
@@ -1763,7 +1763,7 @@ void draw_text_main(SpaceText *st, ARegion *ar)
                        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);
 
index a5954cd..1b58a1e 100644 (file)
@@ -85,7 +85,7 @@ void outputNumInput(NumInput *n, char *str)
                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 @@ char handleNumInput(NumInput *n, wmEvent *event)
                        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 @@ char handleNumInput(NumInput *n, wmEvent *event)
                }
        }
        
-       printf("%f\n", n->val[idx]);
+       // printf("%f\n", n->val[idx]);
 
        /* REDRAW SINCE NUMBERS HAVE CHANGED */
        return 1;
index b321147..6aee6bd 100644 (file)
@@ -38,6 +38,7 @@
 #include "PyObjectPlus.h"
 
 #include <stdio.h>
+#include <stddef.h>
 #include <iostream>