+ if (!showWindow)
+ return;
+
+ if (!entered && ((x >= DS_XPOS) && (x <= (DS_XPOS + DS_WIDTH))
+ && (y >= DS_YPOS) && (y <= (DS_YPOS + DS_HEIGHT))))
+ entered = true;
+
+ if (entered && ((x < DS_XPOS) || (x > (DS_XPOS + DS_WIDTH))
+ || (y < DS_YPOS) || (y > (DS_YPOS + DS_HEIGHT))))
+ {
+ showWindow = false;
+ return;
+ }
+
+// prevDiskSelected = diskSelected;
+ int xChar = (x - DS_XPOS) / FONT_WIDTH;
+ int yChar = (y - DS_YPOS) / FONT_HEIGHT;
+// int currentX = (count / 27) * 22;
+// int currentY = (count % 27);
+ diskSelected = ((xChar / 22) * 27) + yChar;
+
+ if ((yChar >= 27) || (diskSelected >= (int)imageList.size()))
+ diskSelected = -1;
+
+ if (diskSelected != lastDiskSelected)
+ {
+ HandleSelection(sdlRenderer);
+ lastDiskSelected = diskSelected;
+ }
+}
+
+
+void DiskSelector::HandleSelection(SDL_Renderer * renderer)
+{
+// if (diskSelected == prevDiskSelected)
+// return;
+
+ SDL_UpdateTexture(window, NULL, windowPixels, 128 * sizeof(Uint32));
+ DrawFilenames(renderer);