- refactored common sources into common

git-svn-id: http://moon:8086/svn/mips@197 a8ebac50-d88d-4704-bea3-6648445a41b3
This commit is contained in:
2021-11-23 17:43:37 +00:00
parent 28aa86d141
commit 2c4a6af07b
40 changed files with 669 additions and 669 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ BUILD_DIR=build/$(BOARD)/$(ENDIANESS)
LSYS_BUILD_DIR=libsys/build/$(BOARD)/$(ENDIANESS) LSYS_BUILD_DIR=libsys/build/$(BOARD)/$(ENDIANESS)
CFLAGS += -Wl,--gc-sections -G 0 -T $(MIPS_HOME)/link/ram.ld CFLAGS += -Wl,--gc-sections -G 0 -T $(MIPS_HOME)/link/ram.ld
CFLAGS += -I. -Ilibsys -Ilibsys/boards/$(BOARD) -L$(LSYS_BUILD_DIR) $(DEFINES) CFLAGS += -I. -Icommon -Ilibsys -Ilibsys/boards/$(BOARD) -L$(LSYS_BUILD_DIR) $(DEFINES)
CFLAGS += -Wl,-M CFLAGS += -Wl,-M
LIBS=-lsys -lm -lc LIBS=-lsys -lm -lc
+20 -20
View File
@@ -238,23 +238,23 @@ $(BUILD_DIR)/basic_math.elf: $(BUILD_DIR) basicmath_small.c rad2deg.c cubic.c
$(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex
JMAN_SRC= \ JMAN_SRC= \
jman/bintree.c \ common/jman/bintree.c \
jman/camset.c \ common/jman/camset.c \
jman/engine.c \ common/jman/engine.c \
jman/graph_state.c \ common/jman/graph_state.c \
jman/grid.c \ common/jman/grid.c \
jman/imageio.c \ common/jman/imageio.c \
jman/linklist.c \ common/jman/linklist.c \
jman/matrix.c \ common/jman/matrix.c \
jman/object.c \ common/jman/object.c \
jman/render.c \ common/jman/render.c \
jman/ri.c \ common/jman/ri.c \
jman/ribgen.c \ common/jman/ribgen.c \
jman/stack.c \ common/jman/stack.c \
jman/vars.c common/jman/vars.c
$(BUILD_DIR)/jman_patches.elf: $(BUILD_DIR) $(JMAN_SRC) jman/main_patches.c $(BUILD_DIR)/jman_patches.elf: $(BUILD_DIR) $(JMAN_SRC) main_patches.c
$(CC) $(CFLAGS) -I../ -o $@ -o $@ jman/main_patches.c $(JMAN_SRC) $(LIBS) >$@.map $(CC) $(CFLAGS) -I../ -o $@ -o $@ main_patches.c $(JMAN_SRC) $(LIBS) >$@.map
$(OBJDUMP) -d $@ > $@.dis $(OBJDUMP) -d $@ > $@.dis
$(OBJCOPY) $@ -O binary $@.bin $(OBJCOPY) $@ -O binary $@.bin
$(OBJCOPY) -O srec $@ $@.srec $(OBJCOPY) -O srec $@ $@.srec
@@ -262,8 +262,8 @@ $(BUILD_DIR)/jman_patches.elf: $(BUILD_DIR) $(JMAN_SRC) jman/main_patches.c
cat $@.srec | $(PACKHEX) > $@.pack cat $@.srec | $(PACKHEX) > $@.pack
$(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex
$(BUILD_DIR)/jman_patchmeshes.elf: $(BUILD_DIR) $(JMAN_SRC) jman/main_patchmeshes.c jman/patches2.c $(BUILD_DIR)/jman_patchmeshes.elf: $(BUILD_DIR) $(JMAN_SRC) main_patchmeshes.c common/jman/patches2.c
$(CC) $(CFLAGS) -I../ -o $@ -o $@ jman/main_patchmeshes.c jman/patches2.c $(JMAN_SRC) $(LIBS) >$@.map $(CC) $(CFLAGS) -I../ -o $@ -o $@ main_patchmeshes.c common/jman/patches2.c $(JMAN_SRC) $(LIBS) >$@.map
$(OBJDUMP) -d $@ > $@.dis $(OBJDUMP) -d $@ > $@.dis
$(OBJCOPY) $@ -O binary $@.bin $(OBJCOPY) $@ -O binary $@.bin
$(OBJCOPY) -O srec $@ $@.srec $(OBJCOPY) -O srec $@ $@.srec
@@ -271,8 +271,8 @@ $(BUILD_DIR)/jman_patchmeshes.elf: $(BUILD_DIR) $(JMAN_SRC) jman/main_patchmeshe
cat $@.srec | $(PACKHEX) > $@.pack cat $@.srec | $(PACKHEX) > $@.pack
$(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex $(OBJCOPY) -O ihex -I binary $@.flash.bin $@.hex
$(BUILD_DIR)/jman_polys.elf: $(BUILD_DIR) $(JMAN_SRC) jman/main_polypin.c jman/polys.c $(BUILD_DIR)/jman_polys.elf: $(BUILD_DIR) $(JMAN_SRC) main_polypin.c common/jman/polys.c
$(CC) $(CFLAGS) -I../ -o $@ -o $@ jman/main_polypin.c jman/polys.c $(JMAN_SRC) $(LIBS) >$@.map $(CC) $(CFLAGS) -I../ -o $@ -o $@ main_polypin.c common/jman/polys.c $(JMAN_SRC) $(LIBS) >$@.map
$(OBJDUMP) -d $@ > $@.dis $(OBJDUMP) -d $@ > $@.dis
$(OBJCOPY) $@ -O binary $@.bin $(OBJCOPY) $@ -O binary $@.bin
$(OBJCOPY) -O srec $@ $@.srec $(OBJCOPY) -O srec $@ $@.srec
@@ -7,7 +7,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "bintree.h" #include <jman/bintree.h>
// ------------------------------------------------------------ // ------------------------------------------------------------
node_t* GetParent(node_t *pObj) node_t* GetParent(node_t *pObj)
@@ -4,8 +4,8 @@
// //
// 27.02.2005, J.Ahrensfeld // 27.02.2005, J.Ahrensfeld
// ------------------------------------------------------------ // ------------------------------------------------------------
#ifndef BINTREE_H #ifndef JMAN_BINTREE_H
#define BINTREE_H #define JMAN_BINTREE_H
// ------------------------------------------------------------ // ------------------------------------------------------------
typedef struct _node_t typedef struct _node_t
@@ -39,4 +39,4 @@ int bintree_destroy(node_t *pObj);
// ------------------------------------------------------------ // ------------------------------------------------------------
#endif // BINTREE_H #endif // JMAN_BINTREE_H
@@ -1,6 +1,6 @@
#include <math.h> #include <math.h>
#include "ri.h" #include <jman/ri.h>
#include "camset.h" #include <jman/camset.h>
#define min(a,b) ((a)<(b)?(a):(b)) #define min(a,b) ((a)<(b)?(a):(b))
#define PI 3.1415926535897932384626433832795 #define PI 3.1415926535897932384626433832795
@@ -1,11 +1,9 @@
#ifndef CAMSET_H #ifndef JMAN_CAMSET_H
#define CAMSET_H #define JMAN_CAMSET_H
//#include "ri.h"
void PlaceCamera(RtPoint position, RtPoint direction, float roll); void PlaceCamera(RtPoint position, RtPoint direction, float roll);
void AimZ(RtPoint direction); void AimZ(RtPoint direction);
void FrameCamera(float focallength, float framewidth, float frameheight); void FrameCamera(float focallength, float framewidth, float frameheight);
void FrameCamera2(float focallength, float framewidth, float frameheight); void FrameCamera2(float focallength, float framewidth, float frameheight);
#endif // CAMSET_H #endif // JMAN_CAMSET_H
@@ -5,8 +5,8 @@
// //
// 12.03.2005, J.Ahrensfeld // 12.03.2005, J.Ahrensfeld
// ------------------------------------------------------------ // ------------------------------------------------------------
#ifndef COLORTYPES_H #ifndef JMAN_COLORTYPES_H
#define COLORTYPES_H #define JMAN_COLORTYPES_H
// ------------------------------------------------------------ // ------------------------------------------------------------
#define COMP_RED 0 #define COMP_RED 0
@@ -33,4 +33,4 @@ typedef rgba_t rgba_matrix_t[4];
// ------------------------------------------------------------ // ------------------------------------------------------------
#endif // COLORTYPES_H #endif // JMAN_COLORTYPES_H
+8 -12
View File
@@ -3,18 +3,14 @@
#include <string.h> #include <string.h>
#include <math.h> #include <math.h>
#include <time.h> #include <time.h>
#include "ri.h"
#include "types.h" #include <jman/matrix.h>
#include "matrix.h" #include <jman/stack.h>
#include "graph_state.h" #include <jman/vars.h>
#include "stack.h" #include <jman/imageio.h>
#include "object.h" #include <jman/colortypes.h>
#include "vars.h" #include <jman/render.h>
#include "engine.h" #include <jman/bintree.h>
#include "imageio.h"
#include "colortypes.h"
#include "render.h"
#include "bintree.h"
RtToken RI_P = NULL; RtToken RI_P = NULL;
ri_var_t* V_P = NULL; ri_var_t* V_P = NULL;
+10 -3
View File
@@ -1,10 +1,17 @@
#ifndef ENGINE_H #ifndef JMAN_ENGINE_H
#define ENGINE_H #define JMAN_ENGINE_H
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <jman/types.h>
#include <jman/ri.h>
#include <jman/vars.h>
#include <jman/object.h>
#include <jman/engine.h>
#include <jman/graph_state.h>
#define ENGINE_CONTEXT_LEVEL_MAIN 0 #define ENGINE_CONTEXT_LEVEL_MAIN 0
#define ENGINE_CONTEXT_LEVEL_SUB 1 #define ENGINE_CONTEXT_LEVEL_SUB 1
@@ -66,4 +73,4 @@ void jstats(void);
void Tic(double *tic_start); void Tic(double *tic_start);
double Toc(double *tic_start); double Toc(double *tic_start);
#endif // ENGINE_H #endif // JMAN_ENGINE_H
@@ -1,13 +1,13 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "ri.h" #include <jman/ri.h>
#include "types.h" #include <jman/types.h>
#include "stack.h" #include <jman/stack.h>
#include "graph_state.h" #include <jman/graph_state.h>
#include "object.h" #include <jman/object.h>
#include "matrix.h" #include <jman/matrix.h>
#include "vars.h" #include <jman/vars.h>
#include "engine.h" #include <jman/engine.h>
static char RI_DEFAULT_FILNAME[] = "ri.pic"; static char RI_DEFAULT_FILNAME[] = "ri.pic";
@@ -1,11 +1,11 @@
/*************************************************************************/ /*************************************************************************/
/* Types.h /* Types.h
/*************************************************************************/ /*************************************************************************/
#ifndef GRAPH_STATE_H #ifndef JMAN_GRAPH_STATE_H
#define GRAPH_STATE_H #define JMAN_GRAPH_STATE_H
#include "types.h" #include <jman/types.h>
#include "stack.h" #include <jman/stack.h>
#define PI 3.1415926535897932384626433832795 #define PI 3.1415926535897932384626433832795
#define NUM_COORD_SYSTEMS 6 #define NUM_COORD_SYSTEMS 6
@@ -92,5 +92,5 @@ void GS_xform_push(graph_state_t *pObj);
void GS_xform_pop(graph_state_t *pObj); void GS_xform_pop(graph_state_t *pObj);
void GS_xform_set(graph_state_t *pObj, uint32_t id); void GS_xform_set(graph_state_t *pObj, uint32_t id);
#endif // GRAPH_STATE_H #endif // JMAN_GRAPH_STATE_H
+8 -8
View File
@@ -2,14 +2,14 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <math.h> #include <math.h>
#include "ri.h" #include <jman/ri.h>
#include "types.h" #include <jman/types.h>
#include "matrix.h" #include <jman/matrix.h>
#include "linklist.h" #include <jman/linklist.h>
#include "vars.h" #include <jman/vars.h>
#include "grid.h" #include <jman/grid.h>
#include "graph_state.h" #include <jman/graph_state.h>
#include "object.h" #include <jman/object.h>
void Grid_create(grid_t *pObj, uint32_t npu, uint32_t npv) void Grid_create(grid_t *pObj, uint32_t npu, uint32_t npv)
{ {
+4 -3
View File
@@ -1,5 +1,5 @@
#ifndef GRID_H #ifndef JMAN_GRID_H
#define GRID_H #define JMAN_GRID_H
typedef struct _spoint_state_t typedef struct _spoint_state_t
{ {
@@ -32,5 +32,6 @@ void Grid_assign_Ng2N(grid_t *pObj);
void Grid_displace(grid_t *pObj); void Grid_displace(grid_t *pObj);
void Grid_shade(grid_t *pObj, RtMatrix *pXform, linkedlist_t *pLights); void Grid_shade(grid_t *pObj, RtMatrix *pXform, linkedlist_t *pLights);
void Grid_shadeConstant(grid_t *pObj); void Grid_shadeConstant(grid_t *pObj);
void Grid_InitUV(grid_t *pObj);
#endif // GRID #endif // JMAN_GRID
@@ -9,10 +9,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <math.h> #include <math.h>
#include "libsys.h" #include <jman/imageio.h>
#include "types.h"
#include "colortypes.h"
#include "imageio.h"
// ------------------------------------------------------------ // ------------------------------------------------------------
double smin(double v1, double v2) double smin(double v1, double v2)
@@ -76,7 +73,7 @@ void ImageCopy(image_t *pSrc, image_t *pDst)
pDst->num_ch = pSrc->num_ch; pDst->num_ch = pSrc->num_ch;
if (!pDst->pColor_data) if (!pDst->pColor_data)
pDst->pColor_data = (double*)jmalloc(pSrc->num_ch*pSrc->num_pixel*sizeof(double)); pDst->pColor_data = (uint64_t*)jmalloc(pSrc->num_ch*pSrc->num_pixel*sizeof(double));
memcpy(pDst->pColor_data, pSrc->pColor_data, pSrc->num_ch*pSrc->num_pixel*sizeof(double)); memcpy(pDst->pColor_data, pSrc->pColor_data, pSrc->num_ch*pSrc->num_pixel*sizeof(double));
@@ -5,12 +5,13 @@
// //
// 12.03.2005, J.Ahrensfeld // 12.03.2005, J.Ahrensfeld
// ------------------------------------------------------------ // ------------------------------------------------------------
#ifndef IMAGEIO_H #ifndef JMAN_IMAGEIO_H
#define IMAGEIO_H #define JMAN_IMAGEIO_H
#include "libsys.h" #include <libsys/libsys.h>
#include "types.h" #include <jman/types.h>
#include "colortypes.h" #include <jman/colortypes.h>
#include <jman/imageio.h>
// ------------------------------------------------------------ // ------------------------------------------------------------
typedef struct _image_t typedef struct _image_t
@@ -30,4 +31,4 @@ int ImageSaveTiff(image_t *pObj, char *filename);
void ImageSetPixel(image_t *pObj, uint32_t u, uint32_t v, rgba_t color); void ImageSetPixel(image_t *pObj, uint32_t u, uint32_t v, rgba_t color);
// ------------------------------------------------------------ // ------------------------------------------------------------
#endif // IMAGEIO_H #endif // JMAN_IMAGEIO_H
@@ -1,6 +1,6 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "linklist.h" #include <jman/linklist.h>
linkedlist_t* LinkedList_free(linkedlist_t *pObj) linkedlist_t* LinkedList_free(linkedlist_t *pObj)
{ {
@@ -1,9 +1,8 @@
#ifndef LINKLIST_H #ifndef JMAN_LINKLIST_H
#define LINKLIST_H #define JMAN_LINKLIST_H
#include <string.h> #include <string.h>
#include "types.h" #include <jman/types.h>
typedef struct _slinkedlist_t typedef struct _slinkedlist_t
{ {
@@ -25,4 +24,4 @@ linkedlist_t* LinkedList_del(linkedlist_t *pObj);
linkedlist_t* LinkedList_find_first(linkedlist_t *pObj); linkedlist_t* LinkedList_find_first(linkedlist_t *pObj);
linkedlist_t* LinkedList_find_last(linkedlist_t *pObj); linkedlist_t* LinkedList_find_last(linkedlist_t *pObj);
#endif // LINKLIST_H #endif // JMAN_LINKLIST_H
@@ -45,9 +45,10 @@
#include <stdio.h> #include <stdio.h>
#include <string.h>
#include <math.h> #include <math.h>
#include "ri.h" #include <jman/ri.h>
#include "types.h" #include <jman/types.h>
#define min 1e-06 // Zahl<min -> Zahl=0 #define min 1e-06 // Zahl<min -> Zahl=0
#define pi 3.14159265359 #define pi 3.14159265359
@@ -5,12 +5,12 @@
// Beschreibung: Funktionen fuer das Rechnen mit Transformationsmatrizen // Beschreibung: Funktionen fuer das Rechnen mit Transformationsmatrizen
// //
// ergaenzendes Modul: matrix.cc // ergaenzendes Modul: matrix.cc
// letzte Änderung 01.09.199, Jens Ahrensfeld // letzte nderung 01.09.199, Jens Ahrensfeld
#ifndef MATRIX_H #ifndef JMAN_MATRIX_H
#define MATRIX_H #define JMAN_MATRIX_H
#include "ri.h" #include <jman/ri.h>
extern void PrintMatrix(RtMatrix,short); extern void PrintMatrix(RtMatrix,short);
extern void PrintVector(RtFloat*,short); extern void PrintVector(RtFloat*,short);
@@ -40,4 +40,4 @@ void PointSwapXY(RtFloat *pSrcDst);
void PointSwapXZ(RtFloat *pSrcDst); void PointSwapXZ(RtFloat *pSrcDst);
void PointSwapYZ(RtFloat *pSrcDst); void PointSwapYZ(RtFloat *pSrcDst);
#endif #endif // JMAN_MATRIX
@@ -1,14 +1,14 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <math.h> #include <math.h>
#include "ri.h" #include <jman/ri.h>
#include "types.h" #include <jman/types.h>
#include "graph_state.h" #include <jman/graph_state.h>
#include "matrix.h" #include <jman/matrix.h>
#include "object.h" #include <jman/object.h>
#include "vars.h" #include <jman/vars.h>
#include "engine.h" #include <jman/engine.h>
#include "grid.h" #include <jman/grid.h>
extern engine_t engine; extern engine_t engine;
@@ -581,7 +581,7 @@ void Sphere_dice(object_t *pObj, RtInt npu, RtInt npv)
du = (RtFloat)(1.0/(nu-1)); du = (RtFloat)(1.0/(nu-1));
dv = (RtFloat)(1.0/(nv-1)); dv = (RtFloat)(1.0/(nv-1));
// Declare variable "P" // Declare variable <jman/P"
pVar = VarListDeclare(pGridVars, "P", "varying", "point"); pVar = VarListDeclare(pGridVars, "P", "varying", "point");
pPoint = (RtPoint*)VarAlloc(pVar, nu*nv); pPoint = (RtPoint*)VarAlloc(pVar, nu*nv);
@@ -1,11 +1,13 @@
#ifndef OBJECT_H #ifndef JMAN_OBJECT_H
#define OBJECT_H #define JMAN_OBJECT_H
// -------------------------------------------------------------- // --------------------------------------------------------------
#include "types.h" #include <jman/types.h>
#include "linklist.h" #include <jman/linklist.h>
#include "vars.h" #include <jman/vars.h>
#include "grid.h" #include <jman/grid.h>
#include <jman/graph_state.h>
// -------------------------------------------------------------- // --------------------------------------------------------------
extern RtToken OBJECT_TYPE_VERTEX; extern RtToken OBJECT_TYPE_VERTEX;
extern RtToken OBJECT_TYPE_POLYGON; extern RtToken OBJECT_TYPE_POLYGON;
@@ -149,5 +151,5 @@ RtPointer Object_get_var(object_t *pObj, RtToken name);
RtPointer Object_add_var(object_t *pObj, RtToken name, RtPointer *pValues); RtPointer Object_add_var(object_t *pObj, RtToken name, RtPointer *pValues);
// -------------------------------------------------------------- // --------------------------------------------------------------
#endif // OBJECT_H #endif // JMAN_OBJECT_H
@@ -1,5 +1,5 @@
#include "ri.h" #include <jman/ri.h>
#include "patches.h" #include <jman/patches.h>
#define NU 13 #define NU 13
#define MAXNPTS 100 #define MAXNPTS 100
@@ -2,7 +2,10 @@
/* From the RenderMan Companion p. 81 */ /* From the RenderMan Companion p. 81 */
/* Listing 5.3 Bowling pin with normals assigned to vertices, defined using RiPointsPolygons */ /* Listing 5.3 Bowling pin with normals assigned to vertices, defined using RiPointsPolygons */
#include "ri.h" #include <jman/ri.h>
#ifndef JMAN_PATCHES
#define JMAN_PATCHES
typedef struct _sPoint2D typedef struct _sPoint2D
{ {
@@ -11,5 +14,4 @@ typedef struct _sPoint2D
void SurfOR(Point2D points[], int npoints); void SurfOR(Point2D points[], int npoints);
#endif // JMAN_PATCHES
@@ -2,8 +2,8 @@
/* From the RenderMan Companion p. 81 */ /* From the RenderMan Companion p. 81 */
/* Listing 5.3 Bowling pin with normals assigned to vertices, defined using RiPointsPolygons */ /* Listing 5.3 Bowling pin with normals assigned to vertices, defined using RiPointsPolygons */
#include "ri.h" #include <jman/ri.h>
#include "patches.h" #include <jman/patches.h>
#define MAXNPTS 100 #define MAXNPTS 100
#define BEZIERWIDTH 12 #define BEZIERWIDTH 12
+2 -2
View File
@@ -2,8 +2,8 @@
/* From the RenderMan Companion p. 81 */ /* From the RenderMan Companion p. 81 */
/* Listing 5.3 Bowling pin with normals assigned to vertices, defined using RiPointsPolygons */ /* Listing 5.3 Bowling pin with normals assigned to vertices, defined using RiPointsPolygons */
#include "ri.h" #include <jman/ri.h>
#include "polys.h" #include <jman/polys.h>
void PolySurfOR(Point2D *points, RtColor *colors, RtInt npoints) void PolySurfOR(Point2D *points, RtColor *colors, RtInt npoints)
{ {
+5 -2
View File
@@ -2,7 +2,10 @@
/* From the RenderMan Companion p. 81 */ /* From the RenderMan Companion p. 81 */
/* Listing 5.3 Bowling pin with normals assigned to vertices, defined using RiPointsPolygons */ /* Listing 5.3 Bowling pin with normals assigned to vertices, defined using RiPointsPolygons */
#include "ri.h" #include <jman/ri.h>
#ifndef JMAN_POLYS
#define JMAN_POLYS
typedef struct _sPoint2D typedef struct _sPoint2D
{ {
@@ -16,4 +19,4 @@ void getnextpair(float offset, RtPoint *ptrnextpair, RtFloat *point0, RtFloat *p
#define NDIVS 24 #define NDIVS 24
#define MAXVERTS 1000 #define MAXVERTS 1000
#endif // JMAN_POLYS
+1 -13
View File
@@ -2,19 +2,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <math.h> #include <math.h>
#include "ri.h" #include <jman/render.h>
#include "types.h"
#include "matrix.h"
#include "graph_state.h"
#include "stack.h"
#include "object.h"
#include "vars.h"
#include "engine.h"
#include "imageio.h"
#include "colortypes.h"
#include "grid.h"
#include "bintree.h"
#include "render.h"
#define RENDER_POINTS 1 #define RENDER_POINTS 1
+15 -14
View File
@@ -1,17 +1,18 @@
#ifndef RENDER_H #ifndef JMAN_RENDER_H
#define RENDER_H #define JMAN_RENDER_H
#include "ri.h" #include <jman/ri.h>
#include "types.h" #include <jman/types.h>
#include "matrix.h" #include <jman/matrix.h>
#include "graph_state.h" #include <jman/graph_state.h>
#include "stack.h" #include <jman/stack.h>
#include "object.h" #include <jman/object.h>
#include "vars.h" #include <jman/vars.h>
#include "engine.h" #include <jman/engine.h>
#include "imageio.h" #include <jman/imageio.h>
#include "colortypes.h" #include <jman/colortypes.h>
#include "bintree.h" #include <jman/grid.h>
#include <jman/bintree.h>
typedef struct _sshaded_pixel_t typedef struct _sshaded_pixel_t
{ {
@@ -37,4 +38,4 @@ void Render_patchmesh(render_t *pObj, object_t *pObject);
void Render_sphere(render_t *pObj, object_t *pObject); void Render_sphere(render_t *pObj, object_t *pObject);
void Render_patch(render_t *pObj, object_t *pObject); void Render_patch(render_t *pObj, object_t *pObject);
#endif // RENDER_H #endif // JMAN_RENDER_H
+10 -10
View File
@@ -3,16 +3,16 @@
#include <stdarg.h> #include <stdarg.h>
#include <string.h> #include <string.h>
#include <math.h> #include <math.h>
#include "ri.h" #include <jman/ri.h>
#include "types.h" #include <jman/types.h>
#include "matrix.h" #include <jman/matrix.h>
#include "stack.h" #include <jman/stack.h>
#include "graph_state.h" #include <jman/graph_state.h>
#include "object.h" #include <jman/object.h>
#include "vars.h" #include <jman/vars.h>
#include "engine.h" #include <jman/engine.h>
#include "linklist.h" #include <jman/linklist.h>
#include "ribgen.h" #include <jman/ribgen.h>
// Globals // Globals
engine_t engine = {0}; engine_t engine = {0};
+3 -3
View File
@@ -2,8 +2,8 @@
* ri.h - header file for the Blue Moon Rendering Tools (BMRT) * * ri.h - header file for the Blue Moon Rendering Tools (BMRT) *
*************************************************************************/ *************************************************************************/
#ifndef RI_H #ifndef JMAN_RI_H
#define RI_H 1 #define JMAN_RI_H 1
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@@ -400,5 +400,5 @@ RtVoid RiReadArchiveV (RtString filename, RtArchiveCallback callback,
#endif #endif
#endif /* RI_H */ #endif /* JMAN_RI_H */
@@ -3,14 +3,14 @@
#include <stdarg.h> #include <stdarg.h>
#include <string.h> #include <string.h>
#include <math.h> #include <math.h>
#include "ri.h" #include <jman/ri.h>
#include "types.h" #include <jman/types.h>
#include "matrix.h" #include <jman/matrix.h>
#include "graph_state.h" #include <jman/graph_state.h>
#include "object.h" #include <jman/object.h>
#include "vars.h" #include <jman/vars.h>
#include "engine.h" #include <jman/engine.h>
#include "ribgen.h" #include <jman/ribgen.h>
// -------------------------------------------------------------- // --------------------------------------------------------------
void RibgenPrintVars(engine_t *pObj, ri_var_t *pVar, RtPointer arg) void RibgenPrintVars(engine_t *pObj, ri_var_t *pVar, RtPointer arg)
@@ -1,5 +1,5 @@
#ifndef RIBGEN_H #ifndef JMAN_RIBGEN_H
#define RIBGEN_H #define JMAN_RIBGEN_H
// -------------------------------------------------------------- // --------------------------------------------------------------
void Ribgen_FrameBegin(engine_t *pObj, RtInt number); void Ribgen_FrameBegin(engine_t *pObj, RtInt number);
@@ -40,4 +40,4 @@ void Ribgen_Surface(engine_t *pObj, char *name, va_list args);
void Ribgen_Displacement(engine_t *pObj, char *name, va_list args); void Ribgen_Displacement(engine_t *pObj, char *name, va_list args);
// -------------------------------------------------------------- // --------------------------------------------------------------
#endif // RIBGEN_H #endif // JMAN_RIBGEN_H
+2 -1
View File
@@ -1,6 +1,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "stack.h" #include <jman/engine.h>
#include <jman/stack.h>
stack_t* Stack_free_top(stack_t *pObj) stack_t* Stack_free_top(stack_t *pObj)
{ {
+4 -4
View File
@@ -1,7 +1,7 @@
#ifndef STACK_H #ifndef JMAN_STACK_H
#define STACK_H #define JMAN_STACK_H
#include "types.h" #include <jman/types.h>
typedef struct _sstack_t typedef struct _sstack_t
{ {
@@ -17,4 +17,4 @@ stack_t* Stack_free(stack_t *pObj);
stack_t* Stack_push(stack_t *pObj, void **ppData, uint32_t size); stack_t* Stack_push(stack_t *pObj, void **ppData, uint32_t size);
stack_t* Stack_pop(stack_t *pObj, void **ppData); stack_t* Stack_pop(stack_t *pObj, void **ppData);
#endif // STACK_H #endif // JMAN_STACK_H
+3 -3
View File
@@ -2,8 +2,8 @@
/* Types.h */ /* Types.h */
/*************************************************************************/ /*************************************************************************/
#ifndef TYPES_H #ifndef JMAN_TYPES_H
#define TYPES_H #define JMAN_TYPES_H
#include <stdint.h> #include <stdint.h>
@@ -17,4 +17,4 @@
#define MAX(a,b) ((a)>(b)?(a):(b)) #define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b)) #define MIN(a,b) ((a)<(b)?(a):(b))
#endif #endif // JMAN_TYPES_H
+10 -9
View File
@@ -2,15 +2,16 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <math.h> #include <math.h>
#include "ri.h" #include <jman/ri.h>
#include "types.h" #include <jman/types.h>
#include "matrix.h" #include <jman/engine.h>
#include "graph_state.h" #include <jman/matrix.h>
#include "stack.h" #include <jman/graph_state.h>
#include "object.h" #include <jman/stack.h>
#include "imageio.h" #include <jman/object.h>
#include "colortypes.h" #include <jman/imageio.h>
#include "vars.h" #include <jman/colortypes.h>
#include <jman/vars.h>
RtToken VAR_CLASSES[] = {"vertex", "uniform", "varying", "constant", NULL}; RtToken VAR_CLASSES[] = {"vertex", "uniform", "varying", "constant", NULL};
RtToken VAR_TYPES[] = {"float", "point", "color", "string", "integer", "vector", "normal", "matrix", "hpoint", NULL}; RtToken VAR_TYPES[] = {"float", "point", "color", "string", "integer", "vector", "normal", "matrix", "hpoint", NULL};
+5 -3
View File
@@ -1,7 +1,8 @@
#ifndef VARS_H #ifndef JMAN_VARS_H
#define VARS_H #define JMAN_VARS_H
#include <stdint.h> #include <stdint.h>
#include <jman/linklist.h>
typedef struct _sri_var_t typedef struct _sri_var_t
{ {
@@ -26,6 +27,7 @@ enum _vVarClass {VC_VERTEX, VC_UNIFORM, VC_VARYING, VC_CONSTANT};
void VarListInit(var_list_t *pObj); void VarListInit(var_list_t *pObj);
void VarListFree(var_list_t *pObj); void VarListFree(var_list_t *pObj);
RtPointer VarGetByName(var_list_t *pObj, RtToken name);
ri_var_t* VarListFindByName(var_list_t *pObj, uint8_t *name); ri_var_t* VarListFindByName(var_list_t *pObj, uint8_t *name);
ri_var_t* VarListDeclare(var_list_t *pObj, uint8_t *name, uint8_t *cls, uint8_t *type); ri_var_t* VarListDeclare(var_list_t *pObj, uint8_t *name, uint8_t *cls, uint8_t *type);
ri_var_t* VarListAdd(var_list_t *pObj, ri_var_t *pVar); ri_var_t* VarListAdd(var_list_t *pObj, ri_var_t *pVar);
@@ -38,4 +40,4 @@ RtPointer VarGet(ri_var_t *pObj);
void VarListPrint(var_list_t *pObj); void VarListPrint(var_list_t *pObj);
#endif // VARS_H #endif // JMAN_VARS_H
@@ -3,8 +3,8 @@
/* Listing 8.5 An improved boilerplate viewing program */ /* Listing 8.5 An improved boilerplate viewing program */
#include <stdio.h> #include <stdio.h>
#include "ri.h" #include <jman/ri.h>
#include "camset.h" #include <jman/camset.h>
#define NFRAMES 20 #define NFRAMES 20
#define SHADING_RATE 20 #define SHADING_RATE 20
@@ -45,7 +45,7 @@
#define Z2 .33 #define Z2 .33
#define Z3 1 #define Z3 1
PatchExample(Patch) void PatchExample(Patch)
RtPoint Patch[4][4]; RtPoint Patch[4][4];
{ {
RtPoint blpatch[2][2]; RtPoint blpatch[2][2];
@@ -80,7 +80,7 @@ RtPoint Patch[4][4];
#endif #endif
} }
Go() void Go()
{ {
static RtPoint Patch[16] = { static RtPoint Patch[16] = {
{ X0, Y0, Z0}, { X1, Y2, Z0}, { X2, Y1, Z0}, { X3, Y3, Z0}, { X0, Y0, Z0}, { X1, Y2, Z0}, { X2, Y1, Z0}, { X3, Y3, Z0},
@@ -107,7 +107,7 @@ typedef struct _testi
RtPointer p; RtPointer p;
} testi; } testi;
main() int main()
{ {
RtInt frame, i, nverts[] = {4, 4}; RtInt frame, i, nverts[] = {4, 4};
RtToken my_var; RtToken my_var;
@@ -3,9 +3,9 @@
/* Listing 8.5 An improved boilerplate viewing program */ /* Listing 8.5 An improved boilerplate viewing program */
#include <stdio.h> #include <stdio.h>
#include "ri.h" #include <jman/ri.h>
#include "camset.h" #include <jman/camset.h>
#include "patches.h" #include <jman/patches.h>
#define NFRAMES 25 #define NFRAMES 25
@@ -3,9 +3,9 @@
/* Listing 8.5 An improved boilerplate viewing program */ /* Listing 8.5 An improved boilerplate viewing program */
#include <stdio.h> #include <stdio.h>
#include "ri.h" #include <jman/ri.h>
#include "camset.h" #include <jman/camset.h>
#include "polys.h" #include <jman/polys.h>
/* viewbasics.c: file compiling view options into a rendering shell. */ /* viewbasics.c: file compiling view options into a rendering shell. */