diff options
| author | manuel <manuel@mausz.at> | 2011-05-05 00:57:07 +0200 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2011-05-05 00:57:07 +0200 |
| commit | ce48af53646cd9e7ec762fc1ac176b3aa620b11d (patch) | |
| tree | f8fbf2cae8c7d0cbac2696a8f4cf94410bfb4928 /pacman-c++/proto | |
| parent | e54ccad07e256ba877bd41d70bd358bd0085bd1e (diff) | |
| download | foop-ce48af53646cd9e7ec762fc1ac176b3aa620b11d.tar.gz foop-ce48af53646cd9e7ec762fc1ac176b3aa620b11d.tar.bz2 foop-ce48af53646cd9e7ec762fc1ac176b3aa620b11d.zip | |
- refactorized the whole project and made a few subprojects
- replaced tcp with enet
- added connect dialog
- some smaller bugfixes
Diffstat (limited to 'pacman-c++/proto')
| -rw-r--r-- | pacman-c++/proto/pacman.proto | 18 | ||||
| -rw-r--r-- | pacman-c++/proto/proto.pro | 9 | ||||
| -rw-r--r-- | pacman-c++/proto/protobuf.pri | 33 |
3 files changed, 60 insertions, 0 deletions
diff --git a/pacman-c++/proto/pacman.proto b/pacman-c++/proto/pacman.proto new file mode 100644 index 0000000..8e088e8 --- /dev/null +++ b/pacman-c++/proto/pacman.proto | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | package ProtoBuf; | ||
| 2 | |||
| 3 | message KeyPressUpdate { | ||
| 4 | required uint32 newKey = 1; | ||
| 5 | } | ||
| 6 | |||
| 7 | message Init { | ||
| 8 | required uint32 color = 1; | ||
| 9 | required uint32 maxplayers = 2; | ||
| 10 | } | ||
| 11 | |||
| 12 | message MapUpdate { | ||
| 13 | repeated uint32 field = 1 [packed=true]; | ||
| 14 | repeated uint32 round_points = 2; | ||
| 15 | repeated uint32 game_points = 3; | ||
| 16 | repeated uint32 eating_order = 4; | ||
| 17 | } | ||
| 18 | |||
diff --git a/pacman-c++/proto/proto.pro b/pacman-c++/proto/proto.pro new file mode 100644 index 0000000..7c0b334 --- /dev/null +++ b/pacman-c++/proto/proto.pro | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | TEMPLATE = lib | ||
| 2 | CONFIG += staticlib | ||
| 3 | |||
| 4 | include(../common.pri) | ||
| 5 | |||
| 6 | PROTOS = pacman.proto | ||
| 7 | include(protobuf.pri) | ||
| 8 | LIBS += -lprotobuf | ||
| 9 | OTHER_FILES += $${PROTOS} | ||
diff --git a/pacman-c++/proto/protobuf.pri b/pacman-c++/proto/protobuf.pri new file mode 100644 index 0000000..718cb70 --- /dev/null +++ b/pacman-c++/proto/protobuf.pri | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | # | ||
| 2 | # Qt qmake integration with Google Protocol Buffers compiler protoc | ||
| 3 | # | ||
| 4 | # To compile protocol buffers with qt qmake, specify PROTOS variable and | ||
| 5 | # include this file | ||
| 6 | # | ||
| 7 | # Example: | ||
| 8 | # PROTOS = a.proto b.proto | ||
| 9 | # include(protobuf.pri) | ||
| 10 | # | ||
| 11 | # By default protoc looks for .proto files (including the imported ones) in | ||
| 12 | # the current directory where protoc is run. If you need to include additional | ||
| 13 | # paths specify the PROTOPATH variable | ||
| 14 | # | ||
| 15 | |||
| 16 | PROTOPATH += . | ||
| 17 | PROTOPATHS = | ||
| 18 | for(p, PROTOPATH):PROTOPATHS += --proto_path=$${p} | ||
| 19 | |||
| 20 | protobuf_decl.name = protobuf header | ||
| 21 | protobuf_decl.input = PROTOS | ||
| 22 | protobuf_decl.output = ${QMAKE_FILE_BASE}.pb.h | ||
| 23 | protobuf_decl.commands = protoc --cpp_out="." $${PROTOPATHS} $(INCPATH) ${QMAKE_FILE_IN} | ||
| 24 | protobuf_decl.variable_out = GENERATED_FILES | ||
| 25 | QMAKE_EXTRA_COMPILERS += protobuf_decl | ||
| 26 | |||
| 27 | protobuf_impl.name = protobuf implementation | ||
| 28 | protobuf_impl.input = PROTOS | ||
| 29 | protobuf_impl.output = ${QMAKE_FILE_BASE}.pb.cc | ||
| 30 | protobuf_impl.depends = ${QMAKE_FILE_BASE}.pb.h | ||
| 31 | protobuf_impl.commands = $$escape_expand(\\n) | ||
| 32 | protobuf_impl.variable_out = GENERATED_SOURCES | ||
| 33 | QMAKE_EXTRA_COMPILERS += protobuf_impl | ||
