mirror of
https://github.com/whoahq/whoa.git
synced 2026-08-05 00:14:31 +03:00
Compare commits
3 Commits
62e2f9c31c
...
145a658c50
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
145a658c50 | ||
|
|
0163d91543 | ||
|
|
dd3a0f6a81 |
@ -112,12 +112,12 @@ bool StringToBOOL(lua_State* L, int32_t idx, int32_t def) {
|
||||
}
|
||||
|
||||
int32_t StringToDrawLayer(const char* string, int32_t& layer) {
|
||||
struct drawlayer {
|
||||
struct LayerEntry {
|
||||
int32_t layer;
|
||||
const char* string;
|
||||
};
|
||||
|
||||
static drawlayer array_drawlayer[5] = {
|
||||
static LayerEntry layerMap[] = {
|
||||
{ 0, "BACKGROUND" },
|
||||
{ 1, "BORDER" },
|
||||
{ 2, "ARTWORK" },
|
||||
@ -125,9 +125,9 @@ int32_t StringToDrawLayer(const char* string, int32_t& layer) {
|
||||
{ 4, "HIGHLIGHT" }
|
||||
};
|
||||
|
||||
for (int32_t i = 0; i < 5; i++) {
|
||||
if (!SStrCmpI(array_drawlayer[i].string, string, 0x7FFFFFFFu)) {
|
||||
layer = array_drawlayer[i].layer;
|
||||
for (const auto& entry : layerMap) {
|
||||
if (!SStrCmpI(entry.string, string)) {
|
||||
layer = entry.layer;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@ -141,7 +141,7 @@ int32_t StringToJustify(const char* string, uint32_t& justify) {
|
||||
const char* string;
|
||||
};
|
||||
|
||||
static JustifyEntry justifyMap[6] = {
|
||||
static JustifyEntry justifyMap[] = {
|
||||
{ 0x1, "LEFT" },
|
||||
{ 0x2, "CENTER" },
|
||||
{ 0x4, "RIGHT" },
|
||||
@ -150,9 +150,9 @@ int32_t StringToJustify(const char* string, uint32_t& justify) {
|
||||
{ 0x20, "BOTTOM" }
|
||||
};
|
||||
|
||||
for (int32_t i = 0; i < 5; i++) {
|
||||
if (!SStrCmpI(justifyMap[i].string, string, 0x7FFFFFFFu)) {
|
||||
justify = justifyMap[i].value;
|
||||
for (const auto& entry : justifyMap) {
|
||||
if (!SStrCmpI(entry.string, string)) {
|
||||
justify = entry.value;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user