Skip to content

Commit

Permalink
cleanup Event.proto remove it to Object.proto and rename
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertBColton committed Mar 16, 2019
1 parent a421640 commit 50a838f
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 26 deletions.
2 changes: 1 addition & 1 deletion CommandLine/libEGM/action.h
Expand Up @@ -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>

Expand Down
4 changes: 2 additions & 2 deletions CompilerSource/compiler/components/write_defragged_events.cpp
Expand Up @@ -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";
}
Expand Down Expand Up @@ -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;
Expand Down
9 changes: 0 additions & 9 deletions shared/protos/Event.proto → shared/protos/Action.proto
Expand Up @@ -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"];
}
34 changes: 21 additions & 13 deletions shared/protos/Object.proto
Expand Up @@ -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; }

Expand All @@ -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"];
}
1 change: 0 additions & 1 deletion shared/protos/Timeline.proto
Expand Up @@ -2,7 +2,6 @@ syntax = "proto2";
package buffers.resources;

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

message Timeline {
message Moment {
Expand Down

0 comments on commit 50a838f

Please sign in to comment.