Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move rwviewer into rwgame with imgui #719

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

danhedron
Copy link
Member

@danhedron danhedron commented May 27, 2019

This removes a lot of stuff that's needed just for Qt and simplifies the code.

Screenshot from 2019-05-27 22-25-13
Screenshot from 2019-05-27 22-25-58

A few things left to match functionality with rwviewer

  • Free-cam map viewer

  • Make it possible to remove viewed objects

rwgame/RWGame.cpp Outdated Show resolved Hide resolved
std::transform(filename.begin(), filename.end(), filename.begin(),
::tolower);
if (!filename.compare("text")) {
textPath = p;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: std::move?

throw std::runtime_error("text directory not found in gamedata path");
}
std::vector<std::string> names;
for (const rwfs::path& p : rwfs::directory_iterator(textPath)) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: allocate memory for all at once?

auto langName = p.filename().string();
std::transform(langName.begin(), langName.end(), langName.begin(),
::tolower);
names.push_back(langName);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: std::move?

rwgame/RWViewer.hpp Outdated Show resolved Hide resolved
rwgame/RWViewer.hpp Outdated Show resolved Hide resolved
rwgame/RWGame.cpp Outdated Show resolved Hide resolved
rwgame/RWGame.cpp Outdated Show resolved Hide resolved
rwgame/RWViewer.cpp Outdated Show resolved Hide resolved
if (ImGui::Selectable(it->second.second.c_str(), false,
ImGuiSelectableFlags_AllowDoubleClick)) {
if (ImGui::IsMouseDoubleClicked(0)) {
strncpy(previewStr_, it->second.second.c_str(), 512);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

std::copy_n

@codecov
Copy link

codecov bot commented May 27, 2019

Codecov Report

Merging #719 into master will increase coverage by 0.59%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #719      +/-   ##
==========================================
+ Coverage   18.12%   18.72%   +0.59%     
==========================================
  Files         252      229      -23     
  Lines       22938    22211     -727     
  Branches     5769     5795      +26     
==========================================
  Hits         4158     4158              
+ Misses      17659    16935     -724     
+ Partials     1121     1118       -3
Impacted Files Coverage Δ
rwgame/RWGame.hpp 0% <ø> (ø) ⬆️
rwgame/main.cpp 0% <0%> (ø) ⬆️
rwgame/RWConfig.inc 46.66% <0%> (-3.34%) ⬇️
rwgame/viewer/RWViewer.hpp 0% <0%> (ø)
rwgame/viewer/RWViewerWindows.cpp 0% <0%> (ø)
rwgame/RWImGui.cpp 0% <0%> (ø) ⬆️
rwgame/RWGame.cpp 0% <0%> (ø) ⬆️
rwgame/viewer/RWViewerWindows.hpp 0% <0%> (ø)
rwgame/viewer/RWViewer.cpp 0% <0%> (ø)
rwengine/src/objects/CharacterObject.cpp 13.25% <0%> (ø) ⬆️
... and 18 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 51b7264...69afb86. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants