Skip to content

Commit

Permalink
UPBGE: Fix compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
youle31 committed Jul 26, 2023
1 parent fe23c9c commit c881d1a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions source/gameengine/Converter/BL_DataConversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,8 +425,8 @@ RAS_MeshObject *BL_ConvertMesh(Mesh *mesh,
CustomData_get_layer_named(&final_me->edge_data, CD_PROP_BOOL, "sharp_edge"));
const bool *sharp_faces = static_cast<const bool *>(
CustomData_get_layer_named(&final_me->face_data, CD_PROP_BOOL, "sharp_face"));
short2 *clnors = static_cast<short2 *>(CustomData_get_layer_for_write(
&final_me->loop_data, CD_CUSTOMLOOPNORMAL, final_me->totloop));
const blender::short2 *clnors = static_cast<const blender::short2 *>(
CustomData_get_layer(&final_me->loop_data, CD_CUSTOMLOOPNORMAL));

bke::mesh::normals_calc_loop(final_me->vert_positions(),
final_me->edges(),
Expand All @@ -438,9 +438,9 @@ RAS_MeshObject *BL_ConvertMesh(Mesh *mesh,
final_me->face_normals(),
sharp_edges,
sharp_faces,
clnors,
use_split_nors,
split_angle,
clnors,
nullptr,
{loop_nors_dst, final_me->corner_verts().size()});
}
Expand Down
4 changes: 2 additions & 2 deletions source/gameengine/Ketsji/KX_NavMeshObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ static int buildRawVertIndicesData(Mesh *me,
return 0;
}

verts = (float *)MEM_mallocN(sizeof(float[3]) * nverts, "buildRawVertIndicesData verts");
BKE_mesh_vert_coords_get(me, (float (*)[3])verts);
float(*v)[3] = BKE_mesh_vert_coords_alloc(me, nullptr);
verts = (float *)v;

/* flip coordinates */
for (vi = 0; vi < nverts; vi++) {
Expand Down
3 changes: 2 additions & 1 deletion source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,8 @@ void CcdPhysicsController::UpdateSoftBody()
index_mp_to_orig = nullptr;
}

float(*positions)[3] = BKE_mesh_vert_positions_for_write(me);
float(*positions)[3] = reinterpret_cast<float(*)[3]>(
me->vert_positions_for_write().data());
const MFace *faces = (MFace *)CustomData_get_layer(&me->fdata_legacy, CD_MFACE);
int numpolys = me->totface_legacy;

Expand Down

0 comments on commit c881d1a

Please sign in to comment.