From 6783075ff294ce45060b4c956ed8a432e259880c Mon Sep 17 00:00:00 2001 From: Rose Date: Tue, 27 Dec 2022 00:46:04 -0800 Subject: [PATCH] Get RFR to actually compile. Many structure changes so it doesn't work yet. --- plugins/remotefortressreader/item_reader.cpp | 3 +- .../remotefortressreader.cpp | 68 ++++++++++--------- 2 files changed, 37 insertions(+), 34 deletions(-) diff --git a/plugins/remotefortressreader/item_reader.cpp b/plugins/remotefortressreader/item_reader.cpp index 56ec9019b..c791852f3 100644 --- a/plugins/remotefortressreader/item_reader.cpp +++ b/plugins/remotefortressreader/item_reader.cpp @@ -271,7 +271,8 @@ void CopyItem(RemoteFortressReader::Item * NetItem, df::item * DfItem) case df::enums::item_type::GLOVES: break; case df::enums::item_type::BOX: - type->set_mat_index(DfItem->isBag()); + //FIXME: Figure out how things change with this. Possibly make sure the item types are mutable. + //type->set_mat_index(DfItem->isBag()); break; case df::enums::item_type::BIN: break; diff --git a/plugins/remotefortressreader/remotefortressreader.cpp b/plugins/remotefortressreader/remotefortressreader.cpp index 643e92b21..acf7f27ad 100644 --- a/plugins/remotefortressreader/remotefortressreader.cpp +++ b/plugins/remotefortressreader/remotefortressreader.cpp @@ -319,14 +319,14 @@ uint16_t fletcher16(uint8_t const *data, size_t bytes) void ConvertDfColor(int16_t index, RemoteFortressReader::ColorDefinition * out) { - if (!df::global::enabler) + if (!df::global::gps) return; - auto enabler = df::global::enabler; + auto gps = df::global::gps; - out->set_red((int)(enabler->ccolor[index][0] * 255)); - out->set_green((int)(enabler->ccolor[index][1] * 255)); - out->set_blue((int)(enabler->ccolor[index][2] * 255)); + out->set_red(gps->uccolor[index][0]); + out->set_green(gps->uccolor[index][1]); + out->set_blue(gps->uccolor[index][2]); } void ConvertDfColor(int16_t in[3], RemoteFortressReader::ColorDefinition * out) @@ -1854,18 +1854,19 @@ static command_result GetViewInfo(color_ostream &stream, const EmptyMessage *in, Gui::getViewCoords(x, y, z); Gui::getCursorCoords(cx, cy, cz); -#if DF_VERSION_INT > 34011 - auto embark = Gui::getViewscreenByType(0); - if (embark) - { - df::embark_location location = embark->location; - df::world_data * data = df::global::world->world_data; - if (data && data->region_map) - { - z = data->region_map[location.region_pos.x][location.region_pos.y].elevation; - } - } -#endif + //FIXME: Get get this info from the new embark screen. +//#if DF_VERSION_INT > 34011 +// auto embark = Gui::getViewscreenByType(0); +// if (embark) +// { +// df::embark_location location = embark->location; +// df::world_data * data = df::global::world->world_data; +// if (data && data->region_map) +// { +// z = data->region_map[location.region_pos.x][location.region_pos.y].elevation; +// } +// } +//#endif auto dims = Gui::getDwarfmodeViewDims(); @@ -1915,22 +1916,23 @@ static command_result GetMapInfo(color_ostream &stream, const EmptyMessage *in, DFCoord GetMapCenter() { DFCoord output; -#if DF_VERSION_INT > 34011 - auto embark = Gui::getViewscreenByType(0); - if (embark) - { - df::embark_location location = embark->location; - output.x = (location.region_pos.x * 16) + 8; - output.y = (location.region_pos.y * 16) + 8; - output.z = 100; - df::world_data * data = df::global::world->world_data; - if (data && data->region_map) - { - output.z = data->region_map[location.region_pos.x][location.region_pos.y].elevation; - } - } - else -#endif +//FIXME: Does this even still exist? +//#if DF_VERSION_INT > 34011 +// auto embark = Gui::getViewscreenByType(0); +// if (embark) +// { +// df::embark_location location = embark->location; +// output.x = (location.region_pos.x * 16) + 8; +// output.y = (location.region_pos.y * 16) + 8; +// output.z = 100; +// df::world_data * data = df::global::world->world_data; +// if (data && data->region_map) +// { +// output.z = data->region_map[location.region_pos.x][location.region_pos.y].elevation; +// } +// } +// else +//#endif if (Maps::IsValid()) { int x, y, z;