goat3d

changeset 80:c5e997e8fd62

lalala
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 08 May 2014 23:00:30 +0300
parents a42f6cd4e2fa
children 7458b8568463
files goatview/Makefile goatview/src/goatview.cc
diffstat 2 files changed, 14 insertions(+), 7 deletions(-) [+]
line diff
     1.1 --- a/goatview/Makefile	Thu May 08 19:30:49 2014 +0300
     1.2 +++ b/goatview/Makefile	Thu May 08 23:00:30 2014 +0300
     1.3 @@ -1,15 +1,17 @@
     1.4  PREFIX = /usr/local
     1.5  
     1.6  src = $(wildcard src/*.cc)
     1.7 +csrc = $(wildcard src/*.c)
     1.8  mochdr = src/goatview.h
     1.9  mocsrc = $(patsubst src/%.h,src/moc_%.cc,$(mochdr))
    1.10 -obj = $(sort $(src:.cc=.o) $(mocsrc:.cc=.o))
    1.11 +obj = $(sort $(csrc:.c=.o) $(src:.cc=.o) $(mocsrc:.cc=.o))
    1.12  dep = $(obj:.o=.d)
    1.13  bin = goatview
    1.14  
    1.15  goat_root = ..
    1.16  
    1.17 -CXXFLAGS = -std=c++11 -pedantic -Wall -g $(pic) -I$(goat_root)/src $(qtinc)
    1.18 +CFLAGS = -pedantic -Wall -g $(pic) -I$(goat_root)/src $(qtinc)
    1.19 +CXXFLAGS = -std=c++11 $(CFLAGS)
    1.20  LDFLAGS = $(libgoat) $(libgl) $(qtlib) -lvmath
    1.21  MOC = moc
    1.22  
    1.23 @@ -34,6 +36,9 @@
    1.24  
    1.25  -include $(dep)
    1.26  
    1.27 +%.d: %.c
    1.28 +	@$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
    1.29 +
    1.30  %.d: %.cc
    1.31  	@$(CPP) $(CXXFLAGS) $< -MM -MT $(@:.d=.o) >$@
    1.32  
     2.1 --- a/goatview/src/goatview.cc	Thu May 08 19:30:49 2014 +0300
     2.2 +++ b/goatview/src/goatview.cc	Thu May 08 23:00:30 2014 +0300
     2.3 @@ -183,9 +183,9 @@
     2.4  		int node_count = goat3d_get_node_count(scene);
     2.5  		for(int i=0; i<node_count; i++) {
     2.6  			goat3d_node *node = goat3d_get_node(scene, i);
     2.7 -			if(!goat3d_get_node_parent(node)) {
     2.8 +			//if(!goat3d_get_node_parent(node)) {
     2.9  				draw_node(node);	// only draw root nodes, the rest will be drawn recursively
    2.10 -			}
    2.11 +			//}
    2.12  		}
    2.13  	}
    2.14  }
    2.15 @@ -203,7 +203,7 @@
    2.16  	}
    2.17  
    2.18  	glPushMatrix();
    2.19 -	glLoadMatrixf(xform);
    2.20 +	glMultMatrixf(xform);
    2.21  
    2.22  	if(goat3d_get_node_type(node) == GOAT3D_NODE_MESH) {
    2.23  		goat3d_mesh *mesh = (goat3d_mesh*)goat3d_get_node_object(node);
    2.24 @@ -236,10 +236,10 @@
    2.25  		glDisableClientState(GL_TEXTURE_COORD_ARRAY);
    2.26  	}
    2.27  
    2.28 -	int num_child = goat3d_get_node_child_count(node);
    2.29 +	/*int num_child = goat3d_get_node_child_count(node);
    2.30  	for(int i=0; i<num_child; i++) {
    2.31  		draw_node(goat3d_get_node_child(node, i));
    2.32 -	}
    2.33 +	}*/
    2.34  
    2.35  	glPopMatrix();
    2.36  }
    2.37 @@ -256,6 +256,8 @@
    2.38  {
    2.39  	int dx = ev->x() - prev_x;
    2.40  	int dy = ev->y() - prev_y;
    2.41 +	prev_x = ev->x();
    2.42 +	prev_y = ev->y();
    2.43  
    2.44  	if(!dx && !dy) return;
    2.45