Skip to content

Commit

Permalink
UPBGE: Fix compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
youle31 committed Jan 24, 2025
1 parent 2ac3ca8 commit e08ca50
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 25 deletions.
2 changes: 1 addition & 1 deletion source/blender/editors/interface/interface_handlers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2347,7 +2347,7 @@ static void ui_but_smart_controller_add(bContext *C, uiBut *from, uiBut *to)
return;

/* in case the linked controller is not the active one */
PointerRNA object_ptr = RNA_pointer_create((ID *)ob, &RNA_Object, ob);
PointerRNA object_ptr = RNA_pointer_create_discrete((ID *)ob, &RNA_Object, ob);

WM_operator_properties_create(&props_ptr, "LOGIC_OT_controller_add");
RNA_string_set(&props_ptr, "object", ob->id.name + 2);
Expand Down
6 changes: 3 additions & 3 deletions source/blender/editors/space_logic/logic_ops.cc
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ static int sensor_add_exec(bContext *C, wmOperator *op)
BLI_addtail(&(ob->sensors), sens);

/* set the sensor name based on rna type enum */
PointerRNA sens_ptr = RNA_pointer_create((ID *)ob, &RNA_Sensor, sens);
PointerRNA sens_ptr = RNA_pointer_create_discrete((ID *)ob, &RNA_Sensor, sens);
prop = RNA_struct_find_property(&sens_ptr, "type");

RNA_string_get(op->ptr, "name", name);
Expand Down Expand Up @@ -444,7 +444,7 @@ static int controller_add_exec(bContext *C, wmOperator *op)
BLI_addtail(&(ob->controllers), cont);

/* set the controller name based on rna type enum */
PointerRNA cont_ptr = RNA_pointer_create((ID *)ob, &RNA_Controller, cont);
PointerRNA cont_ptr = RNA_pointer_create_discrete((ID *)ob, &RNA_Controller, cont);
prop = RNA_struct_find_property(&cont_ptr, "type");

RNA_string_get(op->ptr, "name", name);
Expand Down Expand Up @@ -577,7 +577,7 @@ static int actuator_add_exec(bContext *C, wmOperator *op)
BLI_addtail(&(ob->actuators), act);

/* set the actuator name based on rna type enum */
PointerRNA act_ptr = RNA_pointer_create((ID *)ob, &RNA_Actuator, act);
PointerRNA act_ptr = RNA_pointer_create_discrete((ID *)ob, &RNA_Actuator, act);
prop = RNA_struct_find_property(&act_ptr, "type");

RNA_string_get(op->ptr, "name", name);
Expand Down
41 changes: 21 additions & 20 deletions source/blender/editors/space_logic/logic_window.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1160,7 +1160,7 @@ static void draw_sensor_actuator(uiLayout *layout, PointerRNA *ptr)
{
Object *ob = (Object *)ptr->owner_id;

PointerRNA settings_ptr = RNA_pointer_create((ID *)ob, &RNA_GameObjectSettings, ob);
PointerRNA settings_ptr = RNA_pointer_create_discrete((ID *)ob, &RNA_GameObjectSettings, ob);
uiItemPointerR(layout,
ptr,
"actuator",
Expand All @@ -1186,7 +1186,7 @@ static void draw_sensor_armature(uiLayout *layout, PointerRNA *ptr)
PointerRNA pchan_ptr;
PropertyRNA *bones_prop;

PointerRNA pose_ptr = RNA_pointer_create((ID *)ob, &RNA_Pose, ob->pose);
PointerRNA pose_ptr = RNA_pointer_create_discrete((ID *)ob, &RNA_Pose, ob->pose);
bones_prop = RNA_struct_find_property(&pose_ptr, "bones");

uiItemPointerR(layout, ptr, "bone", &pose_ptr, "bones", std::nullopt, ICON_BONE_DATA);
Expand Down Expand Up @@ -1325,7 +1325,7 @@ static void draw_sensor_keyboard(uiLayout *layout, PointerRNA *ptr)
uiItemL(row, IFACE_("Second Modifier:"), ICON_NONE);
uiItemR(row, ptr, "modifier_key_2", UI_ITEM_R_EVENT, "", ICON_NONE);

PointerRNA settings_ptr = RNA_pointer_create((ID *)ob, &RNA_GameObjectSettings, ob);
PointerRNA settings_ptr = RNA_pointer_create_discrete((ID *)ob, &RNA_GameObjectSettings, ob);
uiItemPointerR(layout, ptr, "log", &settings_ptr, "properties", std::nullopt, ICON_NONE);
uiItemPointerR(layout, ptr, "target", &settings_ptr, "properties", std::nullopt, ICON_NONE);
}
Expand Down Expand Up @@ -1381,7 +1381,7 @@ static void draw_sensor_property(uiLayout *layout, PointerRNA *ptr)
uiLayout *row;
uiItemR(layout, ptr, "evaluation_type", UI_ITEM_NONE, std::nullopt, ICON_NONE);

PointerRNA settings_ptr = RNA_pointer_create((ID *)ob, &RNA_GameObjectSettings, ob);
PointerRNA settings_ptr = RNA_pointer_create_discrete((ID *)ob, &RNA_GameObjectSettings, ob);
uiItemPointerR(layout, ptr, "property", &settings_ptr, "properties", std::nullopt, ICON_NONE);

switch (RNA_enum_get(ptr, "evaluation_type")) {
Expand Down Expand Up @@ -1676,7 +1676,7 @@ static void draw_actuator_action(uiLayout *layout, PointerRNA *ptr)
Object *ob = (Object *)ptr->owner_id;
uiLayout *row, *sub;

PointerRNA settings_ptr = RNA_pointer_create((ID *)ob, &RNA_GameObjectSettings, ob);
PointerRNA settings_ptr = RNA_pointer_create_discrete((ID *)ob, &RNA_GameObjectSettings, ob);

row = uiLayoutRow(layout, false);
uiItemR(row, ptr, "play_mode", UI_ITEM_NONE, "", ICON_NONE);
Expand Down Expand Up @@ -1736,7 +1736,7 @@ static void draw_actuator_armature(uiLayout *layout, PointerRNA *ptr)
}

if (ob->pose) {
pose_ptr = RNA_pointer_create((ID *)ob, &RNA_Pose, ob->pose);
pose_ptr = RNA_pointer_create_discrete((ID *)ob, &RNA_Pose, ob->pose);
bones_prop = RNA_struct_find_property(&pose_ptr, "bones");
}

Expand Down Expand Up @@ -2024,7 +2024,7 @@ static void draw_actuator_message(uiLayout *layout, PointerRNA *ptr, bContext *C
PointerRNA main_ptr = RNA_main_pointer_create(CTX_data_main(C));

ob = (Object *)ptr->owner_id;
PointerRNA settings_ptr = RNA_pointer_create((ID *)ob, &RNA_GameObjectSettings, ob);
PointerRNA settings_ptr = RNA_pointer_create_discrete((ID *)ob, &RNA_GameObjectSettings, ob);

uiItemPointerR(layout, ptr, "to_property", &main_ptr, "objects", std::nullopt, ICON_OBJECT_DATA);
uiItemR(layout, ptr, "subject", UI_ITEM_NONE, std::nullopt, ICON_NONE);
Expand All @@ -2046,7 +2046,7 @@ static void draw_actuator_motion(uiLayout *layout, PointerRNA *ptr)
bool angular;

ob = (Object *)ptr->owner_id;
PointerRNA settings_ptr = RNA_pointer_create((ID *)ob, &RNA_GameObjectSettings, ob);
PointerRNA settings_ptr = RNA_pointer_create_discrete((ID *)ob, &RNA_GameObjectSettings, ob);
physics_type = RNA_enum_get(&settings_ptr, "physics_type");

angular = (RNA_enum_get(ptr, "servo_mode") == ACT_SERVO_ANGULAR);
Expand Down Expand Up @@ -2187,7 +2187,7 @@ static void draw_actuator_property(uiLayout *layout, PointerRNA *ptr)

uiLayout *row, *sub;

PointerRNA settings_ptr = RNA_pointer_create((ID *)ob, &RNA_GameObjectSettings, ob);
PointerRNA settings_ptr = RNA_pointer_create_discrete((ID *)ob, &RNA_GameObjectSettings, ob);

uiItemR(layout, ptr, "mode", UI_ITEM_NONE, std::nullopt, ICON_NONE);
uiItemPointerR(layout, ptr, "property", &settings_ptr, "properties", std::nullopt, ICON_NONE);
Expand All @@ -2206,7 +2206,8 @@ static void draw_actuator_property(uiLayout *layout, PointerRNA *ptr)
row = uiLayoutRow(layout, false);
uiItemR(row, ptr, "object", UI_ITEM_NONE, std::nullopt, ICON_NONE);
if (ob_from) {
PointerRNA obj_settings_ptr = RNA_pointer_create((ID *)ob_from, &RNA_GameObjectSettings, ob_from);
PointerRNA obj_settings_ptr = RNA_pointer_create_discrete(
(ID *)ob_from, &RNA_GameObjectSettings, ob_from);
uiItemPointerR(
row, ptr, "object_property", &obj_settings_ptr, "properties", std::nullopt, ICON_NONE);
}
Expand All @@ -2225,7 +2226,7 @@ static void draw_actuator_random(uiLayout *layout, PointerRNA *ptr)
uiLayout *row;

ob = (Object *)ptr->owner_id;
PointerRNA settings_ptr = RNA_pointer_create((ID *)ob, &RNA_GameObjectSettings, ob);
PointerRNA settings_ptr = RNA_pointer_create_discrete((ID *)ob, &RNA_GameObjectSettings, ob);

row = uiLayoutRow(layout, false);

Expand Down Expand Up @@ -2378,7 +2379,7 @@ static void draw_actuator_state(uiLayout *layout, PointerRNA *ptr)
{
uiLayout *split;
Object *ob = (Object *)ptr->owner_id;
PointerRNA settings_ptr = RNA_pointer_create((ID *)ob, &RNA_GameObjectSettings, ob);
PointerRNA settings_ptr = RNA_pointer_create_discrete((ID *)ob, &RNA_GameObjectSettings, ob);

split = uiLayoutSplit(layout, 0.35, false);
uiItemR(split, ptr, "operation", UI_ITEM_NONE, std::nullopt, ICON_NONE);
Expand Down Expand Up @@ -2593,7 +2594,7 @@ void logic_buttons(bContext *C, ARegion *region)
if (ob == nullptr)
return;

PointerRNA logic_ptr = RNA_pointer_create(nullptr, &RNA_SpaceLogicEditor, slogic);
PointerRNA logic_ptr = RNA_pointer_create_discrete(nullptr, &RNA_SpaceLogicEditor, slogic);
idar = get_selected_and_linked_obs(C, &count, slogic->scaflag);

BLI_snprintf(uiblockstr, sizeof(uiblockstr), "buttonswin %p", (void *)region);
Expand Down Expand Up @@ -2679,7 +2680,7 @@ void logic_buttons(bContext *C, ARegion *region)

/* Drawing the Controller Header common to all Selected Objects */

PointerRNA settings_ptr = RNA_pointer_create((ID *)ob, &RNA_GameObjectSettings, ob);
PointerRNA settings_ptr = RNA_pointer_create_discrete((ID *)ob, &RNA_GameObjectSettings, ob);

split = uiLayoutSplit(layout, 0.05f, false);
uiItemR(
Expand All @@ -2700,7 +2701,7 @@ void logic_buttons(bContext *C, ARegion *region)
31,
TIP_("Object name, click to show/hide controllers"));

PointerRNA object_ptr = RNA_pointer_create((ID *)ob, &RNA_Object, ob);
PointerRNA object_ptr = RNA_pointer_create_discrete((ID *)ob, &RNA_Object, ob);
uiLayoutSetContextPointer(row, "object", &object_ptr);
uiItemMenuEnumO(
row, C, "LOGIC_OT_controller_add", "type", IFACE_("Add Controller"), ICON_NONE);
Expand Down Expand Up @@ -2735,7 +2736,7 @@ void logic_buttons(bContext *C, ARegion *region)
uiItemS(layout);

for (cont = (bController *)ob->controllers.first; cont; cont = cont->next) {
PointerRNA ptr = RNA_pointer_create((ID *)ob, &RNA_Controller, cont);
PointerRNA ptr = RNA_pointer_create_discrete((ID *)ob, &RNA_Controller, cont);

if (!(ob->scaflag & OB_ALLSTATE) && !(ob->state & cont->state_mask))
continue;
Expand Down Expand Up @@ -2851,7 +2852,7 @@ void logic_buttons(bContext *C, ARegion *region)
31,
TIP_("Object name, click to show/hide sensors"));

PointerRNA object_ptr = RNA_pointer_create((ID *)ob, &RNA_Object, ob);
PointerRNA object_ptr = RNA_pointer_create_discrete((ID *)ob, &RNA_Object, ob);
uiLayoutSetContextPointer(row, "object", &object_ptr);
uiItemMenuEnumO(row, C, "LOGIC_OT_sensor_add", "type", IFACE_("Add Sensor"), ICON_NONE);

Expand All @@ -2861,7 +2862,7 @@ void logic_buttons(bContext *C, ARegion *region)
uiItemS(layout);

for (sens = (bSensor *)ob->sensors.first; sens; sens = sens->next) {
PointerRNA ptr = RNA_pointer_create((ID *)ob, &RNA_Sensor, sens);
PointerRNA ptr = RNA_pointer_create_discrete((ID *)ob, &RNA_Sensor, sens);

if ((ob->scaflag & OB_ALLSTATE) || !(slogic->scaflag & BUTS_SENS_STATE) ||
(sens->totlinks ==
Expand Down Expand Up @@ -2962,7 +2963,7 @@ void logic_buttons(bContext *C, ARegion *region)
31,
TIP_("Object name, click to show/hide actuators"));

PointerRNA object_ptr = RNA_pointer_create((ID *)ob, &RNA_Object, ob);
PointerRNA object_ptr = RNA_pointer_create_discrete((ID *)ob, &RNA_Object, ob);
uiLayoutSetContextPointer(row, "object", &object_ptr);
uiItemMenuEnumO(row, C, "LOGIC_OT_actuator_add", "type", IFACE_("Add Actuator"), ICON_NONE);

Expand All @@ -2973,7 +2974,7 @@ void logic_buttons(bContext *C, ARegion *region)

for (act = (bActuator *)ob->actuators.first; act; act = act->next) {

PointerRNA ptr = RNA_pointer_create((ID *)ob, &RNA_Actuator, act);
PointerRNA ptr = RNA_pointer_create_discrete((ID *)ob, &RNA_Actuator, act);

if ((ob->scaflag & OB_ALLSTATE) || !(slogic->scaflag & BUTS_ACT_STATE) ||
!(act->flag &
Expand Down
2 changes: 1 addition & 1 deletion source/gameengine/Converter/BL_ConvertActuators.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@ void BL_ConvertActuators(const char *maggiename,
bSteeringActuator *stAct = (bSteeringActuator *)bact->data;
KX_GameObject *navmeshob = nullptr;
if (stAct->navmesh) {
PointerRNA settings_ptr = RNA_pointer_create(
PointerRNA settings_ptr = RNA_pointer_create_discrete(
(ID *)stAct->navmesh, &RNA_GameObjectSettings, stAct->navmesh);
if (RNA_enum_get(&settings_ptr, "physics_type") == OB_BODY_TYPE_NAVMESH)
navmeshob = converter->FindGameObject(stAct->navmesh);
Expand Down

0 comments on commit e08ca50

Please sign in to comment.