mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-11-30 19:16:41 -08:00
overlay: categorize lights for different cab types (#576)
## Link to GitHub Issue or related Pull Request, if one exists #574 ## Description of change Refactor so that grouping of lights are in common I/O code. Add this to IIDX/SDVX/DDR/GitaDora. ## Testing
This commit is contained in:
1 parent
88679b7cb2
commit
a9f0e86aa3
8 files changed
+457
-468
No files matched your search
+11
-9
@@ -109,21 +109,13 @@ namespace GameAPI {
|
||||
}
|
||||
|
||||
namespace Lights {
|
||||
|
||||
std::vector<Light> getLights(const std::string &game_name);
|
||||
|
||||
std::vector<Light> sortLights(
|
||||
const std::vector<Light> &lights,
|
||||
const std::vector<std::string> &light_names);
|
||||
|
||||
template<typename T>
|
||||
void sortLights(std::vector<Light> *lights, T t) {
|
||||
const std::vector<std::string> light_names { t };
|
||||
|
||||
if (lights) {
|
||||
*lights = GameAPI::Lights::sortLights(*lights, light_names);
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, typename... Rest>
|
||||
void sortLights(std::vector<Light> *lights, T t, Rest... rest) {
|
||||
const std::vector<std::string> light_names { t, rest... };
|
||||
@@ -133,6 +125,16 @@ namespace GameAPI {
|
||||
}
|
||||
}
|
||||
|
||||
struct LightAndCategory {
|
||||
const std::string category_name;
|
||||
const std::string light_name;
|
||||
|
||||
LightAndCategory(std::string category_name, std::string light_name) :
|
||||
category_name(std::move(category_name)), light_name(std::move(light_name)) {}
|
||||
};
|
||||
|
||||
void sortLightsWithCategory(std::vector<Light> *lights, const std::initializer_list<LightAndCategory> list);
|
||||
|
||||
void writeLight(rawinput::Device *device, int index, float value);
|
||||
void writeLight(rawinput::RawInputManager *manager, Light &light, float value);
|
||||
void writeLight(std::unique_ptr<rawinput::RawInputManager> &manager, Light &light, float value);
|
||||
|
||||
Reference in new issue
Block a user