2021-12-13 16:46:41 -08:00
|
|
|
/*
|
|
|
|
* @file value_lookup.h
|
|
|
|
*
|
|
|
|
* @date Dec 13, 2021
|
|
|
|
* @author Andrey Belomutskiy, (c) 2012-2021
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
2022-05-15 12:31:35 -07:00
|
|
|
|
|
|
|
struct plain_get_integer_s {
|
|
|
|
const char *token;
|
|
|
|
int *value;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct plain_get_short_s {
|
|
|
|
const char *token;
|
|
|
|
uint16_t *value;
|
|
|
|
};
|
|
|
|
|
2022-05-15 21:00:47 -07:00
|
|
|
struct plain_get_u8_s {
|
|
|
|
const char *token;
|
|
|
|
uint8_t *value;
|
|
|
|
};
|
|
|
|
|
2022-05-15 12:31:35 -07:00
|
|
|
struct plain_get_float_s {
|
|
|
|
const char *token;
|
|
|
|
float *value;
|
|
|
|
};
|
|
|
|
|
2022-11-27 07:11:14 -08:00
|
|
|
template<typename T, size_t TCount>
|
|
|
|
T* findPair(const char *name, T array[TCount], size_t count) {
|
|
|
|
for (size_t i = 0; i < TCount; i++) {
|
2022-05-15 21:00:47 -07:00
|
|
|
T *current = &array[i];
|
|
|
|
if (strEqualCaseInsensitive(name, current->token)) {
|
|
|
|
return current;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2021-12-13 16:46:41 -08:00
|
|
|
float getConfigValueByName(const char *name);
|
2021-12-14 15:25:55 -08:00
|
|
|
void setConfigValueByName(const char *name, float value);
|
2021-12-15 17:11:08 -08:00
|
|
|
float getOutputValueByName(const char *name);
|
2022-05-15 14:47:14 -07:00
|
|
|
|
|
|
|
void * hackEngineConfigurationPointer(void *ptr);
|