Skip to content

Commit 2f549f2

Browse files
committed
Merge remote-tracking branch 'remotes/origin/feature/3D_render' into chore/aggregateBranches
# Conflicts: # src/DasherController.cpp # src/DasherUIScreen.cpp # src/DasherUIScreen.h # src/MainWindow.cpp
2 parents fd9ae60 + 5f97eee commit 2f549f2

File tree

6 files changed

+15
-14
lines changed

6 files changed

+15
-14
lines changed

src/DasherController.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,7 @@ void DasherController::CreateModules()
9090
{
9191
CDashIntfScreenMsgs::CreateModules();
9292

93-
GetModuleManager()->RegisterInputDeviceModule(ScreenModule.get());
94-
95-
SocketInputModule = std::make_shared<SocketInput>(m_pSettingsStore, this, m_pFramerate);
96-
GetModuleManager()->RegisterInputDeviceModule(SocketInputModule.get());
97-
SocketInputModule->startListen();
98-
99-
GetModuleManager()->SetDefaultInputDevice(SocketInputModule.get());
93+
GetModuleManager()->RegisterInputDeviceModule(ScreenModule.get(), true);
10094
}
10195

10296
void DasherController::CopyToClipboard(const std::string& text)

src/DasherUIScreen.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include "MainWindow.h"
44
#include "imgui/imgui_internal.h"
55

6-
DasherUIScreen::DasherUIScreen(): Dasher::CDasherScreen(100,100), CScreenCoordInput(_("Mouse Input"))
6+
DasherUIScreen::DasherUIScreen(): Dasher::CDasherScreen(100,100), CScreenCoordInput("Mouse Input")
77
{
88
Font = MainWindow::LoadFonts(50.0f);
99
}
@@ -93,7 +93,7 @@ bool DasherUIScreen::IsPointVisible(Dasher::screenint, Dasher::screenint){
9393
return true;
9494
}
9595

96-
bool DasherUIScreen::SetCanvasSize(const ImVec2 position, const ImVec2 size)
96+
bool DasherUIScreen::SetCanvasSize(ImVec2 position, ImVec2 size)
9797
{
9898
if(fabs(this->CanvasSize.x - size.x) > std::numeric_limits<float>::epsilon() || fabs(this->CanvasSize.y - size.y) > std::numeric_limits<float>::epsilon())
9999
{

src/DasherUIScreen.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ class DasherUIScreen : public Dasher::CDasherScreen, public Dasher::CScreenCoord
2020
bool IsPointVisible(Dasher::screenint x, Dasher::screenint y) override;
2121

2222
bool SetCanvasSize(ImVec2 CanvasPos, ImVec2 CanvasSize);
23-
2423
bool GetScreenCoords(Dasher::screenint& iX, Dasher::screenint& iY, Dasher::CDasherView* pView) override;
2524

2625
private:

src/MainWindow.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ MainWindow::MainWindow()
1818
Controller->Initialize();
1919

2020
Controller->GetPermittedValues(Dasher::SP_ALPHABET_ID, Alphabets);
21+
Controller->GetPermittedValues(Dasher::SP_COLOUR_ID, ColorPalettes);
2122
}
2223

2324
#define FORWARD_KEY(ImGui_Key, DasherKey) { \
@@ -105,10 +106,16 @@ bool MainWindow::render(float DeltaTime)
105106
Controller->SetLongParameter(Dasher::LP_MAX_BITRATE, speed);
106107
}
107108

108-
static int item_current = 0;
109-
if(ImGui::Combo("Alphabet", &item_current, [](void* data, int idx, const char** out_text) { *out_text = static_cast<const std::vector<std::string>*>(data)->at(idx).c_str(); return true; }, (void*)&Alphabets, static_cast<int>(Alphabets.size()), 10))
109+
static int item_current_alphabet = 0;
110+
if(ImGui::Combo("Alphabet", &item_current_alphabet, [](void* data, int idx, const char** out_text) { *out_text = static_cast<const std::vector<std::string>*>(data)->at(idx).c_str(); return true; }, (void*)&Alphabets, static_cast<int>(Alphabets.size()), 10))
110111
{
111-
Controller->SetStringParameter(Dasher::SP_ALPHABET_ID, Alphabets[item_current]);
112+
Controller->SetStringParameter(Dasher::SP_ALPHABET_ID, Alphabets[item_current_alphabet]);
113+
}
114+
115+
static int item_current_colorpalette = 0;
116+
if(ImGui::Combo("Color Palette", &item_current_colorpalette, [](void* data, int idx, const char** out_text) { *out_text = static_cast<const std::vector<std::string>*>(data)->at(idx).c_str(); return true; }, (void*)&ColorPalettes, static_cast<int>(ColorPalettes.size()), 10))
117+
{
118+
Controller->SetStringParameter(Dasher::SP_COLOUR_ID, ColorPalettes[item_current_colorpalette]);
112119
}
113120

114121
ImGui::EndMenu();

src/MainWindow.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,6 @@ class MainWindow : public Dasher::CommandlineErrorDisplay
3232
std::unique_ptr <Dasher::XmlSettingsStore> Settings;
3333
std::unique_ptr<DasherController> Controller;
3434
std::vector<std::string> Alphabets;
35+
std::vector<std::string> ColorPalettes;
3536
};
3637

src/SocketInput.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ SocketInput::~SocketInput()
2020

2121
bool SocketInput::GetScreenCoords(Dasher::screenint& iX, Dasher::screenint& iY, Dasher::CDasherView* pView)
2222
{
23-
const Dasher::CDasherView::ScreenRegion screenRegion = pView->VisibleRegion();
23+
const Dasher::CDasherView::DasherCoordScreenRegion screenRegion = pView->VisibleRegion();
2424

2525
const double vectorLength = static_cast<double>(std::min(Dasher::CDasherModel::ORIGIN_Y - screenRegion.minY, screenRegion.maxY - Dasher::CDasherModel::ORIGIN_Y));
2626
const double normalization = sqrt(lastRelativeX * lastRelativeX + lastRelativeY * lastRelativeY);

0 commit comments

Comments
 (0)