Skip to content
Permalink
Browse files

Protos: Include a discrete MIME type in file_path fields.

  • Loading branch information
JoshDreamland committed Jan 14, 2020
1 parent 90813d2 commit 758c67d8b8738fc42413bc0903b29440884b432c
Showing with 29 additions and 16 deletions.
  1. +1 −1 shared/protos/Background.proto
  2. +1 −1 shared/protos/Sound.proto
  3. +1 −1 shared/protos/Sprite.proto
  4. +26 −13 shared/protos/options.proto
@@ -25,5 +25,5 @@ message Background {
optional uint32 width = 15;
optional uint32 height = 16;

optional string image = 17 [(gmx) = "data", (file_path) = true];
optional string image = 17 [(gmx) = "data", (file_path) = true, (file_kind) = IMAGE];
}
@@ -20,7 +20,7 @@ message Sound {

optional Type type = 9 [(gmx) = "types/type"];

optional string data = 10 [(gmx) = "origname", (file_path) = true];
optional string data = 10 [(gmx) = "origname", (file_path) = true, (file_kind) = AUDIO];

optional int32 effects = 11;
optional uint32 bit_rate = 12 [(gmx) = "bitRates/bitRate"];
@@ -35,5 +35,5 @@ message Sprite {
optional uint32 width = 19;
optional uint32 height = 20;

repeated string subimages = 21 [(gmx) = "frames/frame", (file_path) = true];
repeated string subimages = 21 [(gmx) = "frames/frame", (file_path) = true, (file_kind) = IMAGE];
}
@@ -1,13 +1,26 @@
syntax = "proto2";
package buffers;

import "google/protobuf/descriptor.proto";
extend google.protobuf.FieldOptions {
optional int32 id_start = 50000;
optional bool file_path = 50001;
optional string resource_ref = 50002;
optional string gmx = 50003;
optional string gmx_id = 50004;
optional string yyp = 50005;
optional string yyp_id = 50006;
}
syntax = "proto2";
package buffers;

enum FileKind {
UNKNOWN = 0;
APPLICATION = 1;
AUDIO = 2;
FONT = 3;
IMAGE = 4;
MODEL = 5;
TEXT = 6;
VIDEO = 7;
}

import "google/protobuf/descriptor.proto";
extend google.protobuf.FieldOptions {
optional int32 id_start = 50000;
optional bool file_path = 50001;
optional string resource_ref = 50002;
optional string gmx = 50003;
optional string gmx_id = 50004;
optional string yyp = 50005;
optional string yyp_id = 50006;
// When file_path is true, this is the type of file indicated.
optional FileKind file_kind = 50007;
}

0 comments on commit 758c67d

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