mirror of
https://github.com/nunuhara/xsystem4.git
synced 2026-09-22 23:18:01 +03:00
Merge pull request #296 from kichikuou/alignment-fix
Use xcalloc_aligned for allocating structures containing mat4
This commit is contained in:
+1
-1
@@ -518,7 +518,7 @@ struct model *model_load(struct archive *aar, const char *path)
|
||||
model->bone_map = ht_create(pol->nr_bones * 3 / 2);
|
||||
model->bone_name_map = ht_create(pol->nr_bones * 3 / 2);
|
||||
model->mot_cache = ht_create(16);
|
||||
model->bones = xcalloc(pol->nr_bones, sizeof(struct bone));
|
||||
model->bones = xcalloc_aligned(pol->nr_bones, struct bone);
|
||||
for (uint32_t i = 0; i < pol->nr_bones; i++) {
|
||||
add_bone(model, pol, &pol->bones[i]);
|
||||
}
|
||||
|
||||
+2
-2
@@ -38,7 +38,7 @@ enum RE_plugin_version re_plugin_version;
|
||||
|
||||
static struct RE_instance *create_instance(struct RE_plugin *plugin)
|
||||
{
|
||||
struct RE_instance *instance = xcalloc(1, sizeof(struct RE_instance));
|
||||
struct RE_instance *instance = xcalloc_aligned(1, struct RE_instance);
|
||||
instance->plugin = plugin;
|
||||
for (int i = 0; i < RE_NR_INSTANCE_TARGETS; i++)
|
||||
instance->target[i] = -1;
|
||||
@@ -229,7 +229,7 @@ struct RE_plugin *RE_plugin_new(enum RE_plugin_version version)
|
||||
if (!aar)
|
||||
return NULL;
|
||||
|
||||
struct RE_plugin *plugin = xcalloc(1, sizeof(struct RE_plugin));
|
||||
struct RE_plugin *plugin = xcalloc_aligned(1, struct RE_plugin);
|
||||
plugin->plugin.name = "ReignEngine";
|
||||
plugin->plugin.update = RE_render;
|
||||
plugin->plugin.to_json = RE_to_json;
|
||||
|
||||
@@ -60,7 +60,7 @@ struct dungeon_context *dungeon_get_context(int surface)
|
||||
|
||||
struct dungeon_context *dungeon_context_create(enum draw_dungeon_version version, int width, int height)
|
||||
{
|
||||
struct dungeon_context *ctx = xcalloc(1, sizeof(struct dungeon_context));
|
||||
struct dungeon_context *ctx = xcalloc_aligned(1, struct dungeon_context);
|
||||
ctx->plugin.name = plugin_name;
|
||||
ctx->plugin.free = dungeon_context_free;
|
||||
ctx->plugin.update = dungeon_render;
|
||||
|
||||
+1
-1
@@ -153,7 +153,7 @@ static struct parts_flash_object *update_object(struct parts_flash_object *obj,
|
||||
{
|
||||
if (!obj) {
|
||||
if (tag->flags & PLACE_FLAG_HAS_CHARACTER) {
|
||||
obj = xcalloc(1, sizeof(struct parts_flash_object));
|
||||
obj = xcalloc_aligned(1, struct parts_flash_object);
|
||||
obj->depth = tag->depth;
|
||||
} else {
|
||||
ERROR("no object to update (depth=%d)", tag->depth);
|
||||
|
||||
@@ -419,7 +419,6 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
sys_error_handler = error_handler;
|
||||
|
||||
initialize_instructions();
|
||||
char *ainfile;
|
||||
int err = AIN_SUCCESS;
|
||||
bool audit = false;
|
||||
|
||||
+1
-1
Submodule subprojects/libsys4 updated: 4da6bf68d4...920dd0185a
Reference in New Issue
Block a user