Skip to content

Commit

Permalink
Merge pull request #2 from gameware/fix/update-to-latest-from-source
Browse files Browse the repository at this point in the history
Fix/update to latest from stingray source (1.6)
  • Loading branch information
engelbd authored and GitHub Enterprise committed Oct 28, 2016
2 parents fbe33f0 + 0e624f2 commit 97f3bf7
Show file tree
Hide file tree
Showing 15 changed files with 103 additions and 74 deletions.
70 changes: 35 additions & 35 deletions engine_plugins/render_plugin/render_plugin_sample/helpers.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions stingray_sdk/engine_plugin_api/c_api/c_api_application.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ struct ApplicationCApi

const char* (*build) ();
const char* (*platform) ();
const char* (*source_platform) ();
const char* (*build_identifier) ();
const char* (*sysinfo) ();
ConstConfigRootPtr (*settings_root) ();
Expand All @@ -38,4 +37,3 @@ struct ApplicationCApi
#ifdef __cplusplus
}
#endif

2 changes: 2 additions & 0 deletions stingray_sdk/engine_plugin_api/c_api/c_api_camera.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ struct CameraCApi

enum CameraMode (*mode)(ConstCameraPtr);
void (*set_mode)(CameraPtr, enum CameraMode);

void (*set_local)(CameraPtr, ConstMatrix4x4Ptr m, unsigned);
};

#ifdef __cplusplus
Expand Down
3 changes: 2 additions & 1 deletion stingray_sdk/engine_plugin_api/c_api/c_api_entity.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "c_api_types.h"
#include "entity_components/c_api_data_component.h"
#include "entity_components/c_api_render_data_component.h"
#include "entity_components/c_api_debug_name_component.h"
#include "entity_components/c_api_tag_component.h"
#include "entity_components/c_api_animation_state_machine_component.h"
Expand All @@ -21,7 +22,7 @@ struct EntityManagerApi
void (*destroy) (EntityRef);
int (*is_alive) (EntityRef);
void (*set_debug_name) (EntityRef, const char*);
EntityRef (*spawn) (WorldPtr, uint64_t entity_name, ConstMatrix4x4Ptr transform);
EntityRef (*spawn) (WorldPtr, uint64_t entity_name_id64, const char *optional_debug_entity_name, ConstMatrix4x4Ptr transform);
};

struct EntityCApi
Expand Down
2 changes: 1 addition & 1 deletion stingray_sdk/engine_plugin_api/c_api/c_api_line_object.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ struct LineObjectCApi
void (*add_axes) (LineObjectPtr, ConstMatrix4x4Ptr pose, float length);

/* Not available in Release builds. If camera_direction is supplied, back-facing triangles will get culled. */
void (*add_unit_meshes) (LineObjectPtr, uint64_t unit_id64, ConstVector4Ptr color, ConstMatrix4x4Ptr pose, ConstVector3Ptr optional_camera_direction);
void (*add_unit_meshes) (LineObjectPtr, uint64_t unit_resource_name_id64, const char *optional_debug_unit_resource_name, ConstVector4Ptr color, ConstMatrix4x4Ptr pose, ConstVector3Ptr optional_camera_direction);
};

#ifdef __cplusplus
Expand Down
2 changes: 1 addition & 1 deletion stingray_sdk/engine_plugin_api/c_api/c_api_material.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ struct MaterialCApi

unsigned (*material_id) (ConstMaterialPtr);
void (*set_shader_pass_flag) (MaterialPtr, unsigned flag_name_id32, int enabled);
void (*set_texture) (MaterialPtr, unsigned slot_name_id32, uint64_t texture_resource);
void (*set_texture) (MaterialPtr, unsigned slot_name_id32, uint64_t texture_resource_name_id64, const char *optional_debug_texture_resource_name);
void (*set_resource) (MaterialPtr, unsigned slot_name_id32, ConstRenderResourcePtr);
void (*set_matrix4x4) (MaterialPtr, unsigned variable_name_id32, ConstMatrix4x4Ptr);
};
Expand Down
6 changes: 6 additions & 0 deletions stingray_sdk/engine_plugin_api/c_api/c_api_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ extern "C" {
typedef void* AnimationStateMachineComponentPtr;
typedef void* DebugNameComponentPtr;
typedef void* DataComponentPtr;
typedef void* RenderDataComponentPtr;
typedef void* TagComponentPtr;
typedef void* ComponentPtr;
typedef CApiPhysicsWorld* PhysicsWorldPtr;
Expand Down Expand Up @@ -130,6 +131,11 @@ extern "C" {
unsigned num_states;
};

struct AnimationLayerSeeds {
unsigned seeds[32];
unsigned num_seeds;
};

struct AnimationLayerInfo {
float length;
double t;
Expand Down
9 changes: 6 additions & 3 deletions stingray_sdk/engine_plugin_api/c_api/c_api_unit.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ struct UnitCApi
void* (*flow_variable) (UnitRef, unsigned variable_name_id32);
void (*set_flow_variable) (UnitRef, unsigned variable_name_id32, void* value);

uint64_t (*set_material) (UnitRef, unsigned slot_name_id32, uint64_t material_resource);
uint64_t (*set_material) (UnitRef, unsigned slot_name_id32, uint64_t material_resource_name_id64, const char *optional_debug_material_resource_name);
uint64_t (*set_material_to_none) (UnitRef, unsigned slot_name_id32);

unsigned (*num_meshes) (UnitRef);
Expand All @@ -80,14 +80,14 @@ struct UnitCApi
void (*animation_set_constraint_target_position) (UnitRef, unsigned index, ConstVector3Ptr);
void (*animation_set_constraint_target_rotation) (UnitRef, unsigned index, ConstQuaternionPtr);

unsigned (*crossfade_animation) (UnitRef, uint64_t animation_name, unsigned layer, float blend_time, int should_loop, enum AnimationBlendType);
unsigned (*crossfade_animation) (UnitRef, uint64_t animation_name_id64, const char *optional_debug_animation_name, unsigned layer, float blend_time, int should_loop, enum AnimationBlendType);
unsigned (*is_crossfading_animation) (UnitRef);
void (*crossfade_animation_set_time) (UnitRef, unsigned id, float time, int should_cap_to_range);
void (*crossfade_animation_set_speed) (UnitRef, unsigned id, float speed);

void (*disable_state_machine) (UnitRef);
void (*enable_state_machine) (UnitRef);
void (*set_state_machine) (UnitRef, uint64_t state_machine_name);
void (*set_state_machine) (UnitRef, uint64_t machine_name_id64, const char *optional_debug_machine_name);
int (*has_state_machine) (UnitRef);
int (*has_event) (UnitRef, unsigned event_name_id32);

Expand All @@ -101,6 +101,9 @@ struct UnitCApi
void (*animation_set_state) (UnitRef, struct AnimationStates*);
struct AnimationStates (*animation_get_state) (UnitRef);

void(*animation_set_seeds) (UnitRef, struct AnimationLayerSeeds*);
struct AnimationLayerSeeds(*animation_get_seeds) (UnitRef);

struct AnimationLayerInfo (*animation_layer_info) (UnitRef, unsigned index);
void (*set_merge_options) (UnitRef, float max_start_time, float max_drift, float clock_fidelity);

Expand Down
12 changes: 6 additions & 6 deletions stingray_sdk/engine_plugin_api/c_api/c_api_world.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ enum WorldCApi_OrphanedParticlePolicy

struct WorldCApi
{
UnitRef (*spawn_unit) (WorldPtr world_pointer, uint64_t unit_name, ConstMatrix4x4Ptr transform);
UnitRef (*spawn_unit) (WorldPtr world_pointer, uint64_t unit_name_id64, const char *optional_debug_unit_name, ConstMatrix4x4Ptr transform);
void (*destroy_unit) (WorldPtr world_pointer, UnitRef unit_ref);
unsigned (*num_units) (ConstWorldPtr world_pointer);

Expand All @@ -30,7 +30,7 @@ struct WorldCApi
void (*link_unit) (WorldPtr world_pointer, UnitRef child, unsigned child_node_index, UnitRef parent, unsigned parent_node_index);
void (*unlink_unit) (WorldPtr world_pointer, UnitRef child);
void (*update_unit) (WorldPtr world_pointer, UnitRef unit_ref);
ParticleRef (*create_particles) (WorldPtr world_pointer, uint64_t effect_name, ConstMatrix4x4Ptr transform);
ParticleRef (*create_particles) (WorldPtr world_pointer, uint64_t name_id64, const char *optional_debug_name, ConstMatrix4x4Ptr transform);
void (*destroy_particles) (WorldPtr world_pointer, ParticleRef id);
void (*stop_spawning_particles) (WorldPtr world_pointer, ParticleRef id);
int (*are_particles_playing) (ConstWorldPtr world_pointer, ParticleRef id);
Expand All @@ -39,10 +39,10 @@ struct WorldCApi
void (*move_particles) (WorldPtr world_pointer, ParticleRef id, ConstMatrix4x4Ptr transform);
void (*link_particles) (WorldPtr world_pointer, ParticleRef id, UnitRef unit_ref, unsigned unit_node_index, ConstMatrix4x4Ptr local_pose, enum WorldCApi_OrphanedParticlePolicy orphaned_policy);

unsigned (*find_particles_variable) (ConstWorldPtr world_pointer, uint64_t effect_name, unsigned variable_name_id32);
unsigned (*find_particles_variable) (ConstWorldPtr world_pointer, uint64_t name_id64, const char *optional_debug_name, unsigned variable_name_id32);
void (*set_particles_variable) (WorldPtr world_pointer, ParticleRef id, unsigned variable, ConstVector3Ptr value);

LevelPtr (*load_level) (WorldPtr world_pointer, uint64_t level_name_id64, ConstMatrix4x4Ptr transform, uint64_t optional_level_id);
LevelPtr (*load_level) (WorldPtr world_pointer, uint64_t level_name_id64, const char *optional_debug_level_name, ConstMatrix4x4Ptr transform, uint64_t optional_level_id);
void (*destroy_level) (WorldPtr world_pointer, LevelPtr level_pointer);
unsigned (*num_levels) (ConstWorldPtr world_pointer);
LevelPtr (*level) (WorldPtr world_pointer, unsigned index);
Expand All @@ -58,10 +58,10 @@ struct WorldCApi
VectorFieldPtr (*vector_field) (WorldPtr world_pointer, unsigned vector_field_name_id32);
ScatterSystemPtr (*scatter_system) (WorldPtr world_pointer);

ShadingEnvironmentPtr (*create_shading_environment) (WorldPtr world_pointer, uint64_t name_id64);
ShadingEnvironmentPtr (*create_shading_environment) (WorldPtr world_pointer, uint64_t name_id64, const char *optional_debug_name);
ShadingEnvironmentPtr (*create_default_shading_environment) (WorldPtr world_pointer);
void (*destroy_shading_environment) (WorldPtr world_pointer, ShadingEnvironmentPtr shading_environment_pointer);
void (*set_shading_environment) (WorldPtr world_pointer, ShadingEnvironmentPtr shading_environment, uint64_t name_id64);
void (*set_shading_environment) (WorldPtr world_pointer, ShadingEnvironmentPtr shading_environment, uint64_t name_id64, const char *optional_debug_name);

LineObjectPtr (*create_line_object) (WorldPtr world_pointer, int disable_depth_test);
void (*destroy_line_object) (WorldPtr world_pointer, LineObjectPtr line_object_pointer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ struct AnimationBlenderComponentCApi
void (*set_property) (AnimationBlenderComponentPtr, EntityRef, struct EntityPropertyParameter*, unsigned num_args, ...);
struct EntityPropertyValue (*get_property) (DataComponentPtr, EntityRef, unsigned num_args, ...);

unsigned (*crossfade) (AnimationBlenderComponentPtr, EntityRef, uint64_t animation_name, unsigned layer, float blend_time, int should_loop, enum AnimationBlendType anim_blend_type);
unsigned (*crossfade) (AnimationBlenderComponentPtr, EntityRef, uint64_t animation_name_id64, const char *optional_debug_animation_name, unsigned layer, float blend_time, int should_loop, enum AnimationBlendType anim_blend_type);
void (*set_time) (AnimationBlenderComponentPtr, EntityRef, unsigned id, float time, int should_cap_to_range);
void (*set_speed) (AnimationBlenderComponentPtr, EntityRef, unsigned id, float speed);
int (*is_crossfading) (AnimationBlenderComponentPtr, EntityRef);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ struct AnimationStateMachineComponentCApi
struct EntityPropertyValue (*get_property) (DataComponentPtr, EntityRef, unsigned num_args, ...);

int (*has_event) (AnimationStateMachineComponentPtr, EntityRef, unsigned event_name_id32);
void (*trigger_event) (AnimationStateMachineComponentPtr, EntityRef, unsigned event_name_id32);
void (*trigger_event) (AnimationStateMachineComponentPtr, EntityRef, unsigned event_name_id32, const char *opt_event_plain_name);
unsigned (*find_variable) (AnimationStateMachineComponentPtr, EntityRef, unsigned variable_name_id32);
float (*get_variable) (AnimationStateMachineComponentPtr, EntityRef, unsigned index);
void (*set_variable) (AnimationStateMachineComponentPtr, EntityRef, unsigned index, float value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ struct MeshComponentCApi
{
MeshComponentPtr (*component) (WorldPtr);

InstanceId (*create) (MeshComponentPtr, EntityRef);
void (*destroy) (MeshComponentPtr, EntityRef, InstanceId);
unsigned (*instances) (MeshComponentPtr, EntityRef, InstanceId *buffer, unsigned buffer_size);
InstanceId (*create) (MeshComponentPtr comp, EntityRef e_ref);
void (*destroy) (MeshComponentPtr comp, EntityRef e_ref, InstanceId);
unsigned (*instances) (MeshComponentPtr comp, EntityRef e_ref, InstanceId *buffer, unsigned buffer_size);

/* All property keys should be in the format of const char* */
void (*set_property) (MeshComponentPtr, EntityRef, InstanceId, struct EntityPropertyParameter*, unsigned num_args, ...);
void (*set_property) (MeshComponentPtr comp, EntityRef e_ref, InstanceId, struct EntityPropertyParameter*, unsigned num_args, ...);
struct EntityPropertyValue (*get_property) (DataComponentPtr, EntityRef, InstanceId, unsigned num_args, ...);

InstanceId (*create_with_mesh) (MeshComponentPtr, EntityRef, uint64_t scene_resource_id64, unsigned mesh_name_id32);
void (*set_material) (MeshComponentPtr, EntityRef, InstanceId, unsigned key_id32, uint64_t material_resource_id64, unsigned material_id32);
InstanceId (*create_with_mesh) (MeshComponentPtr comp, EntityRef e_ref, uint64_t scene_resource_id64, const char *optional_debug_scene_resource_name, unsigned mesh_name_id32, const char *optional_debug_mesh_name);
void (*set_material) (MeshComponentPtr comp, EntityRef e_ref, InstanceId id, unsigned key_id32, uint64_t material_resource_id64, const char *optional_debug_material_resource_name, unsigned material_id32, const char *optional_debug_material_name);
};

#ifdef __cplusplus
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#pragma once

#include "../c_api_types.h"

#ifdef __cplusplus
extern "C" {
#endif

struct RenderDataComponentCApi
{
RenderDataComponentPtr (*component) (WorldPtr world);

InstanceId (*create) (RenderDataComponentPtr, EntityRef);
void (*destroy) (RenderDataComponentPtr, EntityRef, InstanceId);
unsigned (*instances) (RenderDataComponentPtr, EntityRef, InstanceId *buffer, unsigned buffer_size);

/* All property keys should be in the format of const char* */
void (*set_property) (RenderDataComponentPtr, EntityRef, InstanceId, struct EntityPropertyParameter*, unsigned num_args, ...);
struct EntityPropertyValue (*get_property) (RenderDataComponentPtr, EntityRef, InstanceId, unsigned num_args, ...);
};

#ifdef __cplusplus
}
#endif
Loading

0 comments on commit 97f3bf7

Please sign in to comment.