*/
gdouble conversion[] = { 1, 3.6, 2.237, 3.281, 1.944 };
guint unit = 1;
-#define UNIT_COUNT 4
+#define UNIT_COUNT 5
// TODO: wrap this mess up somewhere
-// TODO: knot graphics are missing
-static GdkPixbuf* big_graphics[14];
-static GdkPixbuf* small_graphics[14];
+static GdkPixbuf* big_graphics[15];
+static GdkPixbuf* small_graphics[15];
static GtkWidget* digits[5];
static GtkWidget* unit_graphic;
* and store the pixbufs to the array. Pixbufs are
* correct size to be used in the big digits.
*/
- while(i < 14) {
+ while(i < 15) {
char* path = g_malloc(30);
g_sprintf(path, IMAGE_PATH, i);
g_print(path);
*/
speed *= conversion[unit];
+ /* we need to limit the speed down to
+ * less than 1000 whatever or else hell
+ * breaks loose in the form of assert
+ */
+ if(!(fabs(speed) < 1000)) {
+ g_print("Ahem, may I suggest to limit the speed (%f) a bit, Sir.\n", speed);
+ speed = 0;
+ }
+
/* Convert float to a 6 digits (including dot) wide
* string with leading zeros. After conversion
* the speed looks like:
"This program is licensed under GNU General Public License, "
"which means (among other things) that you don't have to pay "
"a dime for it. "
- "If you think, however, that this software is worth it, you "
- "can always drop me a postcard.\n\n"
- "Wellu Mäkinen\n"
- "Poste restante\n"
- "33580 Tampere\n"
- "FINLAND\n\n"
"PS. Long-tapping on the screen will quit the program.");
gtk_dialog_run(GTK_DIALOG(dialog));
gtk_widget_destroy(dialog);