# HG changeset patch # User kazz # Date 1277178745 -32400 # Node ID 58d426cece23659983a2e22d0349243f11c278ae # Parent a37eb30d40d8205a7cb9131e895e8ebcc7570fb5 add init_aquarium with protobuf diff -r a37eb30d40d8 -r 58d426cece23 Renderer/Test/Makefile.macosx --- a/Renderer/Test/Makefile.macosx Tue Jun 22 12:10:37 2010 +0900 +++ b/Renderer/Test/Makefile.macosx Tue Jun 22 12:52:25 2010 +0900 @@ -19,7 +19,7 @@ %.pb.cc: $(PROTODIR)/%.proto $(PROTO) $(PROTOFLAGS) $< -ALL = ball_bound boss1_action direction gaplant ieshoot node panel universe untitled vacuum property_test send_linda dynamic writer chain_old SgRootChange viewer aquarium +ALL = ball_bound boss1_action direction gaplant ieshoot node panel universe untitled vacuum property_test send_linda dynamic writer chain_old SgRootChange viewer aquarium init_aquarium oFLAGS=-g -O2 CFLAGt=-g -O2 @@ -97,6 +97,9 @@ aquarium : $(AQUARIUM_OBJ) $(CC) -o $@ $? $(LIBS) $(PROTOLIBS) +INIT_AQUARIUM_OBJ = aquarium.pb.o init_aquarium.o +init_aquarium : $(INIT_AQUARIUM_OBJ) + $(CC) -o $@ $? $(LIBS) $(PROTOLIBS) run: $(TARGET) sudo ./$(TARGET) -width 576 -height 384 -bpp 32 @@ -113,5 +116,5 @@ rm -f *~ \#* $(ALL) rm -f $(BALL_BOUND_XML).cc $(BALL_BOUND_XML).h $(BALL_BOUND_OBJ) rm -f *.pb.{cc,h} - + -include depend.inc diff -r a37eb30d40d8 -r 58d426cece23 Renderer/Test/init_aquarium.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Renderer/Test/init_aquarium.cc Tue Jun 22 12:52:25 2010 +0900 @@ -0,0 +1,18 @@ +#include +#include "lindaapi.h" +#include "aquarium.pb.h" + +int main(int argc, char *argv[]) { + init_linda(); + aqua::Width *width = new aqua::Width(); + width->set_width(0); // 0 ¤Ç½é´ü²½ + int size = width->ByteSize(); + unsigned char *msg = (unsigned char *) malloc(sizeof(char) * size); + width->SerializeToArray(msg, size); + + int linda = open_linda_java("localhost", 10000); + psx_out(linda, 1, msg, size); + psx_sync_n(); + + return 0; +} diff -r a37eb30d40d8 -r 58d426cece23 Renderer/Test/protobuf/aquarium.proto --- a/Renderer/Test/protobuf/aquarium.proto Tue Jun 22 12:10:37 2010 +0900 +++ b/Renderer/Test/protobuf/aquarium.proto Tue Jun 22 12:52:25 2010 +0900 @@ -1,3 +1,5 @@ +package aqua; + message Width { required int32 width = 1; }