Lua inputbox: Allow negative values and floating point input. Unfinished, has problems of display (mouse cursor cleaning, display cleaning and alignment, removing redundant digits like in 15.000)

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1354 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Yves Rizoud
2010-02-19 02:09:50 +00:00
parent f05906f99b
commit 14464fef39
8 changed files with 156 additions and 41 deletions

9
misc.c
View File

@@ -24,6 +24,7 @@
#include <string.h>
#include <strings.h>
#include <stdlib.h>
#include <math.h>
#include "struct.h"
#include "sdlscreen.h"
#include "global.h"
@@ -811,6 +812,14 @@ int Max(int a,int b)
return (a>b)?a:b;
}
/* Round number n to d decimal points */
double Fround(double n, unsigned d)
{
double exp;
exp = pow(10.0, d);
return floor(n * exp + 0.5) / exp;
}
// Fonction retournant le libellé d'une mode (ex: " 320x200")
char * Mode_label(int mode)