commit 4fa5bf5faa979dcd2e7b83d32274eddacc0ab8a3
parent c30ea2d0f67698513c8213dec6f33335e1785d40
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Thu, 10 Sep 2015 13:36:17 +0200
Fix compilation errors due to APIs update
Use the new S3D session API and the new smc_device_create profile
Diffstat:
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/sgf.c b/src/sgf.c
@@ -238,7 +238,7 @@ sgf_integrate
struct smc_accumulator* accum = NULL;
struct smc_accumulator_status status;
size_t i;
- char is_traceable;
+ int mask;
res_T res = RES_OK;
if(!smc || !context || !accbuf || !check_context(context) || !steps_count) {
@@ -250,7 +250,8 @@ sgf_integrate
integrator.type = &accum_buffer_type;
integrator.max_steps = steps_count;
- if(!(S3D(scene_is_traceable(context->scene, &is_traceable)), is_traceable)) {
+ S3D(scene_get_session_mask(context->scene, &mask));
+ if((mask & S3D_TRACE) == 0) {
if(context->verbose) {
logger_print(context->logger, LOG_ERROR,
"No active trace session on the Star-3D scene\n");
diff --git a/src/test_sgf_cube.c b/src/test_sgf_cube.c
@@ -112,7 +112,7 @@ main(int argc, char** argv)
CHECK(s3d_shape_create_mesh(s3d, &shape), RES_OK);
CHECK(s3d_scene_create(s3d, &scn), RES_OK);
CHECK(s3d_scene_attach_shape(scn, shape), RES_OK);
- CHECK(smc_device_create(NULL, NULL, 1, &smc), RES_OK);
+ CHECK(smc_device_create(NULL, NULL, 1, NULL, &smc), RES_OK);
attribs[0].type = S3D_FLOAT3;
attribs[0].usage = S3D_POSITION;
@@ -159,14 +159,13 @@ main(int argc, char** argv)
CHECK(sgf_integrate(NULL, &ctx, NSTEPS, gfacc), RES_BAD_ARG);
CHECK(sgf_integrate(smc, &ctx, NSTEPS, gfacc), RES_BAD_OP);
- CHECK(s3d_scene_begin_trace(scn), RES_OK);
+ CHECK(s3d_scene_begin_session(scn, S3D_TRACE), RES_OK);
FOR_EACH(iprim, 0, nprims) {
struct sgf_accum* row = gfacc + iprim*nprims;
ctx.primitive_id = iprim;
CHECK(sgf_integrate(smc, &ctx, NSTEPS, row), RES_OK);
}
-
- CHECK(s3d_scene_end_trace(scn), RES_OK);
+ CHECK(s3d_scene_end_session(scn), RES_OK);
#if 0
FOR_EACH(iprim, 0, nprims) {
diff --git a/src/test_sgf_tetrahedron.c b/src/test_sgf_tetrahedron.c
@@ -79,7 +79,7 @@ main(int argc, char** argv)
CHECK(s3d_shape_create_mesh(s3d, &shape), RES_OK);
CHECK(s3d_scene_create(s3d, &scn), RES_OK);
CHECK(s3d_scene_attach_shape(scn, shape), RES_OK);
- CHECK(smc_device_create(NULL, NULL, 1, &smc), RES_OK);
+ CHECK(smc_device_create(NULL, NULL, 1, NULL, &smc), RES_OK);
attribs[0].type = S3D_FLOAT3;
attribs[0].usage = S3D_POSITION;
@@ -109,13 +109,13 @@ main(int argc, char** argv)
gfacc = sa_add(gfacc, nprims*nprims);
- CHECK(s3d_scene_begin_trace(scn), RES_OK);
+ CHECK(s3d_scene_begin_session(scn, S3D_TRACE), RES_OK);
FOR_EACH(iprim, 0, nprims) {
struct sgf_accum* row = gfacc + iprim*nprims;
ctx.primitive_id = iprim;
CHECK(sgf_integrate(smc, &ctx, NSTEPS, row), RES_OK);
}
- CHECK(s3d_scene_end_trace(scn), RES_OK);
+ CHECK(s3d_scene_end_session(scn), RES_OK);
/* Expected value */
FOR_EACH(iprim, 0, nprims) {