Mercurial > hg > Game > Cerium
changeset 867:9b25de3bb8de draft
add init_aquarium with protobuf
author | kazz <kazz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 22 Jun 2010 12:52:25 +0900 |
parents | d328690a6f8f |
children | 08ed5e750d78 |
files | Renderer/Test/Makefile.macosx Renderer/Test/init_aquarium.cc Renderer/Test/protobuf/aquarium.proto |
diffstat | 3 files changed, 25 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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
--- /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 <stdio.h> +#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; +}