Skip to content

Commit

Permalink
lib: Disable node debug dump
Browse files Browse the repository at this point in the history
Accidentally committed this define
  • Loading branch information
vkoskiv committed Dec 16, 2023
1 parent b4f570a commit b0fc7fa
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
15 changes: 12 additions & 3 deletions bindings/cray_wrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions generated/gitsha1.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/api/c-ray.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit b0fc7fa

Please sign in to comment.