diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-03-30 08:58:45 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-03-30 08:58:45 +0400 |
commit | 91881dce85424860bb97d7e6ccbffc492ac98bd3 (patch) | |
tree | 66cf7f2b168ba362a7b35b675614f9c3f8e0e8f3 /source | |
parent | 70162a4abd61df29f8ee451d94eeee6315d6155f (diff) |
- include for BGE joystick sensor
- remove print from numinput and get rid of some float/double warnings.
- nicer align line-number in text editor.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_text/text_draw.c | 2 | ||||
-rw-r--r-- | source/blender/editors/util/numinput.c | 6 | ||||
-rw-r--r-- | source/gameengine/GameLogic/SCA_JoystickSensor.cpp | 1 |
3 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c index 6ba047d741a..2601d1ffdf3 100644 --- a/source/blender/editors/space_text/text_draw.c +++ b/source/blender/editors/space_text/text_draw.c @@ -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); diff --git a/source/blender/editors/util/numinput.c b/source/blender/editors/util/numinput.c index a5954cdc215..1b58a1e2a58 100644 --- a/source/blender/editors/util/numinput.c +++ b/source/blender/editors/util/numinput.c @@ -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; diff --git a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp index b32114722d4..6aee6bd19e7 100644 --- a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp +++ b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp @@ -38,6 +38,7 @@ #include "PyObjectPlus.h" #include <stdio.h> +#include <stddef.h> #include <iostream> |