Skip to content
Permalink
Browse files

cleanup Event.proto remove it to Object.proto and rename

  • Loading branch information...
RobertBColton committed Mar 16, 2019
1 parent a421640 commit 50a838f6e01b6a21a7104606d8e22735ae57e6ec
@@ -15,7 +15,7 @@
*** with this code. If not, see <http://www.gnu.org/licenses/>
**/

#include "Event.pb.h"
#include "Action.pb.h"

#include <vector>

@@ -46,7 +46,7 @@ struct foundevent {
};
typedef map<string,foundevent>::iterator evfit;

static inline int event_get_number(const buffers::resources::Event &event) {
static inline int event_get_number(const buffers::resources::Object::Event &event) {
if (event.has_name()) {
std::cerr << "ERROR! IMPLEMENT ME: Event names not supported in compiler.\n";
}
@@ -169,7 +169,7 @@ int lang_CPP::compile_writeDefraggedEvents(const GameData &game, const ParsedObj
// Here's the initializer
wto << " int event_system_initialize()" << endl << " {" << endl;
wto << " events = new event_iter[" << used_events.size() << "]; // Allocated here; not really meant to change." << endl;

int obj_high_id = 0;
for (parsed_object *obj : parsed_objects) {
if (obj->id > obj_high_id) obj_high_id = obj->id;
@@ -73,12 +73,3 @@ message Action {
optional bool is_not = 12 [(gmx) = "isnot"];
repeated Argument arguments = 13 [(gmx) = "arguments/argument"];
}

message Event {
optional int32 type = 1 [(gmx) = "eventtype"];
oneof reference {
int32 number = 2 [(gmx) = "enumb"];
string name = 3 [(gmx) = "ename", (yyp_id) = "collisionObjectId"];
}
optional string code = 4 [(gmx) = "action"];
}
@@ -2,21 +2,16 @@ syntax = "proto2";
package buffers.resources;

import "options.proto";
import "Event.proto";

message Object {
optional int32 id = 2 [(gmx) = "GMX_DEPRECATED"];

optional string parent_name = 3 [(resource_ref)="object", (gmx) = "parentName", (yyp_id) = "parentObjectId"];
optional string sprite_name = 4 [(resource_ref)="sprite", (gmx) = "spriteName", (yyp_id) = "spriteId"];
optional string mask_name = 5 [(resource_ref)="sprite", (gmx) = "maskName", (yyp_id) = "maskSpriteId"];

optional int32 depth = 6 [(yyp) = "YYP_DEPRECATED"];
optional bool solid = 7;
optional bool visible = 8;
optional bool persistent = 9;

repeated Event events = 10 [(gmx) = "events/event", (yyp) = "eventList"];
message Event {
optional int32 type = 1 [(gmx) = "eventtype"];
oneof reference {
int32 number = 2 [(gmx) = "enumb"];
string name = 3 [(gmx) = "ename", (yyp_id) = "collisionObjectId"];
}
optional string code = 4 [(gmx) = "action"];
}

enum PhysicsShape { CIRCLE = 0; BOX = 1; SHAPE = 2; }

@@ -40,5 +35,18 @@ message Object {
repeated PhysicsShapePoint phy_shape = 12 [(gmx) = "PhysicsShapePoints/point", (yyp) = "physicsShapePoints"];
}

optional int32 id = 2 [(gmx) = "GMX_DEPRECATED"];

optional string parent_name = 3 [(resource_ref)="object", (gmx) = "parentName", (yyp_id) = "parentObjectId"];
optional string sprite_name = 4 [(resource_ref)="sprite", (gmx) = "spriteName", (yyp_id) = "spriteId"];
optional string mask_name = 5 [(resource_ref)="sprite", (gmx) = "maskName", (yyp_id) = "maskSpriteId"];

optional int32 depth = 6 [(yyp) = "YYP_DEPRECATED"];
optional bool solid = 7;
optional bool visible = 8;
optional bool persistent = 9;

repeated Event events = 10 [(gmx) = "events/event", (yyp) = "eventList"];

optional ObjectPhysicsSettings physics_settings = 11 [(gmx) = "EGM_NESTED"];
}
@@ -2,7 +2,6 @@ syntax = "proto2";
package buffers.resources;

import "options.proto";
import "Event.proto";

message Timeline {
message Moment {

0 comments on commit 50a838f

Please sign in to comment.
You can’t perform that action at this time.