Skip to content

Commit

Permalink
Sync tile totalSamples
Browse files Browse the repository at this point in the history
Forgot to do that, which makes the sdl drawing code unhappy.
  • Loading branch information
vkoskiv committed Nov 3, 2023
1 parent c053654 commit c0ca45d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/utils/protocol/protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ cJSON *encodeTile(const struct renderTile *tile) {
cJSON_AddNumberToObject(json, "state", tile->state);
cJSON_AddNumberToObject(json, "index", tile->index);
cJSON_AddNumberToObject(json, "completed_samples", tile->completed_samples);
cJSON_AddNumberToObject(json, "total_samples", tile->total_samples);
return json;
}

Expand All @@ -96,6 +97,7 @@ struct renderTile decodeTile(const cJSON *json) {
tile.state = cJSON_GetObjectItem(json, "state")->valueint;
tile.index = cJSON_GetObjectItem(json, "index")->valueint;
tile.completed_samples = cJSON_GetObjectItem(json, "completed_samples")->valueint;
tile.total_samples = cJSON_GetObjectItem(json, "total_samples")->valueint;
return tile;
}

Expand Down

0 comments on commit c0ca45d

Please sign in to comment.