diff --git a/include/plugin.h b/include/plugin.h index ecb99a5..52b4753 100644 --- a/include/plugin.h +++ b/include/plugin.h @@ -17,9 +17,11 @@ #ifndef SYSTEM4_PLUGIN_H #define SYSTEM4_PLUGIN_H +struct sact_sprite; + struct draw_plugin { const char *name; - void (*update)(struct draw_plugin *); + void (*update)(struct sact_sprite *); }; #endif /* SYSTEM4_PLUGIN_H */ diff --git a/include/reign.h b/include/reign.h new file mode 100644 index 0000000..44e7cbf --- /dev/null +++ b/include/reign.h @@ -0,0 +1,97 @@ +/* Copyright (C) 2022 kichikuou + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ + +#ifndef SYSTEM4_REIGN_H +#define SYSTEM4_REIGN_H + +#define RE_MAX_INSTANCES 32 + +#include + +#include "plugin.h" + +struct RE_options { + int anti_aliasing; + int wait_vsync; +}; +extern struct RE_options RE_options; + +struct RE_camera { + vec3 pos; + float pitch, roll, yaw; // in degrees +}; + +struct RE_plugin { + struct draw_plugin plugin; + int sprite; + struct RE_instance *instances[RE_MAX_INSTANCES]; + struct archive *aar; + struct RE_renderer *renderer; + struct RE_camera camera; + mat4 proj_transform; + + // Settings. + int render_mode; + int shadow_mode; + int bump_mode; + int bloom_mode; + int glare_mode; + int fog_mode; + int specular_mode; + int light_map_mode; + int soft_fog_edge_mode; + int ssao_mode; + int vertex_blend_mode; + int shader_precision_mode; + int texture_filter_mode; + bool use_power2_texture; + int shadow_map_resolution_level; + int texture_resolution_level; + float global_ambient_r; + float global_ambient_g; + float global_ambient_b; + float post_effect_filter_y; + float post_effect_filter_cb; + float post_effect_filter_cr; +}; + +struct RE_instance { + struct RE_plugin *plugin; + struct model *model; + int type; + vec3 pos; + float pitch, roll, yaw; // in degrees + vec3 vec; + vec3 scale; + bool draw; + bool local_transform_needs_update; + mat4 local_transform; +}; + +struct RE_plugin *RE_plugin_new(void); +void RE_plugin_free(struct RE_plugin *plugin); +bool RE_plugin_bind(struct RE_plugin *plugin, int sprite); +bool RE_plugin_unbind(struct RE_plugin *plugin); +bool RE_set_projection(struct RE_plugin *plugin, float width, float height, float near, float far, float deg); +int RE_create_instance(struct RE_plugin *plugin); +bool RE_release_instance(struct RE_plugin *plugin, int instance); + +bool RE_instance_load(struct RE_instance *instance, const char *name); + +void RE_render(struct sact_sprite *sp); +void RE_debug_print(struct RE_plugin *p); + +#endif /* SYSTEM4_REIGN_H */ diff --git a/shaders/reign.f.glsl b/shaders/reign.f.glsl new file mode 100644 index 0000000..13ddee9 --- /dev/null +++ b/shaders/reign.f.glsl @@ -0,0 +1,25 @@ +/* Copyright (C) 2022 kichikuou + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ + +uniform sampler2D tex; + +in vec2 tex_coord; +out vec4 frag_color; + +void main() { + // TODO: Implement lighting. + frag_color = texture(tex, tex_coord); +} diff --git a/shaders/reign.v.glsl b/shaders/reign.v.glsl new file mode 100644 index 0000000..935c4f8 --- /dev/null +++ b/shaders/reign.v.glsl @@ -0,0 +1,29 @@ +/* Copyright (C) 2022 kichikuou + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ + +uniform mat4 local_transform; +uniform mat4 view_transform; +uniform mat4 proj_transform; + +in vec3 vertex_pos; +in vec3 vertex_normal; +in vec2 vertex_uv; +out vec2 tex_coord; + +void main() { + gl_Position = proj_transform * view_transform * local_transform * vec4(vertex_pos, 1.0); + tex_coord = vertex_uv; +} diff --git a/src/3d/3d_internal.h b/src/3d/3d_internal.h new file mode 100644 index 0000000..3b19b5d --- /dev/null +++ b/src/3d/3d_internal.h @@ -0,0 +1,138 @@ +/* Copyright (C) 2022 kichikuou + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ + +#ifndef SYSTEM4_3D_3D_INTERNAL_H +#define SYSTEM4_3D_3D_INTERNAL_H + +#include + +#include "system4/archive.h" + +#include "gfx/gl.h" +#include "gfx/gfx.h" + +struct model { + char *name; + int nr_meshes; + struct mesh *meshes; + int nr_materials; + struct material *materials; +}; + +struct mesh { + GLuint vao; + GLuint attr_buffer; + int nr_vertices; + int material; +}; + +struct material { + GLuint color_map; + bool opaque; +}; + +struct RE_renderer { + struct shader shader; + GLuint depth_buffer; + + // Uniform variable locations + GLint local_transform; + GLint proj_transform; + + // Attribute variable locations + GLint vertex_normal; + GLint vertex_uv; +}; + +// model.c + +struct model *model_load(struct archive *aar, const char *path, struct RE_renderer *renderer); +void model_free(struct model *model); + +// renderer.c + +struct RE_renderer *RE_renderer_new(struct texture *texture); +void RE_renderer_free(struct RE_renderer *r); + +// parser.c + +struct pol { + int32_t version; + uint32_t nr_materials; + struct pol_material_group *materials; + uint32_t nr_meshes; + struct pol_mesh **meshes; + uint32_t nr_bones; + struct pol_bone *bones; +}; + +enum pol_texture_type { + COLOR_MAP = 1, + MAX_TEXTURE_TYPE +}; + +struct pol_material { + char *name; + char *textures[MAX_TEXTURE_TYPE]; +}; + +struct pol_material_group { + struct pol_material m; + uint32_t nr_children; + struct pol_material *children; +}; + +struct pol_mesh { + char *name; + uint32_t material; + uint32_t nr_vertices; + struct pol_vertex *vertices; + uint32_t nr_uvs; + vec2 *uvs; + uint32_t nr_triangles; + struct pol_triangle *triangles; +}; + +struct pol_vertex { + vec3 pos; + uint32_t nr_weights; + struct pol_bone_weight *weights; +}; + +struct pol_bone_weight { + uint32_t bone; + float weight; +}; + +struct pol_triangle { + uint32_t vert_index[3]; + uint32_t uv_index[3]; + vec3 normals[3]; + uint32_t material; // index in the material group +}; + +struct pol_bone { + char *name; + uint32_t id; + int32_t parent; + vec3 pos; + versor rotq; +}; + +struct pol *pol_parse(uint8_t *data, size_t size); +void pol_free(struct pol *pol); + +#endif /* SYSTEM4_3D_3D_INTERNAL_H */ diff --git a/src/3d/model.c b/src/3d/model.c new file mode 100644 index 0000000..9706eca --- /dev/null +++ b/src/3d/model.c @@ -0,0 +1,209 @@ +/* Copyright (C) 2022 kichikuou + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ + +#include +#include +#include + +#include "system4.h" +#include "system4/aar.h" +#include "system4/cg.h" + +#include "3d_internal.h" +#include "reign.h" + +struct vertex { + GLfloat pos[3]; + GLfloat normal[3]; + GLfloat uv[2]; +}; + +static bool init_material(struct material *material, const struct pol_material *m, struct archive *aar, const char *path) +{ + if (!m->textures[COLOR_MAP]) { + WARNING("No color texture"); + return false; + } + char *texture_path = xmalloc(strlen(path) + strlen(m->textures[COLOR_MAP]) + 2); + sprintf(texture_path, "%s\\%s", path, m->textures[COLOR_MAP]); + struct archive_data *dfile = archive_get_by_name(aar, texture_path); + if (!dfile) { + WARNING("cannot load texture %s", texture_path); + free(texture_path); + return false; + } + struct cg *cg = cg_load_data(dfile); + archive_free_data(dfile); + if (!cg) { + WARNING("cg_load_data failed: %s", texture_path); + free(texture_path); + return false; + } + free(texture_path); + + glGenTextures(1, &material->color_map); + glBindTexture(GL_TEXTURE_2D, material->color_map); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, cg->metrics.w, cg->metrics.h, 0, GL_RGBA, GL_UNSIGNED_BYTE, cg->pixels); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); + glGenerateMipmap(GL_TEXTURE_2D); + glBindTexture(GL_TEXTURE_2D, 0); + material->opaque = !cg->metrics.has_alpha; + + cg_free(cg); + return true; +} + +static void destroy_material(struct material *material) +{ + if (material->color_map) + glDeleteTextures(1, &material->color_map); +} + +static void add_mesh(struct model *model, struct pol_mesh *m, int material_index, int material, struct RE_renderer *r) +{ + struct vertex *buf = xmalloc(m->nr_triangles * 3 * sizeof(struct vertex)); + int v = 0; + for (uint32_t i = 0; i < m->nr_triangles; i++) { + struct pol_triangle *t = &m->triangles[i]; + if (material_index >= 0 && t->material != (uint32_t)material_index) + continue; + for (int j = 0; j < 3; j++) { + glm_vec3_copy(m->vertices[t->vert_index[j]].pos, buf[v].pos); + glm_vec3_copy(t->normals[j], buf[v].normal); + glm_vec2_copy(m->uvs[t->uv_index[j]], buf[v].uv); + v++; + } + } + if (v == 0) { + free(buf); + return; + } + model->meshes = xrealloc_array(model->meshes, model->nr_meshes, model->nr_meshes + 1, sizeof(struct mesh)); + struct mesh *mesh = &model->meshes[model->nr_meshes++]; + mesh->material = material; + mesh->nr_vertices = v; + + glGenVertexArrays(1, &mesh->vao); + glBindVertexArray(mesh->vao); + glGenBuffers(1, &mesh->attr_buffer); + glBindBuffer(GL_ARRAY_BUFFER, mesh->attr_buffer); + + glEnableVertexAttribArray(r->shader.vertex); + glVertexAttribPointer(r->shader.vertex, 3, GL_FLOAT, GL_FALSE, sizeof(struct vertex), (const void *)0); + glEnableVertexAttribArray(r->vertex_normal); + glVertexAttribPointer(r->vertex_normal, 3, GL_FLOAT, GL_TRUE, sizeof(struct vertex), (const void *)offsetof(struct vertex, normal)); + glEnableVertexAttribArray(r->vertex_uv); + glVertexAttribPointer(r->vertex_uv, 2, GL_FLOAT, GL_FALSE, sizeof(struct vertex), (const void *)offsetof(struct vertex, uv)); + glBufferData(GL_ARRAY_BUFFER, mesh->nr_vertices * sizeof(struct vertex), buf, GL_STATIC_DRAW); + + glBindVertexArray(0); + glBindBuffer(GL_ARRAY_BUFFER, 0); + + free(buf); +} + +static void destroy_mesh(struct mesh *mesh) +{ + glDeleteVertexArrays(1, &mesh->vao); + glDeleteBuffers(1, &mesh->attr_buffer); +} + +struct model *model_load(struct archive *aar, const char *path, struct RE_renderer *r) +{ + if (path[0] == '\0') + return NULL; + + const char *basename = strrchr(path, '\\'); + basename = basename ? basename + 1 : path; + char *polname = xmalloc(strlen(path) + strlen(basename) + 6); + sprintf(polname, "%s\\%s.POL", path, basename); + + struct archive_data *dfile = archive_get_by_name(aar, polname); + if (!dfile) { + WARNING("%s: not found", polname); + free(polname); + return NULL; + } + + struct pol *pol = pol_parse(dfile->data, dfile->size); + archive_free_data(dfile); + if (!pol) { + WARNING("%s: parse error", polname); + free(polname); + return NULL; + } + + struct model *model = xcalloc(1, sizeof(struct model)); + model->name = polname; + + // Materials + int *material_offsets = xmalloc(pol->nr_materials * sizeof(int)); + for (uint32_t i = 0; i < pol->nr_materials; i++) { + material_offsets[i] = model->nr_materials; + if (pol->materials[i].nr_children) + model->nr_materials += pol->materials[i].nr_children; + else + model->nr_materials++; + } + model->materials = xcalloc(model->nr_materials, sizeof(struct material)); + for (uint32_t i = 0; i < pol->nr_materials; i++) { + if (pol->materials[i].nr_children == 0) { + init_material(&model->materials[material_offsets[i]], + &pol->materials[i].m, aar, path); + continue; + } + for (uint32_t j = 0; j < pol->materials[i].nr_children; j++) { + init_material(&model->materials[material_offsets[i] + j], + &pol->materials[i].children[j], aar, path); + } + } + + // Meshes + for (uint32_t i = 0; i < pol->nr_meshes; i++) { + if (!pol->meshes[i]) + continue; + struct pol_material_group *mg = &pol->materials[pol->meshes[i]->material]; + int m_off = material_offsets[pol->meshes[i]->material]; + if (mg->nr_children == 0) { + add_mesh(model, pol->meshes[i], -1, m_off, r); + continue; + } + for (uint32_t j = 0; j < mg->nr_children; j++) { + add_mesh(model, pol->meshes[i], j, m_off + j, r); + } + } + + free(material_offsets); + pol_free(pol); + return model; +} + +void model_free(struct model *model) +{ + for (int i = 0; i < model->nr_meshes; i++) + destroy_mesh(&model->meshes[i]); + free(model->meshes); + + for (int i = 0; i < model->nr_materials; i++) + destroy_material(&model->materials[i]); + free(model->materials); + + free(model->name); + free(model); +} diff --git a/src/3d/parser.c b/src/3d/parser.c new file mode 100644 index 0000000..9548955 --- /dev/null +++ b/src/3d/parser.c @@ -0,0 +1,286 @@ +/* Copyright (C) 2022 kichikuou + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ + +#include +#include +#include + +#include "system4.h" +#include "system4/buffer.h" + +#include "3d_internal.h" + +#define METERS_PER_INCH 0.0254 + +static char *read_cstring(struct buffer *r) +{ + char *s = strdup(buffer_strdata(r)); + buffer_skip(r, strlen(s) + 1); + return s; +} + +static void read_position(struct buffer *r, vec3 v) +{ + // left->right handed system + v[0] = buffer_read_float(r) * METERS_PER_INCH; + v[1] = buffer_read_float(r) * METERS_PER_INCH; + v[2] = -buffer_read_float(r) * METERS_PER_INCH; +} + +static void read_direction(struct buffer *r, vec3 v) +{ + // left->right handed system + v[0] = buffer_read_float(r); + v[1] = buffer_read_float(r); + v[2] = -buffer_read_float(r); +} + +static void read_quaternion(struct buffer *r, versor q) +{ + // left->right handed system + float w = buffer_read_float(r); + float x = -buffer_read_float(r); + float y = -buffer_read_float(r); + float z = buffer_read_float(r); + glm_quat_init(q, x, y, z, w); +} + +static void parse_material(struct buffer *r, struct pol_material *m) +{ + m->name = read_cstring(r); + + int nr_textures = buffer_read_int32(r); + for (int i = 0; i < nr_textures; i++) { + char *filename = read_cstring(r); + int type = buffer_read_int32(r); + if ((unsigned)type < MAX_TEXTURE_TYPE) { + m->textures[type] = filename; + } else { + WARNING("invalid texture type %d", type); + free(filename); + } + } +} + +static void destroy_material(struct pol_material *m) +{ + free(m->name); + for (int i = 0; i < MAX_TEXTURE_TYPE; i++) + free(m->textures[i]); +} + +static void parse_material_group(struct buffer *r, struct pol_material_group *mg) +{ + parse_material(r, &mg->m); + + mg->nr_children = buffer_read_int32(r); + if (mg->nr_children > 0) { + mg->children = xcalloc(mg->nr_children, sizeof(struct pol_material)); + for (uint32_t i = 0; i < mg->nr_children; i++) { + parse_material(r, &mg->children[i]); + } + } +} + +static void destroy_material_group(struct pol_material_group *mg) +{ + destroy_material(&mg->m); + if (mg->children) { + for (uint32_t i = 0; i < mg->nr_children; i++) + destroy_material(&mg->children[i]); + free(mg->children); + } +} + +static void parse_vertex(struct buffer *r, int pol_version, struct pol_vertex *v) +{ + read_position(r, v->pos); + v->nr_weights = pol_version == 1 ? buffer_read_int32(r) : buffer_read_u16(r); + if (v->nr_weights) { + v->weights = xcalloc(v->nr_weights, sizeof(struct pol_bone_weight)); + for (uint32_t i = 0; i < v->nr_weights; i++) { + v->weights[i].bone = pol_version == 1 ? buffer_read_int32(r) : buffer_read_u16(r); + v->weights[i].weight = buffer_read_float(r); + } + } +} + +static void destroy_vertex(struct pol_vertex *v) +{ + if (v->weights) + free(v->weights); +} + +static void parse_triangle(struct buffer *r, int unknowns_length, struct pol_triangle *t) +{ + t->vert_index[0] = buffer_read_int32(r); + t->vert_index[1] = buffer_read_int32(r); + t->vert_index[2] = buffer_read_int32(r); + t->uv_index[0] = buffer_read_int32(r); + t->uv_index[1] = buffer_read_int32(r); + t->uv_index[2] = buffer_read_int32(r); + + buffer_skip(r, unknowns_length); + + read_direction(r, t->normals[0]); + read_direction(r, t->normals[1]); + read_direction(r, t->normals[2]); + t->material = buffer_read_int32(r); +} + +static struct pol_mesh *parse_mesh(struct buffer *r, int pol_version) +{ + int type = buffer_read_int32(r); + if (type != 0) { + if (type != -1) + WARNING("unknown mesh type: %d", type); + return NULL; + } + struct pol_mesh *mesh = xcalloc(1, sizeof(struct pol_mesh)); + mesh->name = read_cstring(r); + mesh->material = buffer_read_int32(r); + + mesh->nr_vertices = buffer_read_int32(r); + mesh->vertices = xcalloc(mesh->nr_vertices, sizeof(struct pol_vertex)); + for (uint32_t i = 0; i < mesh->nr_vertices; i++) { + parse_vertex(r, pol_version, &mesh->vertices[i]); + } + + mesh->nr_uvs = buffer_read_int32(r); + mesh->uvs = xcalloc(mesh->nr_uvs, sizeof(vec2)); + for (uint32_t i = 0; i < mesh->nr_uvs; i++) { + mesh->uvs[i][0] = buffer_read_float(r); + mesh->uvs[i][1] = buffer_read_float(r); + } + + int triangle_unknowns_length = 12; + + int nr_unknown_f64s = buffer_read_int32(r); + if (nr_unknown_f64s) { + buffer_skip(r, nr_unknown_f64s * 8); + triangle_unknowns_length += 12; + } + + if (pol_version == 1) { + int nr_unknown_vecs = buffer_read_int32(r); + buffer_skip(r, nr_unknown_vecs * 12); + } else { + int nr_unknown_ints = buffer_read_int32(r); + buffer_skip(r, nr_unknown_ints * 4); + int nr_unknown_bytes = buffer_read_int32(r); + if (nr_unknown_bytes) { + buffer_skip(r, nr_unknown_bytes); + triangle_unknowns_length += 12; + } + } + + mesh->nr_triangles = buffer_read_int32(r); + mesh->triangles = xcalloc(mesh->nr_triangles, sizeof(struct pol_triangle)); + for (uint32_t i = 0; i < mesh->nr_triangles; i++) { + parse_triangle(r, triangle_unknowns_length, &mesh->triangles[i]); + } + + if (pol_version == 1) { + if (buffer_read_int32(r) != 1) + WARNING("unexpected mesh footer"); + if (buffer_read_int32(r) != 0) + WARNING("unexpected mesh footer"); + } + + return mesh; +} + +static void free_mesh(struct pol_mesh *mesh) +{ + if (!mesh) + return; + free(mesh->name); + for (uint32_t i = 0; i < mesh->nr_vertices; i++) + destroy_vertex(&mesh->vertices[i]); + free(mesh->vertices); + free(mesh->uvs); + free(mesh->triangles); + free(mesh); +} + +static void parse_bone(struct buffer *r, struct pol_bone *bone) +{ + bone->name = read_cstring(r); + bone->id = buffer_read_int32(r); + bone->parent = buffer_read_int32(r); + read_position(r, bone->pos); + read_quaternion(r, bone->rotq); +} + +static void destroy_bone(struct pol_bone *bone) +{ + free(bone->name); +} + +struct pol *pol_parse(uint8_t *data, size_t size) +{ + struct buffer r; + buffer_init(&r, data, size); + if (memcmp(buffer_strdata(&r), "POL\0", 4)) + return NULL; + buffer_skip(&r, 4); + + struct pol *pol = xcalloc(1, sizeof(struct pol)); + pol->version = buffer_read_int32(&r); + if (pol->version != 1 && pol->version != 2) { + WARNING("unknown POL version: %d", pol->version); + free(pol); + return NULL; + } + pol->nr_materials = buffer_read_int32(&r); + pol->materials = xcalloc(pol->nr_materials, sizeof(struct pol_material_group)); + for (uint32_t i = 0; i < pol->nr_materials; i++) { + parse_material_group(&r, &pol->materials[i]); + } + + pol->nr_meshes = buffer_read_int32(&r); + pol->meshes = xcalloc(pol->nr_meshes, sizeof(struct pol_mesh *)); + for (uint32_t i = 0; i < pol->nr_meshes; i++) { + pol->meshes[i] = parse_mesh(&r, pol->version); + } + + pol->nr_bones = buffer_read_int32(&r); + if (pol->nr_bones) { + pol->bones = xcalloc(pol->nr_bones, sizeof(struct pol_bone)); + for (uint32_t i = 0; i < pol->nr_bones; i++) { + parse_bone(&r, &pol->bones[i]); + } + } + + if (buffer_remaining(&r) != 0) { + WARNING("extra data at end"); + } + return pol; +} + +void pol_free(struct pol *pol) +{ + for (uint32_t i = 0; i < pol->nr_materials; i++) + destroy_material_group(&pol->materials[i]); + free(pol->materials); + for (uint32_t i = 0; i < pol->nr_meshes; i++) + free_mesh(pol->meshes[i]); + free(pol->meshes); + for (uint32_t i = 0; i < pol->nr_bones; i++) + destroy_bone(&pol->bones[i]); + free(pol->bones); + free(pol); +} diff --git a/src/3d/reign.c b/src/3d/reign.c new file mode 100644 index 0000000..a8f3e45 --- /dev/null +++ b/src/3d/reign.c @@ -0,0 +1,166 @@ +/* Copyright (C) 2022 kichikuou + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ + +#include +#include +#include +#include +#include + +#include "system4.h" +#include "system4/aar.h" + +#include "3d_internal.h" +#include "reign.h" +#include "sact.h" +#include "xsystem4.h" + +static struct RE_instance *create_instance(struct RE_plugin *plugin) +{ + struct RE_instance *instance = xcalloc(1, sizeof(struct RE_instance)); + instance->plugin = plugin; + instance->scale[0] = 1.0; + instance->scale[1] = 1.0; + instance->scale[2] = 1.0; + glm_mat4_identity(instance->local_transform); + return instance; +} + +static void free_instance(struct RE_instance *instance) +{ + if (instance->model) + model_free(instance->model); + free(instance); +} + +struct RE_plugin *RE_plugin_new(void) +{ + char *aar_path = gamedir_path("Data/ReignData.red"); + int error = ARCHIVE_SUCCESS; + struct archive *aar = (struct archive *)aar_open(aar_path, ARCHIVE_MMAP, &error); + if (error == ARCHIVE_FILE_ERROR) { + WARNING("aar_open(\"%s\"): %s", display_utf0(aar_path), strerror(errno)); + } else if (error == ARCHIVE_BAD_ARCHIVE_ERROR) { + WARNING("aar_open(\"%s\"): invalid AAR archive", display_utf0(aar_path)); + } + free(aar_path); + if (!aar) + return NULL; + + struct RE_plugin *plugin = xcalloc(1, sizeof(struct RE_plugin)); + plugin->plugin.name = "ReignEngine"; + plugin->plugin.update = RE_render; + plugin->aar = aar; + return plugin; +} + +void RE_plugin_free(struct RE_plugin *plugin) +{ + for (int i = 0; i < RE_MAX_INSTANCES; i++) { + if (plugin->instances[i]) + free_instance(plugin->instances[i]); + } + archive_free(plugin->aar); + if (plugin->renderer) + RE_renderer_free(plugin->renderer); + free(plugin); +} + +bool RE_plugin_bind(struct RE_plugin *plugin, int sprite) +{ + struct sact_sprite *sp = sact_try_get_sprite(sprite); + if (!sp) + return false; + plugin->renderer = RE_renderer_new(sprite_get_texture(sp)); + plugin->sprite = sprite; + sprite_bind_plugin(sp, &plugin->plugin); + return true; +} + +bool RE_plugin_unbind(struct RE_plugin *plugin) +{ + if (!plugin || !plugin->renderer) + return false; + struct sact_sprite *sp = sact_try_get_sprite(plugin->sprite); + if (sp) + sprite_bind_plugin(sp, NULL); + RE_renderer_free(plugin->renderer); + plugin->renderer = NULL; + plugin->sprite = 0; + return true; +} + +bool RE_set_projection(struct RE_plugin *plugin, float width, float height, float near, float far, float deg) +{ + if (!plugin) + return false; + glm_perspective(glm_rad(deg), width / height, near, far, plugin->proj_transform); + return true; +} + +int RE_create_instance(struct RE_plugin *plugin) +{ + if (!plugin) + return -1; + for (int i = 0; i < RE_MAX_INSTANCES; i++) { + if (!plugin->instances[i]) { + plugin->instances[i] = create_instance(plugin); + return i; + } + } + WARNING("too many instances"); + return -1; +} + +bool RE_release_instance(struct RE_plugin *plugin, int instance) +{ + if (!plugin || !plugin->instances[instance]) + return false; + free_instance(plugin->instances[instance]); + plugin->instances[instance] = NULL; + return true; +} + +bool RE_instance_load(struct RE_instance *instance, const char *name) +{ + if (!instance) + return false; + if (instance->model) + model_free(instance->model); + instance->model = model_load(instance->plugin->aar, name, instance->plugin->renderer); + return !!instance->model; +} + +void RE_debug_print(struct RE_plugin *p) +{ + printf("camera = { x: %f, y: %f, z: %f, pitch: %f, roll: %f, yaw: %f }", + p->camera.pos[0], p->camera.pos[1], p->camera.pos[2], + p->camera.pitch, p->camera.roll, p->camera.yaw); + + for (int i = 0; i < RE_MAX_INSTANCES; i++) { + struct RE_instance *inst = p->instances[i]; + if (!inst || !inst->model) + continue; + printf("[%d] = {", i); + printf(" name: \"%s\",", inst->model->name); + printf(" type: %d,", inst->type); + printf(" draw: %d,", inst->draw); + printf(" pos: { x: %f, y: %f, z: %f },", inst->pos[0], inst->pos[1], inst->pos[2]); + printf(" vec: { x: %f, y: %f, z: %f },", inst->vec[0], inst->vec[1], inst->vec[2]); + printf(" scale: { x: %f, y: %f, z: %f },", inst->scale[0], inst->scale[1], inst->scale[2]); + printf("}"); + } +} diff --git a/src/3d/renderer.c b/src/3d/renderer.c new file mode 100644 index 0000000..932414f --- /dev/null +++ b/src/3d/renderer.c @@ -0,0 +1,152 @@ +/* Copyright (C) 2022 kichikuou + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ + +#include + +#include "system4.h" + +#include "3d_internal.h" +#include "reign.h" +#include "sact.h" + +struct RE_renderer *RE_renderer_new(struct texture *texture) +{ + struct RE_renderer *r = xcalloc(1, sizeof(struct RE_renderer)); + + gfx_load_shader(&r->shader, "shaders/reign.v.glsl", "shaders/reign.f.glsl"); + r->local_transform = glGetUniformLocation(r->shader.program, "local_transform"); + r->proj_transform = glGetUniformLocation(r->shader.program, "proj_transform"); + r->vertex_normal = glGetAttribLocation(r->shader.program, "vertex_normal"); + r->vertex_uv = glGetAttribLocation(r->shader.program, "vertex_uv"); + + glGenRenderbuffers(1, &r->depth_buffer); + glBindRenderbuffer(GL_RENDERBUFFER, r->depth_buffer); + glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, texture->w, texture->h); + glBindRenderbuffer(GL_RENDERBUFFER, 0); + + return r; +} + +void RE_renderer_free(struct RE_renderer *r) +{ + glDeleteProgram(r->shader.program); + glDeleteRenderbuffers(1, &r->depth_buffer); + free(r); +} + +static void calc_view_matrix(struct RE_camera *camera, mat4 out) +{ + vec3 front = { 0.0, 0.0, -1.0 }; + vec3 euler = { + glm_rad(camera->pitch), + glm_rad(camera->yaw), + glm_rad(camera->roll) + }; + mat4 rot; + glm_euler(euler, rot); + glm_mat4_mulv3(rot, front, 0.0, front); + vec3 up = {0.0, 1.0, 0.0}; + glm_look(camera->pos, front, up, out); +} + +static void update_local_transform(struct RE_instance *inst) +{ + vec3 euler = { + glm_rad(inst->pitch), + glm_rad(inst->yaw), + glm_rad(inst->roll) + }; + mat4 rot; + glm_euler(euler, rot); + + glm_translate_make(inst->local_transform, inst->pos); + glm_mat4_mul(inst->local_transform, rot, inst->local_transform); + glm_scale(inst->local_transform, inst->scale); + + inst->local_transform_needs_update = false; +} + +static void render_instance(struct RE_instance *inst, struct RE_renderer *r, mat4 view_transform, mat4 proj_transform) +{ + if (!inst->draw || !inst->model) + return; + + if (inst->local_transform_needs_update) + update_local_transform(inst); + + glUseProgram(r->shader.program); + glUniformMatrix4fv(r->shader.view_transform, 1, GL_FALSE, view_transform[0]); + glUniformMatrix4fv(r->proj_transform, 1, GL_FALSE, proj_transform[0]); + glUniformMatrix4fv(r->local_transform, 1, GL_FALSE, inst->local_transform[0]); + + struct model *model = inst->model; + for (int i = 0; i < model->nr_meshes; i++) { + struct mesh *mesh = &model->meshes[i]; + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D, model->materials[mesh->material].color_map); + glUniform1i(r->shader.texture, 0); + + glBindVertexArray(mesh->vao); + glDrawArrays(GL_TRIANGLES, 0, mesh->nr_vertices); + glBindVertexArray(0); + glBindTexture(GL_TEXTURE_2D, 0); + } + + glUseProgram(0); +} + +void RE_render(struct sact_sprite *sp) +{ + struct RE_plugin *plugin = (struct RE_plugin *)sp->plugin; + struct RE_renderer *r = plugin->renderer; + if (!r) + return; + sprite_dirty(sp); + struct texture *texture = sprite_get_texture(sp); + + GLuint fbo = gfx_set_framebuffer(GL_DRAW_FRAMEBUFFER, texture, 0, 0, texture->w, texture->h); + glFramebufferRenderbuffer(GL_DRAW_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, r->depth_buffer); + if (glCheckFramebufferStatus(GL_DRAW_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) + ERROR("Incomplete framebuffer"); + + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + glEnable(GL_DEPTH_TEST); + glEnable(GL_CULL_FACE); + + mat4 view_transform; + calc_view_matrix(&plugin->camera, view_transform); + + // Tweak the projection transform so that the rendering result is vertically + // flipped. If we render the scene normally, the resulting image will be + // bottom-up (the first pixel is at the bottom-left), but we want a top-down + // image (the first pixel is at the top-left). This changes the coordinate + // system from right-handed to left-handed, we also need to reverse the + // winding order. + plugin->proj_transform[1][1] *= -1; + glFrontFace(GL_CW); + + for (int i = 0; i < RE_MAX_INSTANCES; i++) { + if (plugin->instances[i]) + render_instance(plugin->instances[i], r, view_transform, plugin->proj_transform); + } + + plugin->proj_transform[1][1] *= -1; + glFrontFace(GL_CCW); + glDisable(GL_DEPTH_TEST); + glDisable(GL_CULL_FACE); + glFramebufferRenderbuffer(GL_DRAW_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, 0); + gfx_reset_framebuffer(GL_DRAW_FRAMEBUFFER, fbo); +} diff --git a/src/dungeon/dungeon.c b/src/dungeon/dungeon.c index b9b3b16..d51a16c 100644 --- a/src/dungeon/dungeon.c +++ b/src/dungeon/dungeon.c @@ -45,7 +45,7 @@ #define M_PI (3.14159265358979323846) #endif -static void dungeon_render(struct draw_plugin *plugin); +static void dungeon_render(struct sact_sprite *sp); struct dungeon_context *dungeon_context_create(enum draw_dungeon_version version, int surface) { @@ -257,12 +257,11 @@ static void model_view_matrix(struct camera *camera, mat4 out) glm_lookat(eye, camera->pos, up, out); } -static void dungeon_render(struct draw_plugin *plugin) +static void dungeon_render(struct sact_sprite *sp) { - struct dungeon_context *ctx = (struct dungeon_context *)plugin; + struct dungeon_context *ctx = (struct dungeon_context *)sp->plugin; if (!ctx->loaded || !ctx->draw_enabled) return; - struct sact_sprite *sp = sact_get_sprite(ctx->surface); sprite_dirty(sp); struct texture *texture = sprite_get_texture(sp); diff --git a/src/ffi.c b/src/ffi.c index 8e5adb8..925a286 100644 --- a/src/ffi.c +++ b/src/ffi.c @@ -338,6 +338,7 @@ extern struct static_library lib_OutputLog; extern struct static_library lib_PassRegister; extern struct static_library lib_PlayDemo; extern struct static_library lib_PlayMovie; +extern struct static_library lib_ReignEngine; extern struct static_library lib_SACT2; extern struct static_library lib_SACTDX; extern struct static_library lib_SengokuRanceFont; @@ -401,6 +402,7 @@ static struct static_library *static_libraries[] = { &lib_PassRegister, &lib_PlayDemo, &lib_PlayMovie, + &lib_ReignEngine, &lib_SACT2, &lib_SACTDX, &lib_SengokuRanceFont, diff --git a/src/hll/ReignEngine.c b/src/hll/ReignEngine.c new file mode 100644 index 0000000..52dc47b --- /dev/null +++ b/src/hll/ReignEngine.c @@ -0,0 +1,1227 @@ +/* Copyright (C) 2022 kichikuou + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ + +#include + +#include "system4.h" +#include "system4/aar.h" +#include "system4/string.h" + +#include "hll.h" +#include "reign.h" + +#define RE_MAX_PLUGINS 1 + +struct RE_options RE_options; + +static struct RE_plugin *plugins[RE_MAX_PLUGINS]; + +static struct RE_plugin *get_plugin(unsigned plugin) +{ + return plugin < RE_MAX_PLUGINS ? plugins[plugin] : NULL; +} + +static struct RE_instance *get_instance(unsigned plugin, unsigned instance) +{ + struct RE_plugin *rp = get_plugin(plugin); + if (!rp) + return NULL; + return instance < RE_MAX_INSTANCES ? rp->instances[instance] : NULL; +} + +static int ReignEngine_CreatePlugin(void) +{ + for (int i = 0; i < RE_MAX_PLUGINS; i++) { + if (!plugins[i]) { + plugins[i] = RE_plugin_new(); + return plugins[i] ? i : -1; + } + } + WARNING("too many plugins"); + return -1; +} + +static bool ReignEngine_ReleasePlugin(int handle) +{ + if ((unsigned)handle >= RE_MAX_PLUGINS || !plugins[handle]) + return false; + RE_plugin_free(plugins[handle]); + plugins[handle] = NULL; + return true; +} + +static bool ReignEngine_BindPlugin(int handle, int sprite) +{ + return RE_plugin_bind(get_plugin(handle), sprite); +} + +static bool ReignEngine_UnbindPlugin(int handle) +{ + return RE_plugin_unbind(get_plugin(handle)); +} + +HLL_QUIET_UNIMPLEMENTED(true, bool, ReignEngine, BuildModel, int plugin, int pass_time); + +static int ReignEngine_CreateInstance(int plugin) +{ + return RE_create_instance(get_plugin(plugin)); +} + +static bool ReignEngine_ReleaseInstance(int plugin, int instance) +{ + return RE_release_instance(get_plugin(plugin), instance); +} + +static bool ReignEngine_LoadInstance(int plugin, int instance, struct string *name) +{ + return RE_instance_load(get_instance(plugin, instance), name->text); +} + +static bool ReignEngine_SetInstanceType(int plugin, int instance, int type) +{ + struct RE_instance *ri = get_instance(plugin, instance); + if (!ri) + return false; + ri->type = type; + return true; +} + +static bool ReignEngine_SetInstancePos(int plugin, int instance, float x, float y, float z) +{ + struct RE_instance *ri = get_instance(plugin, instance); + if (!ri) + return false; + ri->pos[0] = x; + ri->pos[1] = y; + ri->pos[2] = -z; + ri->local_transform_needs_update = true; + return true; +} + +static bool ReignEngine_SetInstanceVector(int plugin, int instance, float x, float y, float z) +{ + struct RE_instance *ri = get_instance(plugin, instance); + if (!ri) + return false; + ri->vec[0] = x; + ri->vec[1] = y; + ri->vec[2] = -z; + return true; +} + +static bool ReignEngine_SetInstanceAngle(int plugin, int instance, float angle) +{ + struct RE_instance *ri = get_instance(plugin, instance); + if (!ri) + return false; + ri->yaw = -angle; + ri->local_transform_needs_update = true; + return true; +} + +static bool ReignEngine_SetInstanceAngleP(int plugin, int instance, float angle_p) +{ + struct RE_instance *ri = get_instance(plugin, instance); + if (!ri) + return false; + ri->pitch = angle_p; + ri->local_transform_needs_update = true; + return true; +} + +static bool ReignEngine_SetInstanceAngleB(int plugin, int instance, float angle_b) +{ + struct RE_instance *ri = get_instance(plugin, instance); + if (!ri) + return false; + ri->roll = angle_b; + ri->local_transform_needs_update = true; + return true; +} + +static float ReignEngine_GetInstanceScaleX(int plugin, int instance) +{ + struct RE_instance *ri = get_instance(plugin, instance); + return ri ? ri->scale[0] : 0.0; +} + +static float ReignEngine_GetInstanceScaleY(int plugin, int instance) +{ + struct RE_instance *ri = get_instance(plugin, instance); + return ri ? ri->scale[1] : 0.0; +} + +static float ReignEngine_GetInstanceScaleZ(int plugin, int instance) +{ + struct RE_instance *ri = get_instance(plugin, instance); + return ri ? ri->scale[2] : 0.0; +} + +static bool ReignEngine_SetInstanceScaleX(int plugin, int instance, float scale_x) +{ + struct RE_instance *ri = get_instance(plugin, instance); + if (!ri) + return false; + ri->scale[0] = scale_x; + ri->local_transform_needs_update = true; + return true; +} + +static bool ReignEngine_SetInstanceScaleY(int plugin, int instance, float scale_y) +{ + struct RE_instance *ri = get_instance(plugin, instance); + if (!ri) + return false; + ri->scale[1] = scale_y; + ri->local_transform_needs_update = true; + return true; +} + +static bool ReignEngine_SetInstanceScaleZ(int plugin, int instance, float scale_z) +{ + struct RE_instance *ri = get_instance(plugin, instance); + if (!ri) + return false; + ri->scale[0] = scale_z; + ri->local_transform_needs_update = true; + return true; +} + +//bool ReignEngine_SetInstanceZBias(int plugin, int instance, float fZBias); +//float ReignEngine_GetInstanceZBias(int plugin, int instance); +HLL_WARN_UNIMPLEMENTED(false, bool, ReignEngine, SetInstanceVertexPos, int plugin, int instance, int index, float x, float y, float z); +HLL_WARN_UNIMPLEMENTED(false, bool, ReignEngine, SetInstanceDiffuse, int plugin, int instance, float r, float g, float b); +HLL_WARN_UNIMPLEMENTED(false, bool, ReignEngine, SetInstanceGlobeDiffuse, int plugin, int instance, float r, float g, float b); +HLL_WARN_UNIMPLEMENTED(false, bool, ReignEngine, SetInstanceAmbient, int plugin, int instance, float r, float g, float b); +//bool ReignEngine_SetInstanceSpecular(int plugin, int instance, float fSpecular); +//bool ReignEngine_SetInstanceAlpha(int plugin, int instance, float fAlpha); +//bool ReignEngine_SetInstanceAttenuationNear(int plugin, int instance, float fNear); +//bool ReignEngine_SetInstanceAttenuationFar(int plugin, int instance, float fFar); + +static bool ReignEngine_SetInstanceDraw(int plugin, int instance, bool flag) +{ + struct RE_instance *ri = get_instance(plugin, instance); + if (!ri) + return false; + ri->draw = flag; + return true; +} + +HLL_WARN_UNIMPLEMENTED(false, bool, ReignEngine, SetInstanceDrawShadow, int plugin, int instance, bool flag); +HLL_WARN_UNIMPLEMENTED(false, bool, ReignEngine, SetInstanceDrawBackShadow, int plugin, int instance, bool flag); +HLL_WARN_UNIMPLEMENTED(false, bool, ReignEngine, SetInstanceDrawMakeShadow, int plugin, int instance, bool flag); +HLL_WARN_UNIMPLEMENTED(false, bool, ReignEngine, SetInstanceDrawBump, int plugin, int instance, bool flag); + +static bool ReignEngine_GetInstanceDraw(int plugin, int instance) +{ + struct RE_instance *ri = get_instance(plugin, instance); + if (!ri) + return false; + return ri->draw; +} + +//bool ReignEngine_GetInstanceDrawShadow(int plugin, int instance); +//bool ReignEngine_GetInstanceDrawBackShadow(int plugin, int instance); +//bool ReignEngine_GetInstanceDrawMakeShadow(int plugin, int instance); +//bool ReignEngine_GetInstanceDrawBump(int plugin, int instance); +//int ReignEngine_GetInstanceDrawType(int plugin, int instance); +HLL_WARN_UNIMPLEMENTED(false, bool, ReignEngine, SetInstanceDrawType, int plugin, int instance, int draw_type); +HLL_WARN_UNIMPLEMENTED(false, bool, ReignEngine, LoadInstanceMotion, int plugin, int instance, struct string *name); +HLL_WARN_UNIMPLEMENTED(0, int, ReignEngine, GetInstanceMotionState, int plugin, int instance); +HLL_WARN_UNIMPLEMENTED(0.0, float, ReignEngine, GetInstanceMotionFrame, int plugin, int instance); +HLL_WARN_UNIMPLEMENTED(false, bool, ReignEngine, SetInstanceMotionState, int plugin, int instance, int state); +HLL_WARN_UNIMPLEMENTED(false, bool, ReignEngine, SetInstanceMotionFrame, int plugin, int instance, float frame); +HLL_WARN_UNIMPLEMENTED(false, bool, ReignEngine, SetInstanceMotionFrameRange, int plugin, int instance, float begin_frame, float end_frame); +HLL_WARN_UNIMPLEMENTED(false, bool, ReignEngine, SetInstanceMotionLoopFrameRange, int plugin, int instance, float begin_frame, float end_frame); +HLL_WARN_UNIMPLEMENTED(false, bool, ReignEngine, LoadInstanceNextMotion, int plugin, int instance, struct string *name); +//bool ReignEngine_SetInstanceNextMotionState(int plugin, int instance, int nState); +//bool ReignEngine_SetInstanceNextMotionFrame(int plugin, int instance, float fFrame); +HLL_WARN_UNIMPLEMENTED(false, bool, ReignEngine, SetInstanceNextMotionFrameRange, int plugin, int instance, float begin_frame, float end_frame); +HLL_WARN_UNIMPLEMENTED(false, bool, ReignEngine, SetInstanceNextMotionLoopFrameRange, int plugin, int instance, float begin_frame, float end_frame); +//bool ReignEngine_SetInstanceMotionBlendRate(int plugin, int instance, float fRate); +//bool ReignEngine_SetInstanceMotionBlend(int plugin, int instance, bool bMotionBlend); +HLL_WARN_UNIMPLEMENTED(false, bool, ReignEngine, IsInstanceMotionBlend, int plugin, int instance); +//bool ReignEngine_GetInstanceMotionBlendPutTime(int plugin, int instance); +HLL_WARN_UNIMPLEMENTED(false, bool, ReignEngine, SetInstanceMotionBlendPutTime, int plugin, int instance, bool flag); +//bool ReignEngine_SwapInstanceMotion(int plugin, int instance); +//bool ReignEngine_FreeInstanceNextMotion(int plugin, int instance); +//int ReignEngine_GetInstanceNumofMaterial(int plugin, int instance); +//bool ReignEngine_GetInstanceMaterialName(int plugin, int instance, int num, struct string **pIName); +//float ReignEngine_GetInstanceMaterialParam(int plugin, int instance, int nMaterial, int type); +//bool ReignEngine_SetInstanceMaterialParam(int plugin, int instance, int nMaterial, int type, float param); +//bool ReignEngine_SaveInstanceAddMaterialData(int plugin, int instance); +//bool ReignEngine_SetInstancePointPos(int plugin, int instance, int index, float x, float y, float z); +//bool ReignEngine_GetInstancePointPos(int plugin, int instance, int index, float *pfX, float *pfY, float *pfZ); +//bool ReignEngine_GetInstanceColumnPos(int plugin, int instance, float *fX, float *fY, float *fZ); +//float ReignEngine_GetInstanceColumnHeight(int plugin, int instance); +//float ReignEngine_GetInstanceColumnRadius(int plugin, int instance); +//float ReignEngine_GetInstanceColumnAngle(int plugin, int instance); +//float ReignEngine_GetInstanceColumnAngleP(int plugin, int instance); +//float ReignEngine_GetInstanceColumnAngleB(int plugin, int instance); +HLL_WARN_UNIMPLEMENTED(false, bool, ReignEngine, SetInstanceColumnPos, int plugin, int instance, float x, float y, float z); +HLL_WARN_UNIMPLEMENTED(false, bool, ReignEngine, SetInstanceColumnHeight, int plugin, int instance, float height); +HLL_WARN_UNIMPLEMENTED(false, bool, ReignEngine, SetInstanceColumnRadius, int plugin, int instance, float radius); +HLL_WARN_UNIMPLEMENTED(false, bool, ReignEngine, SetInstanceColumnAngle, int plugin, int instance, float angle); +//bool ReignEngine_SetInstanceColumnAngleP(int plugin, int instance, float fAngleP); +//bool ReignEngine_SetInstanceColumnAngleB(int plugin, int instance, float fAngleB); +//bool ReignEngine_GetInstanceDrawColumn(int plugin, int instance); +//bool ReignEngine_SetInstanceDrawColumn(int plugin, int instance, bool bDraw); +HLL_WARN_UNIMPLEMENTED(false, bool, ReignEngine, SetInstanceTarget, int plugin, int instance, int index, int target); +//int ReignEngine_GetInstanceTarget(int plugin, int instance, int index); +//float ReignEngine_GetInstanceFPS(int plugin, int instance); +HLL_WARN_UNIMPLEMENTED(false, bool, ReignEngine, SetInstanceFPS, int plugin, int instance, float fps); +HLL_WARN_UNIMPLEMENTED(0, int, ReignEngine, GetInstanceBoneIndex, int plugin, int instance, struct string *name); +HLL_WARN_UNIMPLEMENTED(false, bool, ReignEngine, TransInstanceLocalPosToWorldPosByBone, int plugin, int instance, int bone, float offset_x, float offset_y, float offset_z, float *x, float *y, float *z); +//int ReignEngine_GetInstanceNumofPolygon(int plugin, int instance); +//int ReignEngine_GetInstanceTextureMemorySize(int plugin, int instance); +//void ReignEngine_GetInstanceInfoText(int plugin, int instance, struct string **pIText); +//void ReignEngine_GetInstanceMaterialInfoText(int plugin, int instance, struct string **pIText); +HLL_WARN_UNIMPLEMENTED(0.0, float, ReignEngine, CalcInstanceHeightDetection, int plugin, int instance, float x, float z); +//float ReignEngine_GetInstanceSoftFogEdgeLength(int plugin, int instance); +HLL_WARN_UNIMPLEMENTED(false, bool, ReignEngine, SetInstanceSoftFogEdgeLength, int plugin, int instance, float length); +//float ReignEngine_GetInstanceShadowVolumeBoneRadius(int plugin, int instance); +HLL_WARN_UNIMPLEMENTED(false, bool, ReignEngine, SetInstanceShadowVolumeBoneRadius, int plugin, int instance, float radius); +//bool ReignEngine_GetInstanceDebugDrawShadowVolume(int plugin, int instance); +//bool ReignEngine_SetInstanceDebugDrawShadowVolume(int plugin, int instance, bool flag); +//bool ReignEngine_SaveEffect(int plugin, int instance); +HLL_WARN_UNIMPLEMENTED(false, bool, ReignEngine, GetEffectFrameRange, int plugin, int instance, int *begin_frame, int *end_frame); +//int ReignEngine_GetEffectObjectType(int plugin, int instance, int nObject); +//int ReignEngine_GetEffectObjectMoveType(int plugin, int instance, int nObject); +//int ReignEngine_GetEffectObjectUpVecType(int plugin, int instance, int nObject); +//float ReignEngine_GetEffectObjectMoveCurve(int plugin, int instance, int nObject); +//void ReignEngine_GetEffectObjectFrame(int plugin, int instance, int nObject, int *pnBeginFrame, int *pnEndFrame); +//int ReignEngine_GetEffectObjectStopFrame(int plugin, int instance, int nObject); +//int ReignEngine_GetEffectNumofObject(int plugin, int instance); +//void ReignEngine_GetEffectObjectName(int plugin, int instance, int nObject, struct string **pIName); +//int ReignEngine_GetEffectNumofObjectPos(int plugin, int instance, int nObject); +//int ReignEngine_GetEffectNumofObjectPosUnit(int plugin, int instance, int nObject, int nPos); +//int ReignEngine_GetEffectObjectPosUnitType(int plugin, int instance, int nObject, int nPos, int nPosUnit); +//int ReignEngine_GetEffectObjectPosUnitIndex(int plugin, int instance, int nObject, int nPos, int nPosUnit); +//int ReignEngine_GetEffectNumofObjectPosUnitParam(int plugin, int instance, int nObject, int nPos, int nPosUnit); +//float ReignEngine_GetEffectObjectPosUnitParam(int plugin, int instance, int nObject, int nPos, int nPosUnit, int nParam); +//int ReignEngine_GetEffectNumofObjectPosUnitString(int plugin, int instance, int nObject, int nPos, int nPosUnit); +//void ReignEngine_GetEffectObjectPosUnitString(int plugin, int instance, int nObject, int nPos, int nPosUnit, int nParam, struct string **pIResult); +//int ReignEngine_GetEffectNumofObjectTexture(int plugin, int instance, int nObject); +//void ReignEngine_GetEffectObjectTexture(int plugin, int instance, int nObject, int nTexture, struct string **pIName); +//bool ReignEngine_GetEffectObjectSize(int plugin, int instance, int nObject, float *pfBeginSize, float *pfEndSize); +//bool ReignEngine_GetEffectObjectSize2(int plugin, int instance, int nObject, int nFrame, float *pfSize); +//bool ReignEngine_GetEffectObjectSizeX(int plugin, int instance, int nObject, int nFrame, float *pfSize); +//bool ReignEngine_GetEffectObjectSizeY(int plugin, int instance, int nObject, int nFrame, float *pfSize); +//bool ReignEngine_GetEffectObjectSizeType(int plugin, int instance, int nObject, int nFrame, int *nType); +//bool ReignEngine_GetEffectObjectSizeXType(int plugin, int instance, int nObject, int nFrame, int *nType); +//bool ReignEngine_GetEffectObjectSizeYType(int plugin, int instance, int nObject, int nFrame, int *nType); +//int ReignEngine_GetEffectNumofObjectSize2(int plugin, int instance, int nObject); +//int ReignEngine_GetEffectNumofObjectSizeX(int plugin, int instance, int nObject); +//int ReignEngine_GetEffectNumofObjectSizeY(int plugin, int instance, int nObject); +//int ReignEngine_GetEffectNumofObjectSizeType(int plugin, int instance, int nObject); +//int ReignEngine_GetEffectNumofObjectSizeXType(int plugin, int instance, int nObject); +//int ReignEngine_GetEffectNumofObjectSizeYType(int plugin, int instance, int nObject); +//int ReignEngine_GetEffectObjectBlendType(int plugin, int instance, int nObject); +//void ReignEngine_GetEffectObjectPolygonName(int plugin, int instance, int nObject, struct string **pIResult); +//int ReignEngine_GetEffectNumofObjectParticle(int plugin, int instance, int nObject); +//int ReignEngine_GetEffectObjectAlphaFadeInTime(int plugin, int instance, int nObject); +//int ReignEngine_GetEffectObjectAlphaFadeOutTime(int plugin, int instance, int nObject); +//int ReignEngine_GetEffectObjectTextureAnimeTime(int plugin, int instance, int nObject); +//float ReignEngine_GetEffectObjectAlphaFadeInFrame(int plugin, int instance, int nObject); +//float ReignEngine_GetEffectObjectAlphaFadeOutFrame(int plugin, int instance, int nObject); +//float ReignEngine_GetEffectObjectTextureAnimeFrame(int plugin, int instance, int nObject); +//int ReignEngine_GetEffectObjectFrameReferenceType(int plugin, int instance, int nObject); +//int ReignEngine_GetEffectObjectFrameReferenceParam(int plugin, int instance, int nObject); +//void ReignEngine_GetEffectObjectXRotationAngle(int plugin, int instance, int nObject, float *pfBeginAngle, float *pfEndAngle); +//void ReignEngine_GetEffectObjectYRotationAngle(int plugin, int instance, int nObject, float *pfBeginAngle, float *pfEndAngle); +//void ReignEngine_GetEffectObjectZRotationAngle(int plugin, int instance, int nObject, float *pfBeginAngle, float *pfEndAngle); +//void ReignEngine_GetEffectObjectXRevolutionAngle(int plugin, int instance, int nObject, float *pfBeginAngle, float *pfEndAngle); +//void ReignEngine_GetEffectObjectXRevolutionDistance(int plugin, int instance, int nObject, float *pfBeginDistance, float *pfEndDistance); +//void ReignEngine_GetEffectObjectYRevolutionAngle(int plugin, int instance, int nObject, float *pfBeginAngle, float *pfEndAngle); +//void ReignEngine_GetEffectObjectYRevolutionDistance(int plugin, int instance, int nObject, float *pfBeginDistance, float *pfEndDistance); +//void ReignEngine_GetEffectObjectZRevolutionAngle(int plugin, int instance, int nObject, float *pfBeginAngle, float *pfEndAngle); +//void ReignEngine_GetEffectObjectZRevolutionDistance(int plugin, int instance, int nObject, float *pfBeginDistance, float *pfEndDistance); +//bool ReignEngine_AddEffectObject(int plugin, int instance); +//bool ReignEngine_DeleteEffectObject(int plugin, int instance, int nObject); +//bool ReignEngine_SetEffectObjectName(int plugin, int instance, int nObject, struct string *pIName); +//bool ReignEngine_SetEffectObjectType(int plugin, int instance, int nObject, int type); +//bool ReignEngine_SetEffectObjectMoveType(int plugin, int instance, int nObject, int type); +//bool ReignEngine_SetEffectObjectUpVecType(int plugin, int instance, int nObject, int type); +//bool ReignEngine_SetEffectObjectMoveCurve(int plugin, int instance, int nObject, float fCurve); +//bool ReignEngine_SetEffectObjectFrame(int plugin, int instance, int nObject, int nBeginFrame, int nEndFrame); +//bool ReignEngine_SetEffectObjectStopFrame(int plugin, int instance, int nObject, int nStopFrame); +//bool ReignEngine_SetEffectObjectPosUnitType(int plugin, int instance, int nObject, int nPos, int nPosUnit, int type); +//bool ReignEngine_SetEffectObjectPosUnitIndex(int plugin, int instance, int nObject, int nPos, int nPosUnit, int index); +//bool ReignEngine_SetEffectObjectPosUnitParam(int plugin, int instance, int nObject, int nPos, int nPosUnit, int nParam, float fData); +//bool ReignEngine_SetEffectObjectPosUnitString(int plugin, int instance, int nObject, int nPos, int nPosUnit, int nParam, struct string *String); +//bool ReignEngine_SetEffectObjectTexture(int plugin, int instance, int nObject, int nTexture, struct string *pIName); +//bool ReignEngine_SetEffectObjectSize(int plugin, int instance, int nObject, float fBeginSize, float fEndSize); +//bool ReignEngine_SetEffectObjectSize2(int plugin, int instance, int nObject, int nFrame, float fSize); +//bool ReignEngine_SetEffectObjectSizeX(int plugin, int instance, int nObject, int nFrame, float fSize); +//bool ReignEngine_SetEffectObjectSizeY(int plugin, int instance, int nObject, int nFrame, float fSize); +//bool ReignEngine_SetEffectObjectSizeType(int plugin, int instance, int nObject, int nFrame, int type); +//bool ReignEngine_SetEffectObjectSizeXType(int plugin, int instance, int nObject, int nFrame, int type); +//bool ReignEngine_SetEffectObjectSizeYType(int plugin, int instance, int nObject, int nFrame, int type); +//bool ReignEngine_SetEffectObjectBlendType(int plugin, int instance, int nObject, int type); +//bool ReignEngine_SetEffectObjectPolygonName(int plugin, int instance, int nObject, struct string *pIName); +//bool ReignEngine_SetEffectNumofObjectParticle(int plugin, int instance, int nObject, int numof); +//bool ReignEngine_SetEffectObjectAlphaFadeInTime(int plugin, int instance, int nObject, int nTime); +//bool ReignEngine_SetEffectObjectAlphaFadeOutTime(int plugin, int instance, int nObject, int nTime); +//bool ReignEngine_SetEffectObjectTextureAnimeTime(int plugin, int instance, int nObject, int nTime); +//bool ReignEngine_SetEffectObjectAlphaFadeInFrame(int plugin, int instance, int nObject, float fFrame); +//bool ReignEngine_SetEffectObjectAlphaFadeOutFrame(int plugin, int instance, int nObject, float fFrame); +//bool ReignEngine_SetEffectObjectTextureAnimeFrame(int plugin, int instance, int nObject, float fFrame); +//bool ReignEngine_SetEffectObjectFrameReferenceType(int plugin, int instance, int nObject, int type); +//bool ReignEngine_SetEffectObjectFrameReferenceParam(int plugin, int instance, int nObject, int nParam); +//bool ReignEngine_SetEffectObjectXRotationAngle(int plugin, int instance, int nObject, float fBeginAngle, float fEndAngle); +//bool ReignEngine_SetEffectObjectYRotationAngle(int plugin, int instance, int nObject, float fBeginAngle, float fEndAngle); +//bool ReignEngine_SetEffectObjectZRotationAngle(int plugin, int instance, int nObject, float fBeginAngle, float fEndAngle); +//bool ReignEngine_SetEffectObjectXRevolutionAngle(int plugin, int instance, int nObject, float fBeginAngle, float fEndAngle); +//bool ReignEngine_SetEffectObjectXRevolutionDistance(int plugin, int instance, int nObject, float fBeginDistance, float fEndDistance); +//bool ReignEngine_SetEffectObjectYRevolutionAngle(int plugin, int instance, int nObject, float fBeginAngle, float fEndAngle); +//bool ReignEngine_SetEffectObjectYRevolutionDistance(int plugin, int instance, int nObject, float fBeginDistance, float fEndDistance); +//bool ReignEngine_SetEffectObjectZRevolutionAngle(int plugin, int instance, int nObject, float fBeginAngle, float fEndAngle); +//bool ReignEngine_SetEffectObjectZRevolutionDistance(int plugin, int instance, int nObject, float fBeginDistance, float fEndDistance); +//bool ReignEngine_GetEffectObjectCurveLength(int plugin, int instance, int nObject, float *pfX, float *pfY, float *pfZ); +//bool ReignEngine_SetEffectObjectCurveLength(int plugin, int instance, int nObject, float x, float y, float z); +//int ReignEngine_GetEffectObjectChildFrame(int plugin, int instance, int nObject); +//float ReignEngine_GetEffectObjectChildLength(int plugin, int instance, int nObject); +//float ReignEngine_GetEffectObjectChildBeginSlope(int plugin, int instance, int nObject); +//float ReignEngine_GetEffectObjectChildEndSlope(int plugin, int instance, int nObject); +//float ReignEngine_GetEffectObjectChildCreateBeginFrame(int plugin, int instance, int nObject); +//float ReignEngine_GetEffectObjectChildCreateEndFrame(int plugin, int instance, int nObject); +//int ReignEngine_GetEffectObjectChildMoveDirType(int plugin, int instance, int nObject); +//bool ReignEngine_SetEffectObjectChildFrame(int plugin, int instance, int nObject, int nFrame); +//bool ReignEngine_SetEffectObjectChildLength(int plugin, int instance, int nObject, float fLength); +//bool ReignEngine_SetEffectObjectChildBeginSlope(int plugin, int instance, int nObject, float fSlope); +//bool ReignEngine_SetEffectObjectChildEndSlope(int plugin, int instance, int nObject, float fSlope); +//bool ReignEngine_SetEffectObjectChildCreateBeginFrame(int plugin, int instance, int nObject, float fFrame); +//bool ReignEngine_SetEffectObjectChildCreateEndFrame(int plugin, int instance, int nObject, float fFrame); +//bool ReignEngine_SetEffectObjectChildMoveDirType(int plugin, int instance, int nObject, int type); +//int ReignEngine_GetEffectObjectDirType(int plugin, int instance, int nObject); +//bool ReignEngine_SetEffectObjectDirType(int plugin, int instance, int nObject, int type); +//int ReignEngine_GetEffectNumofObjectDamage(int plugin, int instance, int nObject); +//int ReignEngine_GetEffectObjectDamage(int plugin, int instance, int nObject, int nFrame); +//bool ReignEngine_SetEffectObjectDamage(int plugin, int instance, int nObject, int nFrame, int nData); +//bool ReignEngine_GetEffectObjectDraw(int plugin, int instance, int nObject); +//bool ReignEngine_SetEffectObjectDraw(int plugin, int instance, int nObject, bool bDraw); +//float ReignEngine_GetEffectObjectOffsetX(int plugin, int instance, int nObject); +//float ReignEngine_GetEffectObjectOffsetY(int plugin, int instance, int nObject); +//bool ReignEngine_SetEffectObjectOffsetX(int plugin, int instance, int nObject, float fOffsetX); +//bool ReignEngine_SetEffectObjectOffsetY(int plugin, int instance, int nObject, float fOffsetY); +//bool ReignEngine_GetCameraQuakeEffectFlag(int plugin, int instance); +//bool ReignEngine_SetCameraQuakeEffectFlag(int plugin, int instance, bool flag); + +bool ReignEngine_SetCameraPos(int plugin, float x, float y, float z) +{ + struct RE_plugin *p = get_plugin(plugin); + if (!p) + return false; + p->camera.pos[0] = x; + p->camera.pos[1] = y; + p->camera.pos[2] = -z; + return true; +} + +bool ReignEngine_SetCameraAngle(int plugin, float angle) +{ + struct RE_plugin *p = get_plugin(plugin); + if (!p) + return false; + p->camera.yaw = -angle; + return true; +} + +bool ReignEngine_SetCameraAngleP(int plugin, float angle_p) +{ + struct RE_plugin *p = get_plugin(plugin); + if (!p) + return false; + p->camera.pitch = angle_p; + return true; +} + +bool ReignEngine_SetCameraAngleB(int plugin, float angle_b) +{ + struct RE_plugin *p = get_plugin(plugin); + if (!p) + return false; + p->camera.roll = angle_b; + return true; +} + +//float ReignEngine_GetShadowBias(int plugin, int num); +//float ReignEngine_GetShadowTargetDistance(int plugin, int num); + +static int ReignEngine_GetShadowMapResolutionLevel(int plugin) +{ + struct RE_plugin *p = get_plugin(plugin); + return p ? p->shadow_map_resolution_level : 0; +} + +//float ReignEngine_GetShadowSplitDepth(int plugin, int num); +HLL_WARN_UNIMPLEMENTED(false, bool, ReignEngine, SetShadowMapType, int plugin, int type); +HLL_WARN_UNIMPLEMENTED(false, bool, ReignEngine, SetShadowMapLightLookPos, int plugin, float x, float y, float z); +HLL_WARN_UNIMPLEMENTED(false, bool, ReignEngine, SetShadowMapLightDir, int plugin, float x, float y, float z); +HLL_WARN_UNIMPLEMENTED(false, bool, ReignEngine, SetShadowBox, int plugin, float x, float y, float z, float size_x, float size_y, float size_z); +HLL_WARN_UNIMPLEMENTED(false, bool, ReignEngine, SetShadowBias, int plugin, int num, float shadow_bias); +//bool ReignEngine_SetShadowSlopeBias(int plugin, float fShadowSlopeBias); +//bool ReignEngine_SetShadowFilterMag(int plugin, float fShadowFilterMag); +//bool ReignEngine_SetShadowTargetDistance(int plugin, int num, float fDistance); + +static bool ReignEngine_SetShadowMapResolutionLevel(int plugin, int level) +{ + struct RE_plugin *p = get_plugin(plugin); + if (!p) + return false; + p->shadow_map_resolution_level = level; + return true; +} + +//bool ReignEngine_SetShadowSplitDepth(int plugin, int num, float fDepth); +HLL_WARN_UNIMPLEMENTED(false, bool, ReignEngine, SetFogType, int plugin, int type); +HLL_WARN_UNIMPLEMENTED(false, bool, ReignEngine, SetFogNear, int plugin, float near); +HLL_WARN_UNIMPLEMENTED(false, bool, ReignEngine, SetFogFar, int plugin, float far); +HLL_WARN_UNIMPLEMENTED(false, bool, ReignEngine, SetFogColor, int plugin, float r, float g, float b); +//int ReignEngine_GetFogType(int plugin); +//float ReignEngine_GetFogNear(int plugin); +//float ReignEngine_GetFogFar(int plugin); +//void ReignEngine_GetFogColor(int plugin, float *r, float *g, float *b); +HLL_WARN_UNIMPLEMENTED(false, bool, ReignEngine, LoadLightScatteringSetting, int plugin, struct string *filename /* e.g. "Data\PolyData\BG\bg001\bg001.ls2" */); +//float ReignEngine_GetLSBetaR(int plugin); +//float ReignEngine_GetLSBetaM(int plugin); +//float ReignEngine_GetLSG(int plugin); +//float ReignEngine_GetLSDistance(int plugin); +//void ReignEngine_GetLSLightDir(int plugin, float *pfX, float *pfY, float *pfZ); +//void ReignEngine_GetLSLightColor(int plugin, float *r, float *g, float *b); +//void ReignEngine_GetLSSunColor(int plugin, float *r, float *g, float *b); +HLL_WARN_UNIMPLEMENTED(false, bool, ReignEngine, SetLSBetaR, int plugin, float beta_r); +HLL_WARN_UNIMPLEMENTED(false, bool, ReignEngine, SetLSBetaM, int plugin, float beta_m); +HLL_WARN_UNIMPLEMENTED(false, bool, ReignEngine, SetLSG, int plugin, float g); +HLL_WARN_UNIMPLEMENTED(false, bool, ReignEngine, SetLSDistance, int plugin, float distance); +HLL_WARN_UNIMPLEMENTED(false, bool, ReignEngine, SetLSLightDir, int plugin, float x, float y, float z); +HLL_WARN_UNIMPLEMENTED(false, bool, ReignEngine, SetLSLightColor, int plugin, float r, float g, float b); +HLL_WARN_UNIMPLEMENTED(false, bool, ReignEngine, SetLSSunColor, int plugin, float r, float g, float b); +//bool ReignEngine_SetDrawTextureFog(int plugin, bool bDraw); +//bool ReignEngine_GetDrawTextureFog(int plugin); + +static bool ReignEngine_SetOptionAntiAliasing(int flag) +{ + RE_options.anti_aliasing = flag; + return true; +} + +static bool ReignEngine_SetOptionWaitVSync(int flag) +{ + RE_options.wait_vsync = flag; + return true; +} + +static int ReignEngine_GetOptionAntiAliasing(void) +{ + return RE_options.anti_aliasing; +} + +static int ReignEngine_GetOptionWaitVSync(void) +{ + return RE_options.wait_vsync; +} + +//bool ReignEngine_SetViewport(int plugin, int nX, int nY, int nWidth, int nHeight); + +bool ReignEngine_SetProjection(int plugin, float width, float height, float near, float far, float deg) +{ + return RE_set_projection(get_plugin(plugin), width, height, near, far, deg); +} + +//float ReignEngine_GetBrightness(int plugin); +//bool ReignEngine_SetBrightness(int plugin, float fBrightness); + +static bool ReignEngine_SetRenderMode(int plugin, int mode) +{ + struct RE_plugin *p = get_plugin(plugin); + if (!p) + return false; + p->render_mode = mode; + return true; +} + +static bool ReignEngine_SetShadowMode(int plugin, int mode) +{ + struct RE_plugin *p = get_plugin(plugin); + if (!p) + return false; + p->shadow_mode = mode; + return true; +} + +static bool ReignEngine_SetBumpMode(int plugin, int mode) +{ + struct RE_plugin *p = get_plugin(plugin); + if (!p) + return false; + p->bump_mode = mode; + return true; +} + +//bool ReignEngine_SetHDRMode(int plugin, int nMode); + +static bool ReignEngine_SetVertexBlendMode(int plugin, int mode) +{ + struct RE_plugin *p = get_plugin(plugin); + if (!p) + return false; + p->vertex_blend_mode = mode; + return true; +} + +static bool ReignEngine_SetFogMode(int plugin, int mode) +{ + struct RE_plugin *p = get_plugin(plugin); + if (!p) + return false; + p->fog_mode = mode; + return true; +} + +static bool ReignEngine_SetSpecularMode(int plugin, int mode) +{ + struct RE_plugin *p = get_plugin(plugin); + if (!p) + return false; + p->specular_mode = mode; + return true; +} + +static bool ReignEngine_SetLightMapMode(int plugin, int mode) +{ + struct RE_plugin *p = get_plugin(plugin); + if (!p) + return false; + p->light_map_mode = mode; + return true; +} + +static bool ReignEngine_SetSoftFogEdgeMode(int plugin, int mode) +{ + struct RE_plugin *p = get_plugin(plugin); + if (!p) + return false; + p->soft_fog_edge_mode = mode; + return true; +} + +static bool ReignEngine_SetSSAOMode(int plugin, int mode) +{ + struct RE_plugin *p = get_plugin(plugin); + if (!p) + return false; + p->ssao_mode = mode; + return true; +} + +static bool ReignEngine_SetShaderPrecisionMode(int plugin, int mode) +{ + struct RE_plugin *p = get_plugin(plugin); + if (!p) + return false; + p->shader_precision_mode = mode; + return true; +} + +//bool ReignEngine_SetShaderDebugMode(int plugin, int nMode); + +static int ReignEngine_GetRenderMode(int plugin) +{ + struct RE_plugin *p = get_plugin(plugin); + return p ? p->render_mode : 0; +} + +static int ReignEngine_GetShadowMode(int plugin) +{ + struct RE_plugin *p = get_plugin(plugin); + return p ? p->shadow_mode : 0; +} + +static int ReignEngine_GetBumpMode(int plugin) +{ + struct RE_plugin *p = get_plugin(plugin); + return p ? p->bump_mode : 0; +} + +//int ReignEngine_GetHDRMode(int plugin); + +static int ReignEngine_GetVertexBlendMode(int plugin) +{ + struct RE_plugin *p = get_plugin(plugin); + return p ? p->vertex_blend_mode : 0; +} + +static int ReignEngine_GetFogMode(int plugin) +{ + struct RE_plugin *p = get_plugin(plugin); + return p ? p->fog_mode : 0; +} + +static int ReignEngine_GetSpecularMode(int plugin) +{ + struct RE_plugin *p = get_plugin(plugin); + return p ? p->specular_mode : 0; +} + +static int ReignEngine_GetLightMapMode(int plugin) +{ + struct RE_plugin *p = get_plugin(plugin); + return p ? p->light_map_mode : 0; +} + +static int ReignEngine_GetSoftFogEdgeMode(int plugin) +{ + struct RE_plugin *p = get_plugin(plugin); + return p ? p->soft_fog_edge_mode : 0; +} + +static int ReignEngine_GetSSAOMode(int plugin) +{ + struct RE_plugin *p = get_plugin(plugin); + return p ? p->ssao_mode : 0; +} + +static int ReignEngine_GetShaderPrecisionMode(int plugin) +{ + struct RE_plugin *p = get_plugin(plugin); + return p ? p->shader_precision_mode : 0; +} + +//int ReignEngine_GetShaderDebugMode(int plugin); + +static int ReignEngine_GetTextureResolutionLevel(int plugin) +{ + struct RE_plugin *p = get_plugin(plugin); + return p ? p->texture_resolution_level : 0; +} + +static int ReignEngine_GetTextureFilterMode(int plugin) +{ + struct RE_plugin *p = get_plugin(plugin); + return p ? p->texture_filter_mode : 0; +} + +static bool ReignEngine_SetTextureResolutionLevel(int plugin, int level) +{ + struct RE_plugin *p = get_plugin(plugin); + if (!p) + return false; + p->texture_resolution_level = level; + return true; +} + +static bool ReignEngine_SetTextureFilterMode(int plugin, int mode) +{ + struct RE_plugin *p = get_plugin(plugin); + if (!p) + return false; + p->texture_filter_mode = mode; + return true; +} + +static bool ReignEngine_GetUsePower2Texture(int plugin) +{ + struct RE_plugin *p = get_plugin(plugin); + return p ? p->use_power2_texture : false; +} + +static bool ReignEngine_SetUsePower2Texture(int plugin, bool use) +{ + struct RE_plugin *p = get_plugin(plugin); + if (!p) + return false; + p->use_power2_texture = use; + return true; +} + +static bool ReignEngine_GetGlobalAmbient(int plugin, float *r, float *g, float *b) +{ + struct RE_plugin *p = get_plugin(plugin); + if (!p) + return false; + *r = p->global_ambient_r; + *g = p->global_ambient_g; + *b = p->global_ambient_b; + return true; +} + +static bool ReignEngine_SetGlobalAmbient(int plugin, float r, float g, float b) +{ + struct RE_plugin *p = get_plugin(plugin); + if (!p) + return false; + p->global_ambient_r = r; + p->global_ambient_g = g; + p->global_ambient_b = b; + return true; +} + +static int ReignEngine_GetBloomMode(int plugin) +{ + struct RE_plugin *p = get_plugin(plugin); + return p ? p->bloom_mode : 0; +} + +static bool ReignEngine_SetBloomMode(int plugin, int mode) +{ + struct RE_plugin *p = get_plugin(plugin); + if (!p) + return false; + p->bloom_mode = mode; + return true; +} + +static int ReignEngine_GetGlareMode(int plugin) +{ + struct RE_plugin *p = get_plugin(plugin); + return p ? p->glare_mode : 0; +} + +static bool ReignEngine_SetGlareMode(int plugin, int mode) +{ + struct RE_plugin *p = get_plugin(plugin); + if (!p) + return false; + p->glare_mode = mode; + return true; +} + +static float ReignEngine_GetPostEffectFilterY(int plugin) +{ + struct RE_plugin *p = get_plugin(plugin); + return p ? p->post_effect_filter_y : 0.0; +} + +static float ReignEngine_GetPostEffectFilterCb(int plugin) +{ + struct RE_plugin *p = get_plugin(plugin); + return p ? p->post_effect_filter_cb : 0.0; +} + +static float ReignEngine_GetPostEffectFilterCr(int plugin) +{ + struct RE_plugin *p = get_plugin(plugin); + return p ? p->post_effect_filter_cr : 0.0; +} + +static bool ReignEngine_SetPostEffectFilterY(int plugin, float y) +{ + struct RE_plugin *p = get_plugin(plugin); + if (!p) + return false; + p->post_effect_filter_y = y; + return true; +} + +static bool ReignEngine_SetPostEffectFilterCb(int plugin, float cb) +{ + struct RE_plugin *p = get_plugin(plugin); + if (!p) + return false; + p->post_effect_filter_cb = cb; + return true; +} + +static bool ReignEngine_SetPostEffectFilterCr(int plugin, float cr) +{ + struct RE_plugin *p = get_plugin(plugin); + if (!p) + return false; + p->post_effect_filter_cr = cr; + return true; +} + +//bool ReignEngine_GetBackCGName(int plugin, int num, struct string **pICGName); +//int ReignEngine_GetBackCGNum(int plugin, int num); +//float ReignEngine_GetBackCGBlendRate(int plugin, int num); +//float ReignEngine_GetBackCGDestPosX(int plugin, int num); +//float ReignEngine_GetBackCGDestPosY(int plugin, int num); +//float ReignEngine_GetBackCGMag(int plugin, int num); +//float ReignEngine_GetBackCGQuakeMag(int plugin, int num); +//bool ReignEngine_GetBackCGShow(int plugin, int num); +HLL_WARN_UNIMPLEMENTED(true, bool, ReignEngine, SetBackCGName, int plugin, int num, struct string *pICGName /* e.g. "Data\Texture\cg29501" */); +//bool ReignEngine_SetBackCGNum(int plugin, int num, int nCGNum); +HLL_WARN_UNIMPLEMENTED(false, bool, ReignEngine, SetBackCGBlendRate, int plugin, int num, float blend_rate); +HLL_WARN_UNIMPLEMENTED(true, bool, ReignEngine, SetBackCGDestPos, int plugin, int num, float fX, float fY); +//bool ReignEngine_SetBackCGMag(int plugin, int num, float fMag); +//bool ReignEngine_SetBackCGQuakeMag(int plugin, int num, float fQuakeMag); +HLL_WARN_UNIMPLEMENTED(true, bool, ReignEngine, SetBackCGShow, int plugin, int num, bool bShow); +//float ReignEngine_GetGlareBrightnessParam(int plugin, int index); +HLL_WARN_UNIMPLEMENTED(false, bool, ReignEngine, SetGlareBrightnessParam, int plugin, int index, float param); +//float ReignEngine_GetSSAOParam(int plugin, int type); +HLL_WARN_UNIMPLEMENTED(false, bool, ReignEngine, SetSSAOParam, int plugin, int type, float param); +//bool ReignEngine_CalcIntersectEyeVec(int plugin, int instance, int nMouseX, int nMouseY, float *pfX, float *pfY, float *pfZ); +HLL_WARN_UNIMPLEMENTED(false, bool, ReignEngine, IsLoading, int plugin); +//int ReignEngine_GetDebugInfoMode(int plugin); +//bool ReignEngine_SetDebugInfoMode(int plugin, int nMode); +HLL_WARN_UNIMPLEMENTED(30, int, ReignEngine, GetVertexShaderVersion, void); +HLL_WARN_UNIMPLEMENTED(30, int, ReignEngine, GetPixelShaderVersion, void); +HLL_WARN_UNIMPLEMENTED(false, bool, ReignEngine, SetInstanceSpecularReflectRate, int plugin, int instance, float rate); +HLL_WARN_UNIMPLEMENTED(false, bool, ReignEngine, SetInstanceFresnelReflectRate, int plugin, int instance, float rate); +//float ReignEngine_GetInstanceSpecularReflectRate(int plugin, int instance); +//float ReignEngine_GetInstanceFresnelReflectRate(int plugin, int instance); +//float ReignEngine_StringToFloat(struct string *pIText); +//bool ReignEngine_DrawToMainSurface(int plugin); + +HLL_LIBRARY(ReignEngine, + HLL_EXPORT(CreatePlugin, ReignEngine_CreatePlugin), + HLL_EXPORT(ReleasePlugin, ReignEngine_ReleasePlugin), + HLL_EXPORT(BindPlugin, ReignEngine_BindPlugin), + HLL_EXPORT(UnbindPlugin, ReignEngine_UnbindPlugin), + HLL_EXPORT(BuildModel, ReignEngine_BuildModel), + HLL_EXPORT(CreateInstance, ReignEngine_CreateInstance), + HLL_EXPORT(ReleaseInstance, ReignEngine_ReleaseInstance), + HLL_EXPORT(LoadInstance, ReignEngine_LoadInstance), + HLL_EXPORT(SetInstanceType, ReignEngine_SetInstanceType), + HLL_EXPORT(SetInstancePos, ReignEngine_SetInstancePos), + HLL_EXPORT(SetInstanceVector, ReignEngine_SetInstanceVector), + HLL_EXPORT(SetInstanceAngle, ReignEngine_SetInstanceAngle), + HLL_EXPORT(SetInstanceAngleP, ReignEngine_SetInstanceAngleP), + HLL_EXPORT(SetInstanceAngleB, ReignEngine_SetInstanceAngleB), + HLL_EXPORT(GetInstanceScaleX, ReignEngine_GetInstanceScaleX), + HLL_EXPORT(GetInstanceScaleY, ReignEngine_GetInstanceScaleY), + HLL_EXPORT(GetInstanceScaleZ, ReignEngine_GetInstanceScaleZ), + HLL_EXPORT(SetInstanceScaleX, ReignEngine_SetInstanceScaleX), + HLL_EXPORT(SetInstanceScaleY, ReignEngine_SetInstanceScaleY), + HLL_EXPORT(SetInstanceScaleZ, ReignEngine_SetInstanceScaleZ), + HLL_TODO_EXPORT(SetInstanceZBias, ReignEngine_SetInstanceZBias), + HLL_TODO_EXPORT(GetInstanceZBias, ReignEngine_GetInstanceZBias), + HLL_EXPORT(SetInstanceVertexPos, ReignEngine_SetInstanceVertexPos), + HLL_EXPORT(SetInstanceDiffuse, ReignEngine_SetInstanceDiffuse), + HLL_EXPORT(SetInstanceGlobeDiffuse, ReignEngine_SetInstanceGlobeDiffuse), + HLL_EXPORT(SetInstanceAmbient, ReignEngine_SetInstanceAmbient), + HLL_TODO_EXPORT(SetInstanceSpecular, ReignEngine_SetInstanceSpecular), + HLL_TODO_EXPORT(SetInstanceAlpha, ReignEngine_SetInstanceAlpha), + HLL_TODO_EXPORT(SetInstanceAttenuationNear, ReignEngine_SetInstanceAttenuationNear), + HLL_TODO_EXPORT(SetInstanceAttenuationFar, ReignEngine_SetInstanceAttenuationFar), + HLL_EXPORT(SetInstanceDraw, ReignEngine_SetInstanceDraw), + HLL_EXPORT(SetInstanceDrawShadow, ReignEngine_SetInstanceDrawShadow), + HLL_EXPORT(SetInstanceDrawBackShadow, ReignEngine_SetInstanceDrawBackShadow), + HLL_EXPORT(SetInstanceDrawMakeShadow, ReignEngine_SetInstanceDrawMakeShadow), + HLL_EXPORT(SetInstanceDrawBump, ReignEngine_SetInstanceDrawBump), + HLL_EXPORT(GetInstanceDraw, ReignEngine_GetInstanceDraw), + HLL_TODO_EXPORT(GetInstanceDrawShadow, ReignEngine_GetInstanceDrawShadow), + HLL_TODO_EXPORT(GetInstanceDrawBackShadow, ReignEngine_GetInstanceDrawBackShadow), + HLL_TODO_EXPORT(GetInstanceDrawMakeShadow, ReignEngine_GetInstanceDrawMakeShadow), + HLL_TODO_EXPORT(GetInstanceDrawBump, ReignEngine_GetInstanceDrawBump), + HLL_TODO_EXPORT(GetInstanceDrawType, ReignEngine_GetInstanceDrawType), + HLL_EXPORT(SetInstanceDrawType, ReignEngine_SetInstanceDrawType), + HLL_EXPORT(LoadInstanceMotion, ReignEngine_LoadInstanceMotion), + HLL_EXPORT(GetInstanceMotionState, ReignEngine_GetInstanceMotionState), + HLL_EXPORT(GetInstanceMotionFrame, ReignEngine_GetInstanceMotionFrame), + HLL_EXPORT(SetInstanceMotionState, ReignEngine_SetInstanceMotionState), + HLL_EXPORT(SetInstanceMotionFrame, ReignEngine_SetInstanceMotionFrame), + HLL_EXPORT(SetInstanceMotionFrameRange, ReignEngine_SetInstanceMotionFrameRange), + HLL_EXPORT(SetInstanceMotionLoopFrameRange, ReignEngine_SetInstanceMotionLoopFrameRange), + HLL_EXPORT(LoadInstanceNextMotion, ReignEngine_LoadInstanceNextMotion), + HLL_TODO_EXPORT(SetInstanceNextMotionState, ReignEngine_SetInstanceNextMotionState), + HLL_TODO_EXPORT(SetInstanceNextMotionFrame, ReignEngine_SetInstanceNextMotionFrame), + HLL_EXPORT(SetInstanceNextMotionFrameRange, ReignEngine_SetInstanceNextMotionFrameRange), + HLL_EXPORT(SetInstanceNextMotionLoopFrameRange, ReignEngine_SetInstanceNextMotionLoopFrameRange), + HLL_TODO_EXPORT(SetInstanceMotionBlendRate, ReignEngine_SetInstanceMotionBlendRate), + HLL_TODO_EXPORT(SetInstanceMotionBlend, ReignEngine_SetInstanceMotionBlend), + HLL_EXPORT(IsInstanceMotionBlend, ReignEngine_IsInstanceMotionBlend), + HLL_TODO_EXPORT(GetInstanceMotionBlendPutTime, ReignEngine_GetInstanceMotionBlendPutTime), + HLL_EXPORT(SetInstanceMotionBlendPutTime, ReignEngine_SetInstanceMotionBlendPutTime), + HLL_TODO_EXPORT(SwapInstanceMotion, ReignEngine_SwapInstanceMotion), + HLL_TODO_EXPORT(FreeInstanceNextMotion, ReignEngine_FreeInstanceNextMotion), + HLL_TODO_EXPORT(GetInstanceNumofMaterial, ReignEngine_GetInstanceNumofMaterial), + HLL_TODO_EXPORT(GetInstanceMaterialName, ReignEngine_GetInstanceMaterialName), + HLL_TODO_EXPORT(GetInstanceMaterialParam, ReignEngine_GetInstanceMaterialParam), + HLL_TODO_EXPORT(SetInstanceMaterialParam, ReignEngine_SetInstanceMaterialParam), + HLL_TODO_EXPORT(SaveInstanceAddMaterialData, ReignEngine_SaveInstanceAddMaterialData), + HLL_TODO_EXPORT(SetInstancePointPos, ReignEngine_SetInstancePointPos), + HLL_TODO_EXPORT(GetInstancePointPos, ReignEngine_GetInstancePointPos), + HLL_TODO_EXPORT(GetInstanceColumnPos, ReignEngine_GetInstanceColumnPos), + HLL_TODO_EXPORT(GetInstanceColumnHeight, ReignEngine_GetInstanceColumnHeight), + HLL_TODO_EXPORT(GetInstanceColumnRadius, ReignEngine_GetInstanceColumnRadius), + HLL_TODO_EXPORT(GetInstanceColumnAngle, ReignEngine_GetInstanceColumnAngle), + HLL_TODO_EXPORT(GetInstanceColumnAngleP, ReignEngine_GetInstanceColumnAngleP), + HLL_TODO_EXPORT(GetInstanceColumnAngleB, ReignEngine_GetInstanceColumnAngleB), + HLL_EXPORT(SetInstanceColumnPos, ReignEngine_SetInstanceColumnPos), + HLL_EXPORT(SetInstanceColumnHeight, ReignEngine_SetInstanceColumnHeight), + HLL_EXPORT(SetInstanceColumnRadius, ReignEngine_SetInstanceColumnRadius), + HLL_EXPORT(SetInstanceColumnAngle, ReignEngine_SetInstanceColumnAngle), + HLL_TODO_EXPORT(SetInstanceColumnAngleP, ReignEngine_SetInstanceColumnAngleP), + HLL_TODO_EXPORT(SetInstanceColumnAngleB, ReignEngine_SetInstanceColumnAngleB), + HLL_TODO_EXPORT(GetInstanceDrawColumn, ReignEngine_GetInstanceDrawColumn), + HLL_TODO_EXPORT(SetInstanceDrawColumn, ReignEngine_SetInstanceDrawColumn), + HLL_EXPORT(SetInstanceTarget, ReignEngine_SetInstanceTarget), + HLL_TODO_EXPORT(GetInstanceTarget, ReignEngine_GetInstanceTarget), + HLL_TODO_EXPORT(GetInstanceFPS, ReignEngine_GetInstanceFPS), + HLL_EXPORT(SetInstanceFPS, ReignEngine_SetInstanceFPS), + HLL_EXPORT(GetInstanceBoneIndex, ReignEngine_GetInstanceBoneIndex), + HLL_EXPORT(TransInstanceLocalPosToWorldPosByBone, ReignEngine_TransInstanceLocalPosToWorldPosByBone), + HLL_TODO_EXPORT(GetInstanceNumofPolygon, ReignEngine_GetInstanceNumofPolygon), + HLL_TODO_EXPORT(GetInstanceTextureMemorySize, ReignEngine_GetInstanceTextureMemorySize), + HLL_TODO_EXPORT(GetInstanceInfoText, ReignEngine_GetInstanceInfoText), + HLL_TODO_EXPORT(GetInstanceMaterialInfoText, ReignEngine_GetInstanceMaterialInfoText), + HLL_EXPORT(CalcInstanceHeightDetection, ReignEngine_CalcInstanceHeightDetection), + HLL_TODO_EXPORT(GetInstanceSoftFogEdgeLength, ReignEngine_GetInstanceSoftFogEdgeLength), + HLL_EXPORT(SetInstanceSoftFogEdgeLength, ReignEngine_SetInstanceSoftFogEdgeLength), + HLL_TODO_EXPORT(GetInstanceShadowVolumeBoneRadius, ReignEngine_GetInstanceShadowVolumeBoneRadius), + HLL_EXPORT(SetInstanceShadowVolumeBoneRadius, ReignEngine_SetInstanceShadowVolumeBoneRadius), + HLL_TODO_EXPORT(GetInstanceDebugDrawShadowVolume, ReignEngine_GetInstanceDebugDrawShadowVolume), + HLL_TODO_EXPORT(SetInstanceDebugDrawShadowVolume, ReignEngine_SetInstanceDebugDrawShadowVolume), + HLL_TODO_EXPORT(SaveEffect, ReignEngine_SaveEffect), + HLL_EXPORT(GetEffectFrameRange, ReignEngine_GetEffectFrameRange), + HLL_TODO_EXPORT(GetEffectObjectType, ReignEngine_GetEffectObjectType), + HLL_TODO_EXPORT(GetEffectObjectMoveType, ReignEngine_GetEffectObjectMoveType), + HLL_TODO_EXPORT(GetEffectObjectUpVecType, ReignEngine_GetEffectObjectUpVecType), + HLL_TODO_EXPORT(GetEffectObjectMoveCurve, ReignEngine_GetEffectObjectMoveCurve), + HLL_TODO_EXPORT(GetEffectObjectFrame, ReignEngine_GetEffectObjectFrame), + HLL_TODO_EXPORT(GetEffectObjectStopFrame, ReignEngine_GetEffectObjectStopFrame), + HLL_TODO_EXPORT(GetEffectNumofObject, ReignEngine_GetEffectNumofObject), + HLL_TODO_EXPORT(GetEffectObjectName, ReignEngine_GetEffectObjectName), + HLL_TODO_EXPORT(GetEffectNumofObjectPos, ReignEngine_GetEffectNumofObjectPos), + HLL_TODO_EXPORT(GetEffectNumofObjectPosUnit, ReignEngine_GetEffectNumofObjectPosUnit), + HLL_TODO_EXPORT(GetEffectObjectPosUnitType, ReignEngine_GetEffectObjectPosUnitType), + HLL_TODO_EXPORT(GetEffectObjectPosUnitIndex, ReignEngine_GetEffectObjectPosUnitIndex), + HLL_TODO_EXPORT(GetEffectNumofObjectPosUnitParam, ReignEngine_GetEffectNumofObjectPosUnitParam), + HLL_TODO_EXPORT(GetEffectObjectPosUnitParam, ReignEngine_GetEffectObjectPosUnitParam), + HLL_TODO_EXPORT(GetEffectNumofObjectPosUnitString, ReignEngine_GetEffectNumofObjectPosUnitString), + HLL_TODO_EXPORT(GetEffectObjectPosUnitString, ReignEngine_GetEffectObjectPosUnitString), + HLL_TODO_EXPORT(GetEffectNumofObjectTexture, ReignEngine_GetEffectNumofObjectTexture), + HLL_TODO_EXPORT(GetEffectObjectTexture, ReignEngine_GetEffectObjectTexture), + HLL_TODO_EXPORT(GetEffectObjectSize, ReignEngine_GetEffectObjectSize), + HLL_TODO_EXPORT(GetEffectObjectSize2, ReignEngine_GetEffectObjectSize2), + HLL_TODO_EXPORT(GetEffectObjectSizeX, ReignEngine_GetEffectObjectSizeX), + HLL_TODO_EXPORT(GetEffectObjectSizeY, ReignEngine_GetEffectObjectSizeY), + HLL_TODO_EXPORT(GetEffectObjectSizeType, ReignEngine_GetEffectObjectSizeType), + HLL_TODO_EXPORT(GetEffectObjectSizeXType, ReignEngine_GetEffectObjectSizeXType), + HLL_TODO_EXPORT(GetEffectObjectSizeYType, ReignEngine_GetEffectObjectSizeYType), + HLL_TODO_EXPORT(GetEffectNumofObjectSize2, ReignEngine_GetEffectNumofObjectSize2), + HLL_TODO_EXPORT(GetEffectNumofObjectSizeX, ReignEngine_GetEffectNumofObjectSizeX), + HLL_TODO_EXPORT(GetEffectNumofObjectSizeY, ReignEngine_GetEffectNumofObjectSizeY), + HLL_TODO_EXPORT(GetEffectNumofObjectSizeType, ReignEngine_GetEffectNumofObjectSizeType), + HLL_TODO_EXPORT(GetEffectNumofObjectSizeXType, ReignEngine_GetEffectNumofObjectSizeXType), + HLL_TODO_EXPORT(GetEffectNumofObjectSizeYType, ReignEngine_GetEffectNumofObjectSizeYType), + HLL_TODO_EXPORT(GetEffectObjectBlendType, ReignEngine_GetEffectObjectBlendType), + HLL_TODO_EXPORT(GetEffectObjectPolygonName, ReignEngine_GetEffectObjectPolygonName), + HLL_TODO_EXPORT(GetEffectNumofObjectParticle, ReignEngine_GetEffectNumofObjectParticle), + HLL_TODO_EXPORT(GetEffectObjectAlphaFadeInTime, ReignEngine_GetEffectObjectAlphaFadeInTime), + HLL_TODO_EXPORT(GetEffectObjectAlphaFadeOutTime, ReignEngine_GetEffectObjectAlphaFadeOutTime), + HLL_TODO_EXPORT(GetEffectObjectTextureAnimeTime, ReignEngine_GetEffectObjectTextureAnimeTime), + HLL_TODO_EXPORT(GetEffectObjectAlphaFadeInFrame, ReignEngine_GetEffectObjectAlphaFadeInFrame), + HLL_TODO_EXPORT(GetEffectObjectAlphaFadeOutFrame, ReignEngine_GetEffectObjectAlphaFadeOutFrame), + HLL_TODO_EXPORT(GetEffectObjectTextureAnimeFrame, ReignEngine_GetEffectObjectTextureAnimeFrame), + HLL_TODO_EXPORT(GetEffectObjectFrameReferenceType, ReignEngine_GetEffectObjectFrameReferenceType), + HLL_TODO_EXPORT(GetEffectObjectFrameReferenceParam, ReignEngine_GetEffectObjectFrameReferenceParam), + HLL_TODO_EXPORT(GetEffectObjectXRotationAngle, ReignEngine_GetEffectObjectXRotationAngle), + HLL_TODO_EXPORT(GetEffectObjectYRotationAngle, ReignEngine_GetEffectObjectYRotationAngle), + HLL_TODO_EXPORT(GetEffectObjectZRotationAngle, ReignEngine_GetEffectObjectZRotationAngle), + HLL_TODO_EXPORT(GetEffectObjectXRevolutionAngle, ReignEngine_GetEffectObjectXRevolutionAngle), + HLL_TODO_EXPORT(GetEffectObjectXRevolutionDistance, ReignEngine_GetEffectObjectXRevolutionDistance), + HLL_TODO_EXPORT(GetEffectObjectYRevolutionAngle, ReignEngine_GetEffectObjectYRevolutionAngle), + HLL_TODO_EXPORT(GetEffectObjectYRevolutionDistance, ReignEngine_GetEffectObjectYRevolutionDistance), + HLL_TODO_EXPORT(GetEffectObjectZRevolutionAngle, ReignEngine_GetEffectObjectZRevolutionAngle), + HLL_TODO_EXPORT(GetEffectObjectZRevolutionDistance, ReignEngine_GetEffectObjectZRevolutionDistance), + HLL_TODO_EXPORT(AddEffectObject, ReignEngine_AddEffectObject), + HLL_TODO_EXPORT(DeleteEffectObject, ReignEngine_DeleteEffectObject), + HLL_TODO_EXPORT(SetEffectObjectName, ReignEngine_SetEffectObjectName), + HLL_TODO_EXPORT(SetEffectObjectType, ReignEngine_SetEffectObjectType), + HLL_TODO_EXPORT(SetEffectObjectMoveType, ReignEngine_SetEffectObjectMoveType), + HLL_TODO_EXPORT(SetEffectObjectUpVecType, ReignEngine_SetEffectObjectUpVecType), + HLL_TODO_EXPORT(SetEffectObjectMoveCurve, ReignEngine_SetEffectObjectMoveCurve), + HLL_TODO_EXPORT(SetEffectObjectFrame, ReignEngine_SetEffectObjectFrame), + HLL_TODO_EXPORT(SetEffectObjectStopFrame, ReignEngine_SetEffectObjectStopFrame), + HLL_TODO_EXPORT(SetEffectObjectPosUnitType, ReignEngine_SetEffectObjectPosUnitType), + HLL_TODO_EXPORT(SetEffectObjectPosUnitIndex, ReignEngine_SetEffectObjectPosUnitIndex), + HLL_TODO_EXPORT(SetEffectObjectPosUnitParam, ReignEngine_SetEffectObjectPosUnitParam), + HLL_TODO_EXPORT(SetEffectObjectPosUnitString, ReignEngine_SetEffectObjectPosUnitString), + HLL_TODO_EXPORT(SetEffectObjectTexture, ReignEngine_SetEffectObjectTexture), + HLL_TODO_EXPORT(SetEffectObjectSize, ReignEngine_SetEffectObjectSize), + HLL_TODO_EXPORT(SetEffectObjectSize2, ReignEngine_SetEffectObjectSize2), + HLL_TODO_EXPORT(SetEffectObjectSizeX, ReignEngine_SetEffectObjectSizeX), + HLL_TODO_EXPORT(SetEffectObjectSizeY, ReignEngine_SetEffectObjectSizeY), + HLL_TODO_EXPORT(SetEffectObjectSizeType, ReignEngine_SetEffectObjectSizeType), + HLL_TODO_EXPORT(SetEffectObjectSizeXType, ReignEngine_SetEffectObjectSizeXType), + HLL_TODO_EXPORT(SetEffectObjectSizeYType, ReignEngine_SetEffectObjectSizeYType), + HLL_TODO_EXPORT(SetEffectObjectBlendType, ReignEngine_SetEffectObjectBlendType), + HLL_TODO_EXPORT(SetEffectObjectPolygonName, ReignEngine_SetEffectObjectPolygonName), + HLL_TODO_EXPORT(SetEffectNumofObjectParticle, ReignEngine_SetEffectNumofObjectParticle), + HLL_TODO_EXPORT(SetEffectObjectAlphaFadeInTime, ReignEngine_SetEffectObjectAlphaFadeInTime), + HLL_TODO_EXPORT(SetEffectObjectAlphaFadeOutTime, ReignEngine_SetEffectObjectAlphaFadeOutTime), + HLL_TODO_EXPORT(SetEffectObjectTextureAnimeTime, ReignEngine_SetEffectObjectTextureAnimeTime), + HLL_TODO_EXPORT(SetEffectObjectAlphaFadeInFrame, ReignEngine_SetEffectObjectAlphaFadeInFrame), + HLL_TODO_EXPORT(SetEffectObjectAlphaFadeOutFrame, ReignEngine_SetEffectObjectAlphaFadeOutFrame), + HLL_TODO_EXPORT(SetEffectObjectTextureAnimeFrame, ReignEngine_SetEffectObjectTextureAnimeFrame), + HLL_TODO_EXPORT(SetEffectObjectFrameReferenceType, ReignEngine_SetEffectObjectFrameReferenceType), + HLL_TODO_EXPORT(SetEffectObjectFrameReferenceParam, ReignEngine_SetEffectObjectFrameReferenceParam), + HLL_TODO_EXPORT(SetEffectObjectXRotationAngle, ReignEngine_SetEffectObjectXRotationAngle), + HLL_TODO_EXPORT(SetEffectObjectYRotationAngle, ReignEngine_SetEffectObjectYRotationAngle), + HLL_TODO_EXPORT(SetEffectObjectZRotationAngle, ReignEngine_SetEffectObjectZRotationAngle), + HLL_TODO_EXPORT(SetEffectObjectXRevolutionAngle, ReignEngine_SetEffectObjectXRevolutionAngle), + HLL_TODO_EXPORT(SetEffectObjectXRevolutionDistance, ReignEngine_SetEffectObjectXRevolutionDistance), + HLL_TODO_EXPORT(SetEffectObjectYRevolutionAngle, ReignEngine_SetEffectObjectYRevolutionAngle), + HLL_TODO_EXPORT(SetEffectObjectYRevolutionDistance, ReignEngine_SetEffectObjectYRevolutionDistance), + HLL_TODO_EXPORT(SetEffectObjectZRevolutionAngle, ReignEngine_SetEffectObjectZRevolutionAngle), + HLL_TODO_EXPORT(SetEffectObjectZRevolutionDistance, ReignEngine_SetEffectObjectZRevolutionDistance), + HLL_TODO_EXPORT(GetEffectObjectCurveLength, ReignEngine_GetEffectObjectCurveLength), + HLL_TODO_EXPORT(SetEffectObjectCurveLength, ReignEngine_SetEffectObjectCurveLength), + HLL_TODO_EXPORT(GetEffectObjectChildFrame, ReignEngine_GetEffectObjectChildFrame), + HLL_TODO_EXPORT(GetEffectObjectChildLength, ReignEngine_GetEffectObjectChildLength), + HLL_TODO_EXPORT(GetEffectObjectChildBeginSlope, ReignEngine_GetEffectObjectChildBeginSlope), + HLL_TODO_EXPORT(GetEffectObjectChildEndSlope, ReignEngine_GetEffectObjectChildEndSlope), + HLL_TODO_EXPORT(GetEffectObjectChildCreateBeginFrame, ReignEngine_GetEffectObjectChildCreateBeginFrame), + HLL_TODO_EXPORT(GetEffectObjectChildCreateEndFrame, ReignEngine_GetEffectObjectChildCreateEndFrame), + HLL_TODO_EXPORT(GetEffectObjectChildMoveDirType, ReignEngine_GetEffectObjectChildMoveDirType), + HLL_TODO_EXPORT(SetEffectObjectChildFrame, ReignEngine_SetEffectObjectChildFrame), + HLL_TODO_EXPORT(SetEffectObjectChildLength, ReignEngine_SetEffectObjectChildLength), + HLL_TODO_EXPORT(SetEffectObjectChildBeginSlope, ReignEngine_SetEffectObjectChildBeginSlope), + HLL_TODO_EXPORT(SetEffectObjectChildEndSlope, ReignEngine_SetEffectObjectChildEndSlope), + HLL_TODO_EXPORT(SetEffectObjectChildCreateBeginFrame, ReignEngine_SetEffectObjectChildCreateBeginFrame), + HLL_TODO_EXPORT(SetEffectObjectChildCreateEndFrame, ReignEngine_SetEffectObjectChildCreateEndFrame), + HLL_TODO_EXPORT(SetEffectObjectChildMoveDirType, ReignEngine_SetEffectObjectChildMoveDirType), + HLL_TODO_EXPORT(GetEffectObjectDirType, ReignEngine_GetEffectObjectDirType), + HLL_TODO_EXPORT(SetEffectObjectDirType, ReignEngine_SetEffectObjectDirType), + HLL_TODO_EXPORT(GetEffectNumofObjectDamage, ReignEngine_GetEffectNumofObjectDamage), + HLL_TODO_EXPORT(GetEffectObjectDamage, ReignEngine_GetEffectObjectDamage), + HLL_TODO_EXPORT(SetEffectObjectDamage, ReignEngine_SetEffectObjectDamage), + HLL_TODO_EXPORT(GetEffectObjectDraw, ReignEngine_GetEffectObjectDraw), + HLL_TODO_EXPORT(SetEffectObjectDraw, ReignEngine_SetEffectObjectDraw), + HLL_TODO_EXPORT(GetEffectObjectOffsetX, ReignEngine_GetEffectObjectOffsetX), + HLL_TODO_EXPORT(GetEffectObjectOffsetY, ReignEngine_GetEffectObjectOffsetY), + HLL_TODO_EXPORT(SetEffectObjectOffsetX, ReignEngine_SetEffectObjectOffsetX), + HLL_TODO_EXPORT(SetEffectObjectOffsetY, ReignEngine_SetEffectObjectOffsetY), + HLL_TODO_EXPORT(GetCameraQuakeEffectFlag, ReignEngine_GetCameraQuakeEffectFlag), + HLL_TODO_EXPORT(SetCameraQuakeEffectFlag, ReignEngine_SetCameraQuakeEffectFlag), + HLL_EXPORT(SetCameraPos, ReignEngine_SetCameraPos), + HLL_EXPORT(SetCameraAngle, ReignEngine_SetCameraAngle), + HLL_EXPORT(SetCameraAngleP, ReignEngine_SetCameraAngleP), + HLL_EXPORT(SetCameraAngleB, ReignEngine_SetCameraAngleB), + HLL_TODO_EXPORT(GetShadowBias, ReignEngine_GetShadowBias), + HLL_TODO_EXPORT(GetShadowTargetDistance, ReignEngine_GetShadowTargetDistance), + HLL_EXPORT(GetShadowMapResolutionLevel, ReignEngine_GetShadowMapResolutionLevel), + HLL_TODO_EXPORT(GetShadowSplitDepth, ReignEngine_GetShadowSplitDepth), + HLL_EXPORT(SetShadowMapType, ReignEngine_SetShadowMapType), + HLL_EXPORT(SetShadowMapLightLookPos, ReignEngine_SetShadowMapLightLookPos), + HLL_EXPORT(SetShadowMapLightDir, ReignEngine_SetShadowMapLightDir), + HLL_EXPORT(SetShadowBox, ReignEngine_SetShadowBox), + HLL_EXPORT(SetShadowBias, ReignEngine_SetShadowBias), + HLL_TODO_EXPORT(SetShadowSlopeBias, ReignEngine_SetShadowSlopeBias), + HLL_TODO_EXPORT(SetShadowFilterMag, ReignEngine_SetShadowFilterMag), + HLL_TODO_EXPORT(SetShadowTargetDistance, ReignEngine_SetShadowTargetDistance), + HLL_EXPORT(SetShadowMapResolutionLevel, ReignEngine_SetShadowMapResolutionLevel), + HLL_TODO_EXPORT(SetShadowSplitDepth, ReignEngine_SetShadowSplitDepth), + HLL_EXPORT(SetFogType, ReignEngine_SetFogType), + HLL_EXPORT(SetFogNear, ReignEngine_SetFogNear), + HLL_EXPORT(SetFogFar, ReignEngine_SetFogFar), + HLL_EXPORT(SetFogColor, ReignEngine_SetFogColor), + HLL_TODO_EXPORT(GetFogType, ReignEngine_GetFogType), + HLL_TODO_EXPORT(GetFogNear, ReignEngine_GetFogNear), + HLL_TODO_EXPORT(GetFogFar, ReignEngine_GetFogFar), + HLL_TODO_EXPORT(GetFogColor, ReignEngine_GetFogColor), + HLL_EXPORT(LoadLightScatteringSetting, ReignEngine_LoadLightScatteringSetting), + HLL_TODO_EXPORT(GetLSBetaR, ReignEngine_GetLSBetaR), + HLL_TODO_EXPORT(GetLSBetaM, ReignEngine_GetLSBetaM), + HLL_TODO_EXPORT(GetLSG, ReignEngine_GetLSG), + HLL_TODO_EXPORT(GetLSDistance, ReignEngine_GetLSDistance), + HLL_TODO_EXPORT(GetLSLightDir, ReignEngine_GetLSLightDir), + HLL_TODO_EXPORT(GetLSLightColor, ReignEngine_GetLSLightColor), + HLL_TODO_EXPORT(GetLSSunColor, ReignEngine_GetLSSunColor), + HLL_EXPORT(SetLSBetaR, ReignEngine_SetLSBetaR), + HLL_EXPORT(SetLSBetaM, ReignEngine_SetLSBetaM), + HLL_EXPORT(SetLSG, ReignEngine_SetLSG), + HLL_EXPORT(SetLSDistance, ReignEngine_SetLSDistance), + HLL_EXPORT(SetLSLightDir, ReignEngine_SetLSLightDir), + HLL_EXPORT(SetLSLightColor, ReignEngine_SetLSLightColor), + HLL_EXPORT(SetLSSunColor, ReignEngine_SetLSSunColor), + HLL_TODO_EXPORT(SetDrawTextureFog, ReignEngine_SetDrawTextureFog), + HLL_TODO_EXPORT(GetDrawTextureFog, ReignEngine_GetDrawTextureFog), + HLL_EXPORT(SetOptionAntiAliasing, ReignEngine_SetOptionAntiAliasing), + HLL_EXPORT(SetOptionWaitVSync, ReignEngine_SetOptionWaitVSync), + HLL_EXPORT(GetOptionAntiAliasing, ReignEngine_GetOptionAntiAliasing), + HLL_EXPORT(GetOptionWaitVSync, ReignEngine_GetOptionWaitVSync), + HLL_TODO_EXPORT(SetViewport, ReignEngine_SetViewport), + HLL_EXPORT(SetProjection, ReignEngine_SetProjection), + HLL_TODO_EXPORT(GetBrightness, ReignEngine_GetBrightness), + HLL_TODO_EXPORT(SetBrightness, ReignEngine_SetBrightness), + HLL_EXPORT(SetRenderMode, ReignEngine_SetRenderMode), + HLL_EXPORT(SetShadowMode, ReignEngine_SetShadowMode), + HLL_EXPORT(SetBumpMode, ReignEngine_SetBumpMode), + HLL_TODO_EXPORT(SetHDRMode, ReignEngine_SetHDRMode), + HLL_EXPORT(SetVertexBlendMode, ReignEngine_SetVertexBlendMode), + HLL_EXPORT(SetFogMode, ReignEngine_SetFogMode), + HLL_EXPORT(SetSpecularMode, ReignEngine_SetSpecularMode), + HLL_EXPORT(SetLightMapMode, ReignEngine_SetLightMapMode), + HLL_EXPORT(SetSoftFogEdgeMode, ReignEngine_SetSoftFogEdgeMode), + HLL_EXPORT(SetSSAOMode, ReignEngine_SetSSAOMode), + HLL_EXPORT(SetShaderPrecisionMode, ReignEngine_SetShaderPrecisionMode), + HLL_TODO_EXPORT(SetShaderDebugMode, ReignEngine_SetShaderDebugMode), + HLL_EXPORT(GetRenderMode, ReignEngine_GetRenderMode), + HLL_EXPORT(GetShadowMode, ReignEngine_GetShadowMode), + HLL_EXPORT(GetBumpMode, ReignEngine_GetBumpMode), + HLL_TODO_EXPORT(GetHDRMode, ReignEngine_GetHDRMode), + HLL_EXPORT(GetVertexBlendMode, ReignEngine_GetVertexBlendMode), + HLL_EXPORT(GetFogMode, ReignEngine_GetFogMode), + HLL_EXPORT(GetSpecularMode, ReignEngine_GetSpecularMode), + HLL_EXPORT(GetLightMapMode, ReignEngine_GetLightMapMode), + HLL_EXPORT(GetSoftFogEdgeMode, ReignEngine_GetSoftFogEdgeMode), + HLL_EXPORT(GetSSAOMode, ReignEngine_GetSSAOMode), + HLL_EXPORT(GetShaderPrecisionMode, ReignEngine_GetShaderPrecisionMode), + HLL_TODO_EXPORT(GetShaderDebugMode, ReignEngine_GetShaderDebugMode), + HLL_EXPORT(GetTextureResolutionLevel, ReignEngine_GetTextureResolutionLevel), + HLL_EXPORT(GetTextureFilterMode, ReignEngine_GetTextureFilterMode), + HLL_EXPORT(SetTextureResolutionLevel, ReignEngine_SetTextureResolutionLevel), + HLL_EXPORT(SetTextureFilterMode, ReignEngine_SetTextureFilterMode), + HLL_EXPORT(GetUsePower2Texture, ReignEngine_GetUsePower2Texture), + HLL_EXPORT(SetUsePower2Texture, ReignEngine_SetUsePower2Texture), + HLL_EXPORT(GetGlobalAmbient, ReignEngine_GetGlobalAmbient), + HLL_EXPORT(SetGlobalAmbient, ReignEngine_SetGlobalAmbient), + HLL_EXPORT(GetBloomMode, ReignEngine_GetBloomMode), + HLL_EXPORT(SetBloomMode, ReignEngine_SetBloomMode), + HLL_EXPORT(GetGlareMode, ReignEngine_GetGlareMode), + HLL_EXPORT(SetGlareMode, ReignEngine_SetGlareMode), + HLL_EXPORT(GetPostEffectFilterY, ReignEngine_GetPostEffectFilterY), + HLL_EXPORT(GetPostEffectFilterCb, ReignEngine_GetPostEffectFilterCb), + HLL_EXPORT(GetPostEffectFilterCr, ReignEngine_GetPostEffectFilterCr), + HLL_EXPORT(SetPostEffectFilterY, ReignEngine_SetPostEffectFilterY), + HLL_EXPORT(SetPostEffectFilterCb, ReignEngine_SetPostEffectFilterCb), + HLL_EXPORT(SetPostEffectFilterCr, ReignEngine_SetPostEffectFilterCr), + HLL_TODO_EXPORT(GetBackCGName, ReignEngine_GetBackCGName), + HLL_TODO_EXPORT(GetBackCGNum, ReignEngine_GetBackCGNum), + HLL_TODO_EXPORT(GetBackCGBlendRate, ReignEngine_GetBackCGBlendRate), + HLL_TODO_EXPORT(GetBackCGDestPosX, ReignEngine_GetBackCGDestPosX), + HLL_TODO_EXPORT(GetBackCGDestPosY, ReignEngine_GetBackCGDestPosY), + HLL_TODO_EXPORT(GetBackCGMag, ReignEngine_GetBackCGMag), + HLL_TODO_EXPORT(GetBackCGQuakeMag, ReignEngine_GetBackCGQuakeMag), + HLL_TODO_EXPORT(GetBackCGShow, ReignEngine_GetBackCGShow), + HLL_EXPORT(SetBackCGName, ReignEngine_SetBackCGName), + HLL_TODO_EXPORT(SetBackCGNum, ReignEngine_SetBackCGNum), + HLL_EXPORT(SetBackCGBlendRate, ReignEngine_SetBackCGBlendRate), + HLL_EXPORT(SetBackCGDestPos, ReignEngine_SetBackCGDestPos), + HLL_TODO_EXPORT(SetBackCGMag, ReignEngine_SetBackCGMag), + HLL_TODO_EXPORT(SetBackCGQuakeMag, ReignEngine_SetBackCGQuakeMag), + HLL_EXPORT(SetBackCGShow, ReignEngine_SetBackCGShow), + HLL_TODO_EXPORT(GetGlareBrightnessParam, ReignEngine_GetGlareBrightnessParam), + HLL_EXPORT(SetGlareBrightnessParam, ReignEngine_SetGlareBrightnessParam), + HLL_TODO_EXPORT(GetSSAOParam, ReignEngine_GetSSAOParam), + HLL_EXPORT(SetSSAOParam, ReignEngine_SetSSAOParam), + HLL_TODO_EXPORT(CalcIntersectEyeVec, ReignEngine_CalcIntersectEyeVec), + HLL_EXPORT(IsLoading, ReignEngine_IsLoading), + HLL_TODO_EXPORT(GetDebugInfoMode, ReignEngine_GetDebugInfoMode), + HLL_TODO_EXPORT(SetDebugInfoMode, ReignEngine_SetDebugInfoMode), + HLL_EXPORT(GetVertexShaderVersion, ReignEngine_GetVertexShaderVersion), + HLL_EXPORT(GetPixelShaderVersion, ReignEngine_GetPixelShaderVersion), + HLL_EXPORT(SetInstanceSpecularReflectRate, ReignEngine_SetInstanceSpecularReflectRate), + HLL_EXPORT(SetInstanceFresnelReflectRate, ReignEngine_SetInstanceFresnelReflectRate), + HLL_TODO_EXPORT(GetInstanceSpecularReflectRate, ReignEngine_GetInstanceSpecularReflectRate), + HLL_TODO_EXPORT(GetInstanceFresnelReflectRate, ReignEngine_GetInstanceFresnelReflectRate), + HLL_TODO_EXPORT(StringToFloat, ReignEngine_StringToFloat), + HLL_TODO_EXPORT(DrawToMainSurface, ReignEngine_DrawToMainSurface) + ); diff --git a/src/meson.build b/src/meson.build index fd0792c..798fd01 100644 --- a/src/meson.build +++ b/src/meson.build @@ -31,6 +31,11 @@ xsystem4 = [version_h, 'video.c', 'vm.c', + '3d/model.c', + '3d/parser.c', + '3d/reign.c', + '3d/renderer.c', + 'dungeon/dgn.c', 'dungeon/dtx.c', 'dungeon/dungeon.c', @@ -98,6 +103,7 @@ xsystem4 = [version_h, 'hll/PassRegister.c', 'hll/PlayDemo.c', 'hll/PlayMovie.c', + 'hll/ReignEngine.c', 'hll/SACT2.c', 'hll/SengokuRanceFont.c', 'hll/SoundFilePlayer.c', diff --git a/src/sprite.c b/src/sprite.c index 3a914c2..15d4882 100644 --- a/src/sprite.c +++ b/src/sprite.c @@ -338,7 +338,7 @@ void sprite_call_plugins(void) { struct sact_sprite *sp; LIST_FOREACH(sp, &sprites_with_plugins, entry) { - sp->plugin->update(sp->plugin); + sp->plugin->update(sp); } } diff --git a/subprojects/libsys4 b/subprojects/libsys4 index 965d89e..3797afa 160000 --- a/subprojects/libsys4 +++ b/subprojects/libsys4 @@ -1 +1 @@ -Subproject commit 965d89e1c1095b4d8a0409a0f4fed55aa8799a18 +Subproject commit 3797afa47d101f3ef3c85ff6b8788760b8a019e0