+ case MNID_ASPECTRATIO:
+ { // FIXME: Really crude and ugly here, move to video or so
+ int aspect_width;
+ int aspect_height;
+
+ if(sscanf(item->list[item->selected].c_str(), "%d:%d", &aspect_width, &aspect_height) == 2)
+ {
+ config->aspect_ratio = static_cast<double>(aspect_width) /
+ static_cast<double>(aspect_height);
+
+ if (config->aspect_ratio > 1) {
+ SCREEN_WIDTH = static_cast<int> (600 * config->aspect_ratio + 0.5);
+ SCREEN_HEIGHT = 600;
+ } else {
+ SCREEN_WIDTH = 600;
+ SCREEN_HEIGHT = static_cast<int> (600 * 1/config->aspect_ratio + 0.5);
+ }
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, -1.0, 1.0);
+ std::cout << __FILE__ << ":" << __LINE__ << ": change aspect ratio to " << item->list[item->selected] << std::endl;
+ }
+ }
+ break;
+