From b0fc7fad53a1de9c1a493927b8a21845f579052e Mon Sep 17 00:00:00 2001 From: Valtteri Koskivuori Date: Sat, 16 Dec 2023 21:50:40 +0200 Subject: [PATCH] lib: Disable node debug dump Accidentally committed this define --- bindings/cray_wrap.c | 15 ++++++++++++--- generated/gitsha1.c | 4 ++-- src/lib/api/c-ray.c | 2 +- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/bindings/cray_wrap.c b/bindings/cray_wrap.c index c70d204b..9ca01ef5 100644 --- a/bindings/cray_wrap.c +++ b/bindings/cray_wrap.c @@ -296,6 +296,15 @@ static PyObject *py_cr_mesh_bind_vertex_buf(PyObject *self, PyObject *args) { Py_RETURN_NONE; } +static void dump_face(struct cr_face f) { + printf("v0: %i, v1: %i, v2: %i\nn0: %i, n1: %i, n2: %i\nt0: %i, t1: %i, t2: %i\nmat_id: %i, has_normals: %i\n", + f.vertex_idx[0], f.vertex_idx[1], f.vertex_idx[2], + f.normal_idx[0], f.normal_idx[1], f.normal_idx[2], + f.texture_idx[0], f.texture_idx[1], f.texture_idx[2], + f.mat_idx, + f.has_normals == 1 ? 1 : 0); +} + static PyObject *py_cr_mesh_bind_faces(PyObject *self, PyObject *args) { (void)self; (void)args; PyObject *s_ext; @@ -318,9 +327,9 @@ static PyObject *py_cr_mesh_bind_faces(PyObject *self, PyObject *args) { struct cr_face *faces = calloc(face_count, sizeof(*faces)); memcpy(faces, face_view.buf, face_count * sizeof(*faces)); - // for (size_t i = 0; i < face_count; ++i) { - // dump_face(faces[i]); - // } + for (size_t i = 0; i < face_count; ++i) { + dump_face(faces[i]); + } struct cr_scene *s = PyCapsule_GetPointer(s_ext, "cray.cr_scene"); cr_mesh_bind_faces(s, mesh, faces, face_count); diff --git a/generated/gitsha1.c b/generated/gitsha1.c index ee973938..84d8e7bc 100644 --- a/generated/gitsha1.c +++ b/generated/gitsha1.c @@ -3,12 +3,12 @@ // C-ray // // Created by Valtteri Koskivuori on 7.4.2019. -// Copyright © 2015-2020 Valtteri Koskivuori. All rights reserved. +// Copyright © 2019-2020 Valtteri Koskivuori. All rights reserved. // // Autogenerated - Do not edit -#define GIT_SHA1 "NoHash" +#define GIT_SHA1 "b0c253783d4f070605d4c45012c3a88bb9334423" char *gitHash(void) { return GIT_SHA1; diff --git a/src/lib/api/c-ray.c b/src/lib/api/c-ray.c index e304b00b..c9bdda5e 100644 --- a/src/lib/api/c-ray.c +++ b/src/lib/api/c-ray.c @@ -658,7 +658,7 @@ struct cr_shader_node *shader_deepcopy(const struct cr_shader_node *in) { } // TODO: Remove once not needed anymore, and mark serialize_shader_node as static again -#define NODE_DEBUG +// #define NODE_DEBUG #ifdef NODE_DEBUG #include "../../common/vendored/cJSON.h"