bugs and perfomance cleanup.
This commit is contained in:
@@ -65,6 +65,7 @@ static mrb_value params_set(mrb_state *mrb, mrb_value self) {
|
||||
app::EText *element = (app::EText *)app::element_pool[id];
|
||||
|
||||
element->params[mrb_sym2name(mrb, key)] = mrb_str_to_cstr(mrb, mrb_obj_as_string(mrb, value));
|
||||
element->reload_text();
|
||||
|
||||
return mrb_nil_value();
|
||||
}
|
||||
@@ -509,7 +510,7 @@ static mrb_value element_text_inspect(mrb_state *mrb, mrb_value self) {
|
||||
static mrb_value element_text_to_s(mrb_state *mrb, mrb_value self) {
|
||||
uint64_t id = get_id_ElementText(mrb, self);
|
||||
app::EText *element = (app::EText *)app::element_pool[id];
|
||||
std::string localized_text = Localization::get(Ruby::mrb, element->key, element->params);
|
||||
std::string localized_text = Localization::get(element->key, element->params);
|
||||
return mrb_str_new_cstr(mrb, localized_text.c_str());
|
||||
}
|
||||
|
||||
@@ -1173,6 +1174,7 @@ static mrb_value ElementImage_init(mrb_state *mrb, mrb_value self) {
|
||||
}
|
||||
|
||||
uint64_t id = get_id_Animation(mrb, animation_val);
|
||||
animation_pool.use(id);
|
||||
|
||||
app::EImage *element = new app::EImage(id);
|
||||
element->position = {x, y};
|
||||
@@ -1572,7 +1574,7 @@ static mrb_value scene_elements_at(mrb_state *mrb, mrb_value self) {
|
||||
mrb_value position_val;
|
||||
mrb_get_args(mrb, "o", &position_val);
|
||||
|
||||
float x, y;
|
||||
float x = 0, y = 0;
|
||||
HASH_FLOAT(position_val, x, x);
|
||||
HASH_FLOAT(position_val, y, y);
|
||||
Vec2<float> position = {x, y};
|
||||
|
||||
Reference in New Issue
Block a user