r1884 - in trunk/user/pixil
dslinux_amadeus at dslinux.in-berlin.de
dslinux_amadeus at dslinux.in-berlin.de
Fri Sep 14 01:19:21 CEST 2007
Author: amadeus
Date: 2007-09-14 01:19:15 +0200 (Fri, 14 Sep 2007)
New Revision: 1884
Log:
PIXIL compilea in DSLINUX
Modified: trunk/user/pixil/Makefile
===================================================================
--- trunk/user/pixil/Makefile 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/Makefile 2007-09-13 23:19:15 UTC (rev 1884)
@@ -21,12 +21,12 @@
EN_STATIC = --enable-static
ifdef CONFIG_PLATFORM_DSLINUX
-MW_PREFIX = $(BASE_DIR)/../microwin/src
-INSTALL_PREFIX = $(BASE_DIR)/../../romfs/usr/pixil/
+# here is the MicroWindows source code
+MW_PREFIX := $(BASE_DIR)/../microwin/src
+# here is the installation root directory
+INSTALL_PREFIX := $(BASE_DIR)/../../romfs/usr/pixil/
+# we don't have static linkage here
EN_SHARED = --disable-shared
-#CFLAGS += -D_GNU_SOURCE
-CFLAGS += -fno-exceptions
-LDFLAGS += -lstdc++ -lc -lgcc -elf2flt
endif
# The base directory for installing
@@ -140,19 +140,19 @@
.PHONY: platform-build platform-clean platform-install packages-clean
platform-build:
- @ make -C scripts/platforms/
+ @ $(MAKE) -C scripts/platforms/
platform-clean:
- @ make -C scripts/platforms/ clean
+ @ $(MAKE) -C scripts/platforms/ clean
platform-install:
- @ make -C scripts/platforms/ install
+ @ $(MAKE) -C scripts/platforms/ install
packages:
- @ make -C packages
+ @ $(MAKE) -C packages
packages-clean:
- @ make -C packages packages-clean
+ @ $(MAKE) -C packages packages-clean
$(STAGE_DIR):
@ mkdir -p $(STAGE_DIR)/lib
@@ -171,10 +171,10 @@
# ------------------------------
$(MCONFIG_DIR)/conf:
- make -C $(MCONFIG_DIR) conf
+ $(MAKE) -C $(MCONFIG_DIR) conf
$(MCONFIG_DIR)/mconf:
- make -C $(MCONFIG_DIR) conf mconf
+ $(MAKE) -C $(MCONFIG_DIR) conf mconf
menuconfig: $(BASE_DIR)/config $(MCONFIG_DIR)/mconf
@$(MCONFIG_DIR)/mconf $(SYSDEP_DIR)/Config.in
Modified: trunk/user/pixil/Rules.make
===================================================================
--- trunk/user/pixil/Rules.make 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/Rules.make 2007-09-13 23:19:15 UTC (rev 1884)
@@ -6,12 +6,15 @@
# Released under the GPL (see LICENSE) for details
####
+# stack size for uClinux
+ifeq ($(STACK_SIZE),)
+STACK_SIZE = 16384
+endif
# Compiler information
# Get rid of the annoying quotes on the cross compiler
-
ifeq ($(BUILD_NATIVE),y)
CC=gcc
CXX=g++
@@ -24,20 +27,16 @@
CONFIG_X11=y
else
-ifeq ($(USE_CCACHE),1)
-CC=ccache $(TARGET_CROSS)gcc
-CXX=ccache $(TARGET_CROSS)g++
-else
-CC=$(TARGET_CROSS)gcc
-CXX=$(TARGET_CROSS)g++
-endif
AR=$(TARGET_CROSS)ar
RANLIB=$(TARGET_CROSS)ranlib
-LD=$(TARGET_CROSS)ld
endif
# Determine if we are using a uclibc compiler or not
+ifdef CONFIG_PLATFORM_DSLINUX
+UCLIBC=uclibc
+else
UCLIBC=$(findstring uclibc,$(CC))
+endif
# Default paths
@@ -85,8 +84,10 @@
INCLUDES += -I$(INCLUDE_DIR)
-CFLAGS += -Wall
+CXXFLAGS += -Wall
+CXXFLAGS += -DPIXIL
+
# If we are building with uclibc, then add in GNU_SOURCE
# This is hokey, but it works
@@ -103,13 +104,13 @@
# Compile with copious debug information
ifeq ($(CONFIG_DEBUG),y)
-CFLAGS += -O0 -g -DDEBUG
+CXXFLAGS += -O0 -g -DDEBUG
endif
INCLUDES += -I$(FLTKDIR) -I$(FLEKDIR)
ifeq ($(CONFIG_NANOX),y)
-CFLAGS += -DNANOX -DNANO_X
+CXXFLAGS += -DNANOX -DNANO_X
INCLUDES += -I$(MWDIR)/include
LIBDIRS += -L$(MWDIR)/lib
endif
@@ -176,10 +177,12 @@
fi
$(TARGET): $(OBJS)
- $(CC) $(BUILD_CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(sort $(LIBDIRS)) $(LIBS)
+ $(CC) $(BUILD_CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LIBDIRS) $(LDLIBS) $(LIBS)
+ $(TARGET_CROSS)flthdr -s $(STACK_SIZE) $@
$(TARGET_CXX): $(OBJS)
- $(CXX) $(BUILD_CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(sort $(LIBDIRS)) $(LIBS) -lstdc++ -lm
+ $(CXX) -o $@ $(CRTBEGIN) $(BUILD_CFLAGS) $(LDFLAGS) $(OBJS) $(LIBDIRS) $(LDLIBS) $(LIBS) $(CXXLIBS) -lm $(CRTEND)
+ $(TARGET_CROSS)flthdr -s $(STACK_SIZE) $@
$(TARGET_SO): $(OBJS)
$(CC) -shared -o $@ $(OBJS)
@@ -240,10 +243,10 @@
$(CC) -c $(CFLAGS) $(INCLUDES) -o $@ $<
%.o: %.cxx
- $(CXX) -c $(CFLAGS) $(INCLUDES) -o $@ $<
+ $(CXX) -c $(CXXFLAGS) $(INCLUDES) -o $@ $<
%.o: %.cpp
- $(CXX) -c $(CFLAGS) $(INCLUDES) -o $@ $<
+ $(CXX) -c $(CXXFLAGS) $(INCLUDES) -o $@ $<
## These handle multiple platform targets
Modified: trunk/user/pixil/apps/fltk/alarm/alarm_d.cxx
===================================================================
--- trunk/user/pixil/apps/fltk/alarm/alarm_d.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/apps/fltk/alarm/alarm_d.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -42,6 +42,7 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
+#include <limits.h>
#ifdef CONFIG_NANOX
#include <wm/scrtoplib.h>
Modified: trunk/user/pixil/apps/fltk/mp3/frontend/FL/Fl_Eq.H
===================================================================
--- trunk/user/pixil/apps/fltk/mp3/frontend/FL/Fl_Eq.H 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/apps/fltk/mp3/frontend/FL/Fl_Eq.H 2007-09-13 23:19:15 UTC (rev 1884)
@@ -81,9 +81,9 @@
FL_EXPORT void slider_ver_lines(int x, int y, int h, int w, int W, Fl_Color c);
FL_EXPORT int scrollvalue(int windowtop,int windowsize,int first,int totalsize);
- FL_EXPORT void bounds(double a, double b);
+ FL_EXPORT void bounds(float a, float b);
float slider_size() const {return slider_size_;}
- FL_EXPORT void slider_size(double v);
+ FL_EXPORT void slider_size(float v);
Fl_Boxtype slider() const {return (Fl_Boxtype)slider_;}
void slider(Fl_Boxtype c) {slider_ = c;}
Modified: trunk/user/pixil/apps/fltk/mp3/frontend/Fl_Eq.cxx
===================================================================
--- trunk/user/pixil/apps/fltk/mp3/frontend/Fl_Eq.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/apps/fltk/mp3/frontend/Fl_Eq.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -105,7 +105,7 @@
}
void
-Fl_Eq::slider_size(double v)
+Fl_Eq::slider_size(float v)
{
if (v < 0)
v = 0;
@@ -118,7 +118,7 @@
}
void
-Fl_Eq::bounds(double a, double b)
+Fl_Eq::bounds(float a, float b)
{
if (minimum() != a || maximum() != b) {
Fl_Valuator::bounds(a, b);
@@ -152,13 +152,13 @@
fl_color(FL_BLACK);
int stepVal = 4;
- double stepBoxSize = 3;
+ float stepBoxSize = 3;
if (type() != FL_HORIZONTAL) {
- double curStep = 0.0;
- double p1 = percent1 / 100.0;
- double p2 = percent2 / 100.0;
+ float curStep = 0.0;
+ float p1 = percent1 / 100.0;
+ float p2 = percent2 / 100.0;
int convW = W / stepVal;
@@ -183,7 +183,7 @@
if (w > 0 && h > 0) {
if (w < 17) {
w = 17;
- slider_size(double (w) / double (W));
+ slider_size(float (w) / float (W));
slider_size_min_ = slider_size();
}
draw_box(FL_BORDER_BOX, x, y, w, h, c);
@@ -206,7 +206,7 @@
fl_color(FL_BLACK);
int stepVal = 4;
- double stepBoxSize = 3;
+ float stepBoxSize = 3;
if (type() != FL_VERTICAL) {
@@ -215,7 +215,7 @@
255 * FL_NUM_GREEN / 256, 0 * FL_NUM_BLUE / 256);
int curStep = 0;
- double val = value();
+ float val = value();
int event_y = 0;
@@ -261,7 +261,7 @@
if (w > 0 && h > 0) {
if (h < 17) {
h = 17;
- slider_size(double (h) / double (W));
+ slider_size(float (h) / float (W));
slider_size_min_ = slider_size();
}
draw_box(FL_BORDER_BOX, x, y, w, h, c);
@@ -285,7 +285,7 @@
step(1, 1);
if (p + w > t + l)
l = p + w - t;
- slider_size(w >= l ? 1.0 : double (w) / double (l));
+ slider_size(w >= l ? 1.0 : float (w) / float (l));
#ifdef PDA
if (slider_size() < slider_size_min_) {
slider_size(slider_size_min_);
@@ -321,7 +321,7 @@
Fl_Eq::draw(int x, int y, int w, int h)
{
- double val;
+ float val;
if (minimum() == maximum())
val = 0.5;
@@ -465,7 +465,7 @@
if (type() == FL_HOR_FILL_SLIDER
|| type() == FL_VERT_FILL_SLIDER) {
- double val =
+ float val =
(value() - minimum()) / (maximum() - minimum());
if (val >= 1.0)
@@ -487,7 +487,7 @@
S = 0;
} else {
- double val =
+ float val =
(value() - minimum()) / (maximum() - minimum());
if (val >= 1.0)
@@ -508,7 +508,7 @@
}
}
X = mx - offcenter;
- double v;
+ float v;
TRY_AGAIN:
if (X < 0) {
X = 0;
Modified: trunk/user/pixil/apps/fltk/mp3/frontend/dsp_feedback.cc
===================================================================
--- trunk/user/pixil/apps/fltk/mp3/frontend/dsp_feedback.cc 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/apps/fltk/mp3/frontend/dsp_feedback.cc 2007-09-13 23:19:15 UTC (rev 1884)
@@ -195,7 +195,7 @@
buffer = (short int *) data;
/*
- double F, Pi;
+ float F, Pi;
int L, Hz, SR;
Hz = feedback->Hz;
@@ -215,7 +215,7 @@
//int dest[257];
int i;
//short int sample[512];
- //double scale = 100/log(256);
+ //float scale = 100/log(256);
for (i = 0; i < RAWDATASIZE; i += 512) {
Modified: trunk/user/pixil/apps/fltk/mp3/mpegsound/fixed_point.h
===================================================================
--- trunk/user/pixil/apps/fltk/mp3/mpegsound/fixed_point.h 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/apps/fltk/mp3/mpegsound/fixed_point.h 2007-09-13 23:19:15 UTC (rev 1884)
@@ -8,7 +8,7 @@
#define FL2FIX( x, fracs ) ((int)((x)*(1<<fracs)))
-#define FIX2FL( x, fracs ) ((double)(x)/(1<<fracs))
+#define FIX2FL( x, fracs ) ((float)(x)/(1<<fracs))
@@ -22,21 +22,21 @@
int x;
//REAL( void ) {};
//inline REAL( const int );
- //inline REAL( const double );
+ //inline REAL( const float );
inline REAL operator=(const REAL);
inline REAL operator=(const int);
- inline REAL operator=(const double);
+ inline REAL operator=(const float);
inline REAL operator+(const REAL) const;
- inline REAL operator+(const double) const;
+ inline REAL operator+(const float) const;
inline REAL operator-(const REAL) const;
- inline REAL operator-(const double) const;
+ inline REAL operator-(const float) const;
inline REAL operator-(void) const;
inline REAL operator+=(const REAL);
inline REAL operator-=(const REAL);
inline REAL operator*(const REAL) const;
- inline REAL operator*(const double) const;
+ inline REAL operator*(const float) const;
inline REAL operator*=(const REAL);
- inline REAL operator*=(const double);
+ inline REAL operator*=(const float);
inline int operator==(const int) const;
inline int operator!=(const int) const;
inline REAL operator*(const class REAL13) const;
@@ -47,7 +47,7 @@
// x = i << FIXED_POINT_FRACBITS;
//}
-//inline REAL::REAL( const double d )
+//inline REAL::REAL( const float d )
//{
// x = FL2FIX( d, FIXED_POINT_FRACBITS );
//}
@@ -67,7 +67,7 @@
}
inline REAL
-REAL::operator=(const double d)
+REAL::operator=(const float d)
{
x = FL2FIX(d, FIXED_POINT_FRACBITS);
return *this;
@@ -84,7 +84,7 @@
}
inline REAL
-REAL::operator+(const double d) const
+REAL::operator+(const float d) const
{
REAL s;
do {
@@ -104,7 +104,7 @@
}
inline REAL
-REAL::operator-(const double d) const
+REAL::operator-(const float d) const
{
REAL s;
do {
@@ -153,7 +153,7 @@
}
inline REAL
-REAL::operator*(const double d) const
+REAL::operator*(const float d) const
{
REAL s;
do {
@@ -171,7 +171,7 @@
}
inline REAL
-REAL::operator*=(const double d)
+REAL::operator*=(const float d)
{
return (*this = *this * d);
}
@@ -199,13 +199,13 @@
public:
int x;
//inline REAL13( void ) {};
- //inline REAL13( const double );
+ //inline REAL13( const float );
inline REAL13 operator=(const REAL13);
- inline REAL13 operator=(const double);
+ inline REAL13 operator=(const float);
inline REAL13 operator-(void) const;
};
-//inline REAL13::REAL13( const double d )
+//inline REAL13::REAL13( const float d )
//{
// x = FL2FIX( d, 13 );
//}
@@ -218,7 +218,7 @@
}
inline REAL13
-REAL13::operator=(const double d)
+REAL13::operator=(const float d)
{
x = FL2FIX(d, 13);
return *this;
@@ -256,19 +256,19 @@
public:
int x;
//inline REAL19( void ) {};
- //inline REAL19( const double );
- inline REAL19 operator=(const double);
+ //inline REAL19( const float );
+ inline REAL19 operator=(const float);
inline REAL operator*(const REAL) const;
inline REAL operator*(const REAL13) const;
};
-//inline REAL19::REAL19( const double d )
+//inline REAL19::REAL19( const float d )
//{
// x = FL2FIX( d, 19 );
//}
inline REAL19
-REAL19::operator=(const double d)
+REAL19::operator=(const float d)
{
x = FL2FIX(d, 19);
return *this;
Modified: trunk/user/pixil/apps/fltk/mp3/mpegsound/mpeglayer3mktables.cc
===================================================================
--- trunk/user/pixil/apps/fltk/mp3/mpegsound/mpeglayer3mktables.cc 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/apps/fltk/mp3/mpegsound/mpeglayer3mktables.cc 2007-09-13 23:19:15 UTC (rev 1884)
@@ -9,7 +9,7 @@
#include <math.h>
#include <stdio.h>
#define OUT_FNAME "mpeglayer3tables.h"
-typedef double REAL;
+typedef float REAL;
#define PI M_PI
#define PI_12 (PI/12.0)
@@ -53,55 +53,55 @@
{
for (i = 0; i < 18; i++)
win[0][i] = win[1][i] =
- 0.5 * sin(PI_72 * (double) (2 * i + 1)) / cos(PI_72 *
- (double) (2 *
+ 0.5 * sin(PI_72 * (float) (2 * i + 1)) / cos(PI_72 *
+ (float) (2 *
i +
19));
for (; i < 36; i++)
win[0][i] = win[3][i] =
- 0.5 * sin(PI_72 * (double) (2 * i + 1)) / cos(PI_72 *
- (double) (2 *
+ 0.5 * sin(PI_72 * (float) (2 * i + 1)) / cos(PI_72 *
+ (float) (2 *
i +
19));
for (i = 0; i < 6; i++) {
- win[1][i + 18] = 0.5 / cos(PI_72 * (double) (2 * (i + 18) + 19));
- win[3][i + 12] = 0.5 / cos(PI_72 * (double) (2 * (i + 12) + 19));
+ win[1][i + 18] = 0.5 / cos(PI_72 * (float) (2 * (i + 18) + 19));
+ win[3][i + 12] = 0.5 / cos(PI_72 * (float) (2 * (i + 12) + 19));
win[1][i + 24] =
- 0.5 * sin(PI_24 * (double) (2 * i + 13)) / cos(PI_72 *
- (double) (2 *
+ 0.5 * sin(PI_24 * (float) (2 * i + 13)) / cos(PI_72 *
+ (float) (2 *
(i +
24)
+
19));
win[1][i + 30] = win[3][i] = 0.0;
win[3][i + 6] =
- 0.5 * sin(PI_24 * (double) (2 * i + 1)) / cos(PI_72 *
- (double) (2 *
+ 0.5 * sin(PI_24 * (float) (2 * i + 1)) / cos(PI_72 *
+ (float) (2 *
(i +
6) +
19));
}
for (i = 0; i < 12; i++)
win[2][i] =
- 0.5 * sin(PI_24 * (double) (2 * i + 1)) / cos(PI_24 *
- (double) (2 *
+ 0.5 * sin(PI_24 * (float) (2 * i + 1)) / cos(PI_24 *
+ (float) (2 *
i +
7));
}
for (i = 0; i < 9; i++)
- cos_18[i] = cos(PI_18 * double (i));
+ cos_18[i] = cos(PI_18 * float (i));
for (i = 0; i < 9; i++)
- hsec_36[i] = 0.5 / cos(PI_36 * double (i * 2 + 1));
+ hsec_36[i] = 0.5 / cos(PI_36 * float (i * 2 + 1));
for (i = 0; i < 3; i++)
- hsec_12[i] = 0.5 / cos(PI_12 * double (i * 2 + 1));
+ hsec_12[i] = 0.5 / cos(PI_12 * float (i * 2 + 1));
for (i = 0; i < 40; i++)
- two_to_negative_half_pow[i] = (REAL) pow(2.0, -0.5 * (double) i);
+ two_to_negative_half_pow[i] = (REAL) pow(2.0, -0.5 * (float) i);
for (i = 0; i < FOURTHIRDSTABLENUMBER; i++)
- TO_FOUR_THIRDSTABLE[i] = (REAL) pow((double) i, 4.0 / 3.0);
+ TO_FOUR_THIRDSTABLE[i] = (REAL) pow((float) i, 4.0 / 3.0);
for (i = 0; i < 256; i++)
POW2[i] = (REAL) pow(2.0, (0.25 * (i - 210.0)));
for (i = 0; i < 8; i++)
@@ -123,8 +123,8 @@
}
}
-#define IO0 ((double)0.840896415256)
-#define IO1 ((double)0.707106781188)
+#define IO0 ((float)0.840896415256)
+#define IO1 ((float)0.707106781188)
rat_2[0][0].l = rat_2[0][0].r = rat_2[1][0].l = rat_2[1][0].r = 1.;
for (i = 1; i < 64; i++)
Modified: trunk/user/pixil/apps/fltk/mp3/mpegsound/mpegtable.cc
===================================================================
--- trunk/user/pixil/apps/fltk/mp3/mpegsound/mpegtable.cc 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/apps/fltk/mp3/mpegsound/mpegtable.cc 2007-09-13 23:19:15 UTC (rev 1884)
@@ -633,7 +633,7 @@
-/* hcos_64[i] = 1.0 / (2.0*cos(PI*double(i*2+1)/64.0)) */
+/* hcos_64[i] = 1.0 / (2.0*cos(PI*float(i*2+1)/64.0)) */
const REAL
Mpegtoraw::hcos_64[16] = {
X(0.500602998235196),
@@ -654,7 +654,7 @@
X(10.190008123548033)
};
-/* hcos_32[i] = 1.0 / (2.0*cos(PI*double(i*2+1)/32.0)) */
+/* hcos_32[i] = 1.0 / (2.0*cos(PI*float(i*2+1)/32.0)) */
const REAL
Mpegtoraw::hcos_32[8] = {
X(0.502419286188156),
@@ -667,7 +667,7 @@
X(5.101148618689155)
};
-/* hcos_16[i] = 1.0 / (2.0*cos(PI*double(i*2+1)/16.0)) */
+/* hcos_16[i] = 1.0 / (2.0*cos(PI*float(i*2+1)/16.0)) */
const REAL
Mpegtoraw::hcos_16[4] = {
X(0.509795579104159),
@@ -676,7 +676,7 @@
X(2.562915447741505)
};
-/* hcos_8 [i] = 1.0 / (2.0*cos(PI*double(i*2+1)/ 8.0)) */
+/* hcos_8 [i] = 1.0 / (2.0*cos(PI*float(i*2+1)/ 8.0)) */
const REAL
Mpegtoraw::hcos_8[2] = {
X(0.541196100146197),
Modified: trunk/user/pixil/apps/fltk/netconfig/ip_setup.cxx
===================================================================
--- trunk/user/pixil/apps/fltk/netconfig/ip_setup.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/apps/fltk/netconfig/ip_setup.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -667,7 +667,9 @@
//
//////////////////////////////////////////////////////////
-#include <iostream.h>
+#include <iostream>
+using namespace std;
+
IP_Setup::IP_Setup()
{
Modified: trunk/user/pixil/apps/fltk/schedule/nxrepeatevent.cxx
===================================================================
--- trunk/user/pixil/apps/fltk/schedule/nxrepeatevent.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/apps/fltk/schedule/nxrepeatevent.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -195,7 +195,7 @@
time_t end_on = 0;
time_t new_time = 0;
unsigned long days = 0;
- double diff = 0;
+ float diff = 0;
tm *tt;
int year = 0;
int mon = 0;
@@ -352,7 +352,7 @@
int mon = 0;
int m_day = 0;
time_t end_on = 0;
- double diff = 0;
+ float diff = 0;
long days = 0;
time_t new_date;
tm *tt;
Modified: trunk/user/pixil/apps/fltk/schedule/nxschedule.cxx
===================================================================
--- trunk/user/pixil/apps/fltk/schedule/nxschedule.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/apps/fltk/schedule/nxschedule.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -47,6 +47,7 @@
#include <errno.h>
#include <signal.h>
#include <ctype.h>
+#include <limits.h>
#include <pixil_config.h>
#include <par/par.h>
@@ -2887,7 +2888,7 @@
tm *
today =
NULL;
- double
+ float
diff =
0;
time_t
Modified: trunk/user/pixil/apps/fltk/schedule/nxweek.cxx
===================================================================
--- trunk/user/pixil/apps/fltk/schedule/nxweek.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/apps/fltk/schedule/nxweek.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -70,7 +70,7 @@
memset(db_name, 0, sizeof(db_name));
db = NULL;
first_appt = NULL;
- pix_ratio = (double) b_height / 7200; //pix per second
+ pix_ratio = (float) b_height / 7200; //pix per second
day_pix = 86400 * pix_ratio;
num_recs = 0;
memset(appt_array, 0, sizeof(appt_array));
@@ -268,7 +268,7 @@
val = val << 4;
appt_array[col][row1 + idx] = val | low_val;
}
- } else if (NULL == p_Prev) { // double on top of double
+ } else if (NULL == p_Prev) { // float on top of float
new_time = p_Appt->end_time;
tt = localtime(&new_time);
t_hour = tt->tm_hour;
@@ -710,8 +710,8 @@
int hour;
int min;
int wday;
- double h;
- double y;
+ float h;
+ float y;
char buf[16];
tm *tt = localtime(&new_time);
@@ -764,12 +764,12 @@
}
}
-double
-WeekGrid::GetOffSet(double val)
+float
+WeekGrid::GetOffSet(float val)
{
int num = (int) (val / day_pix);
- double close = num * day_pix;
- double rem = val - close;
+ float close = num * day_pix;
+ float rem = val - close;
return rem;
}
@@ -814,20 +814,20 @@
{
int col = 0;
int row = 0;
- double h_val = 0;
- double dec = 0;
+ float h_val = 0;
+ float dec = 0;
int last_val = 0;
int low_val;
int hi_val;
int H;
int start_row = 0;
- double y_val;
+ float y_val;
int Y;
int X;
int x_off;
int next_val;
int width;
- double rem = 0;
+ float rem = 0;
int offset = 0;
// go low
@@ -883,7 +883,7 @@
DPRINT("Y [%d] H [%d]\n", Y, H);
// correct Y
- rem = GetOffSet((double) Y);
+ rem = GetOffSet((float) Y);
offset = Y;
Y = (int) rem - dy;
if (offset >= (dy + (int) (6.5 * b_height)))
@@ -969,7 +969,7 @@
} else
H = 0;
} else {
- rem = GetOffSet((double) Y);
+ rem = GetOffSet((float) Y);
offset = Y;
Y = (int) rem - dy;
if (offset >= (dy + (int) (6.5 * b_height)))
@@ -1019,7 +1019,7 @@
int H;
int X;
int Y;
- double rem;
+ float rem;
tm *tt;
int width = 0;
int x_off = 0;
@@ -1131,7 +1131,7 @@
int big_overlap = 0;
int x_off = 0;
int left = 0;
- double rem = 0;
+ float rem = 0;
int H = 0;
int offset = 0;
int width = 0;
Modified: trunk/user/pixil/apps/fltk/schedule/nxweek.h
===================================================================
--- trunk/user/pixil/apps/fltk/schedule/nxweek.h 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/apps/fltk/schedule/nxweek.h 2007-09-13 23:19:15 UTC (rev 1884)
@@ -69,10 +69,10 @@
typedef struct appt_
{ // appointmet structure
- double x;
- double y;
- double w;
- double h;
+ float x;
+ float y;
+ float w;
+ float h;
int overlay;
int recno;
time_t start_time;
@@ -106,13 +106,13 @@
short info_draw;
uchar appt_array[7][288];
appt *first_appt;
- double pix_ratio;
- double day_pix;
+ float pix_ratio;
+ float day_pix;
NxDb *db;
char db_name[255];
void draw();
int handle(int);
- double GetOffSet(double val);
+ float GetOffSet(float val);
void DrawAppointments();
void DrawOverlaps(int dy);
void DrawRects(int dy);
Modified: trunk/user/pixil/apps/fltk/sync/sync_ui.cxx
===================================================================
--- trunk/user/pixil/apps/fltk/sync/sync_ui.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/apps/fltk/sync/sync_ui.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -414,7 +414,7 @@
Sync *pThis = (Sync *) NxApp::Instance();
int state = pThis->syncState;
- double timeout = 0.5;
+ float timeout = 0.5;
printf("TIMER [%d]\n", state);
@@ -648,7 +648,7 @@
int
Sync::send_update_status(string app_id)
{
- static double s_value = 0;
+ static float s_value = 0;
s_value += 10;
//statusSlider->value(s_value);
if (s_value >= 100)
@@ -667,8 +667,8 @@
{
DPRINT("Get Update Status start\n");
//get sync status
- double value = 0;
- static double slider_value = 0;
+ float value = 0;
+ static float slider_value = 0;
string svalue;
char msg[CL_MAX_MSG_LEN];
Modified: trunk/user/pixil/apps/fltk/sysconfig/about/about.cxx
===================================================================
--- trunk/user/pixil/apps/fltk/sysconfig/about/about.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/apps/fltk/sysconfig/about/about.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -196,7 +196,7 @@
lnlen = 0, // Length of line in # of chars
solflg = 0, // Indicates a start of a line
sowflg = 0; // Indicates a start of a word
- double strwid; // Current width of line
+ float strwid; // Current width of line
if (str == NULL || w == 0)
return;
@@ -390,12 +390,12 @@
void
NxAbout::SetWidths(void)
{
- double max_lbl_width = 0;
+ float max_lbl_width = 0;
fl_font(DEFAULT_TEXT_FONT, DEFAULT_TEXT_SIZE);
for (int i = 0; i < ABOUT_DUMMY; i++) {
char *cp;
- double dbltmp;
+ float dbltmp;
if ((cp = strchr(label_tags[i], '\n')) != NULL) {
char *tmpbuf;
Modified: trunk/user/pixil/apps/fltk/sysconfig/cal/cal_ui.c
===================================================================
--- trunk/user/pixil/apps/fltk/sysconfig/cal/cal_ui.c 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/apps/fltk/sysconfig/cal/cal_ui.c 2007-09-13 23:19:15 UTC (rev 1884)
@@ -491,7 +491,7 @@
int deltax, /* Change in x */
deltay, /* Change in y */
retval = -1; /* Return value, default to fail */
- double fudgex, /* Fudge factor in x */
+ float fudgex, /* Fudge factor in x */
fudgey; /* Fudge factor in y */
CalPt_t validpt1, /* Validation point #1 */
validpt2; /* Validation point #2 */
Modified: trunk/user/pixil/apps/fltk/sysconfig/clock/nxsunclock.cxx
===================================================================
--- trunk/user/pixil/apps/fltk/sysconfig/clock/nxsunclock.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/apps/fltk/sysconfig/clock/nxsunclock.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -997,7 +997,7 @@
void
nxSunclock::map_click_cb(Fl_Widget * W, void *d)
{
- double lat, // Latitude
+ float lat, // Latitude
lon; // Longitude
int ccnt, // City count
h, // Height
@@ -1019,7 +1019,7 @@
// Convert the x/y coordinate's into relative latitude and longitude values
lat = (((-180.0 * ypos) + (180.0 * h)) / h) - 90.0;
- lon = (((360.0 * (double) xpos) / (double) w) - 180.0);
+ lon = (((360.0 * (float) xpos) / (float) w) - 180.0);
if (lon > 180.0)
lon -= 360.0;
@@ -1030,7 +1030,7 @@
if ((ccnt = GetCityList(me->_zndb, (int) lat, (int) lon)) > 0) {
// Load up a Fl_SelectBrowser widget
for (int i = 0; i < ccnt; i++) {
- double tmp;
+ float tmp;
char buf[25];
sprintf(buf, "%s, %s", city_list[i].city_name, city_list[i].reg);
Modified: trunk/user/pixil/apps/fltk/sysconfig/clock/old/astro.c
===================================================================
--- trunk/user/pixil/apps/fltk/sysconfig/clock/old/astro.c 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/apps/fltk/sysconfig/clock/old/astro.c 2007-09-13 23:19:15 UTC (rev 1884)
@@ -70,15 +70,15 @@
/* JTIME -- Convert internal GMT date and time to astronomical
Julian time (i.e. Julian date plus day fraction,
- expressed as a double). */
+ expressed as a float). */
-double
+float
jtime(t)
struct tm *t;
{
#ifdef NOTUSED
long val = t->tm_sec + (60L * (t->tm_min + 60L * t->tm_hour));
- double ret = (((double) (jdate(t) + val)) - 0.5) / 86400.0;
+ float ret = (((float) (jdate(t) + val)) - 0.5) / 86400.0;
return (ret);
#endif
@@ -89,11 +89,11 @@
/* KEPLER -- Solve the equation of Kepler. */
-double
+float
kepler(m, ecc)
- double m, ecc;
+ float m, ecc;
{
- double e, delta;
+ float e, delta;
#define EPSILON 1E-6
e = m = dtr(m);
@@ -117,11 +117,11 @@
void
sunpos(jd, apparent, ra, dec, rv, slong)
- double jd;
+ float jd;
int apparent;
- double *ra, *dec, *rv, *slong;
+ float *ra, *dec, *rv, *slong;
{
- double t, t2, t3, l, m, e, ea, v, theta, omega, eps;
+ float t, t2, t3, l, m, e, ea, v, theta, omega, eps;
/* Time, in Julian centuries of 36525 ephemeris days,
measured from the epoch 1900 January 0.5 ET. */
@@ -184,11 +184,11 @@
/* GMST -- Calculate Greenwich Mean Siderial Time for a given
instant expressed as a Julian date and fraction. */
-double
+float
gmst(jd)
- double jd;
+ float jd;
{
- double t, theta0;
+ float t, theta0;
/* Time, in Julian centuries of 36525 ephemeris days,
Modified: trunk/user/pixil/apps/fltk/sysconfig/clock/sunclock.h
===================================================================
--- trunk/user/pixil/apps/fltk/sysconfig/clock/sunclock.h 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/apps/fltk/sysconfig/clock/sunclock.h 2007-09-13 23:19:15 UTC (rev 1884)
@@ -137,10 +137,10 @@
typedef struct ZoomSettings
{
- double fx; /* zoom factor along width */
- double fy; /* zoom factor along height */
- double fdx; /* translation factor along width */
- double fdy; /* translation factor along height */
+ float fx; /* zoom factor along width */
+ float fy; /* zoom factor along height */
+ float fdx; /* translation factor along width */
+ float fdy; /* translation factor along height */
int mode; /* zoom behaviour mode=0,1,2,3 */
int width; /* width of full extent zoomed area */
int height; /* height of full extent zoomed area */
@@ -194,7 +194,7 @@
typedef struct City
{
char *name; /* Name of the city */
- double lat, lon; /* Latitude and longitude of city */
+ float lat, lon; /* Latitude and longitude of city */
char *tz; /* Timezone of city */
int mode;
struct City *next; /* Pointer to next record */
@@ -205,7 +205,7 @@
typedef struct Mark
{
City *city;
- double save_lat, save_lon;
+ float save_lat, save_lon;
int status, pulse, full;
struct tm sr, ss, dl;
}
@@ -232,7 +232,7 @@
short *tr1; /* pointer to day/night transition 1 */
short *tr2; /* pointer to day/night transition 2 */
int south; /* color code (0 / -1) at South pole */
- double *wave; /* pointer to sine, cosine values */
+ float *wave; /* pointer to sine, cosine values */
Pixmap pix; /* pixmap */
XImage *xim; /* ximage of map */
char *ximdata; /* ximage data copy */
@@ -243,16 +243,16 @@
long projtime; /* last time projected illumination */
long progress; /* time progression (in sec) */
long jump; /* time jump (in sec) */
- double fnoon; /* position of noon, double prec */
+ float fnoon; /* position of noon, float prec */
int noon; /* position of noon, integer */
int local_day; /* previous local day */
int solar_day; /* previous solar day */
int textx; /* x where to draw the text */
int texty; /* y where to draw the text */
int count; /* number of time iterations */
- double sundec; /* Sun declination */
- double sunlon; /* Sun longitude */
- double shadefactor; /* shading factor */
+ float sundec; /* Sun declination */
+ float sunlon; /* Sun longitude */
+ float shadefactor; /* shading factor */
struct City pos1; /* first position */
struct City pos2; /* second position */
struct Mark mark1; /* first mark */
Modified: trunk/user/pixil/apps/fltk/sysconfig/memory/memory.cxx
===================================================================
--- trunk/user/pixil/apps/fltk/sysconfig/memory/memory.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/apps/fltk/sysconfig/memory/memory.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -66,7 +66,7 @@
// Static function prototypes (non class)
-static double getsztags(int byteval, int *idx);
+static float getsztags(int byteval, int *idx);
NxMemory::~NxMemory()
{
@@ -129,7 +129,7 @@
curx, // Current x coordinate
cury, // Current y coordinate
mar = 4; // Left margin
- double fontw0, // Width of "0%" in current font
+ float fontw0, // Width of "0%" in current font
fontw100; // Width of "100%" in current font
Fl_Color def_bg, // Default background
@@ -385,7 +385,7 @@
{
char buf[255]; // Buffer
int tag_idx = 0; // Tag index
- double val; // Value
+ float val; // Value
unsigned long mbuf = 0, // Memory buffered
mcache = 0, // Memory cached
mfree = 0, // Memory free
@@ -437,7 +437,7 @@
_memory.total->label(_memory.t_str);
_memory.total->redraw();
- val = ((double) mused / mtot) * 100.0;
+ val = ((float) mused / mtot) * 100.0;
_memsl->value(val);
_memsl->redraw();
@@ -457,7 +457,7 @@
NxMemory::GetStorage(void)
{
char buf[64];
- double pcnt_used, // Percentage used
+ float pcnt_used, // Percentage used
sadjtot = 0.0, sfree = 0.0, stot = 0.0, sused = 0.0, val; // Value
int tag_idx = 1; // Idx into size_tags
struct statfs stfs; // Filesystem stat info
@@ -467,10 +467,10 @@
if (statfs(f_curDev, &stfs))
return;
- stot = ((double) stfs.f_blocks * stfs.f_bsize) / 1024; // In KB
+ stot = ((float) stfs.f_blocks * stfs.f_bsize) / 1024; // In KB
sadjtot = stfs.f_blocks - (stfs.f_bfree - stfs.f_bavail);
- sfree = ((double) stfs.f_bavail * stfs.f_bsize) / 1024;
- sused = ((double) (sadjtot - stfs.f_bavail) * stfs.f_bsize) / 1024;
+ sfree = ((float) stfs.f_bavail * stfs.f_bsize) / 1024;
+ sused = ((float) (sadjtot - stfs.f_bavail) * stfs.f_bsize) / 1024;
sadjtot = sadjtot * stfs.f_bsize / 1024;
pcnt_used = ((sused) / sadjtot) * 100.0 + 0.5;
@@ -690,7 +690,7 @@
/*******************************************************************************\
**
-** Function: double getsztags()
+** Function: float getsztags()
** Desc: Converts the value into the lowest form of BYTES/KB/MB/GB that is
** >= 1.0 and < 1024.0 units
** Accepts: int value = Value to convert (if *idx == 0, values are assumed bytes)
@@ -698,11 +698,11 @@
** Returns: Double a value >= 1.0 && < 1024.0
**
\*******************************************************************************/
-static double
+static float
getsztags(int value, int *idx)
{
int new_idx = *idx; // New idx
- double retval = value; // Value
+ float retval = value; // Value
if (new_idx < 0 || new_idx > SZ_TAGS)
new_idx = 0;
Modified: trunk/user/pixil/apps/fltk/sysconfig/regional/regional.cxx
===================================================================
--- trunk/user/pixil/apps/fltk/sysconfig/regional/regional.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/apps/fltk/sysconfig/regional/regional.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -303,7 +303,7 @@
_reset = o;
} // end of "Reset button
{
- double width;
+ float width;
NxBox *o;
NxMenuButton *p;
@@ -347,7 +347,7 @@
cury += (int) (1.5 * BUTTON_HEIGHT);
} // end of line
{
- double max_width = 0.0, tmp_width;
+ float max_width = 0.0, tmp_width;
int lblw, lblx, dtaw, dtax;
NxBox *lbls[REG_NUM_TMDT], // Array of sample labels
*dta[REG_NUM_NMBRS]; // Array of sample data
@@ -378,7 +378,7 @@
cury += (int) (0.5 * BUTTON_HEIGHT);
}
{
- double max_width = 0.0, tmp_width;
+ float max_width = 0.0, tmp_width;
int lblw, lblx, dtaw, dtax;
NxBox *lbls[REG_NUM_NMBRS], *dta[REG_NUM_NMBRS];
@@ -526,7 +526,7 @@
NxRegional::SetValues(void)
{
char *cp1, *olocale, tmp_data[128];
- double conv_val = 123456789.0;
+ float conv_val = 123456789.0;
// TODO: Set the curret locale to what was selected and redisplay values
Modified: trunk/user/pixil/apps/fltk/sysconfig/userinfo/userinfo.cxx
===================================================================
--- trunk/user/pixil/apps/fltk/sysconfig/userinfo/userinfo.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/apps/fltk/sysconfig/userinfo/userinfo.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -239,7 +239,7 @@
_resetb = o;
}
{
- double max_lbl_wid = 0; // Label width
+ float max_lbl_wid = 0; // Label width
int input_width;
Fl_Tabs *o; // Tab widget
@@ -248,7 +248,7 @@
fl_font(DEFAULT_TEXT_FONT, DEFAULT_TEXT_SIZE);
for (int i = 1; i <= UI_FLD_MAXFLDS; i++) {
- double tmp_wid;
+ float tmp_wid;
if ((tmp_wid = fl_width(ParIds[i])) > max_lbl_wid)
max_lbl_wid = tmp_wid;
Modified: trunk/user/pixil/apps/fltk/todo/nxtodo.cxx
===================================================================
--- trunk/user/pixil/apps/fltk/todo/nxtodo.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/apps/fltk/todo/nxtodo.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -40,6 +40,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
+#include <time.h>
#include <pixil_config.h>
Modified: trunk/user/pixil/apps/nanox/misc/nxclock.c
===================================================================
--- trunk/user/pixil/apps/nanox/misc/nxclock.c 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/apps/nanox/misc/nxclock.c 2007-09-13 23:19:15 UTC (rev 1884)
@@ -73,8 +73,8 @@
const float minhand[4][2] = { {-0.5f, 0}, {0, 1.5f}, {0.5f, 0}, {0, -11.5f} };
const float sechand[4][2] = { {-0.1f, 0}, {0, 2.0f}, {0.1f, 0}, {0, -11.5f} };
-static void
-drawhand(double ang, const float v[][2], GR_COLOR fill,
+static void
+drawhand(float ang, const float v[][2], GR_COLOR fill,
GR_COLOR line, GR_WINDOW_ID pmap, GR_GC_ID gc)
{
int i;
@@ -114,10 +114,10 @@
static void
-rect(double x, double y, double w, double h, GR_WINDOW_ID pmap, GR_GC_ID gc)
+rect(float x, float y, float w, float h, GR_WINDOW_ID pmap, GR_GC_ID gc)
{
- double r = x + w;
- double t = y + h;
+ float r = x + w;
+ float t = y + h;
begin_polygon();
vertex(x, y);
vertex(r, y);
Modified: trunk/user/pixil/apps/nanox/misc/nxloadmon.c
===================================================================
--- trunk/user/pixil/apps/nanox/misc/nxloadmon.c 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/apps/nanox/misc/nxloadmon.c 2007-09-13 23:19:15 UTC (rev 1884)
@@ -76,7 +76,7 @@
nxEND
};
-double queue[BACKLOG];
+float queue[BACKLOG];
int qhead = 1;
int qtail = 0;
@@ -103,13 +103,13 @@
#define YSIZE info.height
static void expose_points(void);
-static void insert_point(double value);
+static void insert_point(float value);
-static double
+static float
get_load()
{
unsigned long user, nice, sys, idle;
- double total = 0, busy = 0;
+ float total = 0, busy = 0;
char str[BUFSIZ];
char *c;
@@ -141,8 +141,8 @@
dsys = abs(sys - cpudata.sys);
didle = abs(idle - cpudata.idle);
- busy = (double) duser + dnice + dsys;
- total = (double) busy + didle;
+ busy = (float) duser + dnice + dsys;
+ total = (float) busy + didle;
} else
total = 0;
@@ -272,7 +272,7 @@
}
static void
-insert_point(double value)
+insert_point(float value)
{
if (--qhead < 0)
qhead = (BACKLOG - 1);
Modified: trunk/user/pixil/apps/nanox/misc/vertex.c
===================================================================
--- trunk/user/pixil/apps/nanox/misc/vertex.c 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/apps/nanox/misc/vertex.c 2007-09-13 23:19:15 UTC (rev 1884)
@@ -70,7 +70,7 @@
}
void
-mult_matrix(double a, double b, double c, double d, double x, double y)
+mult_matrix(float a, float b, float c, float d, float x, float y)
{
struct matrix o;
o.a = a * m.a + b * m.c;
@@ -83,28 +83,28 @@
}
void
-scale_xy(double x, double y)
+scale_xy(float x, float y)
{
mult_matrix(x, 0, 0, y, 0, 0);
}
void
-scale_x(double x)
+scale_x(float x)
{
mult_matrix(x, 0, 0, x, 0, 0);
}
void
-translate(double x, double y)
+translate(float x, float y)
{
mult_matrix(1, 0, 0, 1, x, y);
}
void
-rotate(double d)
+rotate(float d)
{
if (d) {
- double s, c;
+ float s, c;
if (0 == d) {
s = 0;
c = 1;
@@ -153,26 +153,26 @@
what = POLYGON;
}
-double
-transform_x(double x, double y)
+float
+transform_x(float x, float y)
{
return x * m.a + y * m.c + m.x;
}
-double
-transform_y(double x, double y)
+float
+transform_y(float x, float y)
{
return x * m.b + y * m.d + m.y;
}
-double
-transform_dx(double x, double y)
+float
+transform_dx(float x, float y)
{
return x * m.a + y * m.c;
}
-double
-transform_dy(double x, double y)
+float
+transform_dy(float x, float y)
{
return x * m.b + y * m.d;
}
@@ -192,13 +192,13 @@
}
void
-transformed_double_vertex(double xf, double yf)
+transformed_double_vertex(float xf, float yf)
{
transformed_coord_vertex((COORD_T) xf + .5, (COORD_T) yf + .5);
}
void
-vertex(double x, double y)
+vertex(float x, float y)
{
transformed_double_vertex(x * m.a + y * m.c + m.x,
x * m.b + y * m.d + m.y);
@@ -272,7 +272,7 @@
}
void
-circle(double x, double y, double r, GR_WINDOW_ID pmap, GR_GC_ID gc,
+circle(float x, float y, float r, GR_WINDOW_ID pmap, GR_GC_ID gc,
GR_SIZE w, GR_SIZE h)
{
GrEllipse(pmap, gc, w / 2 - 1, h / 2 - 1, w / 2 - 1, h / 2 - 1);
Modified: trunk/user/pixil/apps/nanox/scribble/hre.h
===================================================================
--- trunk/user/pixil/apps/nanox/scribble/hre.h 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/apps/nanox/scribble/hre.h 2007-09-13 23:19:15 UTC (rev 1884)
@@ -197,9 +197,9 @@
u_short pt_button; /*button state - same as tc_button */
u_short pt_pen; /*other state - same as tc_pen */
short pt_pressure; /*Pressure. + against tablet, - above tablet. */
- double pt_anglex; /*angle of tilt in the x direction, in radians. */
- double pt_angley; /*angle of tilt in the y direction, in radians. */
- double pt_barrelrotate; /*angle of barrel rotation, in radians. */
+ float pt_anglex; /*angle of tilt in the x direction, in radians. */
+ float pt_angley; /*angle of tilt in the y direction, in radians. */
+ float pt_barrelrotate; /*angle of barrel rotation, in radians. */
}
pen_state;
@@ -227,7 +227,7 @@
{
pen_rect pr_area;
short pr_row, pr_col;
- double pr_rowpitch, pr_colpitch;
+ float pr_rowpitch, pr_colpitch;
}
pen_frame;
Modified: trunk/user/pixil/apps/nanox/scribble/hre_api.c
===================================================================
--- trunk/user/pixil/apps/nanox/scribble/hre_api.c 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/apps/nanox/scribble/hre_api.c 2007-09-13 23:19:15 UTC (rev 1884)
@@ -1260,7 +1260,7 @@
u_short button,
u_short pen,
short pressure,
- double anglex, double angley, double barrelrotate)
+ float anglex, float angley, float barrelrotate)
{
if (ps != NULL) {
ps->pt_button = button;
Modified: trunk/user/pixil/apps/nanox/scribble/hre_api_internal.h
===================================================================
--- trunk/user/pixil/apps/nanox/scribble/hre_api_internal.h 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/apps/nanox/scribble/hre_api_internal.h 2007-09-13 23:19:15 UTC (rev 1884)
@@ -249,8 +249,8 @@
u_short button,
u_short pen,
short pressure,
- double anglex,
- double angley, double barrelrotate);
+ float anglex,
+ float angley, float barrelrotate);
void delete_pen_state_array(pen_state * ps);
#endif
Modified: trunk/user/pixil/apps/nanox/scribble/li_recognizer.c
===================================================================
--- trunk/user/pixil/apps/nanox/scribble/li_recognizer.c 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/apps/nanox/scribble/li_recognizer.c 2007-09-13 23:19:15 UTC (rev 1884)
@@ -947,12 +947,12 @@
#ifdef __ultrix
/* Ultrix doesn't have these declarations in math.h! */
-extern double rint(double);
+extern float rint(float);
extern float expf(float);
#endif
#ifdef ELX
-extern double rint(double);
+extern float rint(float);
extern float expf(float); /* N.B. exp() appears to be broken on ELX! */
#endif
@@ -1403,7 +1403,7 @@
int dx = endpt->x - startpt->x;
int dy = endpt->y - startpt->y;
/*
- int tmp = rint(4.0 * atan2((double)dx, (double)dy) / M_PI);
+ int tmp = rint(4.0 * atan2((float)dx, (float)dy) / M_PI);
int dircode = (10 + tmp) % 8;
*/
int tmp = quadr(likeatan(dy, dx));
@@ -2610,11 +2610,11 @@
for (i = LP_FILTER_WIDTH; i >= 0; i--) {
float x = 0.04 * (i * i);
#ifdef ARM_LINUX
- double tmp = 100.0 * exp((double) x);
+ float tmp = 100.0 * exp((float) x);
#else
float tmp = 100.0 * expf(x);
#endif
- int wt = rint((double) tmp);
+ int wt = rint((float) tmp);
lialg_lpfwts[LP_FILTER_WIDTH - i] = wt;
lialg_lpfwts[LP_FILTER_WIDTH + i] = wt;
Modified: trunk/user/pixil/apps/nanox/scribble/matrix.c
===================================================================
--- trunk/user/pixil/apps/nanox/scribble/matrix.c 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/apps/nanox/scribble/matrix.c 2007-09-13 23:19:15 UTC (rev 1884)
@@ -41,7 +41,7 @@
register Vector v;
a = (struct array_header *)
- allocate(sizeof(struct array_header) + r * sizeof(double), char);
+ allocate(sizeof(struct array_header) + r * sizeof(float), char);
a->ndims = 1;
a->nrows = r;
a->ncols = 1;
@@ -65,13 +65,13 @@
int r, c;
{
register struct array_header *a = (struct array_header *)
- allocate(sizeof(struct array_header) + r * sizeof(double *), char);
+ allocate(sizeof(struct array_header) + r * sizeof(float *), char);
register int i;
register Matrix m;
m = (Matrix) (a + 1);
for (i = 0; i < r; i++)
- m[i] = allocate(c, double);
+ m[i] = allocate(c, float);
a->ndims = 2;
a->nrows = r;
a->ncols = c;
@@ -147,7 +147,7 @@
void
FillMatrix(m, fill)
Matrix m;
- double fill;
+ float fill;
{
register int i, j;
for (i = 0; i < NROWS(m); i++)
@@ -155,11 +155,11 @@
m[i][j] = fill;
}
-double
+float
InnerProduct(v1, v2)
register Vector v1, v2;
{
- double result = 0;
+ float result = 0;
register int n = NROWS(v1);
if (n != NROWS(v2)) {
exit_error("InnerProduct %d x %d ", n, NROWS(v2));
@@ -174,7 +174,7 @@
register Matrix m1, m2, prod;
{
register int i, j, k;
- double sum;
+ float sum;
if (NCOLS(m1) != NROWS(m2)) {
error("MatrixMultiply: Can't multiply %dx%d and %dx%d matrices",
@@ -233,7 +233,7 @@
void
ScalarTimesVector(s, v, product)
- double s;
+ float s;
register Vector v, product;
{
register int n = NROWS(v);
@@ -250,7 +250,7 @@
void
ScalarTimesMatrix(s, m, product)
- double s;
+ float s;
register Matrix m, product;
{
register int i, j;
@@ -270,13 +270,13 @@
Compute v'mv
*/
-double
+float
QuadraticForm(v, m)
register Vector v;
register Matrix m;
{
register int i, j, n;
- double result = 0;
+ float result = 0;
n = NROWS(v);
@@ -319,12 +319,12 @@
#define _abs(x) ((x)>=0 ? (x) : -(x))
-double
+float
InvertMatrix(ym, rm)
Matrix ym, rm;
{
register int i, j, k;
- double det, biga, recip_biga, hold;
+ float det, biga, recip_biga, hold;
int l[PERMBUFSIZE], m[PERMBUFSIZE];
register int n;
@@ -491,7 +491,7 @@
Matrix
DeSliceMatrix(m, fill, rowmask, colmask, r)
Matrix m;
- double fill;
+ float fill;
BitVector rowmask, colmask;
Matrix r;
{
@@ -585,14 +585,14 @@
return m;
}
-double
+float
InvertSingularMatrix(m, inv)
Matrix m, inv;
{
register int i, j, k;
BitVector mask;
Matrix sm;
- double det, maxdet;
+ float det, maxdet;
int mi = -1, mj = -1, mk = -1;
maxdet = 0.0;
Modified: trunk/user/pixil/apps/nanox/scribble/matrix.h
===================================================================
--- trunk/user/pixil/apps/nanox/scribble/matrix.h 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/apps/nanox/scribble/matrix.h 2007-09-13 23:19:15 UTC (rev 1884)
@@ -53,8 +53,8 @@
unsigned char filler;
};
-typedef double **Matrix;
-typedef double *Vector;
+typedef float **Matrix;
+typedef float *Vector;
Vector NewVector(); /* int r; (number of rows) */
Matrix NewMatrix(); /* int r, c; (number of rows, number of columns) */
@@ -62,12 +62,12 @@
void FreeMatrix(); /* Matrix m; */
void PrintVector(); /* Vector v; char *fmt; any a1,a2,a3,a4,a5,a6,a7,a8 */
void PrintMatrix(); /* Matrix m; char *fmt; any a1,a2,a3,a4,a5,a6,a7,a8 */
-double InnerProduct(); /* Vector v1, v2 */
+float InnerProduct(); /* Vector v1, v2 */
void MatrixMultiply(); /* Matrix m1, m2, prod; */
void VectorTimesMatrix(); /* Vector v; Matrix m; Vector prod; */
-void ScalarTimesVector(); /* double s; Vector v; Vector prod; */
-double QuadraticForm(); /* Vector v; Matrix m; (computes v'mv) */
-double InvertMatrix(); /* Matrix input_matrix, result_matrix (returns det) */
+void ScalarTimesVector(); /* float s; Vector v; Vector prod; */
+float QuadraticForm(); /* Vector v; Matrix m; (computes v'mv) */
+float InvertMatrix(); /* Matrix input_matrix, result_matrix (returns det) */
Vector SliceVector(); /* Vector v; BitVector rowmask */
Matrix SliceMatrix(); /* Matrix m; Bitvector rowmask, colmask; */
Vector VectorCopy(); /* Vector v; */
@@ -75,11 +75,11 @@
Vector InputVector(); /* FILE *f; */
Matrix InputMatrix(); /* FILE *f; */
-double InvertSingularMatrix(); /* Matrix input, result (returns det) */
-Matrix DeSliceMatrix(); /* Matrix m, double fill, BitVector rowmask, colmask;
+float InvertSingularMatrix(); /* Matrix input, result (returns det) */
+Matrix DeSliceMatrix(); /* Matrix m, float fill, BitVector rowmask, colmask;
Matrix result */
void OutputVector();
void OutputMatrix();
void ZeroVector();
void ZeroMatrix(); /* Matrix m; */
-void FillMatrix(); /* Matrix m; double fill; */
+void FillMatrix(); /* Matrix m; float fill; */
Modified: trunk/user/pixil/apps/nanox/scribble/sc.c
===================================================================
--- trunk/user/pixil/apps/nanox/scribble/sc.c 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/apps/nanox/scribble/sc.c 2007-09-13 23:19:15 UTC (rev 1884)
@@ -7,7 +7,7 @@
#include "sc.h"
#include "stdio.h"
#include "stdlib.h"
-#include "math.h"
+#include <math.h>
#include "zdebug.h"
#define EPS (1.0e-6) /* for singular matrix check */
@@ -100,8 +100,8 @@
{
register sClassDope scd;
register int i, j;
- double nfv[50];
- double nm1on, recipn;
+ float nfv[50];
+ float nm1on, recipn;
scd = sClassNameLookup(sc, classname);
if (scd == NULL) {
@@ -130,7 +130,7 @@
}
scd->nexamples++;
- nm1on = ((double) scd->nexamples - 1) / scd->nexamples;
+ nm1on = ((float) scd->nexamples - 1) / scd->nexamples;
recipn = 1.0 / scd->nexamples;
/* incrementally update covariance matrix */
@@ -155,10 +155,10 @@
register int i, j;
int c;
int ne, denom;
- double oneoverdenom;
+ float oneoverdenom;
register Matrix s;
register Matrix avgcov;
- double det;
+ float det;
register sClassDope scd;
if (sc->nclasses == 0) {
@@ -225,14 +225,14 @@
sClassifyAD(sc, fv, ap, dp)
sClassifier sc;
Vector fv;
- double *ap;
- double *dp;
+ float *ap;
+ float *dp;
{
- double disc[MAXSCLASSES];
+ float disc[MAXSCLASSES];
register int i, maxclass;
- double denom, exp();
+ float denom;
register sClassDope scd;
- double d;
+ float d;
if (sc->w == NULL) {
error("%x not a trained classifier", sc);
@@ -241,7 +241,7 @@
for (i = 0; i < sc->nclasses; i++) {
/* ari */
- double IP;
+ float IP;
IP = InnerProduct(sc->w[i], fv);
/* fprintf(stderr, "sClassifyAD: InnerProduct for class %s is %f.\n", sc->classdope[i]->name, IP); */
/* fprintf(stderr, "sClassifyAD: sc->cnst[i] = %f.\n", sc->cnst[i]); */
@@ -331,14 +331,14 @@
Compute (v-u)' sigma (v-u)
*/
-double
+float
MahalanobisDistance(v, u, sigma)
register Vector v, u;
register Matrix sigma;
{
register int i;
static Vector space;
- double result;
+ float result;
if (space == NULL || NROWS(space) != NROWS(v)) {
if (space)
@@ -357,7 +357,7 @@
Matrix avgcov;
{
int i;
- double det;
+ float det;
BitVector bv;
Matrix m, r;
@@ -482,7 +482,7 @@
{
register Matrix d = NewMatrix(sc->nclasses, sc->nclasses);
register int i, j;
- double min, max = 0;
+ float min, max = 0;
int n, mi, mj;
printf("-----------\n");
Modified: trunk/user/pixil/apps/nanox/scribble/sc.h
===================================================================
--- trunk/user/pixil/apps/nanox/scribble/sc.h 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/apps/nanox/scribble/sc.h 2007-09-13 23:19:15 UTC (rev 1884)
@@ -40,9 +40,9 @@
void sRemoveExample(); /* sc, classname, y */
void sDoneAdding(); /* sc */
sClassDope sClassify(); /* sc, y */
-sClassDope sClassifyAD(); /* sc, y, double *ap; double *dp */
+sClassDope sClassifyAD(); /* sc, y, float *ap; float *dp */
sClassDope sClassNameLookup(); /* sc, classname */
-double MahalanobisDistance(); /* Vector v, u; Matrix sigma */
+float MahalanobisDistance(); /* Vector v, u; Matrix sigma */
void FixClassifier();
void sDumpClassifier();
void sDistances();
Modified: trunk/user/pixil/apps/nanox/scribble/zdebug.h
===================================================================
--- trunk/user/pixil/apps/nanox/scribble/zdebug.h 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/apps/nanox/scribble/zdebug.h 2007-09-13 23:19:15 UTC (rev 1884)
@@ -18,4 +18,4 @@
#define ZZZ(f) if(_zdebug_flag[f] >= 3)
#define ZZZZ(f) if(_zdebug_flag[f] >= 4)
-extern double kludge[];
+extern float kludge[];
Modified: trunk/user/pixil/apps/nanox/wclock/astro.c
===================================================================
--- trunk/user/pixil/apps/nanox/wclock/astro.c 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/apps/nanox/wclock/astro.c 2007-09-13 23:19:15 UTC (rev 1884)
@@ -139,15 +139,15 @@
/* JTIME -- Convert internal GMT date and time to astronomical
Julian time (i.e. Julian date plus day fraction,
- expressed as a double). */
+ expressed as a float). */
-double
+float
jtime(t)
struct tm *t;
{
#ifdef NOTUSED
long val = t->tm_sec + (60L * (t->tm_min + 60L * t->tm_hour));
- double ret = (((double) (jdate(t) + val)) - 0.5) / 86400.0;
+ float ret = (((float) (jdate(t) + val)) - 0.5) / 86400.0;
return (ret);
#endif
@@ -158,11 +158,11 @@
/* KEPLER -- Solve the equation of Kepler. */
-double
+float
kepler(m, ecc)
- double m, ecc;
+ float m, ecc;
{
- double e, delta;
+ float e, delta;
#define EPSILON 1E-6
e = m = dtr(m);
@@ -186,11 +186,11 @@
void
sunpos(jd, apparent, ra, dec, rv, slong)
- double jd;
+ float jd;
int apparent;
- double *ra, *dec, *rv, *slong;
+ float *ra, *dec, *rv, *slong;
{
- double t, t2, t3, l, m, e, ea, v, theta, omega, eps;
+ float t, t2, t3, l, m, e, ea, v, theta, omega, eps;
/* Time, in Julian centuries of 36525 ephemeris days,
measured from the epoch 1900 January 0.5 ET. */
@@ -266,11 +266,11 @@
/* GMST -- Calculate Greenwich Mean Siderial Time for a given
instant expressed as a Julian date and fraction. */
-double
+float
gmst(jd)
- double jd;
+ float jd;
{
- double t, theta0;
+ float t, theta0;
/* Time, in Julian centuries of 36525 ephemeris days,
Modified: trunk/user/pixil/apps/nanox/wclock/city.h
===================================================================
--- trunk/user/pixil/apps/nanox/wclock/city.h 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/apps/nanox/wclock/city.h 2007-09-13 23:19:15 UTC (rev 1884)
@@ -41,8 +41,8 @@
typedef struct city_struct
{
char *name;
- double lat;
- double lon;
+ float lat;
+ float lon;
char *tz;
int visible;
struct city_struct *prev;
Modified: trunk/user/pixil/apps/nanox/wclock/main.c
===================================================================
--- trunk/user/pixil/apps/nanox/wclock/main.c 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/apps/nanox/wclock/main.c 2007-09-13 23:19:15 UTC (rev 1884)
@@ -84,22 +84,22 @@
/* External functions - mainly to do math */
/* See astro.c for all the fun and games */
-extern void sunpos(double jd, int apparent, double *ra,
- double *dec, double *rv, double *slong);
+extern void sunpos(float jd, int apparent, float *ra,
+ float *dec, float *rv, float *slong);
-extern double jtime(struct tm *t);
-extern double gmst(double jd);
+extern float jtime(struct tm *t);
+extern float gmst(float jd);
void write_settings(void);
/* Translate latitude and longitude to X and Y positions */
static void
-translate(double lat, double lon, int *xpos, int *ypos)
+translate(float lat, float lon, int *xpos, int *ypos)
{
- *xpos = (int) ((180.0 + lon) * ((double) WIDTH / 360.0));
+ *xpos = (int) ((180.0 + lon) * ((float) WIDTH / 360.0));
*ypos =
- (int) ((double) HEIGHT - (lat + 90.0) * ((double) HEIGHT / 180.0));
+ (int) ((float) HEIGHT - (lat + 90.0) * ((float) HEIGHT / 180.0));
}
/* Copy the map to to the screen */
@@ -122,18 +122,18 @@
city_t *city = 0;
city_t *best_city = 0;
- double best_len = 999.0;
+ float best_len = 999.0;
for (city = city_head; city; city = city->next) {
int xpos, ypos;
- double dist;
+ float dist;
/* Translate the lat/lon */
translate(city->lat, city->lon, &xpos, &ypos);
/* Figure out the distance from the click */
- dist = hypot((double) abs(ex - xpos), (double) (ey - ypos));
+ dist = hypot((float) abs(ex - xpos), (float) (ey - ypos));
if (dist < best_len) {
best_city = city;
@@ -352,17 +352,17 @@
GR_REGION_ID region = GrNewRegion();
GR_GC_ID gc;
- double daywave[WIDTH];
+ float daywave[WIDTH];
/* Math variables */
- double sunra, sundec, sunrv, sunlon;
- double quot, cd, sd, shiftp;
- double f2, f3, spos, jgmt;
+ float sunra, sundec, sunrv, sunlon;
+ float quot, cd, sd, shiftp;
+ float f2, f3, spos, jgmt;
int hemi, i;
time_t now;
struct tm *gmt;
- double julian;
+ float julian;
/* Get the current UTC time */
@@ -375,7 +375,7 @@
/* Get the position of the sun */
sunpos(julian, 0, &sunra, &sundec, &sunrv, &sunlon);
- jgmt = (double) gmst(julian);
+ jgmt = (float) gmst(julian);
sunlon = fixangle(180.0 + (sunra - (jgmt * 15)));
/* Convert the sun x position on the map */
@@ -393,15 +393,15 @@
sd = sin(quot);
/* This is the radius of the sun */
- quot = (2.0 * M_PI) / (double) width;
+ quot = (2.0 * M_PI) / (float) width;
shiftp = 0.5 * (height + 1);
- f2 = ((double) height) / M_PI;
+ f2 = ((float) height) / M_PI;
f3 = 1E-8 * f2;
for (i = 0; i < width; i++) {
- double val = (double) i;
+ float val = (float) i;
daywave[i] = cos(quot * (val - spos));
}
Modified: trunk/user/pixil/include/editvars.h
===================================================================
--- trunk/user/pixil/include/editvars.h 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/include/editvars.h 2007-09-13 23:19:15 UTC (rev 1884)
@@ -78,10 +78,10 @@
#endif /* */
#ifdef WIN32
-RCLDLL extern double PowersOfTen[];
+RCLDLL extern float PowersOfTen[];
#else /* */
-extern double PowersOfTen[];
+extern float PowersOfTen[];
#endif /* */
enum ErrorSeverity
@@ -122,23 +122,23 @@
#include <math.h>
#ifndef WIN32
#include <cmath>
-#ifndef modf
-//extern "C" double modf(double, double *);
+#ifndef modff
+//extern "C" float modff(float, float *);
#endif /* */
#endif /* */
-inline double
-Round(double num, short places)
+inline float
+Round(float num, short places)
{
- double intpart, fracpart;
- fracpart = modf(num * PowersOfTen[places], &intpart);
+ float intpart, fracpart;
+ fracpart = modff(num * PowersOfTen[places], &intpart);
if (fracpart >= 0.5)
intpart++;
return (intpart / PowersOfTen[places]);
}
inline bool
-IsZero(double num)
+IsZero(float num)
{
return ((num > -0.005) && (num < 0.005));
}
Modified: trunk/user/pixil/include/nxslider.h
===================================================================
--- trunk/user/pixil/include/nxslider.h 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/include/nxslider.h 2007-09-13 23:19:15 UTC (rev 1884)
@@ -68,12 +68,12 @@
void draw(int x, int y, int w, int h);
void draw();
- FL_EXPORT void bounds(double a, double b);
+ FL_EXPORT void bounds(float a, float b);
float slider_size() const
{
return slider_size_;
}
- FL_EXPORT void slider_size(double v);
+ FL_EXPORT void slider_size(float v);
Fl_Boxtype slider() const
{
return (Fl_Boxtype) slider_;
Modified: trunk/user/pixil/include/pixlib/pixlib.h
===================================================================
--- trunk/user/pixil/include/pixlib/pixlib.h 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/include/pixlib/pixlib.h 2007-09-13 23:19:15 UTC (rev 1884)
@@ -387,7 +387,7 @@
typedef struct
{
- double mtotal,
+ float mtotal,
mfree, mused, mshare, mbuffer, mcache, stotal, sused, sfree;
}
pixMemInfo_t;
Modified: trunk/user/pixil/libs/Makefile
===================================================================
--- trunk/user/pixil/libs/Makefile 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/Makefile 2007-09-13 23:19:15 UTC (rev 1884)
@@ -3,12 +3,12 @@
# Set the compiler targets for FLNX configure
-export CC=$(TARGET_CROSS)gcc
-export CXX=$(TARGET_CROSS)g++
-export AR=$(TARGET_CROSS)ar
-export NM=$(TARGET_CROSS)nm
-export RANLIB=$(TARGET_CROSS)ranlib
-export LD=$(TARGET_CROSS)ld
+#export CC=$(TARGET_CROSS)gcc
+#export CXX=$(TARGET_CROSS)g++
+#export AR=$(TARGET_CROSS)ar
+#export NM=$(TARGET_CROSS)nm
+#export RANLIB=$(TARGET_CROSS)ranlib
+#export LD=$(TARGET_CROSS)ld
# FLNX and FLEK are always built
@@ -51,7 +51,7 @@
clean: $(subdir-clean) $(local-clean)
install: $(subdir-install) $(local-install)
-$(subdir-build): dummy
+$(subdir-build): _build_flnx dummy
@ $(MAKE) -C $(patsubst _subdir_%,%,$@)
$(subdir-clean): dummy
Modified: trunk/user/pixil/libs/flek/Flek/FArcball_Control.H
===================================================================
--- trunk/user/pixil/libs/flek/Flek/FArcball_Control.H 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flek/Flek/FArcball_Control.H 2007-09-13 23:19:15 UTC (rev 1884)
@@ -70,7 +70,7 @@
* the user sweeps a rotation arc. The radius is relative to the
* window, where the value 1.0 would be the size of the window.
*/
- FArcball_Control (const FVector3& cen, double rad);
+ FArcball_Control (const FVector3& cen, float rad);
/**
* The destructor.
@@ -93,7 +93,7 @@
* the user sweeps a rotation arc. The radius is relative to the
* window, where the value 1.0 would be the size of the window.
*/
- void place (const FVector3& cen, double rad) {
+ void place (const FVector3& cen, float rad) {
vCenter = cen; dRadius = rad;
}
@@ -113,7 +113,7 @@
* @param y The y coordinate center for all subsequent rotation operations.
* @param z The z coordinate center for all subsequent rotation operations.
*/
- void center (double x, double y, double z) {
+ void center (float x, float y, float z) {
vCenter.set (x, y, z);
}
@@ -132,7 +132,7 @@
* @param x The new x coordinate of the mouse.
* @param y The new y coordinate of the mouse.
*/
- void mouse (double x, double y) {
+ void mouse (float x, float y) {
vNow.set (x, y, 0);
}
@@ -230,18 +230,18 @@
* @return The arcball radius relative to the size of the viewport.
* Where 1.0 equals a diameter equal to the size of the viewport.
*/
- double radius () const { return dRadius; }
+ float radius () const { return dRadius; }
/**
* Sets the arcball radius.
*
* @param The arcball radius. Good values are usually less than 1.0.
*/
- void radius (const double r) { dRadius = r; }
+ void radius (const float r) { dRadius = r; }
protected:
FVector3 vCenter;
- double dRadius;
+ float dRadius;
FQuaternion qNow, qDown, qDrag;
FVector3 vNow, vDown, vFrom, vTo;
@@ -252,7 +252,7 @@
private:
- static FVector3 mouseOnSphere (const FVector3& mouse, const FVector3& ballCenter, double ballRadius);
+ static FVector3 mouseOnSphere (const FVector3& mouse, const FVector3& ballCenter, float ballRadius);
static FVector3 constrainToAxis (const FVector3& loose, const FVector3& axis);
static int nearestConstraintAxis (const FVector3& loose, FVector3 * axes, int nAxes);
static FQuaternion quatFromBallPoints (const FVector3& from, const FVector3& to);
Modified: trunk/user/pixil/libs/flek/Flek/FDate.H
===================================================================
--- trunk/user/pixil/libs/flek/Flek/FDate.H 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flek/Flek/FDate.H 2007-09-13 23:19:15 UTC (rev 1884)
@@ -167,7 +167,7 @@
*
* @return The julian date value for this object.
*/
- double julian_date ();
+ float julian_date ();
/**
* Equality comparison of two dates.
Modified: trunk/user/pixil/libs/flek/Flek/FDolly_Control.H
===================================================================
--- trunk/user/pixil/libs/flek/Flek/FDolly_Control.H 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flek/Flek/FDolly_Control.H 2007-09-13 23:19:15 UTC (rev 1884)
@@ -44,20 +44,20 @@
bool Dragging;
// Mouse translations/points
- double vNow, vDown;
+ float vNow, vDown;
// Current dolly
- double dNow, dDown;
+ float dNow, dDown;
// For scaling given coordinate value
- double scale_factor;
+ float scale_factor;
public:
/**
* Default constructor
*/
- FDolly_Control (double sf=1.0)
+ FDolly_Control (float sf=1.0)
: mNow(), Dragging(false), vNow(0), vDown(0), dNow(0), dDown(0),
scale_factor(sf)
{}
@@ -87,7 +87,7 @@
dNow = 0.0; dDown = 0.0 ; mNow.reset();
}
- void set_scale(double sf) {
+ void set_scale(float sf) {
scale_factor = sf;
}
@@ -106,7 +106,7 @@
/**
* Specify mouse position.
*/
- void mouse (double z) {
+ void mouse (float z) {
vNow = scale_factor*z;
}
@@ -120,7 +120,7 @@
/**
* Get the dolly value.
*/
- double dolly_value (void) const {
+ float dolly_value (void) const {
return dNow;
}
Modified: trunk/user/pixil/libs/flek/Flek/FMatrix3x3.H
===================================================================
--- trunk/user/pixil/libs/flek/Flek/FMatrix3x3.H 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flek/Flek/FMatrix3x3.H 2007-09-13 23:19:15 UTC (rev 1884)
@@ -59,7 +59,7 @@
/**
* One argument constructor - from scalar, set all elements to given value.
*/
- FMatrix3x3 (double scalar)
+ FMatrix3x3 (float scalar)
: FBase ()
{
row[0] = scalar; row[1] = scalar; row[2] = scalar;
@@ -101,7 +101,7 @@
/**
* Assignment from a scalar
*/
- void operator = (double scalar)
+ void operator = (float scalar)
{
row[0] = scalar; row[1] = scalar; row[2] = scalar;
}
@@ -123,7 +123,7 @@
*
* @param scalar Value assigned to each element.
*/
- void set (double scalar)
+ void set (float scalar)
{
row[0] = scalar; row[1] = scalar; row[2] = scalar;
}
@@ -218,7 +218,7 @@
*
* @param scalar The scalar to multiply by.
*/
- void operator *= (double scalar)
+ void operator *= (float scalar)
{
for (int i=0; i < 3; ++i)
row[i] *= scalar;
@@ -229,7 +229,7 @@
*
* @param scalar The scalar to divide by.
*/
- void operator /= (double scalar)
+ void operator /= (float scalar)
{
for (int i=0; i < 3; ++i)
row[i] /= scalar;
@@ -263,9 +263,9 @@
* @param mat The source matrix.
* @return The detrminant of the source matrix.
*/
- friend double determinant(const FMatrix3x3& mat)
+ friend float determinant(const FMatrix3x3& mat)
{
- double det = 0.0;
+ float det = 0.0;
det = mat[0][0] * mat[1][1] * mat[2][2]
+ mat[0][1] * mat[1][2] * mat[2][0]
@@ -313,7 +313,7 @@
}
// Divide matrix by main diagonal element to make it 1.0
- double fact = row[i][i];
+ float fact = row[i][i];
for (j=0; j < 3; ++j)
{
row[j] /= fact;
@@ -325,7 +325,7 @@
{
if ( j != i )
{
- double temp = row[j][i];
+ float temp = row[j][i];
row[j] -= row[i]*temp;
inv[j] -= inv[i]*temp;
}
@@ -336,7 +336,7 @@
// Last row will be 1.0
for (i=0; i < 2; ++i)
{
- double pivot = row[i][i];
+ float pivot = row[i][i];
row[i] /= pivot;
inv[i] /= pivot;
}
@@ -390,7 +390,7 @@
/**
* Post-multiplication by a scalar.
*/
- friend FMatrix3x3 operator * (const FMatrix3x3& mat, double scalar)
+ friend FMatrix3x3 operator * (const FMatrix3x3& mat, float scalar)
{
FMatrix3x3 prod (mat);
prod *= scalar;
@@ -400,7 +400,7 @@
/**
* Pre-multiplication by a scalar.
*/
- friend FMatrix3x3 operator * (double scalar, const FMatrix3x3& mat)
+ friend FMatrix3x3 operator * (float scalar, const FMatrix3x3& mat)
{
FMatrix3x3 prod (mat);
prod *= scalar;
@@ -410,7 +410,7 @@
/**
* Division by a scalar.
*/
- friend FMatrix3x3 operator / (const FMatrix3x3& mat, double scalar)
+ friend FMatrix3x3 operator / (const FMatrix3x3& mat, float scalar)
{
FMatrix3x3 quot (mat);
quot /= scalar;
Modified: trunk/user/pixil/libs/flek/Flek/FMatrix4x4.H
===================================================================
--- trunk/user/pixil/libs/flek/Flek/FMatrix4x4.H 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flek/Flek/FMatrix4x4.H 2007-09-13 23:19:15 UTC (rev 1884)
@@ -61,7 +61,7 @@
/**
* 1 argument constructor - from scalar, set all elements to given value
*/
- FMatrix4x4 (double scalar)
+ FMatrix4x4 (float scalar)
: FBase ()
{
row[0] = scalar; row[1] = scalar; row[2] = scalar; row[3] = scalar;
@@ -121,7 +121,7 @@
/**
* Assignment from a scalar
*/
- void operator = (double scalar)
+ void operator = (float scalar)
{
row[0] = scalar; row[1] = scalar; row[2] = scalar; row[3] = scalar;
}
@@ -134,7 +134,7 @@
row[0] = r0; row[1] = r1; row[2] = r2; row[3] = r3;
}
- void set (double scalar)
+ void set (float scalar)
{
row[0] = scalar; row[1] = scalar; row[2] = scalar; row[3] = scalar;
}
@@ -207,13 +207,13 @@
row[i] -= mat.row[i];
}
- void operator *= (double scalar)
+ void operator *= (float scalar)
{
for (int i=0; i < 4; ++i)
row[i] *= scalar;
}
- void operator /= (double scalar)
+ void operator /= (float scalar)
{
for (int i=0; i < 4; ++i)
row[i] /= scalar;
@@ -266,9 +266,9 @@
return trans;
}
- friend double determinant(const FMatrix4x4& mat)
+ friend float determinant(const FMatrix4x4& mat)
{
- double det = 0.0;
+ float det = 0.0;
for (int i=0; i < 3; ++i)
det += mat[0][i] * cofsign (0, i) * determinant (mat.cofactor (0, i));
@@ -311,7 +311,7 @@
}
// Divide matrix by main diagonal element to make it 1.0
- double fact = row[i][i];
+ float fact = row[i][i];
for (j=0; j < 4; ++j)
{
row[j] /= fact;
@@ -323,7 +323,7 @@
{
if ( j != i )
{
- double temp = row[j][i];
+ float temp = row[j][i];
row[j] -= row[i]*temp;
inv[j] -= inv[i]*temp;
}
@@ -334,7 +334,7 @@
// Last row will be 1.0
for (i=0; i < 3; ++i)
{
- double pivot = row[i][i];
+ float pivot = row[i][i];
row[i] /= pivot;
inv[i] /= pivot;
}
@@ -383,7 +383,7 @@
/**
* Post-multiplication by a scalar.
*/
- friend FMatrix4x4 operator * (const FMatrix4x4& mat, double scalar)
+ friend FMatrix4x4 operator * (const FMatrix4x4& mat, float scalar)
{
FMatrix4x4 prod (mat);
prod *= scalar;
@@ -393,7 +393,7 @@
/**
* Pre-multiplication by a scalar.
*/
- friend FMatrix4x4 operator * (double scalar, const FMatrix4x4& mat)
+ friend FMatrix4x4 operator * (float scalar, const FMatrix4x4& mat)
{
FMatrix4x4 prod (mat);
prod *= scalar;
@@ -403,7 +403,7 @@
/**
* Division by a scalar.
*/
- friend FMatrix4x4 operator / (const FMatrix4x4& mat, double scalar)
+ friend FMatrix4x4 operator / (const FMatrix4x4& mat, float scalar)
{
FMatrix4x4 quot (mat);
quot /= scalar;
@@ -486,7 +486,7 @@
* Fill an array with contents of the matrix
* Row - major form -> Row 1 == { array[0], array[1], array[2], array[3] }
*/
- void fill_array_row_major (double array[16]) const
+ void fill_array_row_major (float array[16]) const
{
int index=0;
for (int i=0; i < 4; ++i)
@@ -503,7 +503,7 @@
* Fill an array with contents of the matrix
* Row - major form -> Column 1 == { array[0], array[1], array[2], array[3] }
*/
- void fill_array_column_major (double array[16]) const
+ void fill_array_column_major (float array[16]) const
{
int index=0;
for (int i=0; i < 4; ++i)
Modified: trunk/user/pixil/libs/flek/Flek/FQuaternion.H
===================================================================
--- trunk/user/pixil/libs/flek/Flek/FQuaternion.H 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flek/Flek/FQuaternion.H 2007-09-13 23:19:15 UTC (rev 1884)
@@ -57,21 +57,21 @@
/**
* Constructor from a vector and a scalar
*/
- FQuaternion (const FVector3& vec, double scalar)
+ FQuaternion (const FVector3& vec, float scalar)
: FBase (), v (vec), w (scalar)
{}
/**
* Same as above, but with reverse order
*/
- FQuaternion (double scalar, const FVector3& vec)
+ FQuaternion (float scalar, const FVector3& vec)
: FBase (), v (vec), w (scalar)
{}
/**
* Construct from 3/4 individual values. Scalar is set to 0 by default
*/
- FQuaternion (double x, double y, double z, double scalar=0.0)
+ FQuaternion (float x, float y, float z, float scalar=0.0)
: FBase (), v (x, y, z), w (scalar)
{}
@@ -110,7 +110,7 @@
/**
* Set the vector and scalar parts of the quaternion
*/
- void set (const FVector3& vec, double scalar=0.0)
+ void set (const FVector3& vec, float scalar=0.0)
{
v = vec; w = scalar;
}
@@ -118,7 +118,7 @@
/**
* Set the vector and scalar parts of the quaternion
*/
- void set (double x, double y, double z, double scalar=0.0)
+ void set (float x, float y, float z, float scalar=0.0)
{
v.set (x, y, z); w = scalar;
}
@@ -144,13 +144,13 @@
* Access the elements of the quaternion. Indices start at 0 and the
* scalar is at index=3
*/
- double& operator [] (uint index)
+ float& operator [] (uint index)
{
if ( index == 3 ) return w;
return v[index];
}
- double operator [] (uint index) const
+ float operator [] (uint index) const
{
if ( index == 3 ) return w;
return v[index];
@@ -191,7 +191,7 @@
void operator *= (const FQuaternion& quat)
{
FVector3 vec;
- double s;
+ float s;
s = w*quat.w - v*quat.v;
vec = quat.v*w + v*quat.w + (v % quat.v);
@@ -206,13 +206,13 @@
this->operator *= (v2q);
}
- void operator *= (double scalar)
+ void operator *= (float scalar)
{
w *= scalar;
v *= scalar;
}
- void operator /= (double scalar)
+ void operator /= (float scalar)
{
w /= scalar;
v /= scalar;
@@ -221,16 +221,16 @@
/**
* Square of the length of a quaternion
*/
- friend double lengthsqr(const FQuaternion& quat)
+ friend float lengthsqr(const FQuaternion& quat)
{
- double lensqr = quat.v*quat.v + quat.w*quat.w;
+ float lensqr = quat.v*quat.v + quat.w*quat.w;
return lensqr;
}
/**
* Length of a quaternion
*/
- friend double length(const FQuaternion& quat)
+ friend float length(const FQuaternion& quat)
{
return sqrt(lengthsqr(quat));
}
@@ -238,12 +238,12 @@
/**
* For consistency define norm and normsqr also
*/
- friend double normsqr(const FQuaternion& quat)
+ friend float normsqr(const FQuaternion& quat)
{
return lengthsqr(quat);
}
- friend double norm(const FQuaternion& quat)
+ friend float norm(const FQuaternion& quat)
{
return length(quat);
}
@@ -261,9 +261,9 @@
* Returns the original length of the quaternion
* If length is 0, nothing is changed
*/
- friend double normalize(FQuaternion& quat)
+ friend float normalize(FQuaternion& quat)
{
- double len = length(quat);
+ float len = length(quat);
if ( is_non_zero(len) == true )
quat /= len;
return len;
@@ -302,7 +302,7 @@
/**
* Post-multiplication by a scalar
*/
- friend FQuaternion operator * (const FQuaternion& q, double scalar)
+ friend FQuaternion operator * (const FQuaternion& q, float scalar)
{
FQuaternion prod = q;
prod *= scalar;
@@ -312,7 +312,7 @@
/**
* Pre-multiplication by a scalara
*/
- friend FQuaternion operator * (double scalar, const FQuaternion& q)
+ friend FQuaternion operator * (float scalar, const FQuaternion& q)
{
FQuaternion prod = q;
prod *= scalar;
@@ -322,7 +322,7 @@
/**
* Division by a scalar
*/
- friend FQuaternion operator / (const FQuaternion& q, double scalar)
+ friend FQuaternion operator / (const FQuaternion& q, float scalar)
{
FQuaternion quot = q;
quot /= scalar;
@@ -367,7 +367,7 @@
FMatrix3x3 to_matrix(void) const
{
FMatrix3x3 mat;
- double x,y,z,s;
+ float x,y,z,s;
v.get(x,y,z); s = w;
@@ -385,7 +385,7 @@
return mat4;
}
- void to_matrix(double array[16]) const
+ void to_matrix(float array[16]) const
{
// Similar to toMatrix4, but fills a given array of 16 elements with the
// rotation matrix corresponding to this quaternion in column major form
@@ -409,7 +409,7 @@
/**
* Get the angle of rotation. Returns value between 0 and PI
*/
- double get_angle(void) const
+ float get_angle(void) const
{
return 2.0 * acos(w);
}
@@ -418,7 +418,7 @@
* Get the angle of rotation. Returns value between 0 and PI
* Computes angle after normalizing the quaternion
*/
- friend double get_angle(const FQuaternion& quat)
+ friend float get_angle(const FQuaternion& quat)
{
// Make the quaternion a unit quaternion first
FQuaternion nq = normalized(quat);
@@ -441,7 +441,7 @@
/**
* Get the axis and angle.
*/
- void get_axis_and_angle(FVector3& axis, double& theta) const
+ void get_axis_and_angle(FVector3& axis, float& theta) const
{
FQuaternion nq = normalized(*this);
@@ -452,7 +452,7 @@
/**
* Set the axis and angle.
*/
- void set_axis_and_angle(const FVector3& axis, double theta)
+ void set_axis_and_angle(const FVector3& axis, float theta)
{
w = cos(theta/2.0);
v = normalized(axis);
@@ -462,7 +462,7 @@
/**
* Change the angle to a new value. Use same axis as before
*/
- void set_angle(double theta)
+ void set_angle(float theta)
{
w = cos(theta/2.0);
normalize(v);
@@ -472,7 +472,7 @@
/**
* Scale the angle by the given scale factor
*/
- void scale_angle(double scale_factor)
+ void scale_angle(float scale_factor)
{
set_angle(get_angle()*scale_factor);
}
@@ -506,7 +506,7 @@
/**
* Scalar component
*/
- double w;
+ float w;
};
Modified: trunk/user/pixil/libs/flek/Flek/FTrans_Control.H
===================================================================
--- trunk/user/pixil/libs/flek/Flek/FTrans_Control.H 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flek/Flek/FTrans_Control.H 2007-09-13 23:19:15 UTC (rev 1884)
@@ -91,7 +91,7 @@
/**
* Specify mouse position.
*/
- void mouse (double x, double y, double z=0.0) {
+ void mouse (float x, float y, float z=0.0) {
vNow.set(x,y,z);
}
Modified: trunk/user/pixil/libs/flek/Flek/FTransformation.H
===================================================================
--- trunk/user/pixil/libs/flek/Flek/FTransformation.H 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flek/Flek/FTransformation.H 2007-09-13 23:19:15 UTC (rev 1884)
@@ -88,7 +88,7 @@
/**
* Static function to compute translation matrix from x, y, z values.
*/
- static FMatrix4x4 translation (double tx, double ty, double tz) {
+ static FMatrix4x4 translation (float tx, float ty, float tz) {
FMatrix4x4 transmat;
transmat[0][3] = tx;
transmat[1][3] = ty;
@@ -99,9 +99,9 @@
/**
* Static function to compute rotation matrix about the x axis.
*/
- static FMatrix4x4 rotation_x (double angle) {
+ static FMatrix4x4 rotation_x (float angle) {
FMatrix4x4 rotmat;
- double ct = cos(angle), st = sin(angle);
+ float ct = cos(angle), st = sin(angle);
rotmat[0].set( 1, 0, 0, 0);
rotmat[1].set( 0, ct, st, 0);
rotmat[2].set( 0,-st, ct, 0);
@@ -112,9 +112,9 @@
/**
* Static function to compute rotation matrix about the y axis.
*/
- static FMatrix4x4 rotation_y (double angle) {
+ static FMatrix4x4 rotation_y (float angle) {
FMatrix4x4 rotmat;
- double ct = cos(angle), st = sin(angle);
+ float ct = cos(angle), st = sin(angle);
rotmat[0].set(ct, 0,-st, 0);
rotmat[1].set( 0, 1, 0, 0);
rotmat[2].set(st, 0, ct, 0);
@@ -125,9 +125,9 @@
/**
* Static function to compute rotation matrix about the z axis.
*/
- static FMatrix4x4 rotation_z (double angle) {
+ static FMatrix4x4 rotation_z (float angle) {
FMatrix4x4 rotmat;
- double ct = cos(angle), st = sin(angle);
+ float ct = cos(angle), st = sin(angle);
rotmat[0].set( ct, st, 0, 0);
rotmat[1].set(-st, ct, 0, 0);
rotmat[2].set( 0, 0, 1, 0);
@@ -149,7 +149,7 @@
/**
* Static function to compute scale matrix from x, y, z values.
*/
- static FMatrix4x4 scaling (double sx, double sy, double sz) {
+ static FMatrix4x4 scaling (float sx, float sy, float sz) {
FMatrix4x4 scmat;
scmat[0][0] = sx;
scmat[1][1] = sy;
@@ -221,19 +221,19 @@
transform = FTransformation :: translation(t) * transform;
}
- void translate (double tx, double ty, double tz) {
+ void translate (float tx, float ty, float tz) {
transform = FTransformation::translation (tx,ty,tz) * transform;
}
- void rotate_x (double angle) {
+ void rotate_x (float angle) {
transform = FTransformation::rotation_x (angle) * transform;
}
- void rotate_y (double angle) {
+ void rotate_y (float angle) {
transform = FTransformation::rotation_y (angle) * transform;
}
- void rotate_z (double angle) {
+ void rotate_z (float angle) {
transform = FTransformation::rotation_z (angle) * transform;
}
@@ -248,7 +248,7 @@
transform = FTransformation :: scaling(s) * transform;
}
- void scale (double sx, double sy, double sz) {
+ void scale (float sx, float sy, float sz) {
transform = FTransformation :: scaling(sx,sy,sz) * transform;
}
@@ -259,19 +259,19 @@
transform *= FTransformation :: translation(t);
}
- void post_translate (double tx, double ty, double tz) {
+ void post_translate (float tx, float ty, float tz) {
transform *= FTransformation :: translation(tx,ty,tz);
}
- void post_rotateX (double angle) {
+ void post_rotateX (float angle) {
transform *= FTransformation :: rotation_x(angle);
}
- void post_rotateY (double angle) {
+ void post_rotateY (float angle) {
transform *= FTransformation :: rotation_y(angle);
}
- void post_rotateZ (double angle) {
+ void post_rotateZ (float angle) {
transform *= FTransformation :: rotation_z(angle);
}
@@ -286,7 +286,7 @@
transform *= FTransformation :: scaling(s);
}
- void post_scale (double sx, double sy, double sz) {
+ void post_scale (float sx, float sy, float sz) {
transform *= FTransformation :: scaling(sx,sy,sz);
}
@@ -294,7 +294,7 @@
* Apply the FTransformation in OpenGL. Calls only glMultMatrix.
*/
void apply (void) const {
- double mat[16];
+ float mat[16];
transform.fill_array_column_major(mat);
glMultMatrixd(mat);
}
Modified: trunk/user/pixil/libs/flek/Flek/FVector2.H
===================================================================
--- trunk/user/pixil/libs/flek/Flek/FVector2.H 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flek/Flek/FVector2.H 2007-09-13 23:19:15 UTC (rev 1884)
@@ -33,7 +33,7 @@
/** @package libflek_core
* fVector2 is a 2 dimensional vector represented internally as an array of
- * doubles. This class is related to fVector3 and fVector4 which are
+ * floats. This class is related to fVector3 and fVector4 which are
* 3-D and 4-D versions of this class. All fVector classes are forward
* declared in fVector.h.
*/
@@ -58,7 +58,7 @@
* This one argument constructor intializes all elements in the vector
* with the given value.
*/
- FVector2 (double val)
+ FVector2 (float val)
: FBase ()
{
elem[0] = elem[1] = val;
@@ -68,7 +68,7 @@
* This one argument constructor initializes the vector with the first
* three elements in the given array.
*/
- FVector2 (double * arr)
+ FVector2 (float * arr)
: FBase ()
{
elem[0] = arr[0]; elem[1] = arr[1];
@@ -78,7 +78,7 @@
* This two argument constructor initializes the vector with the
* passed values.
*/
- FVector2 (double val1, double val2)
+ FVector2 (float val1, float val2)
: FBase ()
{
elem[0] = val1; elem[1] = val2;
@@ -133,7 +133,7 @@
* Assignment operator from a scalar. All elements are set to
* the scalar value.
*/
- FVector2& operator = (double scalar)
+ FVector2& operator = (float scalar)
{
elem[0] = elem[1] = scalar;
return (*this);
@@ -169,7 +169,7 @@
/**
* Set each element vector to the given values.
*/
- void set (double v1, double v2)
+ void set (float v1, float v2)
{
elem[0] = v1; elem[1] = v2;
}
@@ -177,7 +177,7 @@
/**
* Set each element vector to the given value.
*/
- void set (double val)
+ void set (float val)
{
elem[0] = elem[1] = val;
}
@@ -193,7 +193,7 @@
/**
* Get the elements of vector into given values.
*/
- void get (double& v1, double& v2) const
+ void get (float& v1, float& v2) const
{
v1 = elem[0]; v2 = elem[1];
}
@@ -201,7 +201,7 @@
/**
* Fill an array with the elements of the vector.
*/
- void fill_array (double arr[2]) const
+ void fill_array (float arr[2]) const
{
arr[0] = elem[0]; arr[1] = elem[1];
}
@@ -210,7 +210,7 @@
* Element access operator. For efficiency, this doesn't check for
* valid indices
*/
- double& operator [] (uint index)
+ float& operator [] (uint index)
{
return elem[index];
}
@@ -219,7 +219,7 @@
* Element access operator. For efficiency, this doesn't check for
* valid indices
*/
- double operator [] (uint index) const
+ float operator [] (uint index) const
{
return elem[index];
}
@@ -243,7 +243,7 @@
/**
* Arithmetic operator for multiplicative (scalar) assignment.
*/
- void operator *= (double scalar)
+ void operator *= (float scalar)
{
elem[0] *= scalar; elem[1] *= scalar;
}
@@ -251,7 +251,7 @@
/**
* Arithmetic operator for divisive (scalar) assignment.
*/
- void operator /= (double scalar)
+ void operator /= (float scalar)
{
elem[0] /= scalar; elem[1] /= scalar;
}
@@ -279,9 +279,9 @@
/**
* Operator for scalar multiplication (dot product).
*/
- double operator * (const FVector2& vec) const
+ float operator * (const FVector2& vec) const
{
- double dotprod = elem[0]*vec.elem[0] + elem[1]*vec.elem[1];
+ float dotprod = elem[0]*vec.elem[0] + elem[1]*vec.elem[1];
return dotprod;
}
@@ -297,7 +297,7 @@
/**
* Friend operator for scalar pre-multiplication.
*/
- friend FVector2 operator * (double scalar, const FVector2& vec)
+ friend FVector2 operator * (float scalar, const FVector2& vec)
{
FVector2 prod (vec);
@@ -308,7 +308,7 @@
/**
* Friend operator for scalar post-multiplication.
*/
- friend FVector2 operator * (const FVector2& vec, double scalar)
+ friend FVector2 operator * (const FVector2& vec, float scalar)
{
FVector2 prod (vec);
@@ -319,7 +319,7 @@
/**
* Friend operator for scalar division.
*/
- friend FVector2 operator / (const FVector2& vec, double scalar)
+ friend FVector2 operator / (const FVector2& vec, float scalar)
{
FVector2 prod (vec);
@@ -359,16 +359,16 @@
/**
* Square of the norm of the vector.
*/
- friend double normsqr(const FVector2& vec)
+ friend float normsqr(const FVector2& vec)
{
- double nsq = sqr (vec.elem[0]) + sqr (vec.elem[1]);
+ float nsq = sqr (vec.elem[0]) + sqr (vec.elem[1]);
return nsq;
}
/**
* Norm of the vector.
*/
- friend double norm (const FVector2& vec)
+ friend float norm (const FVector2& vec)
{
return sqrt (normsqr (vec));
}
@@ -376,7 +376,7 @@
/**
* Length (norm) of the vector.
*/
- double length ()
+ float length ()
{
return norm (*this);
}
@@ -384,9 +384,9 @@
/**
* Normalize. Returns previous norm.
*/
- friend double normalize (FVector2& vec)
+ friend float normalize (FVector2& vec)
{
- double n = norm (vec);
+ float n = norm (vec);
if ( is_non_zero (n) == true ) vec /= n;
return n;
}
@@ -420,7 +420,7 @@
{
// Correct format
int numread = 0; // No. of elements read
- double val;
+ float val;
char c;
i >> c; // Read opening square bracket
@@ -475,7 +475,7 @@
protected:
- double elem[2];
+ float elem[2];
/**
* Initialize the elements from a FVector3,
Modified: trunk/user/pixil/libs/flek/Flek/FVector3.H
===================================================================
--- trunk/user/pixil/libs/flek/Flek/FVector3.H 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flek/Flek/FVector3.H 2007-09-13 23:19:15 UTC (rev 1884)
@@ -33,7 +33,7 @@
/** @package libflek_core
* FVector3 is a 3 dimensional vector represented internally as an array of
- * doubles. This class is related to FVector2 and FVector4 which are
+ * floats. This class is related to FVector2 and FVector4 which are
* 2-D and 4-D versions of this class. All FVector classes are forward
* declared in FVector.h.
*/
@@ -57,7 +57,7 @@
* This one argument constructor intializes all elements in the vector
* with the given value.
*/
- FVector3 (double val)
+ FVector3 (float val)
: FBase ()
{
elem[0] = elem[1] = elem[2] = val;
@@ -67,7 +67,7 @@
* This one argument constructor initializes the vector with the first
* three elements in the given array.
*/
- FVector3 (double * arr)
+ FVector3 (float * arr)
: FBase ()
{
elem[0] = arr[0]; elem[1] = arr[1]; elem[2] = arr[2];
@@ -77,7 +77,7 @@
* This three argument constructor initializes the vector with the
* passed values.
*/
- FVector3 (double val1, double val2, double val3=0.0)
+ FVector3 (float val1, float val2, float val3=0.0)
: FBase ()
{
elem[0] = val1; elem[1] = val2; elem[2] = val3;
@@ -132,7 +132,7 @@
* Assignment operator from a scalar. All elements are set to
* the scalar value.
*/
- FVector3& operator = (double scalar)
+ FVector3& operator = (float scalar)
{
elem[0] = elem[1] = elem[2] = scalar;
return (*this);
@@ -168,7 +168,7 @@
/**
* Set each element vector to the given values.
*/
- void set (double v1, double v2, double v3)
+ void set (float v1, float v2, float v3)
{
elem[0] = v1; elem[1] = v2; elem[2] = v3;
}
@@ -176,7 +176,7 @@
/**
* Set each element vector to the given value.
*/
- void set (double val)
+ void set (float val)
{
elem[0] = elem[1] = elem[2] = val;
}
@@ -192,7 +192,7 @@
/**
* Get the elements of vector into given values.
*/
- void get (double& v1, double& v2, double& v3) const
+ void get (float& v1, float& v2, float& v3) const
{
v1 = elem[0]; v2 = elem[1]; v3 = elem[2];
}
@@ -200,7 +200,7 @@
/**
* Fill an array with the elements of the vector.
*/
- void fill_array (double arr[3]) const
+ void fill_array (float arr[3]) const
{
arr[0] = elem[0]; arr[1] = elem[1]; arr[2] = elem[2];
}
@@ -209,7 +209,7 @@
* Element access operator. For efficiency, this doesn't check for
* valid indices
*/
- double& operator [] (uint index)
+ float& operator [] (uint index)
{
return elem[index];
}
@@ -218,7 +218,7 @@
* Element access operator. For efficiency, this doesn't check for
* valid indices
*/
- double operator [] (uint index) const
+ float operator [] (uint index) const
{
return elem[index];
}
@@ -242,7 +242,7 @@
/**
* Arithmetic operator for multiplicative (scalar) assignment.
*/
- void operator *= (double scalar)
+ void operator *= (float scalar)
{
elem[0] *= scalar; elem[1] *= scalar; elem[2] *= scalar;
}
@@ -250,7 +250,7 @@
/**
* Arithmetic operator for divisive (scalar) assignment.
*/
- void operator /= (double scalar)
+ void operator /= (float scalar)
{
elem[0] /= scalar; elem[1] /= scalar; elem[2] /= scalar;
}
@@ -278,9 +278,9 @@
/**
* Operator for scalar multiplication (dot product).
*/
- double operator * (const FVector3& vec) const
+ float operator * (const FVector3& vec) const
{
- double dotprod = elem[0]*vec.elem[0] + elem[1]*vec.elem[1] + elem[2]*vec.elem[2];
+ float dotprod = elem[0]*vec.elem[0] + elem[1]*vec.elem[1] + elem[2]*vec.elem[2];
return dotprod;
}
@@ -310,7 +310,7 @@
/**
* Friend operator for scalar pre-multiplication.
*/
- friend FVector3 operator * (double scalar, const FVector3& vec)
+ friend FVector3 operator * (float scalar, const FVector3& vec)
{
FVector3 prod (vec);
@@ -321,7 +321,7 @@
/**
* Friend operator for scalar post-multiplication.
*/
- friend FVector3 operator * (const FVector3& vec, double scalar)
+ friend FVector3 operator * (const FVector3& vec, float scalar)
{
FVector3 prod (vec);
@@ -332,7 +332,7 @@
/**
* Friend operator for scalar division.
*/
- friend FVector3 operator / (const FVector3& vec, double scalar)
+ friend FVector3 operator / (const FVector3& vec, float scalar)
{
FVector3 prod (vec);
@@ -375,16 +375,16 @@
/**
* Square of the norm of the vector.
*/
- friend double normsqr (const FVector3& vec)
+ friend float normsqr (const FVector3& vec)
{
- double nsq = sqr (vec.elem[0]) + sqr (vec.elem[1]) + sqr (vec.elem[2]);
+ float nsq = sqr (vec.elem[0]) + sqr (vec.elem[1]) + sqr (vec.elem[2]);
return nsq;
}
/**
* Norm of the vector.
*/
- friend double norm (const FVector3& vec)
+ friend float norm (const FVector3& vec)
{
return sqrt (normsqr (vec));
}
@@ -392,7 +392,7 @@
/**
* Length (norm) of the vector.
*/
- double length ()
+ float length ()
{
return norm (*this);
}
@@ -400,9 +400,9 @@
/**
* Normalize. Returns previous norm.
*/
- friend double normalize (FVector3& vec)
+ friend float normalize (FVector3& vec)
{
- double n = norm (vec);
+ float n = norm (vec);
if (is_non_zero (n) == true) vec /= n;
return n;
}
@@ -417,7 +417,7 @@
return nvec;
}
- friend double distance (const FVector3& v1, const FVector3& v2)
+ friend float distance (const FVector3& v1, const FVector3& v2)
{
FVector3 t;
t = v1 - v2;
@@ -444,7 +444,7 @@
{
// Correct format
int numread = 0; // No. of elements read
- double val;
+ float val;
char c;
i >> c; // Read opening square bracket
@@ -500,7 +500,7 @@
protected:
- double elem[3];
+ float elem[3];
/**
* Initialize the elements from a FVector2,
Modified: trunk/user/pixil/libs/flek/Flek/FVector4.H
===================================================================
--- trunk/user/pixil/libs/flek/Flek/FVector4.H 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flek/Flek/FVector4.H 2007-09-13 23:19:15 UTC (rev 1884)
@@ -33,7 +33,7 @@
/** @package libflek_core
* FVector4 is a 4 dimensional vector represented internally as an array of
- * doubles. This class is related to FVector2 and FVector3 which are
+ * floats. This class is related to FVector2 and FVector3 which are
* 2-D and 3-D versions of this class. All FVector classes are forward
* declared in FVector.h.
*/
@@ -57,7 +57,7 @@
* This one argument constructor intializes all elements in the vector
* with the given value.
*/
- FVector4 (double val)
+ FVector4 (float val)
: FBase ()
{
elem[0] = elem[1] = elem[2] = elem[3] = val;
@@ -67,7 +67,7 @@
* This one argument constructor initializes the vector with the first
* three elements in the given array.
*/
- FVector4 (double * arr)
+ FVector4 (float * arr)
: FBase ()
{
elem[0] = arr[0]; elem[1] = arr[1]; elem[2] = arr[2]; elem[3] = arr[3];
@@ -77,7 +77,7 @@
* This four argument constructor initializes the vector with the
* passed values.
*/
- FVector4 (double val1, double val2, double val3, double val4)
+ FVector4 (float val1, float val2, float val3, float val4)
: FBase ()
{
elem[0] = val1; elem[1] = val2; elem[2] = val3; elem[3] = val4;
@@ -134,7 +134,7 @@
* Assignment operator from a scalar. All elements are set to
* the scalar value.
*/
- FVector4& operator = (double scalar)
+ FVector4& operator = (float scalar)
{
elem[0] = elem[1] = elem[2] = elem[3] = scalar;
return (*this);
@@ -171,7 +171,7 @@
/**
* Set each element vector to the given values.
*/
- void set (double v1, double v2, double v3, double v4)
+ void set (float v1, float v2, float v3, float v4)
{
elem[0] = v1; elem[1] = v2; elem[2] = v3; elem[3] = v4;
}
@@ -179,7 +179,7 @@
/**
* Set each element vector to the given value.
*/
- void set (double val)
+ void set (float val)
{
elem[0] = elem[1] = elem[2] = elem[3] = val;
}
@@ -195,7 +195,7 @@
/**
* Get the elements of vector into given values.
*/
- void get (double& v1, double& v2, double& v3, double& v4) const
+ void get (float& v1, float& v2, float& v3, float& v4) const
{
v1 = elem[0]; v2 = elem[1]; v3 = elem[2]; v4 = elem[3];
}
@@ -203,7 +203,7 @@
/**
* Fill an array with the elements of the vector.
*/
- void fill_array (double arr[4]) const
+ void fill_array (float arr[4]) const
{
arr[0] = elem[0]; arr[1] = elem[1]; arr[2] = elem[2]; arr[3] = elem[3];
}
@@ -212,7 +212,7 @@
* Element access operator. For efficiency, this doesn't check for
* valid indices
*/
- double& operator [] (uint index)
+ float& operator [] (uint index)
{
return elem[index];
}
@@ -221,7 +221,7 @@
* Element access operator. For efficiency, this doesn't check for
* valid indices
*/
- double operator [] (uint index) const
+ float operator [] (uint index) const
{
return elem[index];
}
@@ -247,7 +247,7 @@
/**
* Arithmetic operator for multiplicative (scalar) assignment.
*/
- void operator *= (double scalar)
+ void operator *= (float scalar)
{
elem[0] *= scalar; elem[1] *= scalar; elem[2] *= scalar; elem[3] *= scalar;
}
@@ -255,7 +255,7 @@
/**
* Arithmetic operator for divisive (scalar) assignment.
*/
- void operator /= (double scalar)
+ void operator /= (float scalar)
{
elem[0] /= scalar; elem[1] /= scalar; elem[2] /= scalar; elem[3] /= scalar;
}
@@ -283,9 +283,9 @@
/**
* Operator for scalar multiplication (dot product).
*/
- double operator * (const FVector4& vec) const
+ float operator * (const FVector4& vec) const
{
- double dotprod = elem[0]*vec.elem[0] + elem[1]*vec.elem[1]
+ float dotprod = elem[0]*vec.elem[0] + elem[1]*vec.elem[1]
+ elem[2]*vec.elem[2] + elem[3]*vec.elem[3];
return dotprod;
}
@@ -302,7 +302,7 @@
/**
* Friend operator for scalar pre-multiplication.
*/
- friend FVector4 operator * (double scalar, const FVector4& vec)
+ friend FVector4 operator * (float scalar, const FVector4& vec)
{
FVector4 prod (vec);
@@ -313,7 +313,7 @@
/**
* Friend operator for scalar post-multiplication.
*/
- friend FVector4 operator * (const FVector4& vec, double scalar)
+ friend FVector4 operator * (const FVector4& vec, float scalar)
{
FVector4 prod (vec);
@@ -324,7 +324,7 @@
/**
* Friend operator for scalar division.
*/
- friend FVector4 operator / (const FVector4& vec, double scalar)
+ friend FVector4 operator / (const FVector4& vec, float scalar)
{
FVector4 prod (vec);
@@ -368,16 +368,16 @@
/**
* Square of the norm of the vector.
*/
- friend double normsqr (const FVector4& vec)
+ friend float normsqr (const FVector4& vec)
{
- double nsq = sqr (vec.elem[0]) + sqr (vec.elem[1]) + sqr (vec.elem[2]) + sqr (vec.elem[3]);
+ float nsq = sqr (vec.elem[0]) + sqr (vec.elem[1]) + sqr (vec.elem[2]) + sqr (vec.elem[3]);
return nsq;
}
/**
* Norm of the vector.
*/
- friend double norm (const FVector4& vec)
+ friend float norm (const FVector4& vec)
{
return sqrt (normsqr (vec));
}
@@ -385,7 +385,7 @@
/**
* Length (norm) of the vector.
*/
- double length ()
+ float length ()
{
return norm (*this);
}
@@ -393,9 +393,9 @@
/**
* Normalize. Returns previous norm.
*/
- friend double normalize(FVector4& vec)
+ friend float normalize(FVector4& vec)
{
- double n = norm(vec);
+ float n = norm(vec);
if ( is_non_zero (n) == true ) vec /= n;
return n;
}
@@ -431,7 +431,7 @@
{
// Correct format
int numread = 0; // No. of elements read
- double val;
+ float val;
char c;
i >> c; // Read opening square bracket
@@ -488,7 +488,7 @@
protected:
- double elem[4];
+ float elem[4];
/**
* Initialize the elements from a FVector2,
Modified: trunk/user/pixil/libs/flek/Flek/FZoom_Control.H
===================================================================
--- trunk/user/pixil/libs/flek/Flek/FZoom_Control.H 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flek/Flek/FZoom_Control.H 2007-09-13 23:19:15 UTC (rev 1884)
@@ -47,7 +47,7 @@
bool Dragging;
// Mouse x coordinate
- double vNowx, vDownx;
+ float vNowx, vDownx;
FVector3 zNow, zDown;
@@ -99,7 +99,7 @@
/**
* Specify mouse position.
*/
- void mouse (double x, double y=0.0, double z=0.0) {
+ void mouse (float x, float y=0.0, float z=0.0) {
vNowx = x;
}
@@ -151,8 +151,8 @@
// For a mouse movement of 1.0, scale changes by a factor of 2
// Note: This is in the transformed mouse coordinates (-1 to 1)
// Also only the x mouse coordinate is used
- double diff = vNowx - vDownx;
- double fact = 1 + absolute (diff);
+ float diff = vNowx - vDownx;
+ float fact = 1 + absolute (diff);
if ( diff < 0.0 ) zNow /= fact;
else zNow *= fact;
Modified: trunk/user/pixil/libs/flek/Flek/Fl_Gl_Arcball_Window.H
===================================================================
--- trunk/user/pixil/libs/flek/Flek/Fl_Gl_Arcball_Window.H 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flek/Flek/Fl_Gl_Arcball_Window.H 2007-09-13 23:19:15 UTC (rev 1884)
@@ -67,18 +67,18 @@
ProjectionType projtype; // Ortho/Perspective projection
// For perspective projection
- double fovy; // Field-of-view in degrees in y
- double aspect; // Ratio of width to height
- double near; // Near clipping plane
- double far; // Far clipping plane
+ float fovy; // Field-of-view in degrees in y
+ float aspect; // Ratio of width to height
+ float near; // Near clipping plane
+ float far; // Far clipping plane
// For orthographic projection
- double umin,umax,vmin,vmax; // Viewing frustum
+ float umin,umax,vmin,vmax; // Viewing frustum
- double cenx, ceny, cenz; // Center point for gluLookAt
- double eyex, eyey, eyez; // Eye point for gluLookAt
- double upx, upy, upz; // Up vector for gluLookAt
- double dist; // Dist from eye pt to center pt
+ float cenx, ceny, cenz; // Center point for gluLookAt
+ float eyex, eyey, eyez; // Eye point for gluLookAt
+ float upx, upy, upz; // Up vector for gluLookAt
+ float dist; // Dist from eye pt to center pt
FVector3 near_color_;
FVector3 far_color_;
@@ -91,7 +91,7 @@
: Fl_Gl_Window(x,y,w,h,l),
arcball(FVector3(0,0,0),1.0), trcontrol(), zoomcontrol(), dollycontrol(10.0),
transform(), currenttr(None),
- fovy(45.0), aspect(double(w)/double(h)), near(1.0), far(1000.0),
+ fovy(45.0), aspect(float(w)/float(h)), near(1.0), far(1000.0),
umin(-1.0), umax(1.0), vmin(-1.0), vmax(1.0),
cenx(0), ceny(0), cenz(0), eyex(0), eyey(0), eyez(50.0), upx(0), upy(1), upz(0)
{}
@@ -132,13 +132,13 @@
// Don't do anything if we aren't in a neutral state or aren't rotating
if ( currenttr != None && currenttr != Rotate ) return;
- double x,y;
+ float x,y;
currenttr = Rotate;
// Transform coords to lie between -1 to 1
- x = ( double(Fl::event_x() << 1) / w() ) - 1.0;
- y = ( -double(Fl::event_y() << 1) / h() ) + 1.0;
+ x = ( float(Fl::event_x() << 1) / w() ) - 1.0;
+ y = ( -float(Fl::event_y() << 1) / h() ) + 1.0;
arcball.mouse(x,y); arcball.update();
@@ -158,14 +158,14 @@
// Don't do anything if we aren't in a neutral state or aren't panning
if ( currenttr != None && currenttr != Pan ) return;
- double x, y;
- double tx=0, ty=0;
+ float x, y;
+ float tx=0, ty=0;
currenttr = Pan;
// Transform coords to lie between -1 to 1
- x = ( double(Fl::event_x() << 1) / w() ) - 1.0;
- y = ( -double(Fl::event_y() << 1) / h() ) + 1.0;
+ x = ( float(Fl::event_x() << 1) / w() ) - 1.0;
+ y = ( -float(Fl::event_y() << 1) / h() ) + 1.0;
// Adjust the x and y values so that moving mouse by 1 pixel
// on screen moves point under mouse by 1 pixel
@@ -200,12 +200,12 @@
// Don't do anything if we aren't in a neutral state or aren't zooming
if ( currenttr != None && currenttr != Zoom ) return;
- double z;
+ float z;
currenttr = Zoom;
// Transform coords to lie between -1 to 1
- z = ( double(Fl::event_x() << 1) / w() ) - 1.0;
+ z = ( float(Fl::event_x() << 1) / w() ) - 1.0;
// Currently both orthographic and perspective zoom is handled by same
// controller which simply does a scaling
@@ -241,12 +241,12 @@
// Don't do anything if we aren't in a neutral state or aren't dollying
if ( currenttr != None && currenttr != Dolly ) return;
- double z;
+ float z;
currenttr = Dolly;
// Transform coords to lie between -1 to 1
- z = ( double(Fl::event_x() << 1) / w() ) - 1.0;
+ z = ( float(Fl::event_x() << 1) / w() ) - 1.0;
dollycontrol.mouse(z); dollycontrol.update();
@@ -277,7 +277,7 @@
void drawConstraints (void) const;
void drawDragArc (void);
void arcball_transform(void) { // Apply the arcball transformation
- double mat[16];
+ float mat[16];
// Do the dollying separately before everything else
glTranslated(0,0,dollycontrol.dolly_value());
@@ -306,7 +306,7 @@
arcball.center(cen);
}
- void arcball_radius(double rad) {
+ void arcball_radius(float rad) {
arcball.radius(rad);
}
@@ -314,7 +314,7 @@
return arcball.center();
}
- double arcball_radius(void) const {
+ float arcball_radius(void) const {
return arcball.radius();
}
Modified: trunk/user/pixil/libs/flek/Flek/gl.H
===================================================================
--- trunk/user/pixil/libs/flek/Flek/gl.H 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flek/Flek/gl.H 2007-09-13 23:19:15 UTC (rev 1884)
@@ -80,25 +80,25 @@
}
/**
- * This form of glVertex takes 4 doubles as it's arguments.
+ * This form of glVertex takes 4 floats as it's arguments.
*/
-inline void glVertex (const double& x, const double& y, const double& z, const double& w)
+inline void glVertex (const float& x, const float& y, const float& z, const float& w)
{
glVertex4d (x, y, z, w);
}
/**
- * This form of glVertex takes 3 doubles as it's arguments.
+ * This form of glVertex takes 3 floats as it's arguments.
*/
-inline void glVertex (const double& x, const double& y, const double& z)
+inline void glVertex (const float& x, const float& y, const float& z)
{
glVertex3d (x, y, z);
}
/**
- * This form of glVertex takes 2 doubles as it's arguments.
+ * This form of glVertex takes 2 floats as it's arguments.
*/
-inline void glVertex (const double& x, const double& y)
+inline void glVertex (const float& x, const float& y)
{
glVertex2d (x, y);
}
@@ -121,17 +121,17 @@
}
/**
- * This form takes 4 doubles as it's arguments (RGBA).
+ * This form takes 4 floats as it's arguments (RGBA).
*/
-inline void glColor (const double& x, const double& y, const double& z, const double& w)
+inline void glColor (const float& x, const float& y, const float& z, const float& w)
{
glColor4d (x, y, z, w);
}
/**
- * This form takes 3 doubles as it's arguments (RGB).
+ * This form takes 3 floats as it's arguments (RGB).
*/
-inline void glColor (const double& x, const double& y, const double& z)
+inline void glColor (const float& x, const float& y, const float& z)
{
glColor3d (x, y, z);
}
@@ -157,15 +157,15 @@
/**
* This form takes an fVector2 and a z value as it's arguments.
*/
-inline void glNormal (const FVector2& v, const double &z)
+inline void glNormal (const FVector2& v, const float &z)
{
glNormal3d (v[0], v[1], z);
}
/**
- * This form takes 3 doubles as it's arguments.
+ * This form takes 3 floats as it's arguments.
*/
-inline void glNormal (const double& x, const double& y, const double& z)
+inline void glNormal (const float& x, const float& y, const float& z)
{
glNormal3d (x, y, z);
}
@@ -181,9 +181,9 @@
}
/**
- * This form takes 3 doubles as it's argument.
+ * This form takes 3 floats as it's argument.
*/
-inline void glScale (const double &x, const double &y=1, const double &z=1)
+inline void glScale (const float &x, const float &y=1, const float &z=1)
{
glScaled (x, y, z);
}
@@ -199,9 +199,9 @@
}
/**
- * This form takes 3 doubles as it's arguments.
+ * This form takes 3 floats as it's arguments.
*/
-inline void glTranslate (const double &x, const double &y=0, const double &z=0)
+inline void glTranslate (const float &x, const float &y=0, const float &z=0)
{
glTranslated (x, y, z);
}
@@ -209,7 +209,7 @@
/**
* glRotate rotates the current transformation matrix by an angle a about an axis v.
*/
-inline void glRotate (const double &a, const FVector3 &v)
+inline void glRotate (const float &a, const FVector3 &v)
{
glRotated (a, v[0], v[1], v[2]);
}
@@ -217,7 +217,7 @@
/**
* glRotate rotates the current transformation matrix by an angle a about an axis (x, y, z).
*/
-inline void glRotate (const double &a, const double &x, const double &y, const double &z)
+inline void glRotate (const float &a, const float &x, const float &y, const float &z)
{
glRotated (a, x, y, z);
}
Modified: trunk/user/pixil/libs/flek/Flek/iostream.H
===================================================================
--- trunk/user/pixil/libs/flek/Flek/iostream.H 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flek/Flek/iostream.H 2007-09-13 23:19:15 UTC (rev 1884)
@@ -5,9 +5,11 @@
// Miscellaneous functions for operating on IO streams in C++
-#include <iostream.h>
-#include <iomanip.h>
+#include <iostream>
+#include <iomanip>
+using namespace std;
+
inline void remove_white_space(istream& i) {
char c;
Modified: trunk/user/pixil/libs/flek/Flek/math.H
===================================================================
--- trunk/user/pixil/libs/flek/Flek/math.H 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flek/Flek/math.H 2007-09-13 23:19:15 UTC (rev 1884)
@@ -57,14 +57,6 @@
return (x < 0.0) ? -x : x;
}
-/**
- * Returns the absolute value.
- */
-inline double absolute (double x)
-{
- return (x < 0.0) ? -x : x;
-}
-
#endif
// Zero '0' value to be used for comparison and assignment
@@ -96,7 +88,7 @@
/**
* Check if passed number is non-zero. (Uses ZERO bounds).
*/
-inline bool is_non_zero (double num) {
+inline bool is_non_zero (float num) {
if ( (num < -ZERO) || (num > ZERO) ) return true;
return false;
}
@@ -110,10 +102,6 @@
return ( ( absolute (x1-x2) < ZERO ) ? true : false );
}
-inline bool are_equal (double x1, double x2) {
- return ( ( absolute (x1-x2) < ZERO ) ? true : false );
-}
-
#endif // #ifndef _INLINE_FP_EQUAL_
@@ -199,20 +187,6 @@
return x*x*x;
}
-/**
- * Square the number.
- */
-inline double sqr (double x) {
- return x*x;
-}
-
-/**
- * Cube the number.
- */
-inline double cube (double x) {
- return x*x*x;
-}
-
#endif
#ifndef _INLINE_MIN_MAX_
@@ -269,20 +243,6 @@
}
/**
- * Minimum of two numbers.
- */
-inline double min (double x, double y) {
- return ( (x < y) ? x : y );
-}
-
-/**
- * Maximum of two numbers.
- */
-inline double max (double x, double y) {
- return ( (x > y) ? x : y );
-}
-
-/**
* Minimum of two unsigned chars.
*/
inline unsigned char min (unsigned char x, unsigned char y) {
@@ -327,14 +287,6 @@
x = y; y = t;
}
-/**
- * Swap two numbers.
- */
-inline void swap (double& x, double& y) {
- double t = x;
- x = y; y = t;
-}
-
#endif
#ifndef _INLINE_DEG_RAD_
@@ -348,26 +300,12 @@
}
/**
- * Degrees to radians.
- */
-inline double deg2rad (double deg) {
- return deg*M_PI/180.0;
-}
-
-/**
* Radians to degrees.
*/
inline float rad2deg (float rad) {
return rad*180.0/M_PI;
}
-/**
- * Radians to degrees.
- */
-inline double rad2deg (double rad) {
- return rad*180.0/M_PI;
-}
-
#endif
#ifndef _INLINE_SIGN_
@@ -388,13 +326,6 @@
}
/**
- * Return the sign of a number. 1, 0, or -1.
- */
-inline double sign (double x) {
- return ( (x < 0.0) ? -1.0 : ((x > 0.0) ? 1.0 : 0.0) );
-}
-
-/**
* For matrices - sign of cofactor. 1 if i+j is even, -1 if i+j is odd
*/
inline int cofsign (uint i, uint j) {
Modified: trunk/user/pixil/libs/flek/src/FDate.cxx
===================================================================
--- trunk/user/pixil/libs/flek/src/FDate.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flek/src/FDate.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -277,7 +277,7 @@
this->Day = d.Day;
}
-double
+float
FDate::julian_date()
{
int days_in_year = 365;
Modified: trunk/user/pixil/libs/flek/src/FPNM.cxx
===================================================================
--- trunk/user/pixil/libs/flek/src/FPNM.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flek/src/FPNM.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -3,9 +3,11 @@
// CET - FIXME - this shouldn't use libstdc++ if it can be avoided- libstdc++
// causes compatibility problems under linux. Maybe should use the regular
// stdio.h stuff?
-#include <iostream.h>
-#include <fstream.h>
+#include <iostream>
+#include <fstream>
+using namespace std;
+
static int
skip_comments(ifstream & input)
{
Modified: trunk/user/pixil/libs/flek/src/Fl_Calendar.cxx
===================================================================
--- trunk/user/pixil/libs/flek/src/Fl_Calendar.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flek/src/Fl_Calendar.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -35,6 +35,7 @@
#ifdef PIXIL
#include <nxapp.h>
+#include <time.h>
void
set_week_buttons(Fl_Calendar_Base * c, int val)
Modified: trunk/user/pixil/libs/flek/src/Flv_List.cxx
===================================================================
--- trunk/user/pixil/libs/flek/src/Flv_List.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flek/src/Flv_List.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -924,8 +924,8 @@
scrollbar.slider_size(x);
#else
scrollbar.
- slider_size((double)
- ((double) x / (double) (H - vscrollbar_width * 2)));
+ slider_size((float)
+ ((float) x / (float) (H - vscrollbar_width * 2)));
#endif
scrollbar.Fl_Valuator::value(top_row()); // , 1, 0, vrows );
if (!scrollbar.visible())
@@ -958,8 +958,8 @@
#else
x = vrow_width / 10;
hscrollbar.
- slider_size((double)
- ((double) x / (double) (W - vscrollbar_width * 2)));
+ slider_size((float)
+ ((float) x / (float) (W - vscrollbar_width * 2)));
#endif
hscrollbar.Fl_Valuator::value(vrow_offset); // , 1, 0, vrows );
if (!hscrollbar.visible())
Modified: trunk/user/pixil/libs/flek/src/Makefile
===================================================================
--- trunk/user/pixil/libs/flek/src/Makefile 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flek/src/Makefile 2007-09-13 23:19:15 UTC (rev 1884)
@@ -17,6 +17,7 @@
CFLAGS ?=
CFLAGS += -DPIXIL
+CXXFLAGS += -DPIXIL
ifeq ($(COMPILE_CROSS),y)
# CFLAGS += -fpermissive
Modified: trunk/user/pixil/libs/flnx/FL/Enumerations.H
===================================================================
--- trunk/user/pixil/libs/flnx/FL/Enumerations.H 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/FL/Enumerations.H 2007-09-13 23:19:15 UTC (rev 1884)
@@ -45,7 +45,7 @@
// because the old "const double" definition would not allow for conditional
// compilation...
//
-// FL_VERSION is a double that describes the major and minor version numbers.
+// FL_VERSION is a float that describes the major and minor version numbers.
// Version 1.1 is actually stored as 1.01 to allow for more than 9 minor
// releases.
//
@@ -57,8 +57,8 @@
#define FL_MAJOR_VERSION 1
#define FL_MINOR_VERSION 0
#define FL_PATCH_VERSION 7
-#define FL_VERSION ((double)FL_MAJOR_VERSION + \
- (double)FL_MINOR_VERSION * 0.01)
+#define FL_VERSION ((float)FL_MAJOR_VERSION + \
+ (float)FL_MINOR_VERSION * 0.01)
typedef unsigned char uchar;
typedef unsigned long ulong;
Modified: trunk/user/pixil/libs/flnx/FL/Fl.H
===================================================================
--- trunk/user/pixil/libs/flnx/FL/Fl.H 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/FL/Fl.H 2007-09-13 23:19:15 UTC (rev 1884)
@@ -90,12 +90,12 @@
// execution:
static FL_EXPORT int wait();
- static FL_EXPORT double wait(double time);
+ static FL_EXPORT float wait(float time);
static FL_EXPORT int check();
static FL_EXPORT int ready();
static FL_EXPORT int run();
static FL_EXPORT Fl_Widget* readqueue();
- static FL_EXPORT void add_timeout(double t,void (*cb)(void*),void* = 0);
+ static FL_EXPORT void add_timeout(float t,void (*cb)(void*),void* = 0);
static FL_EXPORT void remove_timeout(void (*cb)(void*), void* = 0);
static FL_EXPORT void add_fd(int fd, int when, void (*cb)(int,void*),void* =0);
static FL_EXPORT void add_fd(int fd, void (*cb)(int, void*), void* = 0);
Modified: trunk/user/pixil/libs/flnx/FL/Fl_Animator.H
===================================================================
--- trunk/user/pixil/libs/flnx/FL/Fl_Animator.H 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/FL/Fl_Animator.H 2007-09-13 23:19:15 UTC (rev 1884)
@@ -25,7 +25,7 @@
int _xpos;
int _ypos;
- double _interval; /* Gap between frames, in seconds */
+ float _interval; /* Gap between frames, in seconds */
int _fcount; /* The number of frames in the strip */
int _fwidth; /* The xsize of the frames */
@@ -54,7 +54,7 @@
/* internally */
int interval() { return((int ) (_interval * 1000)); }
- void interval(int newint) { _interval = (double) (newint / 1000); }
+ void interval(int newint) { _interval = (float) (newint / 1000); }
int frame_width() { return(_fwidth); }
void frame_width(int newwidth) { _fwidth = newwidth; }
Modified: trunk/user/pixil/libs/flnx/FL/Fl_Chart.H
===================================================================
--- trunk/user/pixil/libs/flnx/FL/Fl_Chart.H 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/FL/Fl_Chart.H 2007-09-13 23:19:15 UTC (rev 1884)
@@ -55,7 +55,7 @@
int maxnumb;
int sizenumb;
FL_CHART_ENTRY *entries;
- double min,max;
+ float min,max;
uchar autosize_;
uchar textfont_,textsize_,textcolor_;
protected:
@@ -63,11 +63,11 @@
public:
FL_EXPORT Fl_Chart(int,int,int,int,const char * = 0);
FL_EXPORT void clear();
- FL_EXPORT void add(double, const char * =0, uchar=0);
- FL_EXPORT void insert(int, double, const char * =0, uchar=0);
- FL_EXPORT void replace(int, double, const char * =0, uchar=0);
- void bounds(double *a,double *b) const {*a = min; *b = max;}
- FL_EXPORT void bounds(double a,double b);
+ FL_EXPORT void add(float, const char * =0, uchar=0);
+ FL_EXPORT void insert(int, float, const char * =0, uchar=0);
+ FL_EXPORT void replace(int, float, const char * =0, uchar=0);
+ void bounds(float *a,float *b) const {*a = min; *b = max;}
+ FL_EXPORT void bounds(float a,float b);
int size() const {return numb;}
int maxsize() const {return maxnumb;}
FL_EXPORT void maxsize(int);
Modified: trunk/user/pixil/libs/flnx/FL/Fl_Color_Chooser.H
===================================================================
--- trunk/user/pixil/libs/flnx/FL/Fl_Color_Chooser.H 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/FL/Fl_Color_Chooser.H 2007-09-13 23:19:15 UTC (rev 1884)
@@ -68,27 +68,27 @@
Flcc_Value_Input gvalue;
Flcc_Value_Input bvalue;
Fl_Box resize_box;
- double hue_, saturation_, value_;
- double r_, g_, b_;
+ float hue_, saturation_, value_;
+ float r_, g_, b_;
FL_EXPORT void set_valuators();
static FL_EXPORT void rgb_cb(Fl_Widget*, void*);
static FL_EXPORT void mode_cb(Fl_Widget*, void*);
public:
int mode() {return choice.value();}
- double hue() const {return hue_;}
- double saturation() const {return saturation_;}
- double value() const {return value_;}
- double r() const {return r_;}
- double g() const {return g_;}
- double b() const {return b_;}
- FL_EXPORT int hsv(double,double,double);
- FL_EXPORT int rgb(double,double,double);
- static FL_EXPORT void hsv2rgb(double, double, double,double&,double&,double&);
- static FL_EXPORT void rgb2hsv(double, double, double,double&,double&,double&);
+ float hue() const {return hue_;}
+ float saturation() const {return saturation_;}
+ float value() const {return value_;}
+ float r() const {return r_;}
+ float g() const {return g_;}
+ float b() const {return b_;}
+ FL_EXPORT int hsv(float,float,float);
+ FL_EXPORT int rgb(float,float,float);
+ static FL_EXPORT void hsv2rgb(float, float, float,float&,float&,float&);
+ static FL_EXPORT void rgb2hsv(float, float, float,float&,float&,float&);
FL_EXPORT Fl_Color_Chooser(int,int,int,int,const char* = 0);
};
-FL_EXPORT int fl_color_chooser(const char* name, double& r, double& g, double& b);
+FL_EXPORT int fl_color_chooser(const char* name, float& r, float& g, float& b);
FL_EXPORT int fl_color_chooser(const char* name, uchar& r, uchar& g, uchar& b);
#endif
Modified: trunk/user/pixil/libs/flnx/FL/Fl_Counter.H
===================================================================
--- trunk/user/pixil/libs/flnx/FL/Fl_Counter.H 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/FL/Fl_Counter.H 2007-09-13 23:19:15 UTC (rev 1884)
@@ -39,7 +39,7 @@
class Fl_Counter : public Fl_Valuator {
uchar textfont_, textsize_, textcolor_;
- double lstep_;
+ float lstep_;
uchar mouseobj;
static FL_EXPORT void repeat_callback(void *);
FL_EXPORT int calc_mouseobj();
@@ -54,9 +54,9 @@
FL_EXPORT int handle(int);
FL_EXPORT Fl_Counter(int,int,int,int,const char * = 0);
FL_EXPORT ~Fl_Counter();
- void lstep(double a) {lstep_ = a;}
- void step(double a,double b) {Fl_Valuator::step(a); lstep_ = b;}
- void step(double a) {Fl_Valuator::step(a);}
+ void lstep(float a) {lstep_ = a;}
+ void step(float a,float b) {Fl_Valuator::step(a); lstep_ = b;}
+ void step(float a) {Fl_Valuator::step(a);}
Fl_Font textfont() const {return (Fl_Font)textfont_;}
void textfont(uchar s) {textfont_ = s;}
uchar textsize() const {return textsize_;}
Modified: trunk/user/pixil/libs/flnx/FL/Fl_Input_.H
===================================================================
--- trunk/user/pixil/libs/flnx/FL/Fl_Input_.H 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/FL/Fl_Input_.H 2007-09-13 23:19:15 UTC (rev 1884)
@@ -58,7 +58,7 @@
uchar erase_cursor_only;
FL_EXPORT const char* expand(const char*, char*) const;
- FL_EXPORT double expandpos(const char*, const char*, const char*, int*) const;
+ FL_EXPORT float expandpos(const char*, const char*, const char*, int*) const;
FL_EXPORT void minimal_update(int, int);
FL_EXPORT void minimal_update(int p);
FL_EXPORT void put_in_buffer(int newsize);
Modified: trunk/user/pixil/libs/flnx/FL/Fl_Positioner.H
===================================================================
--- trunk/user/pixil/libs/flnx/FL/Fl_Positioner.H 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/FL/Fl_Positioner.H 2007-09-13 23:19:15 UTC (rev 1884)
@@ -32,10 +32,10 @@
class Fl_Positioner : public Fl_Widget {
- double xmin, ymin;
- double xmax, ymax;
- double xvalue_, yvalue_;
- double xstep_, ystep_;
+ float xmin, ymin;
+ float xmax, ymax;
+ float xvalue_, yvalue_;
+ float xstep_, ystep_;
protected:
@@ -48,23 +48,23 @@
FL_EXPORT int handle(int);
FL_EXPORT Fl_Positioner(int x,int y,int w,int h, const char *l=0);
- double xvalue() const {return xvalue_;}
- double yvalue() const {return yvalue_;}
- FL_EXPORT int xvalue(double);
- FL_EXPORT int yvalue(double);
- FL_EXPORT int value(double,double);
- FL_EXPORT void xbounds(double, double);
- double xminimum() const {return xmin;}
- void xminimum(double a) {xbounds(a,xmax);}
- double xmaximum() const {return xmax;}
- void xmaximum(double a) {xbounds(xmin,a);}
- FL_EXPORT void ybounds(double, double);
- double yminimum() const {return ymin;}
- void yminimum(double a) {ybounds(a,ymax);}
- double ymaximum() const {return ymax;}
- void ymaximum(double a) {ybounds(ymin,a);}
- void xstep(double a) {xstep_ = a;}
- void ystep(double a) {ystep_ = a;}
+ float xvalue() const {return xvalue_;}
+ float yvalue() const {return yvalue_;}
+ FL_EXPORT int xvalue(float);
+ FL_EXPORT int yvalue(float);
+ FL_EXPORT int value(float,float);
+ FL_EXPORT void xbounds(float, float);
+ float xminimum() const {return xmin;}
+ void xminimum(float a) {xbounds(a,xmax);}
+ float xmaximum() const {return xmax;}
+ void xmaximum(float a) {xbounds(xmin,a);}
+ FL_EXPORT void ybounds(float, float);
+ float yminimum() const {return ymin;}
+ void yminimum(float a) {ybounds(a,ymax);}
+ float ymaximum() const {return ymax;}
+ void ymaximum(float a) {ybounds(ymin,a);}
+ void xstep(float a) {xstep_ = a;}
+ void ystep(float a) {ystep_ = a;}
};
Modified: trunk/user/pixil/libs/flnx/FL/Fl_Slider.H
===================================================================
--- trunk/user/pixil/libs/flnx/FL/Fl_Slider.H 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/FL/Fl_Slider.H 2007-09-13 23:19:15 UTC (rev 1884)
@@ -62,9 +62,9 @@
FL_EXPORT void slider_hor_lines(int x, int y, int h, int w, int W, Fl_Color c);
FL_EXPORT void slider_ver_lines(int x, int y, int h, int w, int W, Fl_Color c);
FL_EXPORT int scrollvalue(int windowtop,int windowsize,int first,int totalsize);
- FL_EXPORT void bounds(double a, double b);
+ FL_EXPORT void bounds(float a, float b);
float slider_size() const {return slider_size_;}
- FL_EXPORT void slider_size(double v);
+ FL_EXPORT void slider_size(float v);
Fl_Boxtype slider() const {return (Fl_Boxtype)slider_;}
void slider(Fl_Boxtype c) {slider_ = c;}
};
Modified: trunk/user/pixil/libs/flnx/FL/Fl_Timer.H
===================================================================
--- trunk/user/pixil/libs/flnx/FL/Fl_Timer.H 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/FL/Fl_Timer.H 2007-09-13 23:19:15 UTC (rev 1884)
@@ -39,7 +39,7 @@
static FL_EXPORT void stepcb(void *);
FL_EXPORT void step();
char on, direction_;
- double delay, total;
+ float delay, total;
long lastsec,lastusec;
protected:
FL_EXPORT void draw();
@@ -47,8 +47,8 @@
FL_EXPORT int handle(int);
FL_EXPORT Fl_Timer(uchar t,int x,int y,int w,int h, const char *l);
FL_EXPORT ~Fl_Timer();
- FL_EXPORT void value(double);
- double value() const {return delay>0.0?delay:0.0;}
+ FL_EXPORT void value(float);
+ float value() const {return delay>0.0?delay:0.0;}
char direction() const {return direction_;}
void direction(char d) {direction_ = d;}
char suspended() const {return !on;}
Modified: trunk/user/pixil/libs/flnx/FL/Fl_Valuator.H
===================================================================
--- trunk/user/pixil/libs/flnx/FL/Fl_Valuator.H 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/FL/Fl_Valuator.H 2007-09-13 23:19:15 UTC (rev 1884)
@@ -36,44 +36,44 @@
class Fl_Valuator : public Fl_Widget {
- double value_;
- double previous_value_;
- double min, max; // truncates to this range *after* rounding
- double A; int B; // rounds to multiples of A/B, or no rounding if A is zero
+ float value_;
+ float previous_value_;
+ float min, max; // truncates to this range *after* rounding
+ float A; int B; // rounds to multiples of A/B, or no rounding if A is zero
protected:
int horizontal() const {return type()&1;}
FL_EXPORT Fl_Valuator(int X, int Y, int W, int H, const char* L);
- double previous_value() const {return previous_value_;}
+ float previous_value() const {return previous_value_;}
void handle_push() {previous_value_ = value_;}
- FL_EXPORT double softclamp(double);
- FL_EXPORT void handle_drag(double newvalue);
+ FL_EXPORT float softclamp(float);
+ FL_EXPORT void handle_drag(float newvalue);
FL_EXPORT void handle_release(); // use drag() value
virtual FL_EXPORT void value_damage(); // cause damage() due to value() changing
public:
- void bounds(double a, double b) {min=a; max=b;}
- double minimum() const {return min;}
- void minimum(double a) {min = a;}
- double maximum() const {return max;}
- void maximum(double a) {max = a;}
- void range(double a, double b) {min = a; max = b;}
+ void bounds(float a, float b) {min=a; max=b;}
+ float minimum() const {return min;}
+ void minimum(float a) {min = a;}
+ float maximum() const {return max;}
+ void maximum(float a) {max = a;}
+ void range(float a, float b) {min = a; max = b;}
void step(int a) {A = a; B = 1;}
- void step(double a, int b) {A = a; B = b;}
- FL_EXPORT void step(double s);
- double step() const {return A/B;}
+ void step(float a, int b) {A = a; B = b;}
+ FL_EXPORT void step(float s);
+ float step() const {return A/B;}
FL_EXPORT void precision(int);
- double value() const {return value_;}
- FL_EXPORT int value(double);
+ float value() const {return value_;}
+ FL_EXPORT int value(float);
virtual int format(char*);
- FL_EXPORT double round(double); // round to nearest multiple of step
- FL_EXPORT double clamp(double); // keep in range
- FL_EXPORT double increment(double, int); // add n*step to value
+ FL_EXPORT float round(float); // round to nearest multiple of step
+ FL_EXPORT float clamp(float); // keep in range
+ FL_EXPORT float increment(float, int); // add n*step to value
};
#endif
Modified: trunk/user/pixil/libs/flnx/FL/fl_draw.H
===================================================================
--- trunk/user/pixil/libs/flnx/FL/fl_draw.H 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/FL/fl_draw.H 2007-09-13 23:19:15 UTC (rev 1884)
@@ -73,26 +73,26 @@
FL_EXPORT void fl_yxline(int x, int y, int y1, int x2, int y3);
// circular lines and pie slices (code in fl_arci.C):
-FL_EXPORT void fl_arc(int x, int y, int w, int h, double a1, double a2);
-FL_EXPORT void fl_pie(int x, int y, int w, int h, double a1, double a2);
-FL_EXPORT void fl_chord(int x, int y, int w, int h, double a1, double a2); // nyi
+FL_EXPORT void fl_arc(int x, int y, int w, int h, float a1, float a2);
+FL_EXPORT void fl_pie(int x, int y, int w, int h, float a1, float a2);
+FL_EXPORT void fl_chord(int x, int y, int w, int h, float a1, float a2); // nyi
// scalable drawing code (code in fl_vertex.C and fl_arc.C):
FL_EXPORT void fl_push_matrix();
FL_EXPORT void fl_pop_matrix();
-FL_EXPORT void fl_scale(double x, double y);
-FL_EXPORT void fl_scale(double x);
-FL_EXPORT void fl_translate(double x, double y);
-FL_EXPORT void fl_rotate(double d);
-FL_EXPORT void fl_mult_matrix(double a, double b, double c, double d, double x,double y);
+FL_EXPORT void fl_scale(float x, float y);
+FL_EXPORT void fl_scale(float x);
+FL_EXPORT void fl_translate(float x, float y);
+FL_EXPORT void fl_rotate(float d);
+FL_EXPORT void fl_mult_matrix(float a, float b, float c, float d, float x,float y);
FL_EXPORT void fl_begin_points();
FL_EXPORT void fl_begin_line();
FL_EXPORT void fl_begin_loop();
FL_EXPORT void fl_begin_polygon();
-FL_EXPORT void fl_vertex(double x, double y);
-FL_EXPORT void fl_curve(double, double, double, double, double, double, double, double);
-FL_EXPORT void fl_arc(double x, double y, double r, double start, double a);
-FL_EXPORT void fl_circle(double x, double y, double r);
+FL_EXPORT void fl_vertex(float x, float y);
+FL_EXPORT void fl_curve(float, float, float, float, float, float, float, float);
+FL_EXPORT void fl_arc(float x, float y, float r, float start, float a);
+FL_EXPORT void fl_circle(float x, float y, float r);
FL_EXPORT void fl_end_points();
FL_EXPORT void fl_end_line();
FL_EXPORT void fl_end_loop();
@@ -101,11 +101,11 @@
FL_EXPORT void fl_gap();
FL_EXPORT void fl_end_complex_polygon();
// get and use transformed positions:
-FL_EXPORT double fl_transform_x(double x, double y);
-FL_EXPORT double fl_transform_y(double x, double y);
-FL_EXPORT double fl_transform_dx(double x, double y);
-FL_EXPORT double fl_transform_dy(double x, double y);
-FL_EXPORT void fl_transformed_vertex(double x, double y);
+FL_EXPORT float fl_transform_x(float x, float y);
+FL_EXPORT float fl_transform_y(float x, float y);
+FL_EXPORT float fl_transform_dx(float x, float y);
+FL_EXPORT float fl_transform_dy(float x, float y);
+FL_EXPORT void fl_transformed_vertex(float x, float y);
// current font:
FL_EXPORT void fl_font(int face, int size);
@@ -117,9 +117,9 @@
// information you can get about the current font:
FL_EXPORT int fl_height(); // using "size" should work ok
FL_EXPORT int fl_descent();
-FL_EXPORT double fl_width(const char*);
-FL_EXPORT double fl_width(const char*, int n);
-FL_EXPORT double fl_width(uchar);
+FL_EXPORT float fl_width(const char*);
+FL_EXPORT float fl_width(const char*, int n);
+FL_EXPORT float fl_width(uchar);
// draw using current font:
FL_EXPORT void fl_draw(const char*, int x, int y);
Modified: trunk/user/pixil/libs/flnx/FL/forms.H
===================================================================
--- trunk/user/pixil/libs/flnx/FL/forms.H 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/FL/forms.H 2007-09-13 23:19:15 UTC (rev 1884)
@@ -275,7 +275,7 @@
inline void fl_addto_group(Fl_Widget* o) {((Fl_Group* )o)->begin();}
#define resizebox _ddfdesign_kludge()
-inline void fl_scale_form(Fl_Window* f, double x, double y) {
+inline void fl_scale_form(Fl_Window* f, float x, float y) {
f->resizable(f); f->size(int(f->w()*x),int(f->h()*y));}
inline void fl_set_form_position(Fl_Window* f,int x,int y) {f->position(x,y);}
inline void fl_set_form_size(Fl_Window* f, int w, int h) {f->size(w,h);}
@@ -515,13 +515,13 @@
forms_constructor(Fl_Chart, fl_add_chart)
inline void fl_clear_chart(Fl_Widget* o) {
((Fl_Chart*)o)->clear();}
-inline void fl_add_chart_value(Fl_Widget* o,double v,const char* s,uchar c){
+inline void fl_add_chart_value(Fl_Widget* o,float v,const char* s,uchar c){
((Fl_Chart*)o)->add(v,s,c);}
-inline void fl_insert_chart_value(Fl_Widget* o, int i, double v, const char* s, uchar c) {
+inline void fl_insert_chart_value(Fl_Widget* o, int i, float v, const char* s, uchar c) {
((Fl_Chart*)o)->insert(i,v,s,c);}
-inline void fl_replace_chart_value(Fl_Widget* o, int i, double v, const char* s, uchar c) {
+inline void fl_replace_chart_value(Fl_Widget* o, int i, float v, const char* s, uchar c) {
((Fl_Chart*)o)->replace(i,v,s,c);}
-inline void fl_set_chart_bounds(Fl_Widget* o, double a, double b) {
+inline void fl_set_chart_bounds(Fl_Widget* o, float a, float b) {
((Fl_Chart*)o)->bounds(a,b);}
inline void fl_set_chart_maxnumb(Fl_Widget* o, int v) {
((Fl_Chart*)o)->maxsize(v);}
@@ -576,23 +576,23 @@
#include "Fl_Counter.H"
forms_constructor(Fl_Counter, fl_add_counter)
-inline void fl_set_counter_value(Fl_Widget* o, double v) {
+inline void fl_set_counter_value(Fl_Widget* o, float v) {
((Fl_Counter*)o)->value(v);}
-inline void fl_set_counter_bounds(Fl_Widget* o, double a, double b) {
+inline void fl_set_counter_bounds(Fl_Widget* o, float a, float b) {
((Fl_Counter*)o)->bounds(a,b);}
-inline void fl_set_counter_step(Fl_Widget* o, double a, double b) {
+inline void fl_set_counter_step(Fl_Widget* o, float a, float b) {
((Fl_Counter*)o)->step(a,b);}
inline void fl_set_counter_precision(Fl_Widget* o, int v) {
((Fl_Counter*)o)->precision(v);}
inline void fl_set_counter_return(Fl_Widget* o, int v) {
((Fl_Counter*)o)->when((Fl_When)(v|FL_WHEN_RELEASE));}
-inline double fl_get_counter_value(Fl_Widget* o) {
+inline float fl_get_counter_value(Fl_Widget* o) {
return ((Fl_Counter*)o)->value();}
inline void fl_get_counter_bounds(Fl_Widget* o, float* a, float* b) {
*a = float(((Fl_Counter*)o)->minimum());
*b = float(((Fl_Counter*)o)->maximum());
}
-//inline void fl_set_counter_filter(Fl_Widget*,const char* (*)(Fl_Widget*,double,int));
+//inline void fl_set_counter_filter(Fl_Widget*,const char* (*)(Fl_Widget*,float,int));
// Cursor stuff cannot be emulated because it uses X stuff
inline void fl_set_cursor(Fl_Window* w, Fl_Cursor c) {w->cursor(c);}
@@ -605,11 +605,11 @@
#define FL_DIAL_COL2 37
forms_constructor(Fl_Dial, fl_add_dial)
-inline void fl_set_dial_value(Fl_Widget* o, double v) {
+inline void fl_set_dial_value(Fl_Widget* o, float v) {
((Fl_Dial*)o)->value(v);}
-inline double fl_get_dial_value(Fl_Widget* o) {
+inline float fl_get_dial_value(Fl_Widget* o) {
return ((Fl_Dial*)o)->value();}
-inline void fl_set_dial_bounds(Fl_Widget* o, double a, double b) {
+inline void fl_set_dial_bounds(Fl_Widget* o, float a, float b) {
((Fl_Dial*)o)->bounds(a, b);}
inline void fl_get_dial_bounds(Fl_Widget* o, float* a, float* b) {
*a = float(((Fl_Dial*)o)->minimum());
@@ -622,7 +622,7 @@
//inline void fl_set_dial_cross(Fl_Widget* o, int);
// inline void fl_set_dial_direction(Fl_Widget* o, uchar d) {
// ((Fl_Dial*)o)->direction(d);}
-inline void fl_set_dial_step(Fl_Widget* o, double v) {
+inline void fl_set_dial_step(Fl_Widget* o, float v) {
((Fl_Dial*)o)->step(v);}
// Frames:
@@ -639,7 +639,7 @@
#include "Fl_Free.H"
inline Fl_Free*
-fl_add_free(int t,double x,double y,double w,double h,const char* l,
+fl_add_free(int t,float x,float y,float w,float h,const char* l,
FL_HANDLEPTR hdl) {
return (Fl_Free*)(fl_add_new(
new Fl_Free(t,int(x),int(y),int(w),int(h),l,hdl)));
@@ -750,29 +750,29 @@
#include "Fl_Positioner.H"
#define FL_NORMAL_POSITIONER 0
forms_constructor(Fl_Positioner, fl_add_positioner)
-inline void fl_set_positioner_xvalue(Fl_Widget* o, double v) {
+inline void fl_set_positioner_xvalue(Fl_Widget* o, float v) {
((Fl_Positioner*)o)->xvalue(v);}
-inline double fl_get_positioner_xvalue(Fl_Widget* o) {
+inline float fl_get_positioner_xvalue(Fl_Widget* o) {
return ((Fl_Positioner*)o)->xvalue();}
-inline void fl_set_positioner_xbounds(Fl_Widget* o, double a, double b) {
+inline void fl_set_positioner_xbounds(Fl_Widget* o, float a, float b) {
((Fl_Positioner*)o)->xbounds(a,b);}
inline void fl_get_positioner_xbounds(Fl_Widget* o, float* a, float* b) {
*a = float(((Fl_Positioner*)o)->xminimum());
*b = float(((Fl_Positioner*)o)->xmaximum());
}
-inline void fl_set_positioner_yvalue(Fl_Widget* o, double v) {
+inline void fl_set_positioner_yvalue(Fl_Widget* o, float v) {
((Fl_Positioner*)o)->yvalue(v);}
-inline double fl_get_positioner_yvalue(Fl_Widget* o) {
+inline float fl_get_positioner_yvalue(Fl_Widget* o) {
return ((Fl_Positioner*)o)->yvalue();}
-inline void fl_set_positioner_ybounds(Fl_Widget* o, double a, double b) {
+inline void fl_set_positioner_ybounds(Fl_Widget* o, float a, float b) {
((Fl_Positioner*)o)->ybounds(a,b);}
inline void fl_get_positioner_ybounds(Fl_Widget* o, float* a, float* b) {
*a = float(((Fl_Positioner*)o)->yminimum());
*b = float(((Fl_Positioner*)o)->ymaximum());
}
-inline void fl_set_positioner_xstep(Fl_Widget* o, double v) {
+inline void fl_set_positioner_xstep(Fl_Widget* o, float v) {
((Fl_Positioner*)o)->xstep(v);}
-inline void fl_set_positioner_ystep(Fl_Widget* o, double v) {
+inline void fl_set_positioner_ystep(Fl_Widget* o, float v) {
((Fl_Positioner*)o)->ystep(v);}
inline void fl_set_positioner_return(Fl_Widget* o, int v) {
((Fl_Positioner*)o)->when((Fl_When)(v|FL_WHEN_RELEASE));}
@@ -784,11 +784,11 @@
forms_constructort(Fl_Slider, fl_add_slider)
#define FL_SLIDER_COL1 FL_GRAY
-inline void fl_set_slider_value(Fl_Widget* o, double v) {
+inline void fl_set_slider_value(Fl_Widget* o, float v) {
((Fl_Slider*)o)->value(v);}
-inline double fl_get_slider_value(Fl_Widget* o) {
+inline float fl_get_slider_value(Fl_Widget* o) {
return ((Fl_Slider*)o)->value();}
-inline void fl_set_slider_bounds(Fl_Widget* o, double a, double b) {
+inline void fl_set_slider_bounds(Fl_Widget* o, float a, float b) {
((Fl_Slider*)o)->bounds(a, b);}
inline void fl_get_slider_bounds(Fl_Widget* o, float* a, float* b) {
*a = float(((Fl_Slider*)o)->minimum());
@@ -796,10 +796,10 @@
}
inline void fl_set_slider_return(Fl_Widget* o, int i) {
((Fl_Slider*)o)->when((Fl_When)(i|FL_WHEN_RELEASE));}
-inline void fl_set_slider_step(Fl_Widget* o, double v) {
+inline void fl_set_slider_step(Fl_Widget* o, float v) {
((Fl_Slider*)o)->step(v);}
-// inline void fl_set_slider_increment(Fl_Widget* o, double v, double);
-inline void fl_set_slider_size(Fl_Widget* o, double v) {
+// inline void fl_set_slider_increment(Fl_Widget* o, float v, float);
+inline void fl_set_slider_size(Fl_Widget* o, float v) {
((Fl_Slider*)o)->slider_size(v);}
#include "Fl_Value_Slider.H"
@@ -823,8 +823,8 @@
#include "Fl_Timer.H"
forms_constructort(Fl_Timer, fl_add_timer)
-inline void fl_set_timer(Fl_Widget* o, double v) {((Fl_Timer*)o)->value(v);}
-inline double fl_get_timer(Fl_Widget* o) {return ((Fl_Timer*)o)->value();}
+inline void fl_set_timer(Fl_Widget* o, float v) {((Fl_Timer*)o)->value(v);}
+inline float fl_get_timer(Fl_Widget* o) {return ((Fl_Timer*)o)->value();}
inline void fl_suspend_timer(Fl_Widget* o) {((Fl_Timer*)o)->suspended(1);}
inline void fl_resume_timer(Fl_Widget* o) {((Fl_Timer*)o)->suspended(0);}
inline void fl_set_timer_countup(Fl_Widget* o,char d) {((Fl_Timer*)o)->direction(d);}
Modified: trunk/user/pixil/libs/flnx/FL/gl.h
===================================================================
--- trunk/user/pixil/libs/flnx/FL/gl.h 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/FL/gl.h 2007-09-13 23:19:15 UTC (rev 1884)
@@ -51,9 +51,9 @@
FL_EXPORT void gl_font(int fontid, int size);
FL_EXPORT int gl_height();
FL_EXPORT int gl_descent();
-FL_EXPORT double gl_width(const char *);
-FL_EXPORT double gl_width(const char *, int n);
-FL_EXPORT double gl_width(uchar);
+FL_EXPORT float gl_width(const char *);
+FL_EXPORT float gl_width(const char *, int n);
+FL_EXPORT float gl_width(uchar);
FL_EXPORT void gl_draw(const char*);
FL_EXPORT void gl_draw(const char*, int n);
Modified: trunk/user/pixil/libs/flnx/FL/glut.H
===================================================================
--- trunk/user/pixil/libs/flnx/FL/glut.H 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/FL/glut.H 2007-09-13 23:19:15 UTC (rev 1884)
@@ -443,18 +443,18 @@
extern int glutStrokeWidth(void *font, int character);
/* GLUT pre-built models sub-API */
-extern void glutWireSphere(GLdouble radius, GLint slices, GLint stacks);
-extern void glutSolidSphere(GLdouble radius, GLint slices, GLint stacks);
-extern void glutWireCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
-extern void glutSolidCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
-extern void glutWireCube(GLdouble size);
-extern void glutSolidCube(GLdouble size);
-extern void glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
-extern void glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
+extern void glutWireSphere(GLfloat radius, GLint slices, GLint stacks);
+extern void glutSolidSphere(GLfloat radius, GLint slices, GLint stacks);
+extern void glutWireCone(GLfloat base, GLfloat height, GLint slices, GLint stacks);
+extern void glutSolidCone(GLfloat base, GLfloat height, GLint slices, GLint stacks);
+extern void glutWireCube(GLfloat size);
+extern void glutSolidCube(GLfloat size);
+extern void glutWireTorus(GLfloat innerRadius, GLfloat outerRadius, GLint sides, GLint rings);
+extern void glutSolidTorus(GLfloat innerRadius, GLfloat outerRadius, GLint sides, GLint rings);
extern void glutWireDodecahedron();
extern void glutSolidDodecahedron();
-extern void glutWireTeapot(GLdouble size);
-extern void glutSolidTeapot(GLdouble size);
+extern void glutWireTeapot(GLfloat size);
+extern void glutSolidTeapot(GLfloat size);
extern void glutWireOctahedron();
extern void glutSolidOctahedron();
extern void glutWireTetrahedron();
Modified: trunk/user/pixil/libs/flnx/FL/math.h
===================================================================
--- trunk/user/pixil/libs/flnx/FL/math.h 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/FL/math.h 2007-09-13 23:19:15 UTC (rev 1884)
@@ -49,8 +49,8 @@
#if defined(WIN32) || defined(CRAY)
-inline double rint(double v) {return floor(v+.5);}
-inline double copysign(double a, double b) {return b<0 ? -a : a;}
+inline float rint(float v) {return floor(v+.5);}
+inline float copysign(float a, float b) {return b<0 ? -a : a;}
#endif
Modified: trunk/user/pixil/libs/flnx/FL/menubar.h
===================================================================
--- trunk/user/pixil/libs/flnx/FL/menubar.h 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/FL/menubar.h 2007-09-13 23:19:15 UTC (rev 1884)
@@ -51,7 +51,7 @@
((Fl_Menu_Item*)m)->add(text,bind,(Fl_Callback*)cb,(void *)data,flags);
}
-inline MenuEntry *MenuPopup(Fl_Widget *o,const char *title,MenuEntry *m,double x,double y) {
+inline MenuEntry *MenuPopup(Fl_Widget *o,const char *title,MenuEntry *m,float x,float y) {
const Fl_Menu_Item* v = ((Fl_Menu_Item*)m)->popup(x,y,title);
if (v && v->callback_) v->do_callback(o);
return (MenuEntry *)v;
Modified: trunk/user/pixil/libs/flnx/fluid/Fl_Widget_Type.cxx
===================================================================
--- trunk/user/pixil/libs/flnx/fluid/Fl_Widget_Type.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/fluid/Fl_Widget_Type.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -931,7 +931,7 @@
i->show();
i->value(((Fl_Slider*)(current_widget->o))->slider_size());
} else {
- double n = i->value();
+ float n = i->value();
for (Fl_Type *o = Fl_Type::first; o; o = o->next)
if (o->selected && o->is_widget()) {
Fl_Widget_Type* q = (Fl_Widget_Type*)o;
@@ -949,7 +949,7 @@
i->show();
i->value(((Fl_Valuator*)(current_widget->o))->minimum());
} else {
- double n = i->value();
+ float n = i->value();
for (Fl_Type *o = Fl_Type::first; o; o = o->next)
if (o->selected && o->is_widget()) {
Fl_Widget_Type* q = (Fl_Widget_Type*)o;
@@ -967,7 +967,7 @@
i->show();
i->value(((Fl_Valuator*)(current_widget->o))->maximum());
} else {
- double n = i->value();
+ float n = i->value();
for (Fl_Type *o = Fl_Type::first; o; o = o->next)
if (o->selected && o->is_widget()) {
Fl_Widget_Type* q = (Fl_Widget_Type*)o;
@@ -985,7 +985,7 @@
i->show();
i->value(((Fl_Valuator*)(current_widget->o))->step());
} else {
- double n = i->value();
+ float n = i->value();
for (Fl_Type *o = Fl_Type::first; o; o = o->next)
if (o->selected && o->is_widget()) {
Fl_Widget_Type* q = (Fl_Widget_Type*)o;
@@ -1008,7 +1008,7 @@
} else
i->hide();
} else {
- double n = i->value();
+ float n = i->value();
for (Fl_Type *o = Fl_Type::first; o; o = o->next)
if (o->selected && o->is_widget()) {
Fl_Widget_Type* q = (Fl_Widget_Type*)o;
@@ -1387,8 +1387,8 @@
if (v->value())
write_c("%so->value(%g);\n", indent(), v->value());
if (is_valuator()==2) {
- double x = ((Fl_Slider*)v)->slider_size();
- double y = ((Fl_Slider*)f)->slider_size();
+ float x = ((Fl_Slider*)v)->slider_size();
+ float y = ((Fl_Slider*)f)->slider_size();
if (x != y) write_c("%so->slider_size(%g);\n", indent(), x);
}
}
@@ -1498,8 +1498,8 @@
if (v->step()!=f->step()) write_string("step %g",v->step());
if (v->value()!=0.0) write_string("value %g",v->value());
if (is_valuator()==2) {
- double x = ((Fl_Slider*)v)->slider_size();
- double y = ((Fl_Slider*)f)->slider_size();
+ float x = ((Fl_Slider*)v)->slider_size();
+ float y = ((Fl_Slider*)f)->slider_size();
if (x != y) write_string("slider_size %g", x);
}
}
Modified: trunk/user/pixil/libs/flnx/fluid/Makefile
===================================================================
--- trunk/user/pixil/libs/flnx/fluid/Makefile 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/fluid/Makefile 2007-09-13 23:19:15 UTC (rev 1884)
@@ -49,17 +49,23 @@
include ../makeinclude
+LIBDIRS += -L../lib
+LDLIBS += -lfltk
+INCLUDES += -I..
+
.SUFFIXES : .cxx .c .o
.cxx.o :
- $(CXX) -I.. $(CXXFLAGS) -c $<
+ $(CXX) -c $(CXXFLAGS) $(INCLUDES) -o $@ $<
.c.o :
- $(CC) -I.. $(CFLAGS) -c $<
-.cxx :
- $(CXX) -I.. $(CXXFLAGS) -o $@ $< -L../lib -lfltk $(LDLIBS)
+ $(CC) -c $(CFLAGS) $(INCLUDES) -o $@ $<
+.o :
+ $(CXX) -o $@ $(CRTBEGIN) $(BUILD_CFLAGS) $(LDFLAGS) $(OBJS) $(LIBDIRS) $(LDLIBS) $(LIBS) $(CXXLIBS)-lm $(CRTEND)
+ $(TARGET_CROSS)flthdr -s $(STACK_SIZE) $@
-$(PROGRAM) : $(OBJECTS) ../lib/$(LIBNAME)
- $(CXX) $(LDFLAGS) -o $(PROGRAM) $(OBJECTS) -L../lib -lfltk $(LDLIBS)
+$(PROGRAM) : $(OBJS) ../lib/$(LIBNAME)
+ $(CXX) -o $@ $(CRTBEGIN) $(BUILD_CFLAGS) $(LDFLAGS) $(OBJS) $(LIBDIRS) -L../lib $(LDLIBS) $(LIBS) $(CXXLIBS) -lm $(CRTEND)
+ $(TARGET_CROSS)flthdr -s $(STACK_SIZE) $@
clean :
-@ rm -f *.o $(PROGRAM) $(CLEAN) core *~ makedepend
Modified: trunk/user/pixil/libs/flnx/fluid/file.cxx
===================================================================
--- trunk/user/pixil/libs/flnx/fluid/file.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/fluid/file.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -347,7 +347,7 @@
void read_fdesign();
-double read_version;
+float read_version;
extern Fl_Type *Fl_Type_make(const char *tn);
Modified: trunk/user/pixil/libs/flnx/src/Fl.cxx
===================================================================
--- trunk/user/pixil/libs/flnx/src/Fl.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/src/Fl.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -51,7 +51,7 @@
char *Fl::e_text = "";
int Fl::e_length;
-static double fl_elapsed();
+static float fl_elapsed();
//
// 'Fl:event_inside()' - Return whether or not the mouse event is inside
@@ -73,14 +73,14 @@
// are only a small number:
static struct Timeout {
- double time;
+ float time;
void (*cb)(void*);
void* arg;
} * timeout;
static int numtimeouts;
static int timeout_array_size;
-void Fl::add_timeout(double t, void (*cb)(void *), void *v) {
+void Fl::add_timeout(float t, void (*cb)(void *), void *v) {
fl_elapsed();
@@ -154,7 +154,7 @@
#endif
}
-extern double fl_wait(int timeout_flag, double timeout);
+extern float fl_wait(int timeout_flag, float timeout);
extern int fl_ready();
static int initclock; // if false we didn't call fl_elapsed() last time
@@ -167,7 +167,7 @@
// called. To reduce the number of system calls to get the
// current time, the "initclock" symbol is turned on by an indefinite
// wait. This should then reset the measured-from time and return zero
-static double fl_elapsed() {
+static float fl_elapsed() {
#ifdef WIN32
@@ -177,7 +177,7 @@
if (!initclock) {prevclock = newclock; initclock = 1; return 0.0;}
else if (newclock < prevclock) return 0.0;
- double t = double(newclock-prevclock)/TICKS_PER_SECOND;
+ float t = float(newclock-prevclock)/TICKS_PER_SECOND;
prevclock = newclock;
#else
@@ -191,7 +191,7 @@
initclock = 1;
return 0.0;
}
- double t = newclock.tv_sec - prevclock.tv_sec +
+ float t = newclock.tv_sec - prevclock.tv_sec +
(newclock.tv_usec - prevclock.tv_usec)/1000000.0;
prevclock.tv_sec = newclock.tv_sec;
prevclock.tv_usec = newclock.tv_usec;
@@ -237,12 +237,12 @@
return 1;
}
-double Fl::wait(double time) {
+float Fl::wait(float time) {
callidle();
int expired = 0;
if (numtimeouts) {time -= fl_elapsed(); expired = call_timeouts();}
flush();
- double wait_time = (idle && !in_idle) || expired ? 0.0 : time;
+ float wait_time = (idle && !in_idle) || expired ? 0.0 : time;
if (numtimeouts && timeout[0].time < wait_time) wait_time = timeout[0].time;
fl_wait(1, wait_time);
return time - fl_elapsed();
Modified: trunk/user/pixil/libs/flnx/src/Fl_Adjuster.cxx
===================================================================
--- trunk/user/pixil/libs/flnx/src/Fl_Adjuster.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/src/Fl_Adjuster.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -64,7 +64,7 @@
}
int Fl_Adjuster::handle(int event) {
- double v;
+ float v;
int delta;
int mx = Fl::event_x();
switch (event) {
Modified: trunk/user/pixil/libs/flnx/src/Fl_Animator.cxx
===================================================================
--- trunk/user/pixil/libs/flnx/src/Fl_Animator.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/src/Fl_Animator.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -41,7 +41,7 @@
_fwidth = fwidth;
_fheight = fheight;
- _interval = ((double) interval / 1000);
+ _interval = ((float) interval / 1000);
_curframe = 0;
Modified: trunk/user/pixil/libs/flnx/src/Fl_Chart.cxx
===================================================================
--- trunk/user/pixil/libs/flnx/src/Fl_Chart.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/src/Fl_Chart.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -39,14 +39,14 @@
static void draw_barchart(int x,int y,int w,int h,
int numb, FL_CHART_ENTRY entries[],
- double min, double max, int autosize, int maxnumb,
+ float min, float max, int autosize, int maxnumb,
Fl_Color textcolor)
/* Draws a bar chart. x,y,w,h is the bounding box, entries the array of
numb entries and min and max the boundaries. */
{
- double incr;
+ float incr;
int zeroh;
- double lh = fl_height();
+ float lh = fl_height();
if (max == min) incr = h;
else incr = h/(max-min);
if ( (-min*incr) < lh) {
@@ -55,7 +55,7 @@
} else {
zeroh = int(y+h+min * incr + .5);
}
- int bwidth = int(w/double(autosize?numb:maxnumb)+.5);
+ int bwidth = int(w/float(autosize?numb:maxnumb)+.5);
/* Draw base line */
fl_color(textcolor);
fl_line(x, zeroh, x+w, zeroh);
@@ -79,20 +79,20 @@
static void draw_horbarchart(int x,int y,int w,int h,
int numb, FL_CHART_ENTRY entries[],
- double min, double max, int autosize, int maxnumb,
+ float min, float max, int autosize, int maxnumb,
Fl_Color textcolor)
/* Draws a horizontal bar chart. x,y,w,h is the bounding box, entries the
array of numb entries and min and max the boundaries. */
{
int i;
- double lw = 0.0; /* Maximal label width */
+ float lw = 0.0; /* Maximal label width */
/* Compute maximal label width */
for (i=0; i<numb; i++) {
- double w1 = fl_width(entries[i].str);
+ float w1 = fl_width(entries[i].str);
if (w1 > lw) lw = w1;
}
if (lw > 0.0) lw += 4.0;
- double incr;
+ float incr;
int zeroh;
if (max == min) incr = w;
else incr = w/(max-min);
@@ -102,7 +102,7 @@
} else {
zeroh = int(x-min * incr + .5);
}
- int bwidth = int(h/double(autosize?numb:maxnumb)+.5);
+ int bwidth = int(h/float(autosize?numb:maxnumb)+.5);
/* Draw base line */
fl_color(textcolor);
fl_line(zeroh, y, zeroh, y+h);
@@ -124,18 +124,18 @@
static void draw_linechart(int type, int x,int y,int w,int h,
int numb, FL_CHART_ENTRY entries[],
- double min, double max, int autosize, int maxnumb,
+ float min, float max, int autosize, int maxnumb,
Fl_Color textcolor)
/* Draws a line chart. x,y,w,h is the bounding box, entries the array of
numb entries and min and max the boundaries. */
{
int i;
- double lh = fl_height();
- double incr;
+ float lh = fl_height();
+ float incr;
if (max == min) incr = h-2.0*lh;
else incr = (h-2.0*lh)/ (max-min);
int zeroh = int(y+h-lh+min * incr + .5);
- double bwidth = w/double(autosize?numb:maxnumb);
+ float bwidth = w/float(autosize?numb:maxnumb);
/* Draw the values */
for (i=0; i<numb; i++) {
int x0 = x + int((i-.5)*bwidth+.5);
@@ -151,7 +151,7 @@
} else if (type == FL_FILLED_CHART && i != 0) {
fl_color((Fl_Color)entries[i-1].col);
if ((entries[i-1].val>0.0)!=(entries[i].val>0.0)) {
- double ttt = entries[i-1].val/(entries[i-1].val-entries[i].val);
+ float ttt = entries[i-1].val/(entries[i-1].val-entries[i].val);
int xt = x + int((i-.5+ttt)*bwidth+.5);
fl_polygon(x0,zeroh, x0,y0, xt,zeroh);
fl_polygon(xt,zeroh, x1,y1, x1,zeroh);
@@ -179,12 +179,12 @@
numb entries */
{
int i;
- double xc,yc,rad; /* center and radius */
- double tot; /* sum of values */
- double incr; /* increment in angle */
- double curang; /* current angle we are drawing */
- double txc,tyc; /* temporary center */
- double lh = fl_height();
+ float xc,yc,rad; /* center and radius */
+ float tot; /* sum of values */
+ float incr; /* increment in angle */
+ float curang; /* current angle we are drawing */
+ float txc,tyc; /* temporary center */
+ float lh = fl_height();
/* compute center and radius */
xc = x+w/2.0; yc = y+h/2.0;
rad = h/2.0 - lh;
@@ -217,7 +217,7 @@
fl_end_loop();
curang += 0.5 * incr * entries[i].val;
/* draw the label */
- double xl = txc + 1.1*rad*cos(ARCINC*curang);
+ float xl = txc + 1.1*rad*cos(ARCINC*curang);
fl_draw(entries[i].str,
int(xl+.5),
int(tyc - 1.1*rad*sin(ARCINC*curang)+.5),
@@ -297,7 +297,7 @@
redraw();
}
-void Fl_Chart::add(double val, const char *str, uchar col) {
+void Fl_Chart::add(float val, const char *str, uchar col) {
/* Allocate more entries if required */
if (numb >= sizenumb) {
sizenumb += FL_CHART_MAX;
@@ -320,7 +320,7 @@
redraw();
}
-void Fl_Chart::insert(int index, double val, const char *str, uchar col) {
+void Fl_Chart::insert(int index, float val, const char *str, uchar col) {
int i;
if (index < 1 || index > numb+1) return;
/* Allocate more entries if required */
@@ -343,7 +343,7 @@
redraw();
}
-void Fl_Chart::replace(int index,double val, const char *str, uchar col) {
+void Fl_Chart::replace(int index,float val, const char *str, uchar col) {
if (index < 1 || index > numb) return;
entries[index-1].val = float(val);
entries[index-1].col = col;
@@ -356,7 +356,7 @@
redraw();
}
-void Fl_Chart::bounds(double min, double max) {
+void Fl_Chart::bounds(float min, float max) {
this->min = min;
this->max = max;
redraw();
Modified: trunk/user/pixil/libs/flnx/src/Fl_Clock.cxx
===================================================================
--- trunk/user/pixil/libs/flnx/src/Fl_Clock.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/src/Fl_Clock.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -40,7 +40,7 @@
const float minhand[4][2] = {{-0.5f, 0}, {0, 1.5f}, {0.5f, 0}, {0, -11.5f}};
const float sechand[4][2] = {{-0.1f, 0}, {0, 2.0f}, {0.1f, 0}, {0, -11.5f}};
-static void drawhand(double ang,const float v[][2],Fl_Color fill,Fl_Color line)
+static void drawhand(float ang,const float v[][2],Fl_Color fill,Fl_Color line)
{
fl_push_matrix();
fl_rotate(ang);
@@ -57,9 +57,9 @@
drawhand(-360*(second()/60.0), sechand, fill, line);
}
-static void rect(double x, double y, double w, double h) {
- double r = x+w;
- double t = y+h;
+static void rect(float x, float y, float w, float h) {
+ float r = x+w;
+ float t = y+h;
fl_begin_polygon();
fl_vertex(x, y);
fl_vertex(r, y);
@@ -147,7 +147,7 @@
struct timeval t;
gettimeofday(&t, 0);
((Fl_Clock*)v)->value(t.tv_sec);
- double delay = 1.0-t.tv_usec*.000001;
+ float delay = 1.0-t.tv_usec*.000001;
if (delay < .1 || delay > .9) delay = 1.0;
Fl::add_timeout(delay, tick, v);
#endif
Modified: trunk/user/pixil/libs/flnx/src/Fl_Color_Chooser.cxx
===================================================================
--- trunk/user/pixil/libs/flnx/src/Fl_Color_Chooser.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/src/Fl_Color_Chooser.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -46,15 +46,15 @@
#define UPDATE_HUE_BOX 1
void Fl_Color_Chooser::hsv2rgb(
- double H, double S, double V, double& r, double& g, double& b) {
+ float H, float S, float V, float& r, float& g, float& b) {
if (S < 5.0e-6) {
r = g = b = V;
} else {
int i = (int)H;
- double f = H - (float)i;
- double p1 = V*(1.0-S);
- double p2 = V*(1.0-S*f);
- double p3 = V*(1.0-S*(1.0-f));
+ float f = H - (float)i;
+ float p1 = V*(1.0-S);
+ float p2 = V*(1.0-S*f);
+ float p3 = V*(1.0-S*(1.0-f));
switch (i) {
case 0: r = V; g = p3; b = p1; break;
case 1: r = p2; g = V; b = p1; break;
@@ -67,16 +67,16 @@
}
void Fl_Color_Chooser::rgb2hsv(
- double r, double g, double b, double& H, double& S, double& V) {
- double maxv = r > g ? r : g; if (b > maxv) maxv = b;
+ float r, float g, float b, float& H, float& S, float& V) {
+ float maxv = r > g ? r : g; if (b > maxv) maxv = b;
V = maxv;
if (maxv>0) {
- double minv = r < g ? r : g; if (b < minv) minv = b;
- S = 1.0 - double(minv)/maxv;
+ float minv = r < g ? r : g; if (b < minv) minv = b;
+ S = 1.0 - float(minv)/maxv;
if (maxv > minv) {
- if (maxv == r) {H = (g-b)/double(maxv-minv); if (H<0) H += 6.0;}
- else if (maxv == g) H = 2.0+(b-r)/double(maxv-minv);
- else H = 4.0+(r-g)/double(maxv-minv);
+ if (maxv == r) {H = (g-b)/float(maxv-minv); if (H<0) H += 6.0;}
+ else if (maxv == g) H = 2.0+(b-r)/float(maxv-minv);
+ else H = 4.0+(r-g)/float(maxv-minv);
}
}
}
@@ -117,12 +117,12 @@
}
}
-int Fl_Color_Chooser::rgb(double r, double g, double b) {
+int Fl_Color_Chooser::rgb(float r, float g, float b) {
if (r == r_ && g == g_ && b == b_) return 0;
r_ = r; g_ = g; b_ = b;
- double ph = hue_;
- double ps = saturation_;
- double pv = value_;
+ float ph = hue_;
+ float ps = saturation_;
+ float pv = value_;
rgb2hsv(r,g,b,hue_,saturation_,value_);
set_valuators();
if (value_ != pv) {
@@ -137,14 +137,14 @@
return 1;
}
-int Fl_Color_Chooser::hsv(double h, double s, double v) {
+int Fl_Color_Chooser::hsv(float h, float s, float v) {
h = fmod(h,6.0); if (h < 0.0) h += 6.0;
if (s < 0.0) s = 0.0; else if (s > 1.0) s = 1.0;
if (v < 0.0) v = 0.0; else if (v > 1.0) v = 1.0;
if (h == hue_ && s == saturation_ && v == value_) return 0;
- double ph = hue_;
- double ps = saturation_;
- double pv = value_;
+ float ph = hue_;
+ float ps = saturation_;
+ float pv = value_;
hue_ = h; saturation_ = s; value_ = v;
if (value_ != pv) {
#ifdef UPDATE_HUE_BOX
@@ -162,7 +162,7 @@
////////////////////////////////////////////////////////////////
-static void tohs(double x, double y, double& h, double& s) {
+static void tohs(float x, float y, float& h, float& s) {
#ifdef CIRCLE
x = 2*x-1;
y = 1-2*y;
@@ -176,16 +176,16 @@
}
int Flcc_HueBox::handle(int e) {
- static double ih, is;
+ static float ih, is;
Fl_Color_Chooser* c = (Fl_Color_Chooser*)parent();
switch (e) {
case FL_PUSH:
ih = c->hue();
is = c->saturation();
case FL_DRAG: {
- double Xf, Yf, H, S;
- Xf = (Fl::event_x()-x()-Fl::box_dx(box()))/double(w()-Fl::box_dw(box()));
- Yf = (Fl::event_y()-y()-Fl::box_dy(box()))/double(h()-Fl::box_dh(box()));
+ float Xf, Yf, H, S;
+ Xf = (Fl::event_x()-x()-Fl::box_dx(box()))/float(w()-Fl::box_dw(box()));
+ Yf = (Fl::event_y()-y()-Fl::box_dy(box()))/float(h()-Fl::box_dh(box()));
tohs(Xf, Yf, H, S);
if (fabs(H-ih) < 3*6.0/w()) H = ih;
if (fabs(S-is) < 3*1.0/h()) S = is;
@@ -200,16 +200,16 @@
static void generate_image(void* vv, int X, int Y, int W, uchar* buf) {
Flcc_HueBox* v = (Flcc_HueBox*)vv;
int iw = v->w()-Fl::box_dw(v->box());
- double Yf = double(Y)/(v->h()-Fl::box_dh(v->box()));
+ float Yf = float(Y)/(v->h()-Fl::box_dh(v->box()));
#ifdef UPDATE_HUE_BOX
- const double V = ((Fl_Color_Chooser*)(v->parent()))->value();
+ const float V = ((Fl_Color_Chooser*)(v->parent()))->value();
#else
- const double V = 1.0;
+ const float V = 1.0;
#endif
for (int x = X; x < X+W; x++) {
- double Xf = double(x)/iw;
- double H,S; tohs(Xf,Yf,H,S);
- double r,g,b;
+ float Xf = float(x)/iw;
+ float H,S; tohs(Xf,Yf,H,S);
+ float r,g,b;
Fl_Color_Chooser::hsv2rgb(H,S,V,r,g,b);
*buf++ = uchar(255*r+.5);
*buf++ = uchar(255*g+.5);
@@ -244,14 +244,14 @@
////////////////////////////////////////////////////////////////
int Flcc_ValueBox::handle(int e) {
- static double iv;
+ static float iv;
Fl_Color_Chooser* c = (Fl_Color_Chooser*)parent();
switch (e) {
case FL_PUSH:
iv = c->value();
case FL_DRAG: {
- double Yf;
- Yf = 1-(Fl::event_y()-y()-Fl::box_dy(box()))/double(h()-Fl::box_dh(box()));
+ float Yf;
+ Yf = 1-(Fl::event_y()-y()-Fl::box_dy(box()))/float(h()-Fl::box_dh(box()));
if (fabs(Yf-iv)<(3*1.0/h())) Yf = iv;
if (c->hsv(c->hue(),c->saturation(),Yf)) c->do_callback();
} return 1;
@@ -260,10 +260,10 @@
}
}
-static double tr, tg, tb;
+static float tr, tg, tb;
static void generate_vimage(void* vv, int X, int Y, int W, uchar* buf) {
Flcc_ValueBox* v = (Flcc_ValueBox*)vv;
- double Yf = 255*(1.0-double(Y)/(v->h()-Fl::box_dh(v->box())));
+ float Yf = 255*(1.0-float(Y)/(v->h()-Fl::box_dh(v->box())));
uchar r = uchar(tr*Yf+.5);
uchar g = uchar(tg*Yf+.5);
uchar b = uchar(tb*Yf+.5);
@@ -293,9 +293,9 @@
void Fl_Color_Chooser::rgb_cb(Fl_Widget* o, void*) {
Fl_Color_Chooser* c = (Fl_Color_Chooser*)(o->parent());
- double r = c->rvalue.value();
- double g = c->gvalue.value();
- double b = c->bvalue.value();
+ float r = c->rvalue.value();
+ float g = c->gvalue.value();
+ float b = c->bvalue.value();
if (c->mode() == M_HSV) {
if (c->hsv(r,g,b)) c->do_callback();
return;
@@ -383,7 +383,7 @@
extern const char* fl_ok;
extern const char* fl_cancel;
-int fl_color_chooser(const char* name, double& r, double& g, double& b) {
+int fl_color_chooser(const char* name, float& r, float& g, float& b) {
Fl_Window window(210,165,name);
Fl_Color_Chooser chooser(5, 5, 200, 95);
ColorChip ok_color(5, 105, 95, 30);
@@ -418,9 +418,9 @@
}
int fl_color_chooser(const char* name, uchar& r, uchar& g, uchar& b) {
- double dr = r/255.0;
- double dg = g/255.0;
- double db = b/255.0;
+ float dr = r/255.0;
+ float dg = g/255.0;
+ float db = b/255.0;
if (fl_color_chooser(name,dr,dg,db)) {
r = uchar(255*dr+.5);
g = uchar(255*dg+.5);
Modified: trunk/user/pixil/libs/flnx/src/Fl_Counter.cxx
===================================================================
--- trunk/user/pixil/libs/flnx/src/Fl_Counter.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/src/Fl_Counter.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -84,7 +84,7 @@
void Fl_Counter::increment_cb() {
if (!mouseobj) return;
- double v = value();
+ float v = value();
switch (mouseobj) {
case 1: v -= lstep_; break;
case 2: v = increment(v, -1); break;
Modified: trunk/user/pixil/libs/flnx/src/Fl_Dial.cxx
===================================================================
--- trunk/user/pixil/libs/flnx/src/Fl_Dial.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/src/Fl_Dial.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -37,7 +37,7 @@
y += Fl::box_dy(box());
w -= Fl::box_dw(box());
h -= Fl::box_dh(box());
- double angle = (a2-a1)*(value()-minimum())/(maximum()-minimum()) + a1;
+ float angle = (a2-a1)*(value()-minimum())/(maximum()-minimum()) + a1;
if (type() == FL_FILL_DIAL) {
// foo: draw this nicely in certain round box types
int foo = (box() > _FL_ROUND_UP_BOX && Fl::box_dx(box()));
@@ -96,11 +96,11 @@
int mx = Fl::event_x()-x-w/2;
int my = Fl::event_y()-y-h/2;
if (!mx && !my) return 1;
- double angle = 270-atan2((float)-my, (float)mx)*180/M_PI;
- double oldangle = (a2-a1)*(value()-minimum())/(maximum()-minimum()) + a1;
+ float angle = 270-atan2((float)-my, (float)mx)*180/M_PI;
+ float oldangle = (a2-a1)*(value()-minimum())/(maximum()-minimum()) + a1;
while (angle < oldangle-180) angle += 360;
while (angle > oldangle+180) angle -= 360;
- double val;
+ float val;
if ((a1<a2) ? (angle <= a1) : (angle >= a1)) {
val = minimum();
} else if ((a1<a2) ? (angle >= a2) : (angle <= a2)) {
Modified: trunk/user/pixil/libs/flnx/src/Fl_Input_.cxx
===================================================================
--- trunk/user/pixil/libs/flnx/src/Fl_Input_.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/src/Fl_Input_.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -68,7 +68,7 @@
if (ww_)
{
if (wordwrap && (p >= value_+size_ || *p==' ' || *p=='\n')) {
- width_to_lastspace += fl_width(lastspace, p-lastspace);
+ width_to_lastspace += (int)fl_width(lastspace, p-lastspace);
if (p > lastspace+1) {
if (width_to_lastspace > wordwrap) {
p = lastspace; o = lastspace_out; break;
@@ -105,7 +105,7 @@
}
// After filling in such a buffer, find the width to e
-double Fl_Input_::expandpos(
+float Fl_Input_::expandpos(
const char* p, // real string
const char* e, // pointer into real string
const char* buf, // conversion of real string by expand()
@@ -154,7 +154,7 @@
////////////////////////////////////////////////////////////////
-static double up_down_pos;
+static float up_down_pos;
static int was_up_down;
void Fl_Input_::setfont() const {
@@ -365,16 +365,16 @@
p = e;
if (e >= value_+size_) break;
}
- const char *l, *r, *t; double f0 = Fl::event_x()-X+xscroll_;
+ const char *l, *r, *t; float f0 = Fl::event_x()-X+xscroll_;
for (l = p, r = e; l<r; ) {
- double f;
+ float f;
t = l+(r-l+1)/2;
f = X-xscroll_+expandpos(p, t, buf, 0);
if (f <= Fl::event_x()) {l = t; f0 = Fl::event_x()-f;}
else r = t-1;
}
if (l < e) { // see if closer to character on right:
- double f1 = X-xscroll_+expandpos(p, l+1, buf, 0)-Fl::event_x();
+ float f1 = X-xscroll_+expandpos(p, l+1, buf, 0)-Fl::event_x();
if (f1 < f0) l = l+1;
}
newpos = l-value();
@@ -441,10 +441,10 @@
int Fl_Input_::up_down_position(int i, int keepmark) {
while (i > 0 && index(i-1) != '\n') i--; // go to start of line
- double oldwid = 0.0;
+ float oldwid = 0.0;
setfont();
while (index(i) && index(i)!='\n') {
- double tt = oldwid + fl_width(index(i));
+ float tt = oldwid + fl_width(index(i));
if ((oldwid+tt)/2 >= up_down_pos) break;
oldwid = tt;
i++;
Modified: trunk/user/pixil/libs/flnx/src/Fl_Positioner.cxx
===================================================================
--- trunk/user/pixil/libs/flnx/src/Fl_Positioner.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/src/Fl_Positioner.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -30,7 +30,7 @@
#include <FL/Fl_Positioner.H>
#include <FL/fl_draw.H>
-static double flinear(double val, double smin, double smax, double gmin, double gmax)
+static float flinear(float val, float smin, float smax, float gmin, float gmax)
{
if (smin == smax) return gmax;
else return gmin + (gmax - gmin) * (val - smin) / (smax - smin);
@@ -54,7 +54,7 @@
draw_label();
}
-int Fl_Positioner::value(double X, double Y) {
+int Fl_Positioner::value(float X, float Y) {
clear_changed();
if (X == xvalue_ && Y == yvalue_) return 0;
xvalue_ = X; yvalue_ = Y;
@@ -62,11 +62,11 @@
return 1;
}
-int Fl_Positioner::xvalue(double X) {
+int Fl_Positioner::xvalue(float X) {
return(value(X, yvalue_));
}
-int Fl_Positioner::yvalue(double Y) {
+int Fl_Positioner::yvalue(float Y) {
return(value(xvalue_, Y));
}
@@ -75,15 +75,15 @@
case FL_PUSH:
case FL_DRAG:
case FL_RELEASE: {
- double x1 = x + 4;
- double y1 = y + 4;
- double w1 = w - 2 * 4;
- double h1 = h - 2 * 4;
- double X = flinear(Fl::event_x(), x1, x1+w1-1.0, xmin, xmax);
+ float x1 = x + 4;
+ float y1 = y + 4;
+ float w1 = w - 2 * 4;
+ float h1 = h - 2 * 4;
+ float X = flinear(Fl::event_x(), x1, x1+w1-1.0, xmin, xmax);
if (xstep_) X = int(X/xstep_+0.5) * xstep_;
if (X < xmin) X = xmin;
if (X > xmax) X = xmax;
- double Y = flinear(Fl::event_y(), y1, y1+h1-1.0, ymin, ymax);
+ float Y = flinear(Fl::event_y(), y1, y1+h1-1.0, ymin, ymax);
if (ystep_) Y = int(Y/ystep_+0.5) * ystep_;
if (Y < ymin) Y = ymin;
if (Y > ymax) Y = ymax;
@@ -114,14 +114,14 @@
xstep_ = ystep_ = 0;
}
-void Fl_Positioner::xbounds(double a, double b) {
+void Fl_Positioner::xbounds(float a, float b) {
if (a != xmin || b != xmax) {
xmin = a; xmax = b;
redraw();
}
}
-void Fl_Positioner::ybounds(double a, double b) {
+void Fl_Positioner::ybounds(float a, float b) {
if (a != ymin || b != ymax) {
ymin = a; ymax = b;
redraw();
Modified: trunk/user/pixil/libs/flnx/src/Fl_Roller.cxx
===================================================================
--- trunk/user/pixil/libs/flnx/src/Fl_Roller.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/src/Fl_Roller.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -57,8 +57,8 @@
int H = h()-Fl::box_dh(box())-1;
if (W<=0 || H <=0) return;
int offset = step() ? int(value()/step()) : 0;
- const double ARC = 1.5; // 1/2 the number of radians visible
- const double delta = .2; // radians per knurl
+ const float ARC = 1.5; // 1/2 the number of radians visible
+ const float delta = .2; // radians per knurl
if (horizontal()) { // horizontal one
// draw shaded ends of wheel:
int h1 = W/4+1; // distance from end that shading starts
@@ -72,8 +72,8 @@
}
if (active_r()) {
// draw ridges:
- double junk;
- for (double y = -ARC+modf(offset*sin(ARC)/(W/2)/delta,&junk)*delta;;
+ float junk;
+ for (float y = -ARC+modff(offset*sin(ARC)/(W/2)/delta,&junk)*delta;;
y += delta) {
int y1 = int((sin(y)/sin(ARC)+1)*W/2);
if (y1 <= 0) continue; else if (y1 >= W-1) break;
@@ -106,8 +106,8 @@
}
if (active_r()) {
// draw ridges:
- double junk;
- for (double y = -ARC+modf(offset*sin(ARC)/(H/2)/delta,&junk)*delta;
+ float junk;
+ for (float y = -ARC+modff(offset*sin(ARC)/(H/2)/delta,&junk)*delta;
; y += delta) {
int y1 = int((sin(y)/sin(ARC)+1)*H/2);
if (y1 <= 0) continue; else if (y1 >= H-1) break;
Modified: trunk/user/pixil/libs/flnx/src/Fl_Scroll.cxx
===================================================================
--- trunk/user/pixil/libs/flnx/src/Fl_Scroll.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/src/Fl_Scroll.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -27,8 +27,10 @@
#include <FL/Fl_Scroll.H>
#include <FL/fl_draw.H>
-#include <iostream.h>
+#include <iostream>
+using namespace std;
+
// Insure the scrollbars are the last children:
void Fl_Scroll::fix_scrollbar_order() {
Fl_Widget*const* a = array();
Modified: trunk/user/pixil/libs/flnx/src/Fl_Scrollbar.cxx
===================================================================
--- trunk/user/pixil/libs/flnx/src/Fl_Scrollbar.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/src/Fl_Scrollbar.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -75,7 +75,7 @@
else {
int sliderx;
int S = int(slider_size()*W+.5);
- double val = (value()-minimum())/(maximum()-minimum());
+ float val = (value()-minimum())/(maximum()-minimum());
if (val >= 1.0) sliderx = W-S;
else if (val <= 0.0) sliderx = 0;
else sliderx = int(val*(W-S)+.5);
@@ -91,7 +91,7 @@
else {
int slidery;
int S = int(slider_size()*H+.5);
- double val = (value()-minimum())/(maximum()-minimum());
+ float val = (value()-minimum())/(maximum()-minimum());
if (val >= 1.0) slidery = H-S;
else if (val <= 0.0) slidery = 0;
else slidery = int(val*(H-S)+.5);
Modified: trunk/user/pixil/libs/flnx/src/Fl_Slider.cxx
===================================================================
--- trunk/user/pixil/libs/flnx/src/Fl_Slider.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/src/Fl_Slider.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -55,7 +55,7 @@
}
void
-Fl_Slider::slider_size(double v)
+Fl_Slider::slider_size(float v)
{
if (v < 0)
v = 0;
@@ -68,7 +68,7 @@
}
void
-Fl_Slider::bounds(double a, double b)
+Fl_Slider::bounds(float a, float b)
{
if (minimum() != a || maximum() != b) {
Fl_Valuator::bounds(a, b);
@@ -90,7 +90,7 @@
#ifndef PDA
if (w < 17) {
w = 17;
- slider_size(double (w) / double (W));
+ slider_size(float (w) / float (W));
slider_size_min_ = slider_size();
}
#else
@@ -120,7 +120,7 @@
#ifndef PDA
if (h < 17) {
h = 17;
- slider_size(double (h) / double (W));
+ slider_size(float (h) / float (W));
slider_size_min_ = slider_size();
}
#else
@@ -147,7 +147,7 @@
step(1, 1);
if (p + w > t + l)
l = p + w - t;
- slider_size(w >= l ? 1.0 : double (w) / double (l));
+ slider_size(w >= l ? 1.0 : float (w) / float (l));
#ifdef PDA
if (slider_size() < slider_size_min_) {
slider_size(slider_size_min_);
@@ -181,7 +181,7 @@
void
Fl_Slider::draw(int x, int y, int w, int h)
{
- double val;
+ float val;
if (minimum() == maximum())
val = 0.5;
@@ -305,7 +305,7 @@
int X;
static int offcenter;
if (type() == FL_HOR_FILL_SLIDER || type() == FL_VERT_FILL_SLIDER) {
- double val = (value() - minimum()) / (maximum() - minimum());
+ float val = (value() - minimum()) / (maximum() - minimum());
if (val >= 1.0)
X = W;
@@ -325,7 +325,7 @@
}
S = 0;
} else {
- double val = (value() - minimum()) / (maximum() - minimum());
+ float val = (value() - minimum()) / (maximum() - minimum());
if (val >= 1.0)
X = W - S;
@@ -345,7 +345,7 @@
}
}
X = mx - offcenter;
- double v;
+ float v;
TRY_AGAIN:
if (X < 0) {
X = 0;
Modified: trunk/user/pixil/libs/flnx/src/Fl_Valuator.cxx
===================================================================
--- trunk/user/pixil/libs/flnx/src/Fl_Valuator.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/src/Fl_Valuator.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -41,9 +41,9 @@
B = 1;
}
-const double epsilon = 1e-12 ;
+const float epsilon = 1e-12 ;
-void Fl_Valuator::step(double s) {
+void Fl_Valuator::step(float s) {
if (s < 0) s = -s;
A = rint(s);
B = 1;
@@ -57,7 +57,7 @@
void Fl_Valuator::value_damage() {damage(FL_DAMAGE_EXPOSE);} // by default do partial-redraw
-int Fl_Valuator::value(double v) {
+int Fl_Valuator::value(float v) {
clear_changed();
if (v == value_) return 0;
value_ = v;
@@ -65,9 +65,9 @@
return 1;
}
-double Fl_Valuator::softclamp(double v) {
+float Fl_Valuator::softclamp(float v) {
int which = (min<=max);
- double p = previous_value_;
+ float p = previous_value_;
if ((v<min)==which && p!=min && (p<min)!=which) return min;
else if ((v>max)==which && p!=max && (p>max)!=which) return max;
else return v;
@@ -75,7 +75,7 @@
// inline void Fl_Valuator::handle_push() {previous_value_ = value_;}
-void Fl_Valuator::handle_drag(double v) {
+void Fl_Valuator::handle_drag(float v) {
if (v != value_) {
value_ = v;
value_damage();
@@ -96,25 +96,25 @@
}
}
-double Fl_Valuator::round(double v) {
+float Fl_Valuator::round(float v) {
if (A) return rint(v*B/A)*A/B;
else return v;
}
-double Fl_Valuator::clamp(double v) {
+float Fl_Valuator::clamp(float v) {
if ((v<min)==(min<=max)) return min;
else if ((v>max)==(min<=max)) return max;
else return v;
}
-double Fl_Valuator::increment(double v, int n) {
+float Fl_Valuator::increment(float v, int n) {
if (!A) return v+n*(max-min)/100;
if (min > max) n = -n;
return (rint(v*B/A)+n)*A/B;
}
int Fl_Valuator::format(char* buffer) {
- double v = value();
+ float v = value();
if (!A || B==1) return sprintf(buffer, "%g", v);
int i, x;
for (x = 10, i = 2; x < B; x *= 10) i++;
Modified: trunk/user/pixil/libs/flnx/src/Fl_Value_Input.cxx
===================================================================
--- trunk/user/pixil/libs/flnx/src/Fl_Value_Input.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/src/Fl_Value_Input.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -36,7 +36,7 @@
void Fl_Value_Input::input_cb(Fl_Widget*, void* v) {
Fl_Value_Input& t = *(Fl_Value_Input*)v;
- double nv;
+ float nv;
if (t.step()>=1.0) nv = strtol(t.input.value(), 0, 0);
else nv = strtod(t.input.value(), 0);
hack_o_rama = &t;
@@ -68,7 +68,7 @@
}
int Fl_Value_Input::handle(int event) {
- double v;
+ float v;
int delta;
int mx = Fl::event_x();
static int ix, drag;
Modified: trunk/user/pixil/libs/flnx/src/Fl_Value_Output.cxx
===================================================================
--- trunk/user/pixil/libs/flnx/src/Fl_Value_Output.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/src/Fl_Value_Output.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -52,7 +52,7 @@
int Fl_Value_Output::handle(int event) {
if (!step()) return 0;
- double v;
+ float v;
int delta;
int mx = Fl::event_x();
static int ix, drag;
Modified: trunk/user/pixil/libs/flnx/src/Fl_cutpaste.cxx
===================================================================
--- trunk/user/pixil/libs/flnx/src/Fl_cutpaste.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/src/Fl_cutpaste.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -92,9 +92,9 @@
XSendEvent(fl_display, e.requestor, 0, 0, (XEvent *)&e);}
return 1;
+#endif //tanghao
default:
return 0;
-#endif //tanghao
}
}
Modified: trunk/user/pixil/libs/flnx/src/Fl_get_key.cxx
===================================================================
--- trunk/user/pixil/libs/flnx/src/Fl_get_key.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/src/Fl_get_key.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -40,7 +40,7 @@
int Fl::event_key(int k) {
if (k > FL_Button && k <= FL_Button+8)
return Fl::event_state(8<<(k-FL_Button));
- int i;
+ int i = 0;
#ifdef __sgi
// get some missing PC keyboard keys:
Modified: trunk/user/pixil/libs/flnx/src/Fl_get_system_colors.cxx
===================================================================
--- trunk/user/pixil/libs/flnx/src/Fl_get_system_colors.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/src/Fl_get_system_colors.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -30,13 +30,13 @@
void Fl::background(uchar r, uchar g, uchar b) {
// replace the gray ramp so that FL_GRAY is this color
if (!r) r = 1; else if (r==255) r = 254;
- double powr = log(r/255.0)/log((FL_GRAY-FL_GRAY_RAMP)/(FL_NUM_GRAY-1.0));
+ float powr = log(r/255.0)/log((FL_GRAY-FL_GRAY_RAMP)/(FL_NUM_GRAY-1.0));
if (!g) g = 1; else if (g==255) g = 254;
- double powg = log(g/255.0)/log((FL_GRAY-FL_GRAY_RAMP)/(FL_NUM_GRAY-1.0));
+ float powg = log(g/255.0)/log((FL_GRAY-FL_GRAY_RAMP)/(FL_NUM_GRAY-1.0));
if (!b) b = 1; else if (b==255) b = 254;
- double powb = log(b/255.0)/log((FL_GRAY-FL_GRAY_RAMP)/(FL_NUM_GRAY-1.0));
+ float powb = log(b/255.0)/log((FL_GRAY-FL_GRAY_RAMP)/(FL_NUM_GRAY-1.0));
for (int i = 0; i < FL_NUM_GRAY; i++) {
- double gray = i/(FL_NUM_GRAY-1.0);
+ float gray = i/(FL_NUM_GRAY-1.0);
Fl::set_color(fl_gray_ramp(i),
uchar(pow(gray,powr)*255+.5),
uchar(pow(gray,powg)*255+.5),
Modified: trunk/user/pixil/libs/flnx/src/Fl_win32.cxx
===================================================================
--- trunk/user/pixil/libs/flnx/src/Fl_win32.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/src/Fl_win32.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -132,7 +132,7 @@
return ::select(0,&fdt[0],&fdt[1],&fdt[2],&t);
}
-double fl_wait(int timeout_flag, double time) {
+float fl_wait(int timeout_flag, float time) {
int have_message = 0;
int timerid;
Modified: trunk/user/pixil/libs/flnx/src/Fl_x.cxx
===================================================================
--- trunk/user/pixil/libs/flnx/src/Fl_x.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/src/Fl_x.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -44,8 +44,10 @@
#include <string.h>
#include <unistd.h>
#include <sys/time.h>
-#include <iostream.h>
+#include <iostream>
+using namespace std;
+
#define CONSOLIDATE_MOTION 1
/**** Define this if your keyboard lacks a backspace key... ****/
/* #define BACKSPACE_HACK 1 */
@@ -341,12 +343,12 @@
int update = 0;
-double
-fl_wait (int timeout_flag, double time)
+float
+fl_wait (int timeout_flag, float time)
{
int msec = 0;
- double mtime = 100.0 * time;
+ float mtime = 100.0 * time;
if (timeout_flag)
if (mtime < 1)
@@ -557,7 +559,7 @@
{
int i;
- GR_WINDOW_INFO info;
+// GR_WINDOW_INFO info;
fl_xevent = (GR_EVENT *) & xevent;
Window xid = xevent.general.wid; //fl_window;
@@ -1496,8 +1498,8 @@
#endif
}
-double
-fl_wait (int timeout_flag, double time)
+float
+fl_wait (int timeout_flag, float time)
{
// OpenGL and other broken libraries call XEventsQueued
Modified: trunk/user/pixil/libs/flnx/src/cmap.cxx
===================================================================
--- trunk/user/pixil/libs/flnx/src/cmap.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/src/cmap.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -93,13 +93,13 @@
void background(uchar r, uchar g, uchar b) {
// replace the gray ramp so that color 47 (by default 2/3) is this color
if (!r) r = 1; else if (r==255) r = 254;
- double powr = log(r/255.0)/log((FL_GRAY-FL_GRAY_RAMP)/(FL_NUM_GRAY-1.0));
+ float powr = log(r/255.0)/log((FL_GRAY-FL_GRAY_RAMP)/(FL_NUM_GRAY-1.0));
if (!g) g = 1; else if (g==255) g = 254;
- double powg = log(g/255.0)/log((FL_GRAY-FL_GRAY_RAMP)/(FL_NUM_GRAY-1.0));
+ float powg = log(g/255.0)/log((FL_GRAY-FL_GRAY_RAMP)/(FL_NUM_GRAY-1.0));
if (!b) b = 1; else if (b==255) b = 254;
- double powb = log(b/255.0)/log((FL_GRAY-FL_GRAY_RAMP)/(FL_NUM_GRAY-1.0));
+ float powb = log(b/255.0)/log((FL_GRAY-FL_GRAY_RAMP)/(FL_NUM_GRAY-1.0));
for (int i = 0; i < FL_NUM_GRAY; i++) {
- double gray = i/(FL_NUM_GRAY-1.0);
+ float gray = i/(FL_NUM_GRAY-1.0);
cmap[i+FL_GRAY_RAMP][0] = uchar(pow(gray,powr)*255+.5);
cmap[i+FL_GRAY_RAMP][1] = uchar(pow(gray,powg)*255+.5);
cmap[i+FL_GRAY_RAMP][2] = uchar(pow(gray,powb)*255+.5);
Modified: trunk/user/pixil/libs/flnx/src/fl_arc.cxx
===================================================================
--- trunk/user/pixil/libs/flnx/src/fl_arc.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/src/fl_arc.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -30,31 +30,31 @@
#include <FL/fl_draw.H>
#include <FL/math.h>
-void fl_arc(double x, double y, double r, double start, double end) {
+void fl_arc(float x, float y, float r, float start, float end) {
// draw start point accurately:
- double A = start*(M_PI/180);
- double X = r*cos(A);
- double Y = -r*sin(A);
+ float A = start*(M_PI/180);
+ float X = r*cos(A);
+ float Y = -r*sin(A);
fl_vertex(x+X,y+Y);
// number of segments per radian:
int n; {
- double x1 = fl_transform_dx(r,0);
- double y1 = fl_transform_dy(r,0);
- double r1 = x1*x1+y1*y1;
+ float x1 = fl_transform_dx(r,0);
+ float y1 = fl_transform_dy(r,0);
+ float r1 = x1*x1+y1*y1;
x1 = fl_transform_dx(0,r);
y1 = fl_transform_dy(0,r);
- double r2 = x1*x1+y1*y1;
+ float r2 = x1*x1+y1*y1;
if (r2 < r1) r1 = r2;
n = int(sqrt(r1)*.841471);
if (n < 2) n = 2;
}
- double epsilon = 1.0/n;
- double E = end*(M_PI/180);
+ float epsilon = 1.0/n;
+ float E = end*(M_PI/180);
int i = int((E-A)*n);
if (i < 0) {i = -i; epsilon = -epsilon;}
- double epsilon2 = epsilon/2;
+ float epsilon2 = epsilon/2;
for (; i>1; i--) {
X += epsilon*Y;
Y -= epsilon2*X;
@@ -67,7 +67,7 @@
}
#if 0 // portable version. X-specific one in fl_vertex.C
-void fl_circle(double x,double y,double r) {
+void fl_circle(float x,float y,float r) {
_fl_arc(x, y, r, r, 0, 360);
}
#endif
Modified: trunk/user/pixil/libs/flnx/src/fl_arci.cxx
===================================================================
--- trunk/user/pixil/libs/flnx/src/fl_arci.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/src/fl_arci.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -40,7 +40,7 @@
#include <FL/math.h>
#endif
-void fl_arc(int x,int y,int w,int h,double a1,double a2) {
+void fl_arc(int x,int y,int w,int h,float a1,float a2) {
if (w <= 0 || h <= 0) return;
#ifdef WIN32
int xa = x+w/2+int(w*cos(a1/180.0*M_PI));
@@ -72,7 +72,7 @@
}
-void fl_pie(int x,int y,int w,int h,double a1,double a2) {
+void fl_pie(int x,int y,int w,int h,float a1,float a2) {
if (w <= 0 || h <= 0) return;
if (a1 == a2) return;
Modified: trunk/user/pixil/libs/flnx/src/fl_curve.cxx
===================================================================
--- trunk/user/pixil/libs/flnx/src/fl_curve.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/src/fl_curve.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -32,46 +32,46 @@
#include <FL/fl_draw.H>
#include <math.h>
-void fl_curve(double X0, double Y0,
- double X1, double Y1,
- double X2, double Y2,
- double X3, double Y3) {
- double x = fl_transform_x(X0,Y0);
- double y = fl_transform_y(X0,Y0);
- double x1 = fl_transform_x(X1,Y1);
- double y1 = fl_transform_y(X1,Y1);
- double x2 = fl_transform_x(X2,Y2);
- double y2 = fl_transform_y(X2,Y2);
- double x3 = fl_transform_x(X3,Y3);
- double y3 = fl_transform_y(X3,Y3);
+void fl_curve(float X0, float Y0,
+ float X1, float Y1,
+ float X2, float Y2,
+ float X3, float Y3) {
+ float x = fl_transform_x(X0,Y0);
+ float y = fl_transform_y(X0,Y0);
+ float x1 = fl_transform_x(X1,Y1);
+ float y1 = fl_transform_y(X1,Y1);
+ float x2 = fl_transform_x(X2,Y2);
+ float y2 = fl_transform_y(X2,Y2);
+ float x3 = fl_transform_x(X3,Y3);
+ float y3 = fl_transform_y(X3,Y3);
int n; { // find smaller size of bounding box
- double lx = x; if (x1<lx) lx=x1; if (x2<lx) lx=x2; if (x3<lx) lx=x3;
- double rx = x; if (x1>rx) rx=x1; if (x2>rx) rx=x2; if (x3>rx) rx=x3;
- double ly = y; if (y1<ly) ly=y1; if (y2<ly) ly=y2; if (y3<ly) ly=y3;
- double ry = y; if (y1>ry) ry=y1; if (y2>ry) ry=y2; if (y3>ry) ry=y3;
+ float lx = x; if (x1<lx) lx=x1; if (x2<lx) lx=x2; if (x3<lx) lx=x3;
+ float rx = x; if (x1>rx) rx=x1; if (x2>rx) rx=x2; if (x3>rx) rx=x3;
+ float ly = y; if (y1<ly) ly=y1; if (y2<ly) ly=y2; if (y3<ly) ly=y3;
+ float ry = y; if (y1>ry) ry=y1; if (y2>ry) ry=y2; if (y3>ry) ry=y3;
// calculate number of pieces to cut curve into:
n = int((rx-lx+ry-ly)/8); if (n < 3) n = 3;
}
- double e = 1.0/n;
+ float e = 1.0/n;
// calculate the coefficients of 3rd order equation:
- double xa = (x3-3*x2+3*x1-x);
- double xb = 3*(x2-2*x1+x);
- double xc = 3*(x1-x);
+ float xa = (x3-3*x2+3*x1-x);
+ float xb = 3*(x2-2*x1+x);
+ float xc = 3*(x1-x);
// calculate the forward differences:
- double dx1 = ((xa*e+xb)*e+xc)*e;
- double dx3 = 6*xa*e*e*e;
- double dx2 = dx3 + 2*xb*e*e;
+ float dx1 = ((xa*e+xb)*e+xc)*e;
+ float dx3 = 6*xa*e*e*e;
+ float dx2 = dx3 + 2*xb*e*e;
// calculate the coefficients of 3rd order equation:
- double ya = (y3-3*y2+3*y1-y);
- double yb = 3*(y2-2*y1+y);
- double yc = 3*(y1-y);
+ float ya = (y3-3*y2+3*y1-y);
+ float yb = 3*(y2-2*y1+y);
+ float yc = 3*(y1-y);
// calculate the forward differences:
- double dy1 = ((ya*e+yb)*e+yc)*e;
- double dy3 = 6*ya*e*e*e;
- double dy2 = dy3 + 2*yb*e*e;
+ float dy1 = ((ya*e+yb)*e+yc)*e;
+ float dy3 = 6*ya*e*e*e;
+ float dy2 = dy3 + 2*yb*e*e;
// draw point 0:
fl_transformed_vertex(x,y);
Modified: trunk/user/pixil/libs/flnx/src/fl_draw.cxx
===================================================================
--- trunk/user/pixil/libs/flnx/src/fl_draw.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/src/fl_draw.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -46,14 +46,14 @@
// Sets width to the width of the string in the current font.
static const char*
-expand(const char* from, char* buf, double maxw, int& n, double &width, int wrap) {
+expand(const char* from, char* buf, float maxw, int& n, float &width, int wrap) {
char* o = buf;
char* e = buf+(MAXBUF-4);
underline_at = 0;
char* word_end = o;
const char* word_start = from;
- double w = 0;
+ float w = 0;
const char* p = from;
for (;; p++) {
@@ -63,7 +63,7 @@
if (!c || c == ' ' || c == '\n') {
// test for word-wrap:
if (word_start < p && wrap) {
- double newwidth = w + fl_width(word_end, o-word_end);
+ float newwidth = w + fl_width(word_end, o-word_end);
if (word_end > buf && newwidth > maxw) { // break before this word
o = word_end;
p = word_start;
@@ -131,7 +131,7 @@
// count how many lines and put the last one into the buffer:
int lines;
- double width;
+ float width;
for (p=str,lines=0; ;) {
e = expand(p, buf, w, buflen, width, align&FL_ALIGN_WRAP);
lines++;
@@ -186,7 +186,7 @@
char buf[MAXBUF];
int buflen;
int lines;
- double width;
+ float width;
int W = 0;
for (p=str,lines=0; ;) {
e = expand(p, buf, w, buflen, width, w!=0);
Modified: trunk/user/pixil/libs/flnx/src/fl_draw_pixmap.cxx
===================================================================
--- trunk/user/pixil/libs/flnx/src/fl_draw_pixmap.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/src/fl_draw_pixmap.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -173,7 +173,7 @@
// if first color is ' ' it is transparent (put it later to make
// it not be transparent):
if (*p == ' ') {
- uchar* c = (uchar*)&d.colors[' '];
+ uchar* c = (uchar*)&d.colors[(int)' '];
#ifdef U64
*(U64*)c = 0;
#if WORDS_BIGENDIAN
Modified: trunk/user/pixil/libs/flnx/src/fl_font.cxx
===================================================================
--- trunk/user/pixil/libs/flnx/src/fl_font.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/src/fl_font.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -634,12 +634,12 @@
/* NanoX functions, because of speed issues with the */
/* TrueType fonts */
-double
+float
fl_width(const char *c)
{
#ifdef NANO_X
GR_FONT_INFO fi;
- double res = 0.0;
+ float res = 0.0;
width_cache_struct *wc = width_cache.check_cache(fl_xfont);
unsigned char *fwidths;
@@ -678,11 +678,11 @@
#endif //tanghao
}
-double
+float
fl_width(const char *c, int n)
{
#ifdef NANO_X
- double w = 0;
+ float w = 0;
GR_FONT_INFO fi;
width_cache_struct *wc = width_cache.check_cache(fl_xfont);
unsigned char *fwidths;
@@ -697,7 +697,7 @@
}
for (int i = 0; i < n; i++) {
- w += (double) (fwidths[*(c + i)]);
+ w += (float) (fwidths[*(c + i)]);
}
return w;
@@ -719,7 +719,7 @@
#endif //tanghao
}
-double
+float
fl_width(uchar c)
{
#ifdef NANO_X
Modified: trunk/user/pixil/libs/flnx/src/fl_font_win32.cxx
===================================================================
--- trunk/user/pixil/libs/flnx/src/fl_font_win32.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/src/fl_font_win32.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -147,19 +147,19 @@
return fl_fontsize->metr.tmDescent;
}
-double fl_width(const char* c) {
- double w = 0.0;
+float fl_width(const char* c) {
+ float w = 0.0;
while (*c) w += fl_fontsize->width[uchar(*c++)];
return w;
}
-double fl_width(const char* c, int n) {
- double w = 0.0;
+float fl_width(const char* c, int n) {
+ float w = 0.0;
while (n--) w += fl_fontsize->width[uchar(*c++)];
return w;
}
-double fl_width(uchar c) {
+float fl_width(uchar c) {
return fl_fontsize->width[c];
}
Modified: trunk/user/pixil/libs/flnx/src/fl_round_box.cxx
===================================================================
--- trunk/user/pixil/libs/flnx/src/fl_round_box.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/src/fl_round_box.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -33,7 +33,7 @@
// A compiler from a certain very large software company will not compile
// the function pointer assignment due to the name conflict with fl_arc.
// This function is to fix that:
-void fl_arc_i(int x,int y,int w,int h,double a1,double a2) {
+void fl_arc_i(int x,int y,int w,int h,float a1,float a2) {
fl_arc(x,y,w,h,a1,a2);
}
@@ -50,7 +50,7 @@
int d = w <= h ? w : h;
if (d <= 1) return;
fl_color((Fl_Color)color);
- void (*f)(int,int,int,int,double,double);
+ void (*f)(int,int,int,int,float,float);
f = (which==FILL) ? fl_pie : fl_arc_i;
if (which >= CLOSED) {
f(x+w-d, y, d, d, w<=h ? 0 : -90, w<=h ? 180 : 90);
Modified: trunk/user/pixil/libs/flnx/src/fl_rounded_box.cxx
===================================================================
--- trunk/user/pixil/libs/flnx/src/fl_rounded_box.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/src/fl_rounded_box.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -30,7 +30,7 @@
#define RS 15
#define BW 3
-static double offset[RN] = { 0.0, 0.07612, 0.29289, 0.61732, 1.0};
+static float offset[RN] = { 0.0, 0.07612, 0.29289, 0.61732, 1.0};
static void rbox(int fill, int x, int y, int w, int h) {
int i;
Modified: trunk/user/pixil/libs/flnx/src/fl_set_fonts.cxx
===================================================================
--- trunk/user/pixil/libs/flnx/src/fl_set_fonts.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/src/fl_set_fonts.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -240,7 +240,7 @@
Fl_Font Fl::set_fonts(const char* xstarname) {
fl_open_display();
- int xlistsize;
+ int xlistsize = 0;
char buf[20];
if (!xstarname) {
strcpy(buf,"-*-"); strcpy(buf+3,fl_encoding);
Modified: trunk/user/pixil/libs/flnx/src/fl_symbols.cxx
===================================================================
--- trunk/user/pixil/libs/flnx/src/fl_symbols.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/src/fl_symbols.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -162,7 +162,7 @@
fl_color(fl_color_average(c, FL_BLACK, .5));
}
-static void rectangle(double x,double y,double x2,double y2,Fl_Color col) {
+static void rectangle(float x,float y,float x2,float y2,Fl_Color col) {
fl_color(col);
BP; vv(x,y); vv(x2,y); vv(x2,y2); vv(x,y2); EP;
set_outline_color(col);
Modified: trunk/user/pixil/libs/flnx/src/fl_vertex.cxx
===================================================================
--- trunk/user/pixil/libs/flnx/src/fl_vertex.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/src/fl_vertex.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -31,7 +31,7 @@
#include <FL/math.h>
#include <stdlib.h>
-struct matrix {double a, b, c, d, x, y;};
+struct matrix {float a, b, c, d, x, y;};
static matrix m = {1, 0, 0, 1, 0, 0};
@@ -42,7 +42,7 @@
void fl_pop_matrix() {m = stack[--sptr];}
-void fl_mult_matrix(double a, double b, double c, double d, double x, double y) {
+void fl_mult_matrix(float a, float b, float c, float d, float x, float y) {
matrix o;
o.a = a*m.a + b*m.c;
@@ -54,15 +54,15 @@
m = o;
}
-void fl_scale(double x,double y) {fl_mult_matrix(x,0,0,y,0,0);}
+void fl_scale(float x,float y) {fl_mult_matrix(x,0,0,y,0,0);}
-void fl_scale(double x) {fl_mult_matrix(x,0,0,x,0,0);}
+void fl_scale(float x) {fl_mult_matrix(x,0,0,x,0,0);}
-void fl_translate(double x,double y) {fl_mult_matrix(1,0,0,1,x,y);}
+void fl_translate(float x,float y) {fl_mult_matrix(1,0,0,1,x,y);}
-void fl_rotate(double d) {
+void fl_rotate(float d) {
if (d) {
- double s, c;
+ float s, c;
if (d == 0) {s = 0; c = 1;}
else if (d == 90) {s = 1; c = 0;}
else if (d == 180) {s = 0; c = -1;}
@@ -96,13 +96,13 @@
void fl_begin_polygon() {n = 0; what = POLYGON;}
-double fl_transform_x(double x, double y) {return x*m.a + y*m.c + m.x;}
+float fl_transform_x(float x, float y) {return x*m.a + y*m.c + m.x;}
-double fl_transform_y(double x, double y) {return x*m.b + y*m.d + m.y;}
+float fl_transform_y(float x, float y) {return x*m.b + y*m.d + m.y;}
-double fl_transform_dx(double x, double y) {return x*m.a + y*m.c;}
+float fl_transform_dx(float x, float y) {return x*m.a + y*m.c;}
-double fl_transform_dy(double x, double y) {return x*m.b + y*m.d;}
+float fl_transform_dy(float x, float y) {return x*m.b + y*m.d;}
static void fl_transformed_vertex(COORD_T x, COORD_T y) {
if (!n || x != p[n-1].x || y != p[n-1].y) {
@@ -120,11 +120,11 @@
}
}
-void fl_transformed_vertex(double xf, double yf) {
+void fl_transformed_vertex(float xf, float yf) {
fl_transformed_vertex(COORD_T(xf+.5), COORD_T(yf+.5));
}
-void fl_vertex(double x,double y) {
+void fl_vertex(float x,float y) {
fl_transformed_vertex(x*m.a + y*m.c + m.x, x*m.b + y*m.d + m.y);
}
@@ -233,11 +233,11 @@
// warning: these do not draw rotated ellipses correctly!
// See fl_arc.c for portable version.
-void fl_circle(double x, double y,double r) {
- double xt = fl_transform_x(x,y);
- double yt = fl_transform_y(x,y);
- double rx = r * (m.c ? sqrt(m.a*m.a+m.c*m.c) : fabs(m.a));
- double ry = r * (m.b ? sqrt(m.b*m.b+m.d*m.d) : fabs(m.d));
+void fl_circle(float x, float y,float r) {
+ float xt = fl_transform_x(x,y);
+ float yt = fl_transform_y(x,y);
+ float rx = r * (m.c ? sqrt(m.a*m.a+m.c*m.c) : fabs(m.a));
+ float ry = r * (m.b ? sqrt(m.b*m.b+m.d*m.d) : fabs(m.d));
int llx = int(xt-rx+.5);
int w = int(xt+rx+.5)-llx;
int lly = int(yt-ry+.5);
Modified: trunk/user/pixil/libs/flnx/src/forms_timer.cxx
===================================================================
--- trunk/user/pixil/libs/flnx/src/forms_timer.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/src/forms_timer.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -67,7 +67,7 @@
col = selection_color();
draw_box(box(), col);
if (type() == FL_VALUE_TIMER && delay>0.0) {
- double d = direction_ ? total-delay : delay;
+ float d = direction_ ? total-delay : delay;
if (d < 60.0)
sprintf(str, "%.1f", d);
else {
@@ -87,9 +87,9 @@
void Fl_Timer::step() {
if (!on) return;
- double lastdelay = delay;
+ float lastdelay = delay;
long sec, usec; fl_gettime(&sec, &usec);
- delay -= (double) (sec - lastsec) + (double) (usec - lastusec) / 1000000.0;
+ delay -= (float) (sec - lastsec) + (float) (usec - lastusec) / 1000000.0;
lastsec = sec; lastusec = usec;
if (lastdelay > 0.0 && delay <= 0.0) {
if (type() == FL_HIDDEN_TIMER) {
@@ -127,7 +127,7 @@
if (t == FL_VALUE_TIMER) align(FL_ALIGN_LEFT);
}
-void Fl_Timer::value(double d) {
+void Fl_Timer::value(float d) {
delay = total = d;
on = (d > 0.0);
fl_gettime(&(lastsec), &(lastusec));
Modified: trunk/user/pixil/libs/flnx/src/gl_draw.cxx
===================================================================
--- trunk/user/pixil/libs/flnx/src/gl_draw.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/src/gl_draw.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -40,9 +40,9 @@
void gl_font(int fontid, int size) {fl_font(fontid, size);}
int gl_height() {return fl_height();}
int gl_descent() {return fl_descent();}
-double gl_width(const char* s) {return fl_width(s);}
-double gl_width(const char* s, int n) {return fl_width(s,n);}
-double gl_width(uchar c) {return fl_width(c);}
+float gl_width(const char* s) {return fl_width(s);}
+float gl_width(const char* s, int n) {return fl_width(s,n);}
+float gl_width(uchar c) {return fl_width(c);}
void gl_draw(const char* str, int n) {
if (!fl_fontsize->listbase) {
Modified: trunk/user/pixil/libs/flnx/src/vsnprintf.c
===================================================================
--- trunk/user/pixil/libs/flnx/src/vsnprintf.c 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/src/vsnprintf.c 2007-09-13 23:19:15 UTC (rev 1884)
@@ -84,7 +84,7 @@
case 'f':
case 'g':
*copy_p = 0;
- sprintf(sprintf_out, copy, va_arg(ap, double));
+ sprintf(sprintf_out, copy, va_arg(ap, float));
copy_p = sprintf_out;
goto DUP;
case 'p':
Modified: trunk/user/pixil/libs/flnx/test/CubeView.h
===================================================================
--- trunk/user/pixil/libs/flnx/test/CubeView.h 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/test/CubeView.h 2007-09-13 23:19:15 UTC (rev 1884)
@@ -45,7 +45,7 @@
public:
// this value determines the scaling factor used to draw the cube.
- double size;
+ float size;
CubeView(int x,int y,int w,int h,const char *l=0);
Modified: trunk/user/pixil/libs/flnx/test/arc.cxx
===================================================================
--- trunk/user/pixil/libs/flnx/test/arc.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/test/arc.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -28,7 +28,7 @@
#include <FL/Fl_Hor_Value_Slider.H>
#include <FL/fl_draw.H>
-double args[6] = {140, 140, 50, 0, 360, 0};
+float args[6] = {140, 140, 50, 0, 360, 0};
const char* name[6] = {"X", "Y", "R", "start", "end", "rotate"};
class Drawing : public Fl_Widget {
Modified: trunk/user/pixil/libs/flnx/test/checkers.cxx
===================================================================
--- trunk/user/pixil/libs/flnx/test/checkers.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/test/checkers.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -1257,7 +1257,7 @@
Fl_Value_Output *intel_output;
void intel_slider_cb(Fl_Widget*w, void*) {
- double v = ((Fl_Slider*)w)->value();
+ float v = ((Fl_Slider*)w)->value();
int n = int(v*v);
intel_output->value(n);
maxevaluate = maxnodes = n;
Modified: trunk/user/pixil/libs/flnx/test/color_chooser.cxx
===================================================================
--- trunk/user/pixil/libs/flnx/test/color_chooser.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/test/color_chooser.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -49,9 +49,9 @@
image = new uchar[3*width*height];
uchar *p = image;
for (int y = 0; y < height; y++) {
- double Y = double(y)/(height-1);
+ float Y = float(y)/(height-1);
for (int x = 0; x < width; x++) {
- double X = double(x)/(width-1);
+ float X = float(x)/(width-1);
*p++ = uchar(255*((1-X)*(1-Y))); // red in upper-left
*p++ = uchar(255*((1-X)*Y)); // green in lower-left
*p++ = uchar(255*(X*Y)); // blue in lower-right
Modified: trunk/user/pixil/libs/flnx/test/cube.cxx
===================================================================
--- trunk/user/pixil/libs/flnx/test/cube.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/test/cube.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -37,10 +37,10 @@
#if !HAVE_GL
class cube_box : public Fl_Box {
public:
- double lasttime;
+ float lasttime;
int wire;
- double size;
- double speed;
+ float size;
+ float speed;
cube_box(int x,int y,int w,int h,const char *l=0)
:Fl_Box(FL_DOWN_BOX,x,y,w,h,l){
label("This demo does\nnot work without GL");
@@ -53,10 +53,10 @@
class cube_box : public Fl_Gl_Window {
void draw();
public:
- double lasttime;
+ float lasttime;
int wire;
- double size;
- double speed;
+ float size;
+ float speed;
cube_box(int x,int y,int w,int h,const char *l=0)
: Fl_Gl_Window(x,y,w,h,l) {lasttime = 0.0;}
};
Modified: trunk/user/pixil/libs/flnx/test/curve.cxx
===================================================================
--- trunk/user/pixil/libs/flnx/test/curve.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/test/curve.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -29,7 +29,7 @@
#include <FL/fl_draw.H>
#include <FL/Fl_Toggle_Button.H>
-double args[9] = {
+float args[9] = {
20,20, 50,200, 100,20, 200,200, 0};
const char* name[9] = {
"X0", "Y0", "X1", "Y1", "X2", "Y2", "X3", "Y3", "rotate"};
Modified: trunk/user/pixil/libs/flnx/test/fractals.cxx
===================================================================
--- trunk/user/pixil/libs/flnx/test/fractals.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/test/fractals.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -607,7 +607,7 @@
glViewport(0,0,w,h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
- gluPerspective(60.0, (GLdouble)w/h, 0.01, 100);
+ gluPerspective(60.0, (GLfloat)w/h, 0.01, 100);
glPushMatrix();
glMatrixMode(GL_MODELVIEW);
glFlush();
Modified: trunk/user/pixil/libs/flnx/test/fullscreen.cxx
===================================================================
--- trunk/user/pixil/libs/flnx/test/fullscreen.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/test/fullscreen.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -90,7 +90,7 @@
glColor3f(.5,.6,.7);
glBegin(GL_POLYGON);
for (int i=0; i<sides; i++) {
- double ang = i*2*M_PI/sides;
+ float ang = i*2*M_PI/sides;
glVertex3f(cos(ang),sin(ang),0);
}
glEnd();
Modified: trunk/user/pixil/libs/flnx/test/gl_overlay.cxx
===================================================================
--- trunk/user/pixil/libs/flnx/test/gl_overlay.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/test/gl_overlay.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -71,7 +71,7 @@
// for (int j=1; j<=1000; j++) {
glBegin(GL_POLYGON);
for (int i=0; i<sides; i++) {
- double ang = i*2*M_PI/sides;
+ float ang = i*2*M_PI/sides;
glColor3f(float(i)/sides,float(i)/sides,float(i)/sides);
glVertex3f(cos(ang),sin(ang),0);
}
@@ -91,7 +91,7 @@
gl_color(FL_RED);
glBegin(GL_LINE_LOOP);
for (int i=0; i<overlay_sides; i++) {
- double ang = i*2*M_PI/overlay_sides;
+ float ang = i*2*M_PI/overlay_sides;
glVertex3f(cos(ang),sin(ang),0);
}
glEnd();
Modified: trunk/user/pixil/libs/flnx/test/glpuzzle.cxx
===================================================================
--- trunk/user/pixil/libs/flnx/test/glpuzzle.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/test/glpuzzle.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -871,7 +871,7 @@
invertMatrix(const GLfloat src[16], GLfloat inverse[16])
{
int i, j, k, swap;
- double t;
+ float t;
GLfloat temp[4][4];
for (i = 0; i < 4; i++) {
Modified: trunk/user/pixil/libs/flnx/test/image.cxx
===================================================================
--- trunk/user/pixil/libs/flnx/test/image.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/test/image.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -42,9 +42,9 @@
image = new uchar[3*width*height];
uchar *p = image;
for (int y = 0; y < height; y++) {
- double Y = double(y)/(height-1);
+ float Y = float(y)/(height-1);
for (int x = 0; x < width; x++) {
- double X = double(x)/(width-1);
+ float X = float(x)/(width-1);
*p++ = uchar(255*((1-X)*(1-Y))); // red in upper-left
*p++ = uchar(255*((1-X)*Y)); // green in lower-left
*p++ = uchar(255*(X*Y)); // blue in lower-right
Modified: trunk/user/pixil/libs/flnx/test/mandelbrot.cxx
===================================================================
--- trunk/user/pixil/libs/flnx/test/mandelbrot.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/test/mandelbrot.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -80,20 +80,20 @@
}
if (nextline < H) {
if (!buffer) buffer = new uchar[W*H];
- double yy = Y+(H/2-nextline)*scale/W;
- double yi = yy; if (julia) yy = jY;
+ float yy = Y+(H/2-nextline)*scale/W;
+ float yi = yy; if (julia) yy = jY;
uchar *p = buffer+nextline*W;
for (int xi = 0; xi < W; xi++) {
- double xx = X+(xi-W/2)*scale/W;
- double wx = xx; double wy = yi;
+ float xx = X+(xi-W/2)*scale/W;
+ float wx = xx; float wy = yi;
if (julia) xx = jX;
for (int i=0; ; i++) {
if (i >= iterations) {*p = 0; break;}
- double t = wx*wx - wy*wy + xx;
+ float t = wx*wx - wy*wy + xx;
wy = 2*wx*wy + yy;
wx = t;
if (wx*wx + wy*wy > 4) {
- wx = t = 1-double(i)/(1<<10);
+ wx = t = 1-float(i)/(1<<10);
if (t <= 0) t = 0; else for (i=brightness; i--;) t*=wx;
*p = 255-int(254*t);
break;
Modified: trunk/user/pixil/libs/flnx/test/mandelbrot.h
===================================================================
--- trunk/user/pixil/libs/flnx/test/mandelbrot.h 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/test/mandelbrot.h 2007-09-13 23:19:15 UTC (rev 1884)
@@ -39,8 +39,8 @@
int julia;
int iterations;
int brightness;
- double jX, jY;
- double X,Y,scale;
+ float jX, jY;
+ float X,Y,scale;
int sx, sy, sw, sh; // selection box
void erase_box();
int handle(int);
Modified: trunk/user/pixil/libs/flnx/test/shape.cxx
===================================================================
--- trunk/user/pixil/libs/flnx/test/shape.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/flnx/test/shape.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -59,7 +59,7 @@
glColor3f(.5,.6,.7);
glBegin(GL_POLYGON);
for (int i=0; i<sides; i++) {
- double ang = i*2*M_PI/sides;
+ float ang = i*2*M_PI/sides;
glVertex3f(cos(ang),sin(ang),0);
}
glEnd();
Modified: trunk/user/pixil/libs/pim/nxapp.cxx
===================================================================
--- trunk/user/pixil/libs/pim/nxapp.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/pim/nxapp.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -45,6 +45,7 @@
#include <unistd.h>
#include <errno.h>
#include <string.h>
+#include <time.h>
#include <ctype.h>
@@ -2471,14 +2472,14 @@
printf("copy_callback\n");
Fl_Widget *w = Fl::selection_owner();
- if (fl_editor_type && dynamic_cast < Fl_Editor * >(w)) {
+ if (fl_editor_type /*&& dynamic_cast < Fl_Editor * >(w)*/) {
// printf("Fl_Editor->Copy() w = %p\n", w);
((Fl_Editor *) w)->Copy();
} else {
- if (!fl_editor_type && dynamic_cast < Fl_Input * >(w)) {
+ if (!fl_editor_type /*&& dynamic_cast < Fl_Input * >(w)*/) {
((Fl_Input_ *) w)->copy();
}
@@ -2493,12 +2494,12 @@
undoTarget = w;
- if (fl_editor_type && dynamic_cast < Fl_Editor * >(w)) {
+ if (fl_editor_type /*&& dynamic_cast < Fl_Editor * >(w)*/) {
((Fl_Editor *) w)->Cut();
} else {
- if (!fl_editor_type && dynamic_cast < Fl_Input * >(w)) {
+ if (!fl_editor_type /*&& dynamic_cast < Fl_Input * >(w)*/) {
((Fl_Input *) w)->cut();
}
Modified: trunk/user/pixil/libs/pim/nxdb.cxx
===================================================================
--- trunk/user/pixil/libs/pim/nxdb.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/pim/nxdb.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -59,6 +59,7 @@
#else /* */
#ifdef __UCLIBC__
#include <iostream>
+using namespace std;
#endif /* */
#include <unistd.h>
#endif /* */
Modified: trunk/user/pixil/libs/pim/nxscrollbar.cxx
===================================================================
--- trunk/user/pixil/libs/pim/nxscrollbar.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/pim/nxscrollbar.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -129,7 +129,7 @@
else {
int sliderx;
int S = int (slider_size() * W + .5);
- double val = (value() - minimum()) / (maximum() - minimum());
+ float val = (value() - minimum()) / (maximum() - minimum());
if (val >= 1.0)
sliderx = W - S;
else if (val <= 0.0)
@@ -154,7 +154,7 @@
else {
int slidery;
int S = int (slider_size() * H + .5);
- double val = (value() - minimum()) / (maximum() - minimum());
+ float val = (value() - minimum()) / (maximum() - minimum());
if (val >= 1.0)
slidery = H - S;
else if (val <= 0.0)
Modified: trunk/user/pixil/libs/pim/nxslider.cxx
===================================================================
--- trunk/user/pixil/libs/pim/nxslider.cxx 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/libs/pim/nxslider.cxx 2007-09-13 23:19:15 UTC (rev 1884)
@@ -74,7 +74,7 @@
}
void
-NxSlider::slider_size(double v)
+NxSlider::slider_size(float v)
{
if (v < 0)
v = 0;
@@ -87,7 +87,7 @@
}
void
-NxSlider::bounds(double a, double b)
+NxSlider::bounds(float a, float b)
{
if (minimum() != a || maximum() != b) {
Fl_Valuator::bounds(a, b);
@@ -105,7 +105,7 @@
step(1, 1);
if (p + w > t + l)
l = p + w - t;
- slider_size(w >= l ? 1.0 : double (w) / double (l));
+ slider_size(w >= l ? 1.0 : float (w) / float (l));
#ifdef PDA
if (slider_size() < slider_size_min_) {
slider_size(slider_size_min_);
@@ -138,7 +138,7 @@
void
NxSlider::draw(int x, int y, int w, int h)
{
- double val;
+ float val;
if (minimum() == maximum())
val = 0.5;
@@ -292,7 +292,7 @@
if (w > 0 && h > 0) {
if (w < 17) {
w = 17;
- slider_size(double (w) / double (W));
+ slider_size(float (w) / float (W));
slider_size_min_ = slider_size();
}
draw_box(FL_BORDER_BOX, x, y, w, h, c);
@@ -318,7 +318,7 @@
if (w > 0 && h > 0) {
if (h < 17) {
h = 17;
- slider_size(double (h) / double (W));
+ slider_size(float (h) / float (W));
slider_size_min_ = slider_size();
}
@@ -359,7 +359,7 @@
int X;
static int offcenter;
if (type() == FL_HOR_FILL_SLIDER || type() == FL_VERT_FILL_SLIDER) {
- double val = (value() - minimum()) / (maximum() - minimum());
+ float val = (value() - minimum()) / (maximum() - minimum());
if (val >= 1.0)
X = W;
@@ -379,7 +379,7 @@
}
S = 0;
} else {
- double val = (value() - minimum()) / (maximum() - minimum());
+ float val = (value() - minimum()) / (maximum() - minimum());
if (val >= 1.0)
X = W - S;
@@ -399,7 +399,7 @@
}
}
X = mx - offcenter;
- double v;
+ float v;
TRY_AGAIN:
if (X < 0) {
X = 0;
Modified: trunk/user/pixil/packages/dvdview/dvdview/autom4te-2.53.cache/output.0
===================================================================
--- trunk/user/pixil/packages/dvdview/dvdview/autom4te-2.53.cache/output.0 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/dvdview/dvdview/autom4te-2.53.cache/output.0 2007-09-13 23:19:15 UTC (rev 1884)
@@ -2785,9 +2785,9 @@
va_end (v);
return s;
}
-int test (int i, double x);
+int test (int i, float x);
struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
+struct s2 {int (*f) (float a);};
int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
int argc;
char **argv;
Modified: trunk/user/pixil/packages/dvdview/dvdview/configure
===================================================================
--- trunk/user/pixil/packages/dvdview/dvdview/configure 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/dvdview/dvdview/configure 2007-09-13 23:19:15 UTC (rev 1884)
@@ -2785,9 +2785,9 @@
va_end (v);
return s;
}
-int test (int i, double x);
+int test (int i, float x);
struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
+struct s2 {int (*f) (float a);};
int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
int argc;
char **argv;
Modified: trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/aclocal.m4
===================================================================
--- trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/aclocal.m4 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/aclocal.m4 2007-09-13 23:19:15 UTC (rev 1884)
@@ -3741,9 +3741,9 @@
va_end (v);
return s;
}
-int test (int i, double x);
+int test (int i, float x);
struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
+struct s2 {int (*f) (float a);};
int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
int argc;
char **argv;
Modified: trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/autom4te-2.53.cache/output.0
===================================================================
--- trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/autom4te-2.53.cache/output.0 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/autom4te-2.53.cache/output.0 2007-09-13 23:19:15 UTC (rev 1884)
@@ -8229,9 +8229,9 @@
va_end (v);
return s;
}
-int test (int i, double x);
+int test (int i, float x);
struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
+struct s2 {int (*f) (float a);};
int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
int argc;
char **argv;
@@ -10182,9 +10182,9 @@
va_end (v);
return s;
}
-int test (int i, double x);
+int test (int i, float x);
struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
+struct s2 {int (*f) (float a);};
int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
int argc;
char **argv;
Modified: trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/autom4te-2.53.cache/output.1
===================================================================
--- trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/autom4te-2.53.cache/output.1 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/autom4te-2.53.cache/output.1 2007-09-13 23:19:15 UTC (rev 1884)
@@ -8230,9 +8230,9 @@
va_end (v);
return s;
}
-int test (int i, double x);
+int test (int i, float x);
struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
+struct s2 {int (*f) (float a);};
int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
int argc;
char **argv;
@@ -10197,9 +10197,9 @@
va_end (v);
return s;
}
-int test (int i, double x);
+int test (int i, float x);
struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
+struct s2 {int (*f) (float a);};
int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
int argc;
char **argv;
Modified: trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/configure
===================================================================
--- trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/configure 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/configure 2007-09-13 23:19:15 UTC (rev 1884)
@@ -8230,9 +8230,9 @@
va_end (v);
return s;
}
-int test (int i, double x);
+int test (int i, float x);
struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
+struct s2 {int (*f) (float a);};
int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
int argc;
char **argv;
@@ -10197,9 +10197,9 @@
va_end (v);
return s;
}
-int test (int i, double x);
+int test (int i, float x);
struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
+struct s2 {int (*f) (float a);};
int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
int argc;
char **argv;
Modified: trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/libvideogfx/graphics/basic/image_tmpl.cc
===================================================================
--- trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/libvideogfx/graphics/basic/image_tmpl.cc 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/libvideogfx/graphics/basic/image_tmpl.cc 2007-09-13 23:19:15 UTC (rev 1884)
@@ -10,7 +10,7 @@
template class Bitmap<Pixel>;
template class Bitmap<bool>;
-template class Bitmap<double>;
+template class Bitmap<float>;
#include "image.cc"
#include "bitmap.cc"
Modified: trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/libvideogfx/graphics/color/colorspace.cc
===================================================================
--- trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/libvideogfx/graphics/color/colorspace.cc 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/libvideogfx/graphics/color/colorspace.cc 2007-09-13 23:19:15 UTC (rev 1884)
@@ -516,16 +516,16 @@
}
-void HSB2RGB(double h,double s,double br, double& red,double& green,double& blue)
+void HSB2RGB(float h,float s,float br, float& red,float& green,float& blue)
{
- double hue = h;
- double saturation = s;
- double brightness = br;
+ float hue = h;
+ float saturation = s;
+ float brightness = br;
if (brightness == 0.0) { red = green = blue = 0.0; return; }
if (saturation == 0.0) { red = green = blue = brightness; return; }
- double offs; // hue mod 1/6
+ float offs; // hue mod 1/6
if (hue < 1.0/6)
{ // red domain; green ascends
offs = hue;
Modified: trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/libvideogfx/graphics/color/colorspace.hh
===================================================================
--- trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/libvideogfx/graphics/color/colorspace.hh 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/libvideogfx/graphics/color/colorspace.hh 2007-09-13 23:19:15 UTC (rev 1884)
@@ -79,7 +79,7 @@
-void HSB2RGB(double h,double s,double b, double& r,double& g,double& b); // input/output range: 0..1
+void HSB2RGB(float h,float s,float b, float& r,float& g,float& b); // input/output range: 0..1
void RGB2YUV(uint8 r,uint8 g,uint8 b, uint8& y,uint8& u,uint8& v);
Modified: trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/libvideogfx/graphics/datatypes/motionfield.hh
===================================================================
--- trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/libvideogfx/graphics/datatypes/motionfield.hh 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/libvideogfx/graphics/datatypes/motionfield.hh 2007-09-13 23:19:15 UTC (rev 1884)
@@ -24,7 +24,7 @@
struct MotionVector
{
- double h,v;
+ float h,v;
};
Modified: trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/libvideogfx/graphics/draw/draw.cc
===================================================================
--- trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/libvideogfx/graphics/draw/draw.cc 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/libvideogfx/graphics/draw/draw.cc 2007-09-13 23:19:15 UTC (rev 1884)
@@ -204,9 +204,9 @@
}
// This function is a part of the DrawLine algorithm. Do not call this function directly
-static bool Clipt(double denom,double num, double& tE, double& tL)
+static bool Clipt(float denom,float num, float& tE, float& tL)
{
- double t;
+ float t;
bool accept = true;
if (denom > 0)
@@ -238,10 +238,10 @@
void ClipLine(int& x0,int& y0,int& x1, int& y1, int xMax, int yMax, bool& visible)
{
- double dx = (double)(x1 - x0);
- double dy = (double)(y1 - y0);
- double tE = 0.0;
- double tL = 1.0;
+ float dx = (float)(x1 - x0);
+ float dy = (float)(y1 - y0);
+ float tE = 0.0;
+ float tL = 1.0;
visible = false;
if (Clipt(dx,0-(x0),tE,tL))
@@ -281,13 +281,13 @@
}
// This function draws a line and places a head on one (arrows == false) or both (arrows==true) sides of the line.
-template <class T> void DrawArrow(Bitmap<T>& bm,int x0,int y0,int x1, int y1,double alpha,int l,T color,bool arrows = false)
+template <class T> void DrawArrow(Bitmap<T>& bm,int x0,int y0,int x1, int y1,float alpha,int l,T color,bool arrows = false)
{
DrawLine(bm,x0,y0,x1,y1,color);
// zeichnen der Pfeilspitze
int xa,ya,dxp,dyp;
- double norm;
+ float norm;
dxp = x1-x0;
dyp = y1-y0;
@@ -547,22 +547,22 @@
}
// this function draws an ellipse. Clipping is also included.
-template <class T> void DrawEllipse(Bitmap<T>& bm,int xm,int ym, int a,int b,double angle,T color)
+template <class T> void DrawEllipse(Bitmap<T>& bm,int xm,int ym, int a,int b,float angle,T color)
{
T*const* p = bm.AskFrame();
static int flag = 0;
- const double beta = angle*M_PI/180;
+ const float beta = angle*M_PI/180;
- const double cosb = cos(beta);
- const double sinb = sin(beta);
- static double alpha_step = M_PI/180;
+ const float cosb = cos(beta);
+ const float sinb = sin(beta);
+ static float alpha_step = M_PI/180;
int x[3],y[3];
- for (double alpha=0;alpha<2*M_PI;alpha+=alpha_step)
+ for (float alpha=0;alpha<2*M_PI;alpha+=alpha_step)
{
- double sina,cosa;
+ float sina,cosa;
cosa = cos(alpha)*a;
sina = sin(alpha)*b;
@@ -636,11 +636,11 @@
template void DrawRectangle(Bitmap<Pixel>& bm,int x1,int y1,int w, int h,Pixel color);
-template void DrawArrow(Bitmap<Pixel>& bm,int x0,int y0,int x1, int y1,double alpha,int l,
+template void DrawArrow(Bitmap<Pixel>& bm,int x0,int y0,int x1, int y1,float alpha,int l,
Pixel color,bool arrows);
template void DrawLine(Bitmap<Pixel>& bm,int x0,int y0,int x1, int y1,Pixel color);
template void DrawCircle(Bitmap<Pixel>& bm,int x0,int y0, int radius,Pixel color,bool);
-template void DrawEllipse(Bitmap<Pixel>& bm,int xm,int ym, int a,int b,double angle,Pixel);
+template void DrawEllipse(Bitmap<Pixel>& bm,int xm,int ym, int a,int b,float angle,Pixel);
template class ArrowPainter<Pixel>;
Modified: trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/libvideogfx/graphics/draw/draw.hh
===================================================================
--- trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/libvideogfx/graphics/draw/draw.hh 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/libvideogfx/graphics/draw/draw.hh 2007-09-13 23:19:15 UTC (rev 1884)
@@ -51,21 +51,21 @@
/* This function draws a line and places a head on one (arrows == false) or
both (arrows==true) sides of the line. */
-template <class T> void DrawArrow(Bitmap<T>& bm,int x0,int y0,int x1, int y1,double alpha,int len,
+template <class T> void DrawArrow(Bitmap<T>& bm,int x0,int y0,int x1, int y1,float alpha,int len,
T color,bool arrows = false);
// main function to draw a circle
template <class T> void DrawCircle(Bitmap<T>& bm,int x0,int y0, int radius,T color,bool fill = false);
// this function draws an ellipse. Clipping is also included.
-template <class T> void DrawEllipse(Bitmap<T>& bm,int xm,int ym, int a,int b,double angle,T color);
+template <class T> void DrawEllipse(Bitmap<T>& bm,int xm,int ym, int a,int b,float angle,T color);
template <class Pel> class ArrowPainter
{
public:
ArrowPainter();
- void SetAlpha(double a) { alpha=a*M_PI/180; }
+ void SetAlpha(float a) { alpha=a*M_PI/180; }
void SetHeadLength(int l) { len=l; }
void DrawBothHeads(bool flag=true) { bothheads=flag; }
void SetColor(Pel c) { color=c; }
@@ -74,7 +74,7 @@
{ ::DrawArrow(bm,x0,y0,x1,y1,alpha,len,color,bothheads); }
private:
- double alpha;
+ float alpha;
int len;
bool bothheads;
Pel color;
Modified: trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/libvideogfx/graphics/filters/linear.cc
===================================================================
--- trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/libvideogfx/graphics/filters/linear.cc 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/libvideogfx/graphics/filters/linear.cc 2007-09-13 23:19:15 UTC (rev 1884)
@@ -162,7 +162,7 @@
template <class Pel> void ConvolveH(const Bitmap<Pel>& src,Bitmap<Pel>& dst,
- const Array<double>& filter,bool useborder)
+ const Array<float>& filter,bool useborder)
{
int left = -filter.AskBase();
int right= filter.AskSize()-left-1;
@@ -180,7 +180,7 @@
dst.Create(xe-xs+1,h,1,1,borderw);
- const double* f = filter.Data_const();
+ const float* f = filter.Data_const();
const Pel*const* sp = src.AskFrame_const();
Pel*const* dp = dst.AskFrame();
@@ -188,7 +188,7 @@
for (int y=-borderw;y<h+borderw;y++)
for (int x=xs;x<=xe;x++)
{
- double sum=0.0;
+ float sum=0.0;
for (int xx=-left;xx<=right;xx++)
sum += f[xx]*sp[y][x+xx];
@@ -198,7 +198,7 @@
template <class Pel> void ConvolveV(const Bitmap<Pel>& src,Bitmap<Pel>& dst,
- const Array<double>& filter,bool useborder)
+ const Array<float>& filter,bool useborder)
{
int top = -filter.AskBase();
int bottom= filter.AskSize()-top-1;
@@ -216,7 +216,7 @@
dst.Create(w,ye-ys+1,1,1,borderw);
- const double* f = filter.Data_const();
+ const float* f = filter.Data_const();
const Pel*const* sp = src.AskFrame_const();
Pel*const* dp = dst.AskFrame();
@@ -224,7 +224,7 @@
for (int y=ys;y<=ye;y++)
for (int x=-borderw;x<w+borderw;x++)
{
- double sum=0.0;
+ float sum=0.0;
for (int yy=-top;yy<=bottom;yy++)
sum += f[yy]*sp[y+yy][x];
@@ -234,7 +234,7 @@
template <class Pel> void ConvolveHV(const Bitmap<Pel>& src,Bitmap<Pel>& dst,
- const Array<double>& filter,bool useborder)
+ const Array<float>& filter,bool useborder)
{
Bitmap<Pel> tmpbm;
ConvolveH(src,tmpbm,filter,useborder);
@@ -242,30 +242,30 @@
}
-void NormalizeFilter(Array<double>& filter)
+void NormalizeFilter(Array<float>& filter)
{
- double sum=0.0;
+ float sum=0.0;
int i0 = filter.AskStartIdx();
int i1 = filter.AskEndIdx();
- double* f = filter.Data();
+ float* f = filter.Data();
for (int i=i0;i<=i1;i++)
sum += f[i];
- const double fact = 1.0/sum;
+ const float fact = 1.0/sum;
for (int i=i0;i<=i1;i++)
f[i] *= fact;
}
-void CreateGaussFilter(Array<double>& filter,double sigma,double cutoffval,bool normalize)
+void CreateGaussFilter(Array<float>& filter,float sigma,float cutoffval,bool normalize)
{
#define MAXRANGE 100
- double filt[MAXRANGE];
+ float filt[MAXRANGE];
- double minus_twosigma2inv = -1.0/(2*sigma*sigma);
+ float minus_twosigma2inv = -1.0/(2*sigma*sigma);
int lastidx=MAXRANGE-1;
for (int i=0;i<MAXRANGE;i++)
@@ -280,7 +280,7 @@
throw "CreateGaussFilter(): Gauss filter is too wide.";
filter.Create(2*lastidx+1 , -lastidx);
- double* f = filter.Data();
+ float* f = filter.Data();
for (int i=0;i<=lastidx;i++)
f[-i]=f[i]=filt[i];
@@ -289,7 +289,7 @@
}
-void CreateGaussDerivFilter(Array<double>& filter,double sigma,double cutoffval=0.01)
+void CreateGaussDerivFilter(Array<float>& filter,float sigma,float cutoffval=0.01)
{
CreateGaussFilter(filter,sigma,cutoffval,false);
@@ -298,30 +298,30 @@
// normalize
- double sum=0.0;
+ float sum=0.0;
int i0 = filter.AskStartIdx();
int i1 = filter.AskEndIdx();
- double* f = filter.Data();
+ float* f = filter.Data();
for (int i=i0;i<=i1;i++)
sum += i*f[i];
- const double fact = 1.0/sum;
+ const float fact = 1.0/sum;
for (int i=i0;i<=i1;i++)
f[i] *= fact;
}
-template class Array<double>;
-template void ConvolveH (const Bitmap<Pixel>&,Bitmap<Pixel>&,const Array<double>&,bool);
-template void ConvolveV (const Bitmap<Pixel>&,Bitmap<Pixel>&,const Array<double>&,bool);
-template void ConvolveHV(const Bitmap<Pixel>&,Bitmap<Pixel>&,const Array<double>&,bool);
+template class Array<float>;
+template void ConvolveH (const Bitmap<Pixel>&,Bitmap<Pixel>&,const Array<float>&,bool);
+template void ConvolveV (const Bitmap<Pixel>&,Bitmap<Pixel>&,const Array<float>&,bool);
+template void ConvolveHV(const Bitmap<Pixel>&,Bitmap<Pixel>&,const Array<float>&,bool);
-template void ConvolveH (const Bitmap<double>&,Bitmap<double>&,const Array<double>&,bool);
-template void ConvolveV (const Bitmap<double>&,Bitmap<double>&,const Array<double>&,bool);
-template void ConvolveHV(const Bitmap<double>&,Bitmap<double>&,const Array<double>&,bool);
+template void ConvolveH (const Bitmap<float>&,Bitmap<float>&,const Array<float>&,bool);
+template void ConvolveV (const Bitmap<float>&,Bitmap<float>&,const Array<float>&,bool);
+template void ConvolveHV(const Bitmap<float>&,Bitmap<float>&,const Array<float>&,bool);
#include "libvideogfx/containers/array.cc"
Modified: trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/libvideogfx/graphics/filters/linear.hh
===================================================================
--- trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/libvideogfx/graphics/filters/linear.hh 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/libvideogfx/graphics/filters/linear.hh 2007-09-13 23:19:15 UTC (rev 1884)
@@ -45,16 +45,16 @@
template <class Pel> void ConvolveH(const Bitmap<Pel>& src,Bitmap<Pel>& dst,
- const Array<double>& filter,bool useborder=true);
+ const Array<float>& filter,bool useborder=true);
template <class Pel> void ConvolveV(const Bitmap<Pel>& src,Bitmap<Pel>& dst,
- const Array<double>& filter,bool useborder=true);
+ const Array<float>& filter,bool useborder=true);
template <class Pel> void ConvolveHV(const Bitmap<Pel>& src,Bitmap<Pel>& dst,
- const Array<double>& filter,bool useborder=true);
+ const Array<float>& filter,bool useborder=true);
-void NormalizeFilter(Array<double>& filter); // Make coefficients sum up to 1.0 .
+void NormalizeFilter(Array<float>& filter); // Make coefficients sum up to 1.0 .
-void CreateGaussFilter (Array<double>& filter,double sigma,double cutoffval=0.01,bool normalize=true);
-void CreateGaussDerivFilter(Array<double>& filter,double sigma,double cutoffval=0.01);
+void CreateGaussFilter (Array<float>& filter,float sigma,float cutoffval=0.01,bool normalize=true);
+void CreateGaussDerivFilter(Array<float>& filter,float sigma,float cutoffval=0.01);
#endif
Modified: trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/libvideogfx/graphics/lowlevel/img2raw.hh
===================================================================
--- trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/libvideogfx/graphics/lowlevel/img2raw.hh 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/libvideogfx/graphics/lowlevel/img2raw.hh 2007-09-13 23:19:15 UTC (rev 1884)
@@ -45,7 +45,7 @@
int final_width,final_height;
bool resize_with_factor;
- double resize_factor;
+ float resize_factor;
bool force_to_greyscale; // REDUNDANT ?
};
@@ -86,7 +86,7 @@
void SetOutputSpec(const RawImageSpec_RGB& spec) { d_spec=spec; }
- void SetZoomFactor(double f=2) { d_spec.resize_factor=f; d_spec.resize_with_factor = (f!=1.0); }
+ void SetZoomFactor(float f=2) { d_spec.resize_factor=f; d_spec.resize_with_factor = (f!=1.0); }
void SetGrayscale(bool flag=true) { d_spec.force_to_greyscale = flag; }
void TransformRGB(const Image_RGB<Pixel>&,uint8* mem,int firstline=0,int lastline=-1);
Modified: trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/libvideogfx/graphics/visualize/motionfield.cc
===================================================================
--- trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/libvideogfx/graphics/visualize/motionfield.cc 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/libvideogfx/graphics/visualize/motionfield.cc 2007-09-13 23:19:15 UTC (rev 1884)
@@ -31,14 +31,14 @@
int x0 = x*mvfld.blksize_h+mvfld.blksize_h/2;
int y0 = y*mvfld.blksize_v+mvfld.blksize_v/2;
- double dx = mvptr[y][x].h;
- double dy = mvptr[y][x].v;
+ float dx = mvptr[y][x].h;
+ float dy = mvptr[y][x].v;
dx *= d_scale;
dy *= d_scale;
- double x1= x0+dx;
- double y1= y0+dy;
+ float x1= x0+dx;
+ float y1= y0+dy;
Pixel color=d_vectorcolor;
if (cbm && !cbm[y][x]) color=0;
@@ -46,7 +46,7 @@
if (d_drawarrows && (abs(mvptr[y][x].h)>0 || abs(mvptr[y][x].v)>0))
{
- double len = sqrt(dx*dx+dy*dy);
+ float len = sqrt(dx*dx+dy*dy);
dx /= len;
dy /= len;
Modified: trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/libvideogfx/graphics/visualize/motionfield.hh
===================================================================
--- trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/libvideogfx/graphics/visualize/motionfield.hh 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/libvideogfx/graphics/visualize/motionfield.hh 2007-09-13 23:19:15 UTC (rev 1884)
@@ -31,14 +31,14 @@
void SetLumaVal(Pixel p) { d_vectorcolor=p; }
void DrawArrows(bool flag) { d_drawarrows=flag; }
- void SetScale(double s) { d_scale=s; }
+ void SetScale(float s) { d_scale=s; }
void Overlay(Image_YUV<Pixel>&,const MotionVectorField&,const Bitmap<bool>* colored=NULL) const;
private:
Pixel d_vectorcolor;
bool d_drawarrows;
- double d_scale;
+ float d_scale;
};
#endif
Modified: trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/libvideogfx/postscript/layout.cc
===================================================================
--- trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/libvideogfx/postscript/layout.cc 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/libvideogfx/postscript/layout.cc 2007-09-13 23:19:15 UTC (rev 1884)
@@ -95,24 +95,24 @@
AddPostscriptModule(*this);
}
-int PrintAreaLayouter_nUp::SetParams(double aspect,bool landscape,int nup,double spacing,PaperSize paper)
+int PrintAreaLayouter_nUp::SetParams(float aspect,bool landscape,int nup,float spacing,PaperSize paper)
{
try_again:
- double width = (landscape ? paper.height : paper.width )-2*paper.border;
- double height = (landscape ? paper.width : paper.height)-2*paper.border;
+ float width = (landscape ? paper.height : paper.width )-2*paper.border;
+ float height = (landscape ? paper.width : paper.height)-2*paper.border;
int bestcol=0;
int bestrow=0;
- double bestaw=0.0;
- double bestah=0.0;
+ float bestaw=0.0;
+ float bestah=0.0;
// Try all possible number of columns and take that one that results in largest area sizes.
for (int ncol=1;ncol<=nup;ncol++)
{
int nrow = (nup+ncol-1)/ncol;
- double aw = (width -(ncol-1)*spacing)/ncol;
- double ah = (height-(nrow-1)*spacing)/nrow;
+ float aw = (width -(ncol-1)*spacing)/ncol;
+ float ah = (height-(nrow-1)*spacing)/nrow;
if (aw<=0.0 || ah <= 0.0)
continue;
@@ -141,8 +141,8 @@
goto try_again;
}
- double aox = (width -(bestcol-1)*spacing - bestcol*bestaw)/bestcol/2;
- double aoy = (height-(bestrow-1)*spacing - bestrow*bestah)/bestrow/2;
+ float aox = (width -(bestcol-1)*spacing - bestcol*bestaw)/bestcol/2;
+ float aoy = (height-(bestrow-1)*spacing - bestrow*bestah)/bestrow/2;
d_nCols = bestcol;
d_nRows = bestrow;
Modified: trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/libvideogfx/postscript/layout.hh
===================================================================
--- trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/libvideogfx/postscript/layout.hh 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/libvideogfx/postscript/layout.hh 2007-09-13 23:19:15 UTC (rev 1884)
@@ -29,12 +29,12 @@
struct PaperSize
{
PaperSize() : border(1.5) { }
- PaperSize(double w,double h) : width(w), height(h), border(1.5) { }
+ PaperSize(float w,float h) : width(w), height(h), border(1.5) { }
// All measures in 'cm'.
- double width,height;
+ float width,height;
- double border; // Unprintable area on each side of paper.
+ float border; // Unprintable area on each side of paper.
};
// Several common paper sizes
@@ -52,8 +52,8 @@
struct PrintingArea
{
// All measures in 'cm'.
- double xoffs,yoffs;
- double width,height;
+ float xoffs,yoffs;
+ float width,height;
};
#define cm2pts 28.5634
@@ -94,7 +94,7 @@
virtual void Finish() = 0;
protected:
- void _SetParams(bool landscape,double paperwidth) { d_landscape=landscape; d_paperwidth=paperwidth; }
+ void _SetParams(bool landscape,float paperwidth) { d_landscape=landscape; d_paperwidth=paperwidth; }
void _Init();
void _BeginNewPage();
@@ -105,7 +105,7 @@
private:
bool d_landscape;
- double d_paperwidth;
+ float d_paperwidth;
bool d_DrawBorder;
int d_currPage;
@@ -132,10 +132,10 @@
PrintAreaLayouter_nUp();
~PrintAreaLayouter_nUp() { }
- int SetParams(double aspect, // width/height
+ int SetParams(float aspect, // width/height
bool landscape=false,
int nup=2, // Number of areas on one sheet of paper (actual number may be greater)
- double spacing=1.0, // spacing between areas (in 'cm')
+ float spacing=1.0, // spacing between areas (in 'cm')
PaperSize paper=Paper_A4);
@@ -152,9 +152,9 @@
private:
int d_nCols,d_nRows;
- double d_xOffs,d_yOffs;
- double d_xStep,d_yStep;
- double d_xSize,d_ySize;
+ float d_xOffs,d_yOffs;
+ float d_xStep,d_yStep;
+ float d_xSize,d_ySize;
int d_nextAreaNr;
Modified: trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/libvideogfx/postscript/mvfield.cc
===================================================================
--- trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/libvideogfx/postscript/mvfield.cc 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/dvdview/dvdview/libvideogfx/libvideogfx/postscript/mvfield.cc 2007-09-13 23:19:15 UTC (rev 1884)
@@ -12,8 +12,8 @@
void MotionField2Postscript::DrawMotionField(const Bitmap<MotVec>& mv,int hperblk,int vperblk)
{
- double blkwidth = d_area.width /mv.AskWidth();
- double blkheight = d_area.height/mv.AskHeight();
+ float blkwidth = d_area.width /mv.AskWidth();
+ float blkheight = d_area.height/mv.AskHeight();
const MotVec*const* mvptr = mv.AskFrame_const();
Modified: trunk/user/pixil/packages/dvdview/dvdview/oldlibgfx/libvideogfx/graphics/basic/image_tmpl.cc
===================================================================
--- trunk/user/pixil/packages/dvdview/dvdview/oldlibgfx/libvideogfx/graphics/basic/image_tmpl.cc 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/dvdview/dvdview/oldlibgfx/libvideogfx/graphics/basic/image_tmpl.cc 2007-09-13 23:19:15 UTC (rev 1884)
@@ -10,7 +10,7 @@
template class Bitmap<Pixel>;
template class Bitmap<bool>;
-template class Bitmap<double>;
+template class Bitmap<float>;
#include "image.cc"
#include "bitmap.cc"
Modified: trunk/user/pixil/packages/dvdview/dvdview/oldlibgfx/libvideogfx/graphics/color/colorspace.cc
===================================================================
--- trunk/user/pixil/packages/dvdview/dvdview/oldlibgfx/libvideogfx/graphics/color/colorspace.cc 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/dvdview/dvdview/oldlibgfx/libvideogfx/graphics/color/colorspace.cc 2007-09-13 23:19:15 UTC (rev 1884)
@@ -516,16 +516,16 @@
}
-void HSB2RGB(double h,double s,double br, double& red,double& green,double& blue)
+void HSB2RGB(float h,float s,float br, float& red,float& green,float& blue)
{
- double hue = h;
- double saturation = s;
- double brightness = br;
+ float hue = h;
+ float saturation = s;
+ float brightness = br;
if (brightness == 0.0) { red = green = blue = 0.0; return; }
if (saturation == 0.0) { red = green = blue = brightness; return; }
- double offs; // hue mod 1/6
+ float offs; // hue mod 1/6
if (hue < 1.0/6)
{ // red domain; green ascends
offs = hue;
Modified: trunk/user/pixil/packages/dvdview/dvdview/oldlibgfx/libvideogfx/graphics/color/colorspace.hh
===================================================================
--- trunk/user/pixil/packages/dvdview/dvdview/oldlibgfx/libvideogfx/graphics/color/colorspace.hh 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/dvdview/dvdview/oldlibgfx/libvideogfx/graphics/color/colorspace.hh 2007-09-13 23:19:15 UTC (rev 1884)
@@ -79,7 +79,7 @@
-void HSB2RGB(double h,double s,double b, double& r,double& g,double& b); // input/output range: 0..1
+void HSB2RGB(float h,float s,float b, float& r,float& g,float& b); // input/output range: 0..1
void RGB2YUV(uint8 r,uint8 g,uint8 b, uint8& y,uint8& u,uint8& v);
Modified: trunk/user/pixil/packages/dvdview/dvdview/oldlibgfx/libvideogfx/graphics/datatypes/motionfield.hh
===================================================================
--- trunk/user/pixil/packages/dvdview/dvdview/oldlibgfx/libvideogfx/graphics/datatypes/motionfield.hh 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/dvdview/dvdview/oldlibgfx/libvideogfx/graphics/datatypes/motionfield.hh 2007-09-13 23:19:15 UTC (rev 1884)
@@ -24,7 +24,7 @@
struct MotionVector
{
- double h,v;
+ float h,v;
};
Modified: trunk/user/pixil/packages/dvdview/dvdview/oldlibgfx/libvideogfx/graphics/draw/draw.cc
===================================================================
--- trunk/user/pixil/packages/dvdview/dvdview/oldlibgfx/libvideogfx/graphics/draw/draw.cc 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/dvdview/dvdview/oldlibgfx/libvideogfx/graphics/draw/draw.cc 2007-09-13 23:19:15 UTC (rev 1884)
@@ -204,9 +204,9 @@
}
// This function is a part of the DrawLine algorithm. Do not call this function directly
-static bool Clipt(double denom,double num, double& tE, double& tL)
+static bool Clipt(float denom,float num, float& tE, float& tL)
{
- double t;
+ float t;
bool accept = true;
if (denom > 0)
@@ -238,10 +238,10 @@
void ClipLine(int& x0,int& y0,int& x1, int& y1, int xMax, int yMax, bool& visible)
{
- double dx = (double)(x1 - x0);
- double dy = (double)(y1 - y0);
- double tE = 0.0;
- double tL = 1.0;
+ float dx = (float)(x1 - x0);
+ float dy = (float)(y1 - y0);
+ float tE = 0.0;
+ float tL = 1.0;
visible = false;
if (Clipt(dx,0-(x0),tE,tL))
@@ -281,13 +281,13 @@
}
// This function draws a line and places a head on one (arrows == false) or both (arrows==true) sides of the line.
-template <class T> void DrawArrow(Bitmap<T>& bm,int x0,int y0,int x1, int y1,double alpha,int l,T color,bool arrows = false)
+template <class T> void DrawArrow(Bitmap<T>& bm,int x0,int y0,int x1, int y1,float alpha,int l,T color,bool arrows = false)
{
DrawLine(bm,x0,y0,x1,y1,color);
// zeichnen der Pfeilspitze
int xa,ya,dxp,dyp;
- double norm;
+ float norm;
dxp = x1-x0;
dyp = y1-y0;
@@ -547,22 +547,22 @@
}
// this function draws an ellipse. Clipping is also included.
-template <class T> void DrawEllipse(Bitmap<T>& bm,int xm,int ym, int a,int b,double angle,T color)
+template <class T> void DrawEllipse(Bitmap<T>& bm,int xm,int ym, int a,int b,float angle,T color)
{
T*const* p = bm.AskFrame();
static int flag = 0;
- const double beta = angle*M_PI/180;
+ const float beta = angle*M_PI/180;
- const double cosb = cos(beta);
- const double sinb = sin(beta);
- static double alpha_step = M_PI/180;
+ const float cosb = cos(beta);
+ const float sinb = sin(beta);
+ static float alpha_step = M_PI/180;
int x[3],y[3];
- for (double alpha=0;alpha<2*M_PI;alpha+=alpha_step)
+ for (float alpha=0;alpha<2*M_PI;alpha+=alpha_step)
{
- double sina,cosa;
+ float sina,cosa;
cosa = cos(alpha)*a;
sina = sin(alpha)*b;
@@ -636,11 +636,11 @@
template void DrawRectangle(Bitmap<Pixel>& bm,int x1,int y1,int w, int h,Pixel color);
-template void DrawArrow(Bitmap<Pixel>& bm,int x0,int y0,int x1, int y1,double alpha,int l,
+template void DrawArrow(Bitmap<Pixel>& bm,int x0,int y0,int x1, int y1,float alpha,int l,
Pixel color,bool arrows);
template void DrawLine(Bitmap<Pixel>& bm,int x0,int y0,int x1, int y1,Pixel color);
template void DrawCircle(Bitmap<Pixel>& bm,int x0,int y0, int radius,Pixel color,bool);
-template void DrawEllipse(Bitmap<Pixel>& bm,int xm,int ym, int a,int b,double angle,Pixel);
+template void DrawEllipse(Bitmap<Pixel>& bm,int xm,int ym, int a,int b,float angle,Pixel);
template class ArrowPainter<Pixel>;
Modified: trunk/user/pixil/packages/dvdview/dvdview/oldlibgfx/libvideogfx/graphics/draw/draw.hh
===================================================================
--- trunk/user/pixil/packages/dvdview/dvdview/oldlibgfx/libvideogfx/graphics/draw/draw.hh 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/dvdview/dvdview/oldlibgfx/libvideogfx/graphics/draw/draw.hh 2007-09-13 23:19:15 UTC (rev 1884)
@@ -51,21 +51,21 @@
/* This function draws a line and places a head on one (arrows == false) or
both (arrows==true) sides of the line. */
-template <class T> void DrawArrow(Bitmap<T>& bm,int x0,int y0,int x1, int y1,double alpha,int len,
+template <class T> void DrawArrow(Bitmap<T>& bm,int x0,int y0,int x1, int y1,float alpha,int len,
T color,bool arrows = false);
// main function to draw a circle
template <class T> void DrawCircle(Bitmap<T>& bm,int x0,int y0, int radius,T color,bool fill = false);
// this function draws an ellipse. Clipping is also included.
-template <class T> void DrawEllipse(Bitmap<T>& bm,int xm,int ym, int a,int b,double angle,T color);
+template <class T> void DrawEllipse(Bitmap<T>& bm,int xm,int ym, int a,int b,float angle,T color);
template <class Pel> class ArrowPainter
{
public:
ArrowPainter();
- void SetAlpha(double a) { alpha=a*M_PI/180; }
+ void SetAlpha(float a) { alpha=a*M_PI/180; }
void SetHeadLength(int l) { len=l; }
void DrawBothHeads(bool flag=true) { bothheads=flag; }
void SetColor(Pel c) { color=c; }
@@ -74,7 +74,7 @@
{ ::DrawArrow(bm,x0,y0,x1,y1,alpha,len,color,bothheads); }
private:
- double alpha;
+ float alpha;
int len;
bool bothheads;
Pel color;
Modified: trunk/user/pixil/packages/dvdview/dvdview/oldlibgfx/libvideogfx/graphics/filters/linear.cc
===================================================================
--- trunk/user/pixil/packages/dvdview/dvdview/oldlibgfx/libvideogfx/graphics/filters/linear.cc 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/dvdview/dvdview/oldlibgfx/libvideogfx/graphics/filters/linear.cc 2007-09-13 23:19:15 UTC (rev 1884)
@@ -162,7 +162,7 @@
template <class Pel> void ConvolveH(const Bitmap<Pel>& src,Bitmap<Pel>& dst,
- const Array<double>& filter,bool useborder)
+ const Array<float>& filter,bool useborder)
{
int left = -filter.AskBase();
int right= filter.AskSize()-left-1;
@@ -180,7 +180,7 @@
dst.Create(xe-xs+1,h,1,1,borderw);
- const double* f = filter.Data_const();
+ const float* f = filter.Data_const();
const Pel*const* sp = src.AskFrame_const();
Pel*const* dp = dst.AskFrame();
@@ -188,7 +188,7 @@
for (int y=-borderw;y<h+borderw;y++)
for (int x=xs;x<=xe;x++)
{
- double sum=0.0;
+ float sum=0.0;
for (int xx=-left;xx<=right;xx++)
sum += f[xx]*sp[y][x+xx];
@@ -198,7 +198,7 @@
template <class Pel> void ConvolveV(const Bitmap<Pel>& src,Bitmap<Pel>& dst,
- const Array<double>& filter,bool useborder)
+ const Array<float>& filter,bool useborder)
{
int top = -filter.AskBase();
int bottom= filter.AskSize()-top-1;
@@ -216,7 +216,7 @@
dst.Create(w,ye-ys+1,1,1,borderw);
- const double* f = filter.Data_const();
+ const float* f = filter.Data_const();
const Pel*const* sp = src.AskFrame_const();
Pel*const* dp = dst.AskFrame();
@@ -224,7 +224,7 @@
for (int y=ys;y<=ye;y++)
for (int x=-borderw;x<w+borderw;x++)
{
- double sum=0.0;
+ float sum=0.0;
for (int yy=-top;yy<=bottom;yy++)
sum += f[yy]*sp[y+yy][x];
@@ -234,7 +234,7 @@
template <class Pel> void ConvolveHV(const Bitmap<Pel>& src,Bitmap<Pel>& dst,
- const Array<double>& filter,bool useborder)
+ const Array<float>& filter,bool useborder)
{
Bitmap<Pel> tmpbm;
ConvolveH(src,tmpbm,filter,useborder);
@@ -242,30 +242,30 @@
}
-void NormalizeFilter(Array<double>& filter)
+void NormalizeFilter(Array<float>& filter)
{
- double sum=0.0;
+ float sum=0.0;
int i0 = filter.AskStartIdx();
int i1 = filter.AskEndIdx();
- double* f = filter.Data();
+ float* f = filter.Data();
for (int i=i0;i<=i1;i++)
sum += f[i];
- const double fact = 1.0/sum;
+ const float fact = 1.0/sum;
for (int i=i0;i<=i1;i++)
f[i] *= fact;
}
-void CreateGaussFilter(Array<double>& filter,double sigma,double cutoffval,bool normalize)
+void CreateGaussFilter(Array<float>& filter,float sigma,float cutoffval,bool normalize)
{
#define MAXRANGE 100
- double filt[MAXRANGE];
+ float filt[MAXRANGE];
- double minus_twosigma2inv = -1.0/(2*sigma*sigma);
+ float minus_twosigma2inv = -1.0/(2*sigma*sigma);
int lastidx=MAXRANGE-1;
for (int i=0;i<MAXRANGE;i++)
@@ -280,7 +280,7 @@
throw "CreateGaussFilter(): Gauss filter is too wide.";
filter.Create(2*lastidx+1 , -lastidx);
- double* f = filter.Data();
+ float* f = filter.Data();
for (int i=0;i<=lastidx;i++)
f[-i]=f[i]=filt[i];
@@ -289,7 +289,7 @@
}
-void CreateGaussDerivFilter(Array<double>& filter,double sigma,double cutoffval=0.01)
+void CreateGaussDerivFilter(Array<float>& filter,float sigma,float cutoffval=0.01)
{
CreateGaussFilter(filter,sigma,cutoffval,false);
@@ -298,30 +298,30 @@
// normalize
- double sum=0.0;
+ float sum=0.0;
int i0 = filter.AskStartIdx();
int i1 = filter.AskEndIdx();
- double* f = filter.Data();
+ float* f = filter.Data();
for (int i=i0;i<=i1;i++)
sum += i*f[i];
- const double fact = 1.0/sum;
+ const float fact = 1.0/sum;
for (int i=i0;i<=i1;i++)
f[i] *= fact;
}
-template class Array<double>;
-template void ConvolveH (const Bitmap<Pixel>&,Bitmap<Pixel>&,const Array<double>&,bool);
-template void ConvolveV (const Bitmap<Pixel>&,Bitmap<Pixel>&,const Array<double>&,bool);
-template void ConvolveHV(const Bitmap<Pixel>&,Bitmap<Pixel>&,const Array<double>&,bool);
+template class Array<float>;
+template void ConvolveH (const Bitmap<Pixel>&,Bitmap<Pixel>&,const Array<float>&,bool);
+template void ConvolveV (const Bitmap<Pixel>&,Bitmap<Pixel>&,const Array<float>&,bool);
+template void ConvolveHV(const Bitmap<Pixel>&,Bitmap<Pixel>&,const Array<float>&,bool);
-template void ConvolveH (const Bitmap<double>&,Bitmap<double>&,const Array<double>&,bool);
-template void ConvolveV (const Bitmap<double>&,Bitmap<double>&,const Array<double>&,bool);
-template void ConvolveHV(const Bitmap<double>&,Bitmap<double>&,const Array<double>&,bool);
+template void ConvolveH (const Bitmap<float>&,Bitmap<float>&,const Array<float>&,bool);
+template void ConvolveV (const Bitmap<float>&,Bitmap<float>&,const Array<float>&,bool);
+template void ConvolveHV(const Bitmap<float>&,Bitmap<float>&,const Array<float>&,bool);
#include "libvideogfx/containers/array.cc"
Modified: trunk/user/pixil/packages/dvdview/dvdview/oldlibgfx/libvideogfx/graphics/filters/linear.hh
===================================================================
--- trunk/user/pixil/packages/dvdview/dvdview/oldlibgfx/libvideogfx/graphics/filters/linear.hh 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/dvdview/dvdview/oldlibgfx/libvideogfx/graphics/filters/linear.hh 2007-09-13 23:19:15 UTC (rev 1884)
@@ -45,16 +45,16 @@
template <class Pel> void ConvolveH(const Bitmap<Pel>& src,Bitmap<Pel>& dst,
- const Array<double>& filter,bool useborder=true);
+ const Array<float>& filter,bool useborder=true);
template <class Pel> void ConvolveV(const Bitmap<Pel>& src,Bitmap<Pel>& dst,
- const Array<double>& filter,bool useborder=true);
+ const Array<float>& filter,bool useborder=true);
template <class Pel> void ConvolveHV(const Bitmap<Pel>& src,Bitmap<Pel>& dst,
- const Array<double>& filter,bool useborder=true);
+ const Array<float>& filter,bool useborder=true);
-void NormalizeFilter(Array<double>& filter); // Make coefficients sum up to 1.0 .
+void NormalizeFilter(Array<float>& filter); // Make coefficients sum up to 1.0 .
-void CreateGaussFilter (Array<double>& filter,double sigma,double cutoffval=0.01,bool normalize=true);
-void CreateGaussDerivFilter(Array<double>& filter,double sigma,double cutoffval=0.01);
+void CreateGaussFilter (Array<float>& filter,float sigma,float cutoffval=0.01,bool normalize=true);
+void CreateGaussDerivFilter(Array<float>& filter,float sigma,float cutoffval=0.01);
#endif
Modified: trunk/user/pixil/packages/dvdview/dvdview/oldlibgfx/libvideogfx/graphics/lowlevel/img2raw.hh
===================================================================
--- trunk/user/pixil/packages/dvdview/dvdview/oldlibgfx/libvideogfx/graphics/lowlevel/img2raw.hh 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/dvdview/dvdview/oldlibgfx/libvideogfx/graphics/lowlevel/img2raw.hh 2007-09-13 23:19:15 UTC (rev 1884)
@@ -45,7 +45,7 @@
int final_width,final_height;
bool resize_with_factor;
- double resize_factor;
+ float resize_factor;
bool force_to_greyscale; // REDUNDANT ?
};
@@ -86,7 +86,7 @@
void SetOutputSpec(const RawImageSpec_RGB& spec) { d_spec=spec; }
- void SetZoomFactor(double f=2) { d_spec.resize_factor=f; d_spec.resize_with_factor = (f!=1.0); }
+ void SetZoomFactor(float f=2) { d_spec.resize_factor=f; d_spec.resize_with_factor = (f!=1.0); }
void SetGrayscale(bool flag=true) { d_spec.force_to_greyscale = flag; }
void TransformRGB(const Image_RGB<Pixel>&,uint8* mem,int firstline=0,int lastline=-1);
Modified: trunk/user/pixil/packages/dvdview/dvdview/oldlibgfx/libvideogfx/graphics/visualize/motionfield.cc
===================================================================
--- trunk/user/pixil/packages/dvdview/dvdview/oldlibgfx/libvideogfx/graphics/visualize/motionfield.cc 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/dvdview/dvdview/oldlibgfx/libvideogfx/graphics/visualize/motionfield.cc 2007-09-13 23:19:15 UTC (rev 1884)
@@ -31,14 +31,14 @@
int x0 = x*mvfld.blksize_h+mvfld.blksize_h/2;
int y0 = y*mvfld.blksize_v+mvfld.blksize_v/2;
- double dx = mvptr[y][x].h;
- double dy = mvptr[y][x].v;
+ float dx = mvptr[y][x].h;
+ float dy = mvptr[y][x].v;
dx *= d_scale;
dy *= d_scale;
- double x1= x0+dx;
- double y1= y0+dy;
+ float x1= x0+dx;
+ float y1= y0+dy;
Pixel color=d_vectorcolor;
if (cbm && !cbm[y][x]) color=0;
@@ -46,7 +46,7 @@
if (d_drawarrows && (abs(mvptr[y][x].h)>0 || abs(mvptr[y][x].v)>0))
{
- double len = sqrt(dx*dx+dy*dy);
+ float len = sqrt(dx*dx+dy*dy);
dx /= len;
dy /= len;
Modified: trunk/user/pixil/packages/dvdview/dvdview/oldlibgfx/libvideogfx/graphics/visualize/motionfield.hh
===================================================================
--- trunk/user/pixil/packages/dvdview/dvdview/oldlibgfx/libvideogfx/graphics/visualize/motionfield.hh 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/dvdview/dvdview/oldlibgfx/libvideogfx/graphics/visualize/motionfield.hh 2007-09-13 23:19:15 UTC (rev 1884)
@@ -31,14 +31,14 @@
void SetLumaVal(Pixel p) { d_vectorcolor=p; }
void DrawArrows(bool flag) { d_drawarrows=flag; }
- void SetScale(double s) { d_scale=s; }
+ void SetScale(float s) { d_scale=s; }
void Overlay(Image_YUV<Pixel>&,const MotionVectorField&,const Bitmap<bool>* colored=NULL) const;
private:
Pixel d_vectorcolor;
bool d_drawarrows;
- double d_scale;
+ float d_scale;
};
#endif
Modified: trunk/user/pixil/packages/dvdview/dvdview/oldlibgfx/libvideogfx/postscript/layout.cc
===================================================================
--- trunk/user/pixil/packages/dvdview/dvdview/oldlibgfx/libvideogfx/postscript/layout.cc 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/dvdview/dvdview/oldlibgfx/libvideogfx/postscript/layout.cc 2007-09-13 23:19:15 UTC (rev 1884)
@@ -95,24 +95,24 @@
AddPostscriptModule(*this);
}
-int PrintAreaLayouter_nUp::SetParams(double aspect,bool landscape,int nup,double spacing,PaperSize paper)
+int PrintAreaLayouter_nUp::SetParams(float aspect,bool landscape,int nup,float spacing,PaperSize paper)
{
try_again:
- double width = (landscape ? paper.height : paper.width )-2*paper.border;
- double height = (landscape ? paper.width : paper.height)-2*paper.border;
+ float width = (landscape ? paper.height : paper.width )-2*paper.border;
+ float height = (landscape ? paper.width : paper.height)-2*paper.border;
int bestcol=0;
int bestrow=0;
- double bestaw=0.0;
- double bestah=0.0;
+ float bestaw=0.0;
+ float bestah=0.0;
// Try all possible number of columns and take that one that results in largest area sizes.
for (int ncol=1;ncol<=nup;ncol++)
{
int nrow = (nup+ncol-1)/ncol;
- double aw = (width -(ncol-1)*spacing)/ncol;
- double ah = (height-(nrow-1)*spacing)/nrow;
+ float aw = (width -(ncol-1)*spacing)/ncol;
+ float ah = (height-(nrow-1)*spacing)/nrow;
if (aw<=0.0 || ah <= 0.0)
continue;
@@ -141,8 +141,8 @@
goto try_again;
}
- double aox = (width -(bestcol-1)*spacing - bestcol*bestaw)/bestcol/2;
- double aoy = (height-(bestrow-1)*spacing - bestrow*bestah)/bestrow/2;
+ float aox = (width -(bestcol-1)*spacing - bestcol*bestaw)/bestcol/2;
+ float aoy = (height-(bestrow-1)*spacing - bestrow*bestah)/bestrow/2;
d_nCols = bestcol;
d_nRows = bestrow;
Modified: trunk/user/pixil/packages/dvdview/dvdview/oldlibgfx/libvideogfx/postscript/layout.hh
===================================================================
--- trunk/user/pixil/packages/dvdview/dvdview/oldlibgfx/libvideogfx/postscript/layout.hh 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/dvdview/dvdview/oldlibgfx/libvideogfx/postscript/layout.hh 2007-09-13 23:19:15 UTC (rev 1884)
@@ -29,12 +29,12 @@
struct PaperSize
{
PaperSize() : border(1.5) { }
- PaperSize(double w,double h) : width(w), height(h), border(1.5) { }
+ PaperSize(float w,float h) : width(w), height(h), border(1.5) { }
// All measures in 'cm'.
- double width,height;
+ float width,height;
- double border; // Unprintable area on each side of paper.
+ float border; // Unprintable area on each side of paper.
};
// Several common paper sizes
@@ -52,8 +52,8 @@
struct PrintingArea
{
// All measures in 'cm'.
- double xoffs,yoffs;
- double width,height;
+ float xoffs,yoffs;
+ float width,height;
};
#define cm2pts 28.5634
@@ -94,7 +94,7 @@
virtual void Finish() = 0;
protected:
- void _SetParams(bool landscape,double paperwidth) { d_landscape=landscape; d_paperwidth=paperwidth; }
+ void _SetParams(bool landscape,float paperwidth) { d_landscape=landscape; d_paperwidth=paperwidth; }
void _Init();
void _BeginNewPage();
@@ -105,7 +105,7 @@
private:
bool d_landscape;
- double d_paperwidth;
+ float d_paperwidth;
bool d_DrawBorder;
int d_currPage;
@@ -132,10 +132,10 @@
PrintAreaLayouter_nUp();
~PrintAreaLayouter_nUp() { }
- int SetParams(double aspect, // width/height
+ int SetParams(float aspect, // width/height
bool landscape=false,
int nup=2, // Number of areas on one sheet of paper (actual number may be greater)
- double spacing=1.0, // spacing between areas (in 'cm')
+ float spacing=1.0, // spacing between areas (in 'cm')
PaperSize paper=Paper_A4);
@@ -152,9 +152,9 @@
private:
int d_nCols,d_nRows;
- double d_xOffs,d_yOffs;
- double d_xStep,d_yStep;
- double d_xSize,d_ySize;
+ float d_xOffs,d_yOffs;
+ float d_xStep,d_yStep;
+ float d_xSize,d_ySize;
int d_nextAreaNr;
Modified: trunk/user/pixil/packages/dvdview/dvdview/oldlibgfx/libvideogfx/postscript/mvfield.cc
===================================================================
--- trunk/user/pixil/packages/dvdview/dvdview/oldlibgfx/libvideogfx/postscript/mvfield.cc 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/dvdview/dvdview/oldlibgfx/libvideogfx/postscript/mvfield.cc 2007-09-13 23:19:15 UTC (rev 1884)
@@ -12,8 +12,8 @@
void MotionField2Postscript::DrawMotionField(const Bitmap<MotVec>& mv,int hperblk,int vperblk)
{
- double blkwidth = d_area.width /mv.AskWidth();
- double blkheight = d_area.height/mv.AskHeight();
+ float blkwidth = d_area.width /mv.AskWidth();
+ float blkheight = d_area.height/mv.AskHeight();
const MotVec*const* mvptr = mv.AskFrame_const();
Modified: trunk/user/pixil/packages/dvdview/dvdview/src/system/videoauconv.hh
===================================================================
--- trunk/user/pixil/packages/dvdview/dvdview/src/system/videoauconv.hh 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/dvdview/dvdview/src/system/videoauconv.hh 2007-09-13 23:19:15 UTC (rev 1884)
@@ -76,7 +76,7 @@
bool d_HasPTS;
PTS d_pts;
int d_pts_picoffset;
- double d_framerate;
+ float d_framerate;
ByteBufferParams d_bytebufparams;
Modified: trunk/user/pixil/packages/dvdview/dvdview/src/video12/modules/idct_arai.cc
===================================================================
--- trunk/user/pixil/packages/dvdview/dvdview/src/video12/modules/idct_arai.cc 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/dvdview/dvdview/src/video12/modules/idct_arai.cc 2007-09-13 23:19:15 UTC (rev 1884)
@@ -129,8 +129,8 @@
static IDCTInt Qb;
static IDCTInt Rb;
-static double OutputScaleFactor[8]; // fuer FDCT
-static double InputScaleFactor[8]; // fuer IDCT
+static float OutputScaleFactor[8]; // fuer FDCT
+static float InputScaleFactor[8]; // fuer IDCT
static long long d_fact[8][8];
@@ -157,7 +157,7 @@
A5b = (DCTInt2)(cos(3.0*PI/8.0)*FDCT_M2ScaleFact+0.5);
OutputScaleFactor[0] = sqrt(0.5)/2.0;
- {for (int i=1;i<8;i++) OutputScaleFactor[i] = 0.25/cos(PI*(double)i/16.0);}
+ {for (int i=1;i<8;i++) OutputScaleFactor[i] = 0.25/cos(PI*(float)i/16.0);}
// IDCT
@@ -181,7 +181,7 @@
Rb = (DCTInt2)(( 2.0*cos(PI/8.0) + 2.0*cos(3.0*PI/8.0))*IDCT_M1ScaleFact+0.5);
InputScaleFactor[0] = 0.5*0.5*sqrt(2);
- {for (int i=1;i<8;i++) InputScaleFactor[i] = 0.5*cos(PI*((double)i)/16.0);}
+ {for (int i=1;i<8;i++) InputScaleFactor[i] = 0.5*cos(PI*((float)i)/16.0);}
IsInitialized=true;
Modified: trunk/user/pixil/packages/dvdview/dvdview/src/vpostproc/pp_filteredresize.cc
===================================================================
--- trunk/user/pixil/packages/dvdview/dvdview/src/vpostproc/pp_filteredresize.cc 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/dvdview/dvdview/src/vpostproc/pp_filteredresize.cc 2007-09-13 23:19:15 UTC (rev 1884)
@@ -118,8 +118,8 @@
// Select filter
- double xfact = ((double)width )/dimg->m_width;
- double yfact = ((double)height)/dimg->m_height;
+ float xfact = ((float)width )/dimg->m_width;
+ float yfact = ((float)height)/dimg->m_height;
// unfiltered resizing
for (int y=0;y<height;y++)
Modified: trunk/user/pixil/packages/dvdview/dvdview/src/vpostproc/pp_mvcol.cc
===================================================================
--- trunk/user/pixil/packages/dvdview/dvdview/src/vpostproc/pp_mvcol.cc 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/dvdview/dvdview/src/vpostproc/pp_mvcol.cc 2007-09-13 23:19:15 UTC (rev 1884)
@@ -85,22 +85,22 @@
BlockColorInfo bci;
- double magnitude=0.0;
- double angle;
+ float magnitude=0.0;
+ float angle;
{
// forward MV
int h,v;
- double m;
+ float m;
if (mb.m_HasMotionForward && d_fwd)
{
h = abs(mb.m_forward1.m_habs);
v = abs(mb.m_forward1.m_vabs);
- m = sqrt((double)(h*h+v*v));
+ m = sqrt((float)(h*h+v*v));
magnitude=m;
}
@@ -112,7 +112,7 @@
h = abs(mb.m_backward1.m_habs);
v = abs(mb.m_backward1.m_vabs);
- m = sqrt((double)(h*h+v*v));
+ m = sqrt((float)(h*h+v*v));
magnitude += m;
magnitude /= 2;
}
@@ -138,7 +138,7 @@
if (h!=0 || v!=0)
{
- double w;
+ float w;
if (h==0)
{
if (v<0) w=PI/2.0;
@@ -148,12 +148,12 @@
{
if (h>0)
{
- w = atan(((double)-v)/h);
+ w = atan(((float)-v)/h);
if (w<0) w+= 2*PI;
}
else
{
- w = -atan(((double)v)/h);
+ w = -atan(((float)v)/h);
w+= PI;
}
}
@@ -205,13 +205,13 @@
for (int yy=0;yy<ch;yy++)
for (int xx=0;xx<cw;xx++)
{
- double rd,gd,bd;
+ float rd,gd,bd;
uint8 r,g,b;
uint8 yc,uc,vc;
- double hue = bci.hue;
- double sat = bci.sat;
- double val = ((double)(yp[blkh*y+yy][16*x+xx]))/255;
+ float hue = bci.hue;
+ float sat = bci.sat;
+ float val = ((float)(yp[blkh*y+yy][16*x+xx]))/255;
HSB2RGB(hue,sat,val, rd,gd,bd);
r = (uint8)(255*rd);
Modified: trunk/user/pixil/packages/flash/flash/Jpeg/jddctmgr.c
===================================================================
--- trunk/user/pixil/packages/flash/flash/Jpeg/jddctmgr.c 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/flash/flash/Jpeg/jddctmgr.c 2007-09-13 23:19:15 UTC (rev 1884)
@@ -214,7 +214,7 @@
*/
FLOAT_MULT_TYPE * fmtbl = (FLOAT_MULT_TYPE *) compptr->dct_table;
int row, col;
- static const double aanscalefactor[DCTSIZE] = {
+ static const float aanscalefactor[DCTSIZE] = {
1.0, 1.387039845, 1.306562965, 1.175875602,
1.0, 0.785694958, 0.541196100, 0.275899379
};
@@ -223,7 +223,7 @@
for (row = 0; row < DCTSIZE; row++) {
for (col = 0; col < DCTSIZE; col++) {
fmtbl[i] = (FLOAT_MULT_TYPE)
- ((double) qtbl->quantval[i] *
+ ((float) qtbl->quantval[i] *
aanscalefactor[row] * aanscalefactor[col]);
i++;
}
Modified: trunk/user/pixil/packages/flash/flash/Jpeg/jmemmgr.c
===================================================================
--- trunk/user/pixil/packages/flash/flash/Jpeg/jmemmgr.c 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/flash/flash/Jpeg/jmemmgr.c 2007-09-13 23:19:15 UTC (rev 1884)
@@ -70,7 +70,7 @@
*/
#ifndef ALIGN_TYPE /* so can override from jconfig.h */
-#define ALIGN_TYPE double
+#define ALIGN_TYPE float
#endif
Modified: trunk/user/pixil/packages/flash/flash/Jpeg/jpeglib.h
===================================================================
--- trunk/user/pixil/packages/flash/flash/Jpeg/jpeglib.h 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/flash/flash/Jpeg/jpeglib.h 2007-09-13 23:19:15 UTC (rev 1884)
@@ -281,7 +281,7 @@
int input_components; /* # of color components in input image */
J_COLOR_SPACE in_color_space; /* colorspace of input image */
- double input_gamma; /* image gamma of input image */
+ float input_gamma; /* image gamma of input image */
/* Compression parameters --- these fields must be set before calling
* jpeg_start_compress(). We recommend calling jpeg_set_defaults() to
@@ -431,7 +431,7 @@
unsigned int scale_num, scale_denom; /* fraction by which to scale image */
- double output_gamma; /* image gamma wanted in output */
+ float output_gamma; /* image gamma wanted in output */
boolean buffered_image; /* TRUE=multiple output passes */
boolean raw_data_out; /* TRUE=downsampled data wanted */
Modified: trunk/user/pixil/packages/flash/flash/Kflash/saver_common/xlock.h
===================================================================
--- trunk/user/pixil/packages/flash/flash/Kflash/saver_common/xlock.h 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/flash/flash/Kflash/saver_common/xlock.h 2007-09-13 23:19:15 UTC (rev 1884)
@@ -224,10 +224,10 @@
#define SINF(n) sinf(n)
#define COSF(n) cosf(n)
#define FABSF(n) fabsf(n)
-#else
-#define SINF(n) ((float)sin((double)(n)))
-#define COSF(n) ((float)cos((double)(n)))
-#define FABSF(n) ((float)fabs((double)(n)))
+#else
+#define SINF(n) ((float)sin((float)(n)))
+#define COSF(n) ((float)cos((float)(n)))
+#define FABSF(n) ((float)fabs((float)(n)))
#endif
/*** random number generator ***/
Modified: trunk/user/pixil/packages/flash/flash/Kflash/saver_common/xlockmore.h
===================================================================
--- trunk/user/pixil/packages/flash/flash/Kflash/saver_common/xlockmore.h 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/flash/flash/Kflash/saver_common/xlockmore.h 2007-09-13 23:19:15 UTC (rev 1884)
@@ -255,9 +255,9 @@
#define COSF(n) cosf(n)
#define FABSF(n) fabsf(n)
#else
-#define SINF(n) ((float)sin((double)(n)))
-#define COSF(n) ((float)cos((double)(n)))
-#define FABSF(n) ((float)fabs((double)(n)))
+#define SINF(n) ((float)sin((float)(n)))
+#define COSF(n) ((float)cos((float)(n)))
+#define FABSF(n) ((float)fabs((float)(n)))
#endif
#endif /* __XLOCK_XLOCK_H__ */
Modified: trunk/user/pixil/packages/flash/flash/Kflash/saver_common/xs_colors.c
===================================================================
--- trunk/user/pixil/packages/flash/flash/Kflash/saver_common/xs_colors.c 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/flash/flash/Kflash/saver_common/xs_colors.c 2007-09-13 23:19:15 UTC (rev 1884)
@@ -84,8 +84,8 @@
void
make_color_ramp (Display *dpy, Colormap cmap,
- int h1, double s1, double v1, /* 0-360, 0-1.0, 0-1.0 */
- int h2, double s2, double v2, /* 0-360, 0-1.0, 0-1.0 */
+ int h1, float s1, float v1, /* 0-360, 0-1.0, 0-1.0 */
+ int h2, float s2, float v2, /* 0-360, 0-1.0, 0-1.0 */
XColor *colors, int *ncolorsP,
Bool closed_p,
Bool allocate_p,
@@ -93,7 +93,7 @@
{
int i;
int ncolors = *ncolorsP;
- double dh, ds, dv; /* deltas */
+ float dh, ds, dv; /* deltas */
AGAIN:
@@ -107,7 +107,7 @@
is always from h1 to h2 (rather than the shorter path.) make_uniform
depends on this.
*/
- dh = ((double)h2 - (double)h1) / ncolors;
+ dh = ((float)h2 - (float)h1) / ncolors;
ds = (s2 - s1) / ncolors;
dv = (v2 - v1) / ncolors;
@@ -186,7 +186,7 @@
static void
make_color_path (Display *dpy, Colormap cmap,
- int npoints, int *h, double *s, double *v,
+ int npoints, int *h, float *s, float *v,
XColor *colors, int *ncolorsP,
Bool allocate_p,
Bool writable_p)
@@ -195,9 +195,9 @@
int total_ncolors = *ncolorsP;
int ncolors[MAXPOINTS]; /* number of pixels per edge */
- double dh[MAXPOINTS]; /* distance between pixels, per edge (0 - 360.0) */
- double ds[MAXPOINTS]; /* distance between pixels, per edge (0 - 1.0) */
- double dv[MAXPOINTS]; /* distance between pixels, per edge (0 - 1.0) */
+ float dh[MAXPOINTS]; /* distance between pixels, per edge (0 - 360.0) */
+ float ds[MAXPOINTS]; /* distance between pixels, per edge (0 - 1.0) */
+ float dv[MAXPOINTS]; /* distance between pixels, per edge (0 - 1.0) */
if (npoints == 0)
{
@@ -221,20 +221,20 @@
AGAIN:
{
- double DH[MAXPOINTS]; /* Distance between H values in the shortest
+ float DH[MAXPOINTS]; /* Distance between H values in the shortest
direction around the circle, that is, the
distance between 10 and 350 is 20.
(Range is 0 - 360.0.)
*/
- double edge[MAXPOINTS]; /* lengths of edges in unit HSV space. */
- double ratio[MAXPOINTS]; /* proportions of the edges (total 1.0) */
- double circum = 0;
- double one_point_oh = 0; /* (debug) */
+ float edge[MAXPOINTS]; /* lengths of edges in unit HSV space. */
+ float ratio[MAXPOINTS]; /* proportions of the edges (total 1.0) */
+ float circum = 0;
+ float one_point_oh = 0; /* (debug) */
for (i = 0; i < npoints; i++)
{
int j = (i+1) % npoints;
- double d = ((double) (h[i] - h[j])) / 360;
+ float d = ((float) (h[i] - h[j])) / 360;
if (d < 0) d = -d;
if (d > 0.5) d = 0.5 - (d - 0.5);
DH[i] = d;
@@ -328,7 +328,7 @@
#endif /* DEBUG */
for (j = 0; j < ncolors[i]; j++, k++)
{
- double hh = (h[i] + (j * dh[i] * direction));
+ float hh = (h[i] + (j * dh[i] * direction));
if (hh < 0) hh += 360;
else if (hh > 360) hh -= 0;
colors[k].flags = DoRed|DoGreen|DoBlue;
@@ -417,15 +417,15 @@
void
make_color_loop (Display *dpy, Colormap cmap,
- int h0, double s0, double v0, /* 0-360, 0-1.0, 0-1.0 */
- int h1, double s1, double v1, /* 0-360, 0-1.0, 0-1.0 */
- int h2, double s2, double v2, /* 0-360, 0-1.0, 0-1.0 */
+ int h0, float s0, float v0, /* 0-360, 0-1.0, 0-1.0 */
+ int h1, float s1, float v1, /* 0-360, 0-1.0, 0-1.0 */
+ int h2, float s2, float v2, /* 0-360, 0-1.0, 0-1.0 */
XColor *colors, int *ncolorsP,
Bool allocate_p,
Bool writable_p)
{
int h[3];
- double s[3], v[3];
+ float s[3], v[3];
h[0] = h0; h[1] = h1; h[2] = h2;
s[0] = s0; s[1] = s1; s[2] = s2;
v[0] = v0; v[1] = v1; v[2] = v2;
@@ -465,10 +465,10 @@
Bool wanted_writable = (allocate_p && writable_pP && *writable_pP);
int i;
int h[MAXPOINTS];
- double s[MAXPOINTS];
- double v[MAXPOINTS];
- double total_s = 0;
- double total_v = 0;
+ float s[MAXPOINTS];
+ float v[MAXPOINTS];
+ float total_s = 0;
+ float total_v = 0;
Screen *screen = DefaultScreenOfDisplay(dpy); /* #### WRONG! */
if (*ncolorsP <= 0) return;
@@ -495,10 +495,10 @@
if (i > 0)
{
int j = (i+1 == npoints) ? 0 : (i-1);
- double hi = ((double) h[i]) / 360;
- double hj = ((double) h[j]) / 360;
- double dh = hj - hi;
- double distance;
+ float hi = ((float) h[i]) / 360;
+ float hj = ((float) h[j]) / 360;
+ float dh = hj - hi;
+ float distance;
if (dh < 0) dh = -dh;
if (dh > 0.5) dh = 0.5 - (dh - 0.5);
distance = sqrt ((dh * dh) +
@@ -554,8 +554,8 @@
Bool wanted_writable = (allocate_p && writable_pP && *writable_pP);
Screen *screen = DefaultScreenOfDisplay(dpy); /* #### WRONG! */
- double S = ((double) (random() % 34) + 66) / 100.0; /* range 66%-100% */
- double V = ((double) (random() % 34) + 66) / 100.0; /* range 66%-100% */
+ float S = ((float) (random() % 34) + 66) / 100.0; /* range 66%-100% */
+ float V = ((float) (random() % 34) + 66) / 100.0; /* range 66%-100% */
if (*ncolorsP <= 0) return;
@@ -611,8 +611,8 @@
if (bright_p)
{
int H = random() % 360; /* range 0-360 */
- double S = ((double) (random()%70) + 30)/100.0; /* range 30%-100% */
- double V = ((double) (random()%34) + 66)/100.0; /* range 66%-100% */
+ float S = ((float) (random()%70) + 30)/100.0; /* range 30%-100% */
+ float V = ((float) (random()%34) + 66)/100.0; /* range 66%-100% */
hsv_to_rgb (H, S, V,
&colors[i].red, &colors[i].green, &colors[i].blue);
}
Modified: trunk/user/pixil/packages/flash/flash/Kflash/saver_common/xs_colors.h
===================================================================
--- trunk/user/pixil/packages/flash/flash/Kflash/saver_common/xs_colors.h 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/flash/flash/Kflash/saver_common/xs_colors.h 2007-09-13 23:19:15 UTC (rev 1884)
@@ -40,8 +40,8 @@
otherwise, read-only cells will be allocated.
*/
extern void make_color_ramp (Display *dpy, Colormap cmap,
- int h1, double s1, double v1,
- int h2, double s2, double v2,
+ int h1, float s1, float v1,
+ int h2, float s2, float v2,
XColor *colors, int *ncolorsP,
Bool closed_p,
Bool allocate_p,
@@ -58,9 +58,9 @@
otherwise, read-only cells will be allocated.
*/
extern void make_color_loop (Display *, Colormap,
- int h1, double s1, double v1,
- int h2, double s2, double v2,
- int h3, double s3, double v3,
+ int h1, float s1, float v1,
+ int h2, float s2, float v2,
+ int h3, float s3, float v3,
XColor *colors, int *ncolorsP,
Bool allocate_p,
Bool writable_p);
Modified: trunk/user/pixil/packages/flash/flash/Kflash/saver_common/xs_hsv.c
===================================================================
--- trunk/user/pixil/packages/flash/flash/Kflash/saver_common/xs_hsv.c 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/flash/flash/Kflash/saver_common/xs_hsv.c 2007-09-13 23:19:15 UTC (rev 1884)
@@ -17,12 +17,12 @@
#include "xs_hsv.h"
void
-hsv_to_rgb (int h, double s, double v,
+hsv_to_rgb (int h, float s, float v,
unsigned short *r, unsigned short *g, unsigned short *b)
{
- double H, S, V, R, G, B;
- double p1, p2, p3;
- double f;
+ float H, S, V, R, G, B;
+ float p1, p2, p3;
+ float f;
int i;
if (s < 0) s = 0;
@@ -50,15 +50,15 @@
void
rgb_to_hsv (unsigned short r, unsigned short g, unsigned short b,
- int *h, double *s, double *v)
+ int *h, float *s, float *v)
{
- double R, G, B, H, S, V;
- double cmax, cmin;
- double cmm;
+ float R, G, B, H, S, V;
+ float cmax, cmin;
+ float cmm;
int imax;
- R = ((double) r) / 65535.0;
- G = ((double) g) / 65535.0;
- B = ((double) b) / 65535.0;
+ R = ((float) r) / 65535.0;
+ G = ((float) g) / 65535.0;
+ B = ((float) b) / 65535.0;
cmax = R; cmin = G; imax = 1;
if ( cmax < G ) { cmax = G; cmin = R; imax = 2; }
if ( cmax < B ) { cmax = B; imax = 3; }
Modified: trunk/user/pixil/packages/flash/flash/Kflash/saver_common/xs_hsv.h
===================================================================
--- trunk/user/pixil/packages/flash/flash/Kflash/saver_common/xs_hsv.h 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/flash/flash/Kflash/saver_common/xs_hsv.h 2007-09-13 23:19:15 UTC (rev 1884)
@@ -17,11 +17,11 @@
H is in the range 0 - 360;
S and V are in the range 0.0 - 1.0.
*/
-extern void hsv_to_rgb (int h, double s, double v,
+extern void hsv_to_rgb (int h, float s, float v,
unsigned short *r,
unsigned short *g,
unsigned short *b);
extern void rgb_to_hsv (unsigned short r, unsigned short g, unsigned short b,
- int *h, double *s, double *v);
+ int *h, float *s, float *v);
#endif /* __HSV_H__ */
Modified: trunk/user/pixil/packages/flash/flash/Kflash/saver_common/xs_yarandom.h
===================================================================
--- trunk/user/pixil/packages/flash/flash/Kflash/saver_common/xs_yarandom.h 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/flash/flash/Kflash/saver_common/xs_yarandom.h 2007-09-13 23:19:15 UTC (rev 1884)
@@ -35,16 +35,16 @@
/* Implement frand using GCC's statement-expression extension. */
# define frand(f) \
- ({ double tmp = (((double) random()) / \
- (((double) ((unsigned int)~0)) / ((double) (f)))); \
+ ({ float tmp = (((float) random()) / \
+ (((float) ((unsigned int)~0)) / ((float) (f)))); \
tmp < 0 ? (-tmp) : tmp; })
#else /* not GCC2 - implement frand using a global variable.*/
-static double _frand_tmp_;
+static float _frand_tmp_;
# define frand(f) \
- (_frand_tmp_ = (((double) random()) / \
- (((double) ((unsigned int)~0)) / ((double) (f)))), \
+ (_frand_tmp_ = (((float) random()) / \
+ (((float) ((unsigned int)~0)) / ((float) (f)))), \
_frand_tmp_ < 0 ? (-_frand_tmp_) : _frand_tmp_)
#endif /* not GCC2 */
Modified: trunk/user/pixil/packages/nxdoom/nxdoom/m_fixed.c
===================================================================
--- trunk/user/pixil/packages/nxdoom/nxdoom/m_fixed.c 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/nxdoom/nxdoom/m_fixed.c 2007-09-13 23:19:15 UTC (rev 1884)
@@ -89,9 +89,9 @@
return (fixed_t) c;
#endif
- double c;
+ float c;
- c = ((double)a) / ((double)b) * FRACUNIT;
+ c = ((float)a) / ((float)b) * FRACUNIT;
if (c >= 2147483648.0 || c < -2147483648.0)
I_Error("FixedDiv: divide by zero");
Modified: trunk/user/pixil/packages/viewml/viewml/jscript/bison2cpp.h
===================================================================
--- trunk/user/pixil/packages/viewml/viewml/jscript/bison2cpp.h 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/viewml/viewml/jscript/bison2cpp.h 2007-09-13 23:19:15 UTC (rev 1884)
@@ -57,7 +57,7 @@
void* newJSArrayAccess( void *_array, void *_index );
void* newJSString( char *_string );
void* newJSBool( char );
-void* newJSFloat( double );
+void* newJSFloat( float );
void* newJSThis();
void* newJSNull();
Modified: trunk/user/pixil/packages/viewml/viewml/jscript/cpp2bison.cpp
===================================================================
--- trunk/user/pixil/packages/viewml/viewml/jscript/cpp2bison.cpp 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/viewml/viewml/jscript/cpp2bison.cpp 2007-09-13 23:19:15 UTC (rev 1884)
@@ -110,7 +110,7 @@
return (void*) new JSBool( (bool)_bool );
}
-extern "C" void* newJSFloat( double _f )
+extern "C" void* newJSFloat( float _f )
{
return (void*) new JSFloat( _f );
}
Modified: trunk/user/pixil/packages/viewml/viewml/jscript/jsexec.cpp
===================================================================
--- trunk/user/pixil/packages/viewml/viewml/jscript/jsexec.cpp 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/viewml/viewml/jscript/jsexec.cpp 2007-09-13 23:19:15 UTC (rev 1884)
@@ -49,7 +49,7 @@
*
*********************************************************/
-JSFloatObject::JSFloatObject( double _i ) : JSObject()
+JSFloatObject::JSFloatObject( float _i ) : JSObject()
{
value = _i;
}
Modified: trunk/user/pixil/packages/viewml/viewml/jscript/jsexec.h
===================================================================
--- trunk/user/pixil/packages/viewml/viewml/jscript/jsexec.h 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/viewml/viewml/jscript/jsexec.h 2007-09-13 23:19:15 UTC (rev 1884)
@@ -372,7 +372,7 @@
class JSFloatObject : public JSObject
{
public:
- JSFloatObject( double _i );
+ JSFloatObject( float _i );
JSFloatObject() { }
virtual int isA() { return TYPE_JSFloatObject; }
@@ -381,10 +381,10 @@
virtual JSObject* copy() { return new JSFloatObject( value ); }
- double getValue() { return value; }
+ float getValue() { return value; }
protected:
- double value;
+ float value;
};
#endif
Modified: trunk/user/pixil/packages/viewml/viewml/jscript/jstree.cpp
===================================================================
--- trunk/user/pixil/packages/viewml/viewml/jscript/jstree.cpp 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/viewml/viewml/jscript/jstree.cpp 2007-09-13 23:19:15 UTC (rev 1884)
@@ -88,7 +88,7 @@
*
*********************************************************/
-JSFloat::JSFloat( double _value ) : JSNode()
+JSFloat::JSFloat( float _value ) : JSNode()
{
value = _value;
}
Modified: trunk/user/pixil/packages/viewml/viewml/jscript/jstree.h
===================================================================
--- trunk/user/pixil/packages/viewml/viewml/jscript/jstree.h 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/viewml/viewml/jscript/jstree.h 2007-09-13 23:19:15 UTC (rev 1884)
@@ -114,7 +114,7 @@
class JSFloat : public JSNode
{
public:
- JSFloat( double );
+ JSFloat( float );
virtual ~JSFloat() { }
virtual int isA() { return ID_JSFloat; }
@@ -122,7 +122,7 @@
virtual int rightValue( JSScopeStack* _s, JSValue *rv );
protected:
- double value;
+ float value;
};
class JSBinaryOperator : public JSNode
Modified: trunk/user/pixil/packages/viewml/viewml/jscript/t1.c
===================================================================
--- trunk/user/pixil/packages/viewml/viewml/jscript/t1.c 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/viewml/viewml/jscript/t1.c 2007-09-13 23:19:15 UTC (rev 1884)
@@ -65,7 +65,7 @@
typedef union
{
int vali;
- double vald;
+ float vald;
char *name;
void *ptr;
} YYSTYPE;
Modified: trunk/user/pixil/packages/viewml/viewml/jscript/t1.h
===================================================================
--- trunk/user/pixil/packages/viewml/viewml/jscript/t1.h 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/viewml/viewml/jscript/t1.h 2007-09-13 23:19:15 UTC (rev 1884)
@@ -1,7 +1,7 @@
typedef union
{
int vali;
- double vald;
+ float vald;
char *name;
void *ptr;
} YYSTYPE;
Modified: trunk/user/pixil/packages/viewml/viewml/jscript/t1.y
===================================================================
--- trunk/user/pixil/packages/viewml/viewml/jscript/t1.y 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/viewml/viewml/jscript/t1.y 2007-09-13 23:19:15 UTC (rev 1884)
@@ -11,7 +11,7 @@
%union
{
int vali;
- double vald;
+ float vald;
char *name;
void *ptr;
}
Modified: trunk/user/pixil/packages/viewml/viewml/kdecore/kconfigbase.cpp
===================================================================
--- trunk/user/pixil/packages/viewml/viewml/kdecore/kconfigbase.cpp 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/viewml/viewml/kdecore/kconfigbase.cpp 2007-09-13 23:19:15 UTC (rev 1884)
@@ -532,18 +532,18 @@
}
-double KConfigBase::readDoubleNumEntry( const char* pKey,
- double nDefault) const
+float KConfigBase::readFloatNumEntry( const char* pKey,
+ float nDefault) const
{
bool ok;
- double rc;
+ float rc;
QString aValue = readEntry( pKey );
if( aValue.isNull() )
return nDefault;
else
{
- rc = aValue.toDouble( &ok );
+ rc = aValue.toFloat( &ok );
return( ok ? rc : 0 );
}
}
@@ -958,13 +958,13 @@
}
-const char* KConfigBase::writeEntry( const char* pKey, double nValue,
+const char* KConfigBase::writeEntry( const char* pKey, float nValue,
bool bPersistent, bool bGlobal,
bool bNLS )
{
QString aValue;
- aValue.setNum( nValue, 'g', 15 );
+ aValue.setNum( nValue, 'f', 15 );
return writeEntry( pKey, aValue, bPersistent, bGlobal, bNLS );
}
Modified: trunk/user/pixil/packages/viewml/viewml/kdecore/kconfigbase.h
===================================================================
--- trunk/user/pixil/packages/viewml/viewml/kdecore/kconfigbase.h 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/viewml/viewml/kdecore/kconfigbase.h 2007-09-13 23:19:15 UTC (rev 1884)
@@ -315,7 +315,7 @@
* @param nDefault A default value returned if the key was not found.
* @return The value for this key or 0 if no value was found.
*/
- double readDoubleNumEntry( const char* pKey, double nDefault = 0.0 ) const;
+ float readFloatNumEntry( const char* pKey, float nDefault = 0.0 ) const;
/**
* Read a QFont.
@@ -535,7 +535,7 @@
* @return The old value for this key. If this key did not
* exist, a null string is returned.
*/
- const char* writeEntry( const char* pKey, double nValue,
+ const char* writeEntry( const char* pKey, float nValue,
bool bPersistent = true, bool bGlobal = false,
bool bNLS = false );
Modified: trunk/user/pixil/packages/viewml/viewml/kdecore/kpoint.cpp
===================================================================
--- trunk/user/pixil/packages/viewml/viewml/kdecore/kpoint.cpp 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/viewml/viewml/kdecore/kpoint.cpp 2007-09-13 23:19:15 UTC (rev 1884)
@@ -96,7 +96,7 @@
}
//==========================================================
-KPoint &KPoint::operator*=(double _c)
+KPoint &KPoint::operator*=(float _c)
{
xpos = static_cast<int>(xpos * _c);
ypos = static_cast<int>(ypos * _c);
@@ -114,7 +114,7 @@
}
//==========================================================
-KPoint &KPoint::operator/=(double _c)
+KPoint &KPoint::operator/=(float _c)
{
xpos = static_cast<int>(xpos / _c);
ypos = static_cast<int>(ypos / _c);
@@ -189,13 +189,13 @@
}
//==========================================================
-KPoint operator*(const KPoint &_pnt,double _c)
+KPoint operator*(const KPoint &_pnt,float _c)
{
return KPoint(_pnt.x() * _c,_pnt.y() *_c);
}
//==========================================================
-KPoint operator*(double _c,const KPoint &_pnt)
+KPoint operator*(float _c,const KPoint &_pnt)
{
return KPoint(_pnt.x() * _c,_pnt.y() *_c);
}
@@ -213,7 +213,7 @@
}
//==========================================================
-KPoint operator/(const KPoint &_pnt,double _c)
+KPoint operator/(const KPoint &_pnt,float _c)
{
return KPoint(_pnt.x() / _c,_pnt.y() /_c);
}
Modified: trunk/user/pixil/packages/viewml/viewml/kdecore/kpoint.h
===================================================================
--- trunk/user/pixil/packages/viewml/viewml/kdecore/kpoint.h 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/viewml/viewml/kdecore/kpoint.h 2007-09-13 23:19:15 UTC (rev 1884)
@@ -34,9 +34,9 @@
KPoint &operator+=(const KPoint &_pnt);
KPoint &operator-=(const KPoint &_pnt);
KPoint &operator*=(int _c);
- KPoint &operator*=(double _c);
+ KPoint &operator*=(float _c);
KPoint &operator/=(int _c);
- KPoint &operator/=(double _c);
+ KPoint &operator/=(float _c);
operator QPoint() const;
@@ -50,11 +50,11 @@
friend KPoint operator-(const KPoint &_pnt1,const KPoint &_pnt2);
friend KPoint operator*(const KPoint &_pnt,int _c);
friend KPoint operator*(int _c,const KPoint &_pnt);
- friend KPoint operator*(const KPoint &_pnt,double _c);
- friend KPoint operator*(double _c,const KPoint &_pnt);
+ friend KPoint operator*(const KPoint &_pnt,float _c);
+ friend KPoint operator*(float _c,const KPoint &_pnt);
friend KPoint operator-(const KPoint &_pnt);
friend KPoint operator/(const KPoint &_pnt,int _c);
- friend KPoint operator/(const KPoint &_pnt,double _c);
+ friend KPoint operator/(const KPoint &_pnt,float _c);
protected:
int xpos,ypos;
Modified: trunk/user/pixil/packages/viewml/viewml/kdecore/kstring.cpp
===================================================================
--- trunk/user/pixil/packages/viewml/viewml/kdecore/kstring.cpp 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/viewml/viewml/kdecore/kstring.cpp 2007-09-13 23:19:15 UTC (rev 1884)
@@ -58,6 +58,7 @@
return _str;
}
+#if 0
QString& operator<<( QString& _str, double _v )
{
QString tmp;
@@ -65,6 +66,7 @@
_str += tmp.data();
return _str;
}
+#endif
QString& operator<<( QString& _str, const char* _v )
{
Modified: trunk/user/pixil/packages/viewml/viewml/kdecore/kstring.h
===================================================================
--- trunk/user/pixil/packages/viewml/viewml/kdecore/kstring.h 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/viewml/viewml/kdecore/kstring.h 2007-09-13 23:19:15 UTC (rev 1884)
@@ -10,7 +10,7 @@
QString& operator<<( QString&, long );
QString& operator<<( QString&, ulong );
QString& operator<<( QString&, float );
-QString& operator<<( QString&, double );
+//QString& operator<<( QString&, double );
QString& operator<<( QString&, const char* );
/* replaces QString::sprintf, where it's not sure, that 256
Modified: trunk/user/pixil/packages/viewml/viewml/kdeui/kbuttonbox.cpp
===================================================================
--- trunk/user/pixil/packages/viewml/viewml/kdeui/kbuttonbox.cpp 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/viewml/viewml/kdeui/kbuttonbox.cpp 2007-09-13 23:19:15 UTC (rev 1884)
@@ -151,7 +151,7 @@
x_pos += b->width() + _autoborder;
} else
- x_pos += (int)((((double)fs) * item->stretch) / stretch);
+ x_pos += (int)((((float)fs) * item->stretch) / stretch);
}
} else { // VERTICAL
// calcualte free size and stretches
@@ -182,7 +182,7 @@
y_pos += b->height() + _autoborder;
} else
- y_pos += (int)((((double)fs) * item->stretch) / stretch);
+ y_pos += (int)((((float)fs) * item->stretch) / stretch);
}
}
}
Modified: trunk/user/pixil/packages/viewml/viewml/kdeui/kruler.cpp
===================================================================
--- trunk/user/pixil/packages/viewml/viewml/kdeui/kruler.cpp 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/viewml/viewml/kdeui/kruler.cpp 2007-09-13 23:19:15 UTC (rev 1884)
@@ -1,5 +1,5 @@
/* This file is part of the KDE libraries
- Copyright (C) 1998 Jörg Habenicht (j.habenicht at europemail.com)
+ Copyright (C) 1998 J�g Habenicht (j.habenicht at europemail.com)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
@@ -34,7 +34,7 @@
#define INIT_SHOW_BIG_MARK true
#define INIT_SHOW_END_MARK true
-#define INIT_PIXEL_PER_MARK (double)10.0 /* distance between 2 base marks in pixel */
+#define INIT_PIXEL_PER_MARK (float)10.0 /* distance between 2 base marks in pixel */
#define INIT_OFFSET (-20)
#define FIX_WIDTH 20 /* widget width in pixel */
@@ -368,13 +368,13 @@
void
KRuler::setPixelPerMark(int rate)
{
- ppm = (double)rate;
+ ppm = (float)rate;
update(contentsRect());
}
*/
void
-KRuler::setPixelPerMark(double rate)
+KRuler::setPixelPerMark(float rate)
{ // never compare floats against each other :)
ppm = rate;
update(contentsRect());
@@ -472,9 +472,9 @@
// pixelpm = (int)ppm;
// left = clip.left(),
// right = clip.right();
- double f, fend,
- offsetmin=(double)(minval-offset),
- offsetmax=(double)(maxval-offset);
+ float f, fend,
+ offsetmin=(float)(minval-offset),
+ offsetmax=(float)(maxval-offset);
// draw labels
QFont font = p->font();
Modified: trunk/user/pixil/packages/viewml/viewml/kdeui/kruler.h
===================================================================
--- trunk/user/pixil/packages/viewml/viewml/kdeui/kruler.h 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/viewml/viewml/kdeui/kruler.h 2007-09-13 23:19:15 UTC (rev 1884)
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/* This file is part of the KDE libraries
- Copyright (C) 1998 Jörg Habenicht (j.habenicht at europemail.com)
+ Copyright (C) 1998 J�g Habenicht (j.habenicht at europemail.com)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
@@ -60,7 +60,7 @@
* so the widget will be painted only once when entering the main event loop.
*
* @short A ruler widget
- * @author Jörg Habenicht
+ * @author J�g Habenicht
*/
class KRuler : public QFrame
{
@@ -270,9 +270,9 @@
* To use int values use setPixelPerMark((int)your_int_value);
* default: 1 mark per 10 pixels
*/
- void setPixelPerMark(double);
+ void setPixelPerMark(float);
/* void setPixelPerMark(int); */
- inline double getPixelPerMark() const;
+ inline float getPixelPerMark() const;
/** the ruler may slide up and down "count" pixels
* this doesn't affect the position of the ruler pointer,
@@ -307,7 +307,7 @@
bool showtm, showlm, showmm, showbm, showem; /* show tiny, little, medium, big, endmarks */
int valuelm, valuemm, valuebm; /* value per little, medium, big mark */
bool showValuelm, showValuemm, showValuebm;
- double ppm; /* pixel per mark */
+ float ppm; /* pixel per mark */
QString endlabel;
QRangeControl range;
@@ -349,7 +349,7 @@
KRuler::getTickStyle() const;
#endif
-double
+float
KRuler::getPixelPerMark() const
{ return ppm; }
Modified: trunk/user/pixil/packages/viewml/viewml/kdeui/ktoolbar.cpp
===================================================================
--- trunk/user/pixil/packages/viewml/viewml/kdeui/ktoolbar.cpp 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/viewml/viewml/kdeui/ktoolbar.cpp 2007-09-13 23:19:15 UTC (rev 1884)
@@ -167,7 +167,7 @@
// Revision 1.58 1998/04/27 19:22:41 ettrich
// Matthias: the nifty feature that you can globally change the size of the
// toolbars broke the nifty-as-well feature that a client can pass another
-// size than 26 to the toolbar´s constructor.
+// size than 26 to the toolbars constructor.
//
// I hope I found a solution which allows both. If you pass an argument
// to the constructor, than a new attribute fixed_size is set.
@@ -675,7 +675,7 @@
/*
if (_size > 28)
{
- double factor=_size/26;
+ float factor=_size/26;
QImage i;
i = enabledPixmap.convertToImage();
i = i.smoothScale(enabledPixmap.width()*factor,
Modified: trunk/user/pixil/packages/viewml/viewml/kfmlib/kfmipc.cpp
===================================================================
--- trunk/user/pixil/packages/viewml/viewml/kfmlib/kfmipc.cpp 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/viewml/viewml/kfmlib/kfmipc.cpp 2007-09-13 23:19:15 UTC (rev 1884)
@@ -31,7 +31,7 @@
write( _fd, (const char*)buffer, strlen(buffer) );
}
-void write_double( int _fd, double _value )
+void write_float( int _fd, float _value )
{
char buffer[10];
sprintf( buffer, "%f ", _value );
@@ -63,9 +63,9 @@
write( _fd, (const char*)(_list->list), len );
}
-void write_doubleList( int _fd, doubleList* _list )
+void write_floatList( int _fd, floatList* _list )
{
- int len = _list->elements * sizeof(double);
+ int len = _list->elements * sizeof(float);
write( _fd, (const char*)&(_list->elements), sizeof(int) );
write( _fd, (const char*)(_list->list), len );
}
@@ -120,7 +120,7 @@
return tmp;
}
-double read_double( char *_data, int &_pos, int _len )
+float read_float( char *_data, int &_pos, int _len )
{
int i = _pos;
while ( _data[ _pos ] != ' ' )
@@ -158,15 +158,15 @@
}
}
-void read_doubleList( char *_data, int &_pos, int _len, doubleList *_list )
+void read_floatList( char *_data, int &_pos, int _len, floatList *_list )
{
int tmp = *((int*)_data + _pos);
_list->elements = tmp;
_pos += sizeof(int);
- _list->list = (double*)malloc( tmp * sizeof(double) );
+ _list->list = (float*)malloc( tmp * sizeof(float) );
for( int i = 0; i < tmp; i++ )
{
- _list->list[i] = read_double( _data, _pos, _len );
+ _list->list[i] = read_float( _data, _pos, _len );
}
}
@@ -202,7 +202,7 @@
free ( _list->list );
}
-void free_doubleList( doubleList *_list )
+void free_floatList( floatList *_list )
{
free ( _list->list );
}
@@ -219,7 +219,7 @@
return strlen(buffer) + 1;
}
-int len_double( double _value )
+int len_float( float _value )
{
char buffer[ 20 ];
sprintf( buffer, "%f", _value );
@@ -255,9 +255,9 @@
return ( sizeof(int) + _list->elements * sizeof(int) );
}
-int len_doubleList( doubleList *_list )
+int len_floatList( floatList *_list )
{
- return ( sizeof(int) + _list->elements * sizeof(double) );
+ return ( sizeof(int) + _list->elements * sizeof(float) );
}
int len_charList( charList *_list )
Modified: trunk/user/pixil/packages/viewml/viewml/kfmlib/kfmipc.h
===================================================================
--- trunk/user/pixil/packages/viewml/viewml/kfmlib/kfmipc.h 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/viewml/viewml/kfmlib/kfmipc.h 2007-09-13 23:19:15 UTC (rev 1884)
@@ -35,10 +35,10 @@
int *list;
};
-struct doubleList
+struct floatList
{
int elements;
- double *list;
+ float *list;
};
struct charList
@@ -56,39 +56,39 @@
#define len_boolList len_boolList
void write_int( int _fd, int _value );
-void write_double( int _fd, double _value );
+void write_float( int _fd, float _value );
void write_char( int _fd, char _value );
void write_string( int _fd, const char* _value );
void write_intList( int _fd, intList* _list );
-void write_doubleList( int _fd, doubleList* _list );
+void write_floatList( int _fd, floatList* _list );
void write_charList( int _fd, charList* _list );
void write_stringList( int _fd, stringList* _list );
char* read_string( char *_data, int &_pos, int _len );
int read_int( char *_data, int &_pos, int _len );
char read_char( char *_data, int &_pos, int _len );
-double read_double( char *_data, int &_pos, int _len );
+float read_float( char *_data, int &_pos, int _len );
void read_stringList( char *_data, int &_pos, int _len, stringList *_list );
void read_intList( char *_data, int &_pos, int _len, intList *_list );
-void read_doubleList( char *_data, int &_pos, int _len, doubleList *_list );
+void read_floatList( char *_data, int &_pos, int _len, floatList *_list );
void read_charList( char *_data, int &_pos, int _len, charList *_list );
#define free_int( x ); ;
#define free_char( x ); ;
-#define free_double( x ); ;
+#define free_float( x ); ;
void free_string( char *_str );
void free_stringList( stringList *_list );
void free_intList( intList *_list );
-void free_doubleList( doubleList *_list );
+void free_floatList( floatList *_list );
void free_charList( charList *_list );
int len_int( int _value );
-int len_double( double _value );
+int len_float( float _value );
int len_char( char _value );
int len_string( const char *_str );
int len_stringList( stringList *_list );
int len_intList( intList *_list );
-int len_doubleList( doubleList *_list );
+int len_floatList( floatList *_list );
int len_charList( charList *_list );
#endif
Modified: trunk/user/pixil/packages/viewml/viewml/src/fltk/nxscrollbar.cpp
===================================================================
--- trunk/user/pixil/packages/viewml/viewml/src/fltk/nxscrollbar.cpp 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/viewml/viewml/src/fltk/nxscrollbar.cpp 2007-09-13 23:19:15 UTC (rev 1884)
@@ -58,7 +58,7 @@
else {
int sliderx;
int S = int(slider_size()*W+.5);
- double val = (value()-minimum())/(maximum()-minimum());
+ float val = (value()-minimum())/(maximum()-minimum());
if (val >= 1.0) sliderx = W-S;
else if (val <= 0.0) sliderx = 0;
else sliderx = int(val*(W-S)+.5);
@@ -74,7 +74,7 @@
else {
int slidery;
int S = int(slider_size()*H+.5);
- double val = (value()-minimum())/(maximum()-minimum());
+ float val = (value()-minimum())/(maximum()-minimum());
if (val >= 1.0) slidery = H-S;
else if (val <= 0.0) slidery = 0;
else slidery = int(val*(H-S)+.5);
Modified: trunk/user/pixil/packages/viewml/viewml/src/fltk/nxslider.cpp
===================================================================
--- trunk/user/pixil/packages/viewml/viewml/src/fltk/nxslider.cpp 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/viewml/viewml/src/fltk/nxslider.cpp 2007-09-13 23:19:15 UTC (rev 1884)
@@ -43,7 +43,7 @@
}
-void NxSlider::slider_size(double v) {
+void NxSlider::slider_size(float v) {
if (v < 0) v = 0;
if (v > 1) v = 1;
if (slider_size_ != float(v)) {
@@ -52,7 +52,7 @@
}
}
-void NxSlider::bounds(double a, double b) {
+void NxSlider::bounds(float a, float b) {
if (minimum() != a || maximum() != b) {
Fl_Valuator::bounds(a, b);
damage(FL_DAMAGE_EXPOSE);
@@ -66,7 +66,7 @@
// l = length, total number of lines
step(1, 1);
if (p+w > t+l) l = p+w-t;
- slider_size(w >= l ? 1.0 : double(w)/double(l));
+ slider_size(w >= l ? 1.0 : float(w)/float(l));
#ifdef PDA
if( slider_size() < slider_size_min_ ) {
slider_size( slider_size_min_ ) ;
@@ -91,7 +91,7 @@
void NxSlider::draw(int x, int y, int w, int h)
{
- double val;
+ float val;
if (minimum() == maximum())
val = 0.5;
@@ -195,7 +195,7 @@
if( w > 0 && h > 0 ) {
if ( w < 17 ) {
w = 17;
- slider_size(double(w)/double(W));
+ slider_size(float(w)/float(W));
slider_size_min_ = slider_size();
}
@@ -236,7 +236,7 @@
if ( w > 0 && h > 0 ) {
if ( h < 17 ) {
h = 17;
- slider_size(double(h)/double(W));
+ slider_size(float(h)/float(W));
slider_size_min_ = slider_size();
}
@@ -275,7 +275,7 @@
int X;
static int offcenter;
if (type() == FL_HOR_FILL_SLIDER || type() == FL_VERT_FILL_SLIDER) {
- double val = (value()-minimum())/(maximum()-minimum());
+ float val = (value()-minimum())/(maximum()-minimum());
if (val >= 1.0) X = W;
else if (val <= 0.0) X = 0;
@@ -289,7 +289,7 @@
}
S = 0;
} else {
- double val = (value()-minimum())/(maximum()-minimum());
+ float val = (value()-minimum())/(maximum()-minimum());
if (val >= 1.0) X = W-S;
else if (val <= 0.0) X = 0;
@@ -303,7 +303,7 @@
}
}
X = mx-offcenter;
- double v;
+ float v;
TRY_AGAIN:
if (X < 0) {
X = 0;
Modified: trunk/user/pixil/packages/viewml/viewml/src/fltk/nxslider.h
===================================================================
--- trunk/user/pixil/packages/viewml/viewml/src/fltk/nxslider.h 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/viewml/viewml/src/fltk/nxslider.h 2007-09-13 23:19:15 UTC (rev 1884)
@@ -31,9 +31,9 @@
void draw(int x, int y, int w, int h);
void draw();
- FL_EXPORT void bounds(double a, double b);
+ FL_EXPORT void bounds(float a, float b);
float slider_size() const {return slider_size_;}
- FL_EXPORT void slider_size(double v);
+ FL_EXPORT void slider_size(float v);
Fl_Boxtype slider() const {return (Fl_Boxtype)slider_;}
void slider(Fl_Boxtype c) {slider_ = c;}
FL_EXPORT int handle(int, int, int, int, int);
Modified: trunk/user/pixil/packages/viewml/viewml/src/fltk/qlistbox.h
===================================================================
--- trunk/user/pixil/packages/viewml/viewml/src/fltk/qlistbox.h 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/viewml/viewml/src/fltk/qlistbox.h 2007-09-13 23:19:15 UTC (rev 1884)
@@ -48,8 +48,8 @@
// CRH long maxItemWidth () const { return 0; }
long maxItemWidth () const
{
- double len = 0;
- double max = 0;
+ float len = 0;
+ float max = 0;
for(int i = 1; i <= m_nCount; i++)
if(max < (len = fl_width(browser->text(i))))
max = len;
Modified: trunk/user/pixil/packages/viewml/viewml/src/fltk/qpainter.h
===================================================================
--- trunk/user/pixil/packages/viewml/viewml/src/fltk/qpainter.h 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/viewml/viewml/src/fltk/qpainter.h 2007-09-13 23:19:15 UTC (rev 1884)
@@ -105,7 +105,7 @@
drawRect(rect.x(),rect.y(),rect.width(), rect.height());
}
- void scale(double sx, double sy) { }
+ void scale(float sx, float sy) { }
void eraseRect(int x, int y, int w, int h);
void eraseRect(const QRect & rect);
Modified: trunk/user/pixil/packages/viewml/viewml/src/fltk/qwmatrix.h
===================================================================
--- trunk/user/pixil/packages/viewml/viewml/src/fltk/qwmatrix.h 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/packages/viewml/viewml/src/fltk/qwmatrix.h 2007-09-13 23:19:15 UTC (rev 1884)
@@ -4,7 +4,7 @@
class QWMatrix
{
public:
- QWMatrix & scale(double dx, double dy) { return *this; }
+ QWMatrix & scale(float dx, float dy) { return *this; }
};
Modified: trunk/user/pixil/pixilDT/include/editvars.h
===================================================================
--- trunk/user/pixil/pixilDT/include/editvars.h 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/pixilDT/include/editvars.h 2007-09-13 23:19:15 UTC (rev 1884)
@@ -77,10 +77,10 @@
#endif /* */
#ifdef WIN32
-RCLDLL extern double PowersOfTen[];
+RCLDLL extern float PowersOfTen[];
#else /* */
-extern double PowersOfTen[];
+extern float PowersOfTen[];
#endif /* */
enum ErrorSeverity
@@ -121,23 +121,23 @@
#include <math.h>
#ifndef WIN32
#include <cmath>
-#ifndef modf
-extern "C" double modf(double, double *);
+#ifndef modff
+extern "C" float modff(float, float *);
#endif /* */
#endif /* */
-inline double
-Round(double num, short places)
+inline float
+Round(float num, short places)
{
- double intpart, fracpart;
- fracpart = modf(num * PowersOfTen[places], &intpart);
+ float intpart, fracpart;
+ fracpart = modff(num * PowersOfTen[places], &intpart);
if (fracpart >= 0.5)
intpart++;
return (intpart / PowersOfTen[places]);
}
inline bool
-IsZero(double num)
+IsZero(float num)
{
return ((num > -0.005) && (num < 0.005));
}
Modified: trunk/user/pixil/pixilDT/include/nxslider.h
===================================================================
--- trunk/user/pixil/pixilDT/include/nxslider.h 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/pixilDT/include/nxslider.h 2007-09-13 23:19:15 UTC (rev 1884)
@@ -67,12 +67,12 @@
void draw(int x, int y, int w, int h);
void draw();
- FL_EXPORT void bounds(double a, double b);
+ FL_EXPORT void bounds(float a, float b);
float slider_size() const
{
return slider_size_;
}
- FL_EXPORT void slider_size(double v);
+ FL_EXPORT void slider_size(float v);
Fl_Boxtype slider() const
{
return (Fl_Boxtype) slider_;
Modified: trunk/user/pixil/pixilDT/src/SchedulerMonthly.cpp
===================================================================
--- trunk/user/pixil/pixilDT/src/SchedulerMonthly.cpp 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/pixilDT/src/SchedulerMonthly.cpp 2007-09-13 23:19:15 UTC (rev 1884)
@@ -484,8 +484,8 @@
SchedulerMonthly::Print()
{
bool bOverflow;
- double fBoxHeight;
- double fBoxWidth;
+ float fBoxHeight;
+ float fBoxWidth;
int nBorder = INCH / 2; // 1/2 inch border
int nCol;
int nCopy;
@@ -543,9 +543,9 @@
// Calculate the sizeof the calendar boxes
fBoxHeight =
- (double (nHeight - (3 * printer.GetFontSize()) / 2 - nBorder))
+ (float (nHeight - (3 * printer.GetFontSize()) / 2 - nBorder))
/6.0;
- fBoxWidth = (double (printer.GetWidth() - 2 * nBorder)) /7.0;
+ fBoxWidth = (float (printer.GetWidth() - 2 * nBorder)) /7.0;
// Draw the day names
for (nCol = 0; nCol < 7; ++nCol) {
@@ -576,7 +576,7 @@
for (nRow = 0; nRow < 6; ++nRow) {
// Calculate this Y and set the next "last Y" value
nY = nLastY;
- nLastY = nHeight - int (double (nRow + 1) * fBoxHeight);
+ nLastY = nHeight - int (float (nRow + 1) * fBoxHeight);
// Get the first "last X" value
nLastX = nBorder;
@@ -585,7 +585,7 @@
for (nCol = 0; nCol < 7; ++nCol) {
// Calculate this X and set the next "last X" value
nX = nLastX;
- nLastX = int (double ((nCol + 1)) * fBoxWidth) + nBorder;
+ nLastX = int (float ((nCol + 1)) * fBoxWidth) + nBorder;
// Get the events for this day
pSchedulerDB->GetAllAppointments(nDate, mapEvent);
Modified: trunk/user/pixil/pixilDT/src/SplashDlg.cpp
===================================================================
--- trunk/user/pixil/pixilDT/src/SplashDlg.cpp 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/pixilDT/src/SplashDlg.cpp 2007-09-13 23:19:15 UTC (rev 1884)
@@ -71,7 +71,7 @@
//--------------------------------------------------------------//
// Constructor //
//--------------------------------------------------------------//
-SplashDlg::SplashDlg(double fSeconds, bool & bTimedOut)
+SplashDlg::SplashDlg(float fSeconds, bool & bTimedOut)
:
Fl_Window((Fl::w() - DLG_WIDTH) / 2,
(Fl::h() - DLG_HEIGHT) / 2, DLG_WIDTH, DLG_HEIGHT)
Modified: trunk/user/pixil/pixilDT/src/SplashDlg.h
===================================================================
--- trunk/user/pixil/pixilDT/src/SplashDlg.h 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/pixilDT/src/SplashDlg.h 2007-09-13 23:19:15 UTC (rev 1884)
@@ -52,7 +52,7 @@
#include <FL/Fl_Window.H>
class SplashDlg:public Fl_Window
{
- public:SplashDlg(double fSeconds,
+ public:SplashDlg(float fSeconds,
// Constructor
bool & bTimedOut);
~SplashDlg(); // Destructor
Modified: trunk/user/pixil/sys/par/lib/Makefile
===================================================================
--- trunk/user/pixil/sys/par/lib/Makefile 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/sys/par/lib/Makefile 2007-09-13 23:19:15 UTC (rev 1884)
@@ -16,6 +16,8 @@
CFLAGS ?=
CFLAGS +=-DHAVE_MMAPBUG -DDEFPARDB="\"$(PAR_DB)\""
NATIVE_CFLAGS=-DHAVE_MMAPBUG -DDEFPARDB="\"$(PAR_DB)\""
+CXXFLAGS +=-DHAVE_MMAPBUG -DDEFPARDB="\"$(PAR_DB)\""
+NATIVE_CXXFLAGS=-DHAVE_MMAPBUG -DDEFPARDB="\"$(PAR_DB)\""
include $(BASE_DIR)/Rules.make
Modified: trunk/user/pixil/sys/par/lib/par_api.c
===================================================================
--- trunk/user/pixil/sys/par/lib/par_api.c 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/sys/par/lib/par_api.c 2007-09-13 23:19:15 UTC (rev 1884)
@@ -82,7 +82,7 @@
break;
case PAR_FLOAT:
- gsize = sizeof(double);
+ gsize = sizeof(float);
break;
case PAR_BOOL:
Modified: trunk/user/pixil/sys/par/tools/parget.c
===================================================================
--- trunk/user/pixil/sys/par/tools/parget.c 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/sys/par/tools/parget.c 2007-09-13 23:19:15 UTC (rev 1884)
@@ -73,7 +73,7 @@
break;
case PAR_FLOAT:
- printf("%f\n", *((double *) value));
+ printf("%f\n", *((float *) value));
case PAR_BOOL:
if (*((int *) value))
Modified: trunk/user/pixil/sys/par/tools/parset.c
===================================================================
--- trunk/user/pixil/sys/par/tools/parset.c 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/sys/par/tools/parset.c 2007-09-13 23:19:15 UTC (rev 1884)
@@ -207,7 +207,7 @@
break;
case PAR_FLOAT:{
- double fval = atof(value);
+ float fval = atof(value);
ret = db_addNode(db, node, value, fval, PAR_FLOAT);
}
Modified: trunk/user/pixil/sys/par/tools/parxml.c
===================================================================
--- trunk/user/pixil/sys/par/tools/parxml.c 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/sys/par/tools/parxml.c 2007-09-13 23:19:15 UTC (rev 1884)
@@ -327,8 +327,8 @@
}
if (strcmp(prop->value, "float") == 0) {
- double fval = atof(text);
- tree_addData((tree_t *) data, &fval, sizeof(double), PAR_FLOAT);
+ float fval = atof(text);
+ tree_addData((tree_t *) data, &fval, sizeof(float), PAR_FLOAT);
return (data);
}
@@ -502,7 +502,7 @@
break;
case PAR_FLOAT:
- fprintf(stream, "%f", *((double *) node->data));
+ fprintf(stream, "%f", *((float *) node->data));
break;
case PAR_COLOR:
Modified: trunk/user/pixil/sys/pixilwm/applets/battery.c
===================================================================
--- trunk/user/pixil/sys/pixilwm/applets/battery.c 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/sys/pixilwm/applets/battery.c 2007-09-13 23:19:15 UTC (rev 1884)
@@ -70,6 +70,7 @@
static int ttl_shown = 0;
static GR_IMAGE_ID batimage;
+#ifdef NOTUSED
static void show_ttlwindow(void) {
char buf[64];
int tw, th, tb;
@@ -99,7 +100,7 @@
if (!fontid)
fontid = GrCreateFont(GR_FONT_GUI_VAR, 0, NULL);
- if (global_battery.status || global_battery.ttl == -1)
+ if (global_battery.status || global_battery.ttl == ((unsigned short)-1))
sprintf(buf, "AC Attached");
else
sprintf(buf, "%d:%02d left", global_battery.ttl / 60,
@@ -123,6 +124,7 @@
ttl_shown = 2;
}
+#endif
static void draw_battery(GR_WINDOW_ID wid) {
GR_GC_ID gc = GrNewGC();
Modified: trunk/user/pixil/sys/pixilwm/applets/loadmon.c
===================================================================
--- trunk/user/pixil/sys/pixilwm/applets/loadmon.c 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/sys/pixilwm/applets/loadmon.c 2007-09-13 23:19:15 UTC (rev 1884)
@@ -25,7 +25,7 @@
static int get_load(void)
{
unsigned long user, nice, sys, idle;
- double total = 0, busy = 0;
+ float total = 0, busy = 0;
char str[BUFSIZ];
char *c;
@@ -58,8 +58,8 @@
dsys = abs(sys - cpudata.sys);
didle = abs(idle - cpudata.idle);
- busy = (double) duser + dnice + dsys;
- total = (double) busy + didle;
+ busy = (float) duser + dnice + dsys;
+ total = (float) busy + didle;
} else
total = 0;
Modified: trunk/user/pixil/sys/pixilwm/applets.h
===================================================================
--- trunk/user/pixil/sys/pixilwm/applets.h 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/sys/pixilwm/applets.h 2007-09-13 23:19:15 UTC (rev 1884)
@@ -55,6 +55,7 @@
int wm_applet_add_timer(int applet_id, int type, unsigned long length, applet_timeout_callback cb);
+void wm_init_applets(void);
unsigned long wm_applet_get_timeout(void);
void wm_applet_handle_event(GR_EVENT *event);
unsigned long wm_applet_handle_timer(unsigned long elapsed);
Modified: trunk/user/pixil/sys/pixilwm/main.c
===================================================================
--- trunk/user/pixil/sys/pixilwm/main.c 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/sys/pixilwm/main.c 2007-09-13 23:19:15 UTC (rev 1884)
@@ -68,7 +68,7 @@
#include "screensaver.h"
-static scrtop_fire_timer(GR_TIMER_ID id);
+static void scrtop_fire_timer(GR_TIMER_ID id);
static void mainloop(void);
GR_TIMER_ID pwr_timer_id = 0;
@@ -328,7 +328,7 @@
}
}
-static scrtop_fire_timer(GR_TIMER_ID id) {
+static void scrtop_fire_timer(GR_TIMER_ID id) {
struct timer_list *a = 0, *p = 0;
for(a = scrtop_timer_list; a; p = a, a = a->next)
Modified: trunk/user/pixil/sys/pixilwm/powerman.c
===================================================================
--- trunk/user/pixil/sys/pixilwm/powerman.c 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/sys/pixilwm/powerman.c 2007-09-13 23:19:15 UTC (rev 1884)
@@ -42,6 +42,7 @@
#include <string.h>
#include <stdlib.h>
#include <nano-X.h>
+#include <nanowm.h>
#include <pixlib/pixlib.h>
#ifdef CONFIG_PAR
@@ -68,11 +69,13 @@
GR_TIMER_ID pm_get_timer_id(void) { return pm_timer_id; }
+#if 0
static void set_pm_timer(int timeout) {
if (pm_timer_id) return;
pm_timer_id = GrCreateTimer(1, timeout);
scrtop_register_timer(pm_timer_id, pm_suspend);
}
+#endif
static void stop_bl_timer(void) {
GrSetScreenSaverTimeout(0);
@@ -205,8 +208,6 @@
void
pm_suspend(void) {
- int state = pix_pwr_onBattery();
-
printf("Suspending the screentop - see you on the flip side\n");
pm_stop_timer(); /* Stop both timers */
Modified: trunk/user/pixil/sys/pixilwm/powerman.h
===================================================================
--- trunk/user/pixil/sys/pixilwm/powerman.h 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/sys/pixilwm/powerman.h 2007-09-13 23:19:15 UTC (rev 1884)
@@ -71,7 +71,7 @@
void pm_bltimer_on(void);
void pm_bltimer_off(void);
-int pm_get_bl_status(void);
+int pm_get_bl_state(void);
void pm_bl_toggle(void);
#endif
Modified: trunk/user/pixil/sys/pixilwm/screensaver.c
===================================================================
--- trunk/user/pixil/sys/pixilwm/screensaver.c 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/sys/pixilwm/screensaver.c 2007-09-13 23:19:15 UTC (rev 1884)
@@ -45,6 +45,7 @@
#include "powerman.h"
static int g_active = 0;
+#ifndef CONFIG_PIXILWM_PM
static GR_WINDOW_ID swindow = 0;
static void draw_screensaver(void) {
@@ -103,6 +104,7 @@
/* Turn back on the backlight */
pm_backlight(1);
}
+#endif
void screensaver_init(void) {
Modified: trunk/user/pixil/sys/syncagent/src/main.c
===================================================================
--- trunk/user/pixil/sys/syncagent/src/main.c 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/sys/syncagent/src/main.c 2007-09-13 23:19:15 UTC (rev 1884)
@@ -10,6 +10,7 @@
#include <sys/time.h>
#include <sys/types.h>
#include <sys/select.h>
+#include <ctype.h>
#include <ipc/colosseum.h>
#include <sync/msg_defs.h>
@@ -127,7 +128,7 @@
char *buffer = (char *) calloc(CL_MAX_MSG_LEN, 1);
if (!buffer)
- return;
+ return -1;
ret = ClGetMessage(buffer, &size, &src);
@@ -159,6 +160,7 @@
}
else printf("SYNAGENT: I don't know what to do with the incoming message [%d] [%s]\n", ret, buffer);
free(buffer);
+ return 0;
}
int
Modified: trunk/user/pixil/sys/syncagent/src/plugin.c
===================================================================
--- trunk/user/pixil/sys/syncagent/src/plugin.c 2007-09-13 22:21:23 UTC (rev 1883)
+++ trunk/user/pixil/sys/syncagent/src/plugin.c 2007-09-13 23:19:15 UTC (rev 1884)
@@ -75,7 +75,7 @@
db_handle *handle = db_openDB(db_getDefaultDB(), PAR_DB_MODE_RDONLY);
if (handle) {
- int len = par_getCapability(handle, "syncagent", (void **) &data);
+ (void) par_getCapability(handle, "syncagent", (void **) &data);
db_closeDB(handle);
}
#endif
More information about the dslinux-commit
mailing list