Mercurial > hg > Game > Cerium
annotate Renderer/Test/init_aquarium.cc @ 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 | |
children | 08ed5e750d78 |
rev | line source |
---|---|
867
9b25de3bb8de
add init_aquarium with protobuf
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1 #include <stdio.h> |
9b25de3bb8de
add init_aquarium with protobuf
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
2 #include "lindaapi.h" |
9b25de3bb8de
add init_aquarium with protobuf
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
3 #include "aquarium.pb.h" |
9b25de3bb8de
add init_aquarium with protobuf
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
4 |
9b25de3bb8de
add init_aquarium with protobuf
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
5 int main(int argc, char *argv[]) { |
9b25de3bb8de
add init_aquarium with protobuf
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
6 init_linda(); |
9b25de3bb8de
add init_aquarium with protobuf
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
7 aqua::Width *width = new aqua::Width(); |
9b25de3bb8de
add init_aquarium with protobuf
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
8 width->set_width(0); // 0 ¤Ç½é´ü²½ |
9b25de3bb8de
add init_aquarium with protobuf
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
9 int size = width->ByteSize(); |
9b25de3bb8de
add init_aquarium with protobuf
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
10 unsigned char *msg = (unsigned char *) malloc(sizeof(char) * size); |
9b25de3bb8de
add init_aquarium with protobuf
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
11 width->SerializeToArray(msg, size); |
9b25de3bb8de
add init_aquarium with protobuf
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
12 |
9b25de3bb8de
add init_aquarium with protobuf
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
13 int linda = open_linda_java("localhost", 10000); |
9b25de3bb8de
add init_aquarium with protobuf
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
14 psx_out(linda, 1, msg, size); |
9b25de3bb8de
add init_aquarium with protobuf
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
15 psx_sync_n(); |
9b25de3bb8de
add init_aquarium with protobuf
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
16 |
9b25de3bb8de
add init_aquarium with protobuf
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
17 return 0; |
9b25de3bb8de
add init_aquarium with protobuf
kazz <kazz@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
18 } |