From 7cbf81c83a95be907ff730f895e5eb36715511ce Mon Sep 17 00:00:00 2001 From: Jonas Kulla Date: Wed, 24 Dec 2014 06:23:28 +0100 Subject: [PATCH] Add 'printFPS' config entry to continuously print FPS to console Useful on platforms that don't have window decorations. --- mkxp.conf.sample | 8 ++++++++ src/config.cpp | 2 ++ src/config.h | 44 ++++++++++++++++++++++++++++++++++++++++++++ src/eventthread.cpp | 33 +++++++++++++++++++++------------ src/eventthread.h | 6 +++--- 5 files changed, 78 insertions(+), 15 deletions(-) diff --git a/mkxp.conf.sample b/mkxp.conf.sample index 2122fab..256b44c 100644 --- a/mkxp.conf.sample +++ b/mkxp.conf.sample @@ -17,6 +17,14 @@ # debugMode=false +# Continuously print average FPS to console. +# This setting does not affect the window title +# FPS display toggled via F2 +# (default: disabled) +# +# printFPS=false + + # Game window is resizable # (default: disabled) # diff --git a/src/config.cpp b/src/config.cpp index 8ff09cf..909204d 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -142,6 +142,7 @@ namespace po = boost::program_options; Config::Config() : rgssVersion(0), debugMode(false), + printFPS(false), winResizable(false), fullscreen(false), fixedAspectRatio(true), @@ -169,6 +170,7 @@ void Config::read(int argc, char *argv[]) #define PO_DESC_ALL \ PO_DESC(rgssVersion, int) \ PO_DESC(debugMode, bool) \ + PO_DESC(printFPS, bool) \ PO_DESC(winResizable, bool) \ PO_DESC(fullscreen, bool) \ PO_DESC(fixedAspectRatio, bool) \ diff --git a/src/config.h b/src/config.h index e7eb357..9563bb1 100644 --- a/src/config.h +++ b/src/config.h @@ -25,11 +25,55 @@ #include #include +struct TouchOverlay +{ + std::string image; + + struct Button + { + enum Shape + { + Rectangle, + Circle, + Triangle + }; + + std::string id; + std::string target; + Shape shape; + + int x; + int y; + + union + { + struct + { + int width; + int height; + } r; + + struct + { + int radius; + } c; + struct + { + int x1, y1; + int x2, y2; + } t; + } u; + }; + + std::vector