diff -r 2ab24976acaa -r 291a1fe2d278 misc.cpp --- a/misc.cpp Sun Apr 28 04:04:36 2013 +0300 +++ b/misc.cpp Fri May 03 03:55:21 2013 +0300 @@ -21,6 +21,7 @@ #include #include "common.h" #include "misc.h" +#include "gui.h" // Prime number table. const ushort g_uaPrimes[NUM_PRIMES] = { @@ -81,30 +82,29 @@ // ============================================================================= // Grid stuff cfg (int, grid, Grid::Medium); +EXTERN_ACTION (gridCoarse) +EXTERN_ACTION (gridMedium) +EXTERN_ACTION (gridFine) -cfg (float, grid_coarse_x, 5.0f); -cfg (float, grid_coarse_y, 5.0f); -cfg (float, grid_coarse_z, 5.0f); +cfg (float, grid_coarse_x, 5.0f); +cfg (float, grid_coarse_y, 5.0f); +cfg (float, grid_coarse_z, 5.0f); cfg (float, grid_coarse_angle, 45.0f); -cfg (float, grid_medium_x, 1.0f); -cfg (float, grid_medium_y, 1.0f); -cfg (float, grid_medium_z, 1.0f); +cfg (float, grid_medium_x, 1.0f); +cfg (float, grid_medium_y, 1.0f); +cfg (float, grid_medium_z, 1.0f); cfg (float, grid_medium_angle, 22.5f); -cfg (float, grid_fine_x, 0.1f); -cfg (float, grid_fine_y, 0.1f); -cfg (float, grid_fine_z, 0.1f); -cfg (float, grid_fine_angle, 7.5f); +cfg (float, grid_fine_x, 0.1f); +cfg (float, grid_fine_y, 0.1f); +cfg (float, grid_fine_z, 0.1f); +cfg (float, grid_fine_angle, 7.5f); const gridinfo g_GridInfo[3] = { - { "Coarse", { &grid_coarse_x, &grid_coarse_y, &grid_coarse_z, &grid_coarse_angle } }, - { "Medium", { &grid_medium_x, &grid_medium_y, &grid_medium_z, &grid_medium_angle } }, - { "Fine", { &grid_fine_x, &grid_fine_y, &grid_fine_z, &grid_fine_angle } } + { "Coarse", { &grid_coarse_x, &grid_coarse_y, &grid_coarse_z, &grid_coarse_angle }, &ACTION (gridCoarse) }, + { "Medium", { &grid_medium_x, &grid_medium_y, &grid_medium_z, &grid_medium_angle }, &ACTION (gridMedium) }, + { "Fine", { &grid_fine_x, &grid_fine_y, &grid_fine_z, &grid_fine_angle }, &ACTION (gridFine) } }; -template inline T abs (T a) { - return (a >= 0) ? a : -a; -} - // ============================================================================= double Grid::snap (double in, const Grid::Config axis) { const double gridval = currentGrid ().confs[axis]->value;