Get RFR to actually compile. Many structure changes so it doesn't work yet.

develop
Rose 2022-12-27 00:46:04 -08:00
parent 5f70a26803
commit 6783075ff2
2 changed files with 37 additions and 34 deletions

@ -271,7 +271,8 @@ void CopyItem(RemoteFortressReader::Item * NetItem, df::item * DfItem)
case df::enums::item_type::GLOVES: case df::enums::item_type::GLOVES:
break; break;
case df::enums::item_type::BOX: 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; break;
case df::enums::item_type::BIN: case df::enums::item_type::BIN:
break; break;

@ -319,14 +319,14 @@ uint16_t fletcher16(uint8_t const *data, size_t bytes)
void ConvertDfColor(int16_t index, RemoteFortressReader::ColorDefinition * out) void ConvertDfColor(int16_t index, RemoteFortressReader::ColorDefinition * out)
{ {
if (!df::global::enabler) if (!df::global::gps)
return; return;
auto enabler = df::global::enabler; auto gps = df::global::gps;
out->set_red((int)(enabler->ccolor[index][0] * 255)); out->set_red(gps->uccolor[index][0]);
out->set_green((int)(enabler->ccolor[index][1] * 255)); out->set_green(gps->uccolor[index][1]);
out->set_blue((int)(enabler->ccolor[index][2] * 255)); out->set_blue(gps->uccolor[index][2]);
} }
void ConvertDfColor(int16_t in[3], RemoteFortressReader::ColorDefinition * out) 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::getViewCoords(x, y, z);
Gui::getCursorCoords(cx, cy, cz); Gui::getCursorCoords(cx, cy, cz);
#if DF_VERSION_INT > 34011 //FIXME: Get get this info from the new embark screen.
auto embark = Gui::getViewscreenByType<df::viewscreen_choose_start_sitest>(0); //#if DF_VERSION_INT > 34011
if (embark) // auto embark = Gui::getViewscreenByType<df::viewscreen_choose_start_sitest>(0);
{ // if (embark)
df::embark_location location = embark->location; // {
df::world_data * data = df::global::world->world_data; // df::embark_location location = embark->location;
if (data && data->region_map) // 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; // {
} // z = data->region_map[location.region_pos.x][location.region_pos.y].elevation;
} // }
#endif // }
//#endif
auto dims = Gui::getDwarfmodeViewDims(); auto dims = Gui::getDwarfmodeViewDims();
@ -1915,22 +1916,23 @@ static command_result GetMapInfo(color_ostream &stream, const EmptyMessage *in,
DFCoord GetMapCenter() DFCoord GetMapCenter()
{ {
DFCoord output; DFCoord output;
#if DF_VERSION_INT > 34011 //FIXME: Does this even still exist?
auto embark = Gui::getViewscreenByType<df::viewscreen_choose_start_sitest>(0); //#if DF_VERSION_INT > 34011
if (embark) // auto embark = Gui::getViewscreenByType<df::viewscreen_choose_start_sitest>(0);
{ // if (embark)
df::embark_location location = embark->location; // {
output.x = (location.region_pos.x * 16) + 8; // df::embark_location location = embark->location;
output.y = (location.region_pos.y * 16) + 8; // output.x = (location.region_pos.x * 16) + 8;
output.z = 100; // output.y = (location.region_pos.y * 16) + 8;
df::world_data * data = df::global::world->world_data; // output.z = 100;
if (data && data->region_map) // 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; // {
} // output.z = data->region_map[location.region_pos.x][location.region_pos.y].elevation;
} // }
else // }
#endif // else
//#endif
if (Maps::IsValid()) if (Maps::IsValid())
{ {
int x, y, z; int x, y, z;