evaluate settings in raw mode, always

This commit is contained in:
Ryan Fleury
2025-05-07 10:50:27 -07:00
parent db2c8607fb
commit 1cc5561f1f
2 changed files with 34 additions and 7 deletions
+27
View File
@@ -1823,6 +1823,33 @@ fancy_viz_eval_tests(void)
raddbg_pin(text(code_string, lang=c));
raddbg_pin(disasm(fancy_viz_eval_tests));
//- rjf: table index lookups
struct
{
char *name;
int x;
int y;
int z;
}
nodes[] =
{
{"---", 1, 7, 3},
{"---", 5, 4, 2},
{"second", 12, 41, 22},
{"---", 8, 9, 1},
{"---", 1, 1, 1},
{"first", 50, 50, 50},
{"fourth", 7, 7, 7},
{"---", 7, 12, 1},
{"third", 27, 43, 41},
{"---", 2, 17, 50},
};
int node_indices[] =
{
5, 2, 8, 6
};
raddbg_pin(table(node_indices, nodes[$]));
//- rjf: bitmaps
unsigned int background_color = 0x00000000;
unsigned int main_color = 0xff2424ff;
+7 -7
View File
@@ -1386,7 +1386,7 @@ rd_setting_b32_from_name(String8 name)
if(value.size != 0)
{
Temp scratch = scratch_begin(0, 0);
String8 expr = push_str8f(scratch.arena, "(bool)(%S)", value);
String8 expr = push_str8f(scratch.arena, "raw((bool)(%S))", value);
E_Eval eval = e_eval_from_string(expr);
result = !!e_value_eval_from_eval(eval).value.u64;
scratch_end(scratch);
@@ -1402,7 +1402,7 @@ rd_setting_u64_from_name(String8 name)
if(value.size != 0)
{
Temp scratch = scratch_begin(0, 0);
String8 expr = push_str8f(scratch.arena, "(uint64)(%S)", value);
String8 expr = push_str8f(scratch.arena, "raw((uint64)(%S))", value);
E_Eval eval = e_eval_from_string(expr);
result = e_value_eval_from_eval(eval).value.u64;
scratch_end(scratch);
@@ -1418,7 +1418,7 @@ rd_setting_f32_from_name(String8 name)
if(value.size != 0)
{
Temp scratch = scratch_begin(0, 0);
String8 expr = push_str8f(scratch.arena, "(float32)(%S)", value);
String8 expr = push_str8f(scratch.arena, "raw((float32)(%S))", value);
E_Eval eval = e_eval_from_string(expr);
result = e_value_eval_from_eval(eval).value.f32;
scratch_end(scratch);
@@ -5515,7 +5515,7 @@ internal B32
rd_view_setting_b32_from_name(String8 name)
{
String8 string = rd_view_setting_from_name(name);
B32 result = !!e_value_from_stringf("(bool)(%S)", string).u64;
B32 result = !!e_value_from_stringf("raw((bool)(%S))", string).u64;
return result;
}
@@ -5523,7 +5523,7 @@ internal U64
rd_view_setting_u64_from_name(String8 name)
{
String8 string = rd_view_setting_from_name(name);
U64 result = e_value_from_stringf("(uint64)(%S)", string).u64;
U64 result = e_value_from_stringf("raw((uint64)(%S))", string).u64;
return result;
}
@@ -5531,7 +5531,7 @@ internal F32
rd_view_setting_f32_from_name(String8 name)
{
String8 string = rd_view_setting_from_name(name);
F32 result = e_value_from_stringf("(float32)(%S)", string).f32;
F32 result = e_value_from_stringf("raw((float32)(%S))", string).f32;
return result;
}
@@ -5974,7 +5974,7 @@ rd_window_frame(void)
MD_Node *value_child = md_child_from_string(n, str8_lit("value"), 0);
U8 split_char = ' ';
String8List tags = str8_split(scratch.arena, tags_child->first->string, &split_char, 1, 0);
U32 color_u32 = e_value_from_string(value_child->first->string).u32;
U32 color_u32 = e_value_from_stringf("raw(%S)", value_child->first->string).u32;
Vec4F32 color_linear = linear_from_srgba(rgba_from_u32(color_u32));
ThemePatternNode *node = push_array(scratch.arena, ThemePatternNode, 1);
node->pattern.tags = str8_array_from_list(rd_frame_arena(), &tags);