From ce48af53646cd9e7ec762fc1ac176b3aa620b11d Mon Sep 17 00:00:00 2001 From: manuel Date: Thu, 5 May 2011 00:57:07 +0200 Subject: - refactorized the whole project and made a few subprojects - replaced tcp with enet - added connect dialog - some smaller bugfixes --- pacman-c++/proto/pacman.proto | 18 ++++++++++++++++++ pacman-c++/proto/proto.pro | 9 +++++++++ pacman-c++/proto/protobuf.pri | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+) create mode 100644 pacman-c++/proto/pacman.proto create mode 100644 pacman-c++/proto/proto.pro create mode 100644 pacman-c++/proto/protobuf.pri (limited to 'pacman-c++/proto') 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 @@ +package ProtoBuf; + +message KeyPressUpdate { + required uint32 newKey = 1; +} + +message Init { + required uint32 color = 1; + required uint32 maxplayers = 2; +} + +message MapUpdate { + repeated uint32 field = 1 [packed=true]; + repeated uint32 round_points = 2; + repeated uint32 game_points = 3; + repeated uint32 eating_order = 4; +} + 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 @@ +TEMPLATE = lib +CONFIG += staticlib + +include(../common.pri) + +PROTOS = pacman.proto +include(protobuf.pri) +LIBS += -lprotobuf +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 @@ +# +# Qt qmake integration with Google Protocol Buffers compiler protoc +# +# To compile protocol buffers with qt qmake, specify PROTOS variable and +# include this file +# +# Example: +# PROTOS = a.proto b.proto +# include(protobuf.pri) +# +# By default protoc looks for .proto files (including the imported ones) in +# the current directory where protoc is run. If you need to include additional +# paths specify the PROTOPATH variable +# + +PROTOPATH += . +PROTOPATHS = +for(p, PROTOPATH):PROTOPATHS += --proto_path=$${p} + +protobuf_decl.name = protobuf header +protobuf_decl.input = PROTOS +protobuf_decl.output = ${QMAKE_FILE_BASE}.pb.h +protobuf_decl.commands = protoc --cpp_out="." $${PROTOPATHS} $(INCPATH) ${QMAKE_FILE_IN} +protobuf_decl.variable_out = GENERATED_FILES +QMAKE_EXTRA_COMPILERS += protobuf_decl + +protobuf_impl.name = protobuf implementation +protobuf_impl.input = PROTOS +protobuf_impl.output = ${QMAKE_FILE_BASE}.pb.cc +protobuf_impl.depends = ${QMAKE_FILE_BASE}.pb.h +protobuf_impl.commands = $$escape_expand(\\n) +protobuf_impl.variable_out = GENERATED_SOURCES +QMAKE_EXTRA_COMPILERS += protobuf_impl -- cgit v1.2.3