From e8f7db11f3372edd8cca383d8b74e77cdbfba49a Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 24 Oct 2005 06:32:30 +0000 Subject: [PATCH] optimize InputFilter::Update (.5ms -> .05ms on k7/1000) --- stepmania/src/InputFilter.cpp | 144 +++++++++++++++++++--------------- 1 file changed, 80 insertions(+), 64 deletions(-) diff --git a/stepmania/src/InputFilter.cpp b/stepmania/src/InputFilter.cpp index 7d3d631dac..b1fb7cd482 100644 --- a/stepmania/src/InputFilter.cpp +++ b/stepmania/src/InputFilter.cpp @@ -5,7 +5,23 @@ #include "RageUtil.h" #include "RageThreads.h" #include "Preference.h" +#include "Foreach.h" +#include +namespace +{ + /* Maintain a set of all interesting buttons: buttons which are being held + * down, or which were held down and need a RELEASE event. We use this to + * optimize InputFilter::Update, so we don't have to process every button + * we know about when most of them aren't in use. This set is protected + * by queuemutex. */ + typedef pair Button; + set