Skip to content

Commit

Permalink
Fix scripting and 2d graphics segfaults
Browse files Browse the repository at this point in the history
  • Loading branch information
vintagepc committed Oct 27, 2021
1 parent 8dfdd60 commit ae084e7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion hw/arm/prusa/opengl/GLDashboardMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,9 @@ void GLDashboardMgr::UpdateMotorStall(int motor, int pos) {

void GLDashboardMgr::UpdateIndicator(int iInd, int level) {
bool bIsFan = iInd == DB_IND_EFAN || iInd == DB_IND_PFAN;
bool bIsDigital = iInd == DB_IND_FSENS || iInd == DB_IND_ZPROBE;
if (iInd>=0 && iInd<DB_IND_COUNT) {
m_indicators.at(iInd)->SetValue(gsl::narrow<uint8_t>(level));
m_indicators.at(iInd)->SetValue(gsl::narrow<uint8_t>(bIsDigital ? level*255U : level));

if (m_p3DVis) {
m_p3DVis->OnBoolChanged(iInd, bIsFan ? level : level>0);
Expand Down
3 changes: 2 additions & 1 deletion hw/arm/prusa/utility/IScriptable.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ class IScriptable
friend ScriptHost;
//friend TelemetryHost;
public:
explicit IScriptable(std::string strName, bool bCanDelete = true, P404ScriptIF *obj = nullptr):m_strName(std::move(strName)),m_obj(obj),m_bCanDelete(bCanDelete){}
explicit IScriptable(std::string strName, P404ScriptIF *obj = nullptr):m_strName(std::move(strName)),m_obj(obj),m_bCanDelete(true){}
explicit IScriptable(std::string strName, bool bCanDelete = true):m_strName(std::move(strName)),m_obj(nullptr),m_bCanDelete(bCanDelete){}
virtual ~IScriptable() = default;

enum class LineStatus
Expand Down

0 comments on commit ae084e7

Please sign in to comment.