Skip to content

Commit ad4087e

Browse files
committed
Revert "Battery icon in editor"
This reverts commit a45a55f.
1 parent f4cdc20 commit ad4087e

File tree

7 files changed

+5
-81
lines changed

7 files changed

+5
-81
lines changed

Lumos/src/Core/OS/OS.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,7 @@ namespace Lumos
3434
//Mobile only
3535
virtual void ShowKeyboard() {};
3636
virtual void HideKeyboard() {};
37-
38-
virtual PowerState GetPowerState() { return POWERSTATE_UNKNOWN; }
39-
virtual int BatteryPercentage() { return 100; }
40-
virtual int BatterySecondsLeft() { return 100; }
41-
37+
4238
protected:
4339

4440
static OS* s_Instance;

Lumos/src/Editor/Editor.cpp

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,11 @@
1111

1212
#include "App/Application.h"
1313
#include "Core/OS/Input.h"
14-
#include "Core/OS/OS.h"
1514
#include "Core/Profiler.h"
1615
#include "App/Engine.h"
1716
#include "App/Scene.h"
1817
#include "App/SceneManager.h"
1918
#include "Events/ApplicationEvent.h"
20-
//#include "Utilities/CommonUtils.h"
2119

2220
#include "ECS/Component/Components.h"
2321
#include "Physics/LumosPhysicsEngine/LumosPhysicsEngine.h"
@@ -352,41 +350,6 @@ namespace Lumos
352350
if (selected)
353351
ImGui::PopStyleColor();
354352
}
355-
356-
ImGui::SameLine(ImGui::GetWindowContentRegionMax().x - 25.0f);
357-
358-
{
359-
auto* os = OS::Instance();
360-
auto powerState = os->GetPowerState();
361-
362-
switch(powerState)
363-
{
364-
case POWERSTATE_CHARGING :
365-
ImGui::Text(ICON_FA_BATTERY_FULL);
366-
break;
367-
case POWERSTATE_ON_BATTERY :
368-
ImGui::Text(ICON_FA_BATTERY_FULL);
369-
break;
370-
case POWERSTATE_NO_BATTERY :
371-
ImGui::Text(ICON_FA_BATTERY_EMPTY);
372-
ImGuiHelpers::Tooltip("Battery");
373-
break;
374-
case POWERSTATE_CHARGED :
375-
ImGui::Text(ICON_FA_BATTERY_FULL);
376-
break;
377-
378-
default : break;
379-
}
380-
381-
int seconds = os->BatterySecondsLeft();
382-
383-
int minutes,hours;
384-
385-
// CommonUtils::SecondsToHoursAndMinutes(seconds, hours, minutes, seconds);
386-
387-
ImGuiHelpers::Tooltip("Battery");
388-
}
389-
390353

391354
ImGui::PopStyleColor();
392355
ImGui::EndMainMenuBar();

Lumos/src/ImGui/ImGuiLayer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ namespace Lumos
2323
void OnAttach() override;
2424
void OnDetach() override;
2525
void OnUpdate(TimeStep* dt, Scene* scene) override;
26-
void OnEvent(Event& event);
26+
void OnEvent(Event& event) override;
2727
void OnRender(Scene* scene) override;
2828
void OnNewScene(Scene* scene) override;
2929

Lumos/src/Physics/B2PhysicsEngine/B2PhysicsEngine.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace Lumos
2121
~B2PhysicsEngine();
2222
void SetDefaults();
2323

24-
void OnUpdate(TimeStep* timeStep, Scene* scene);
24+
void OnUpdate(TimeStep* timeStep, Scene* scene) override;
2525
void OnInit() override {};
2626
void OnImGui() override;
2727

Lumos/src/Platform/macOS/macOSOS.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ namespace Lumos
1212
void Init();
1313
void Run() override;
1414
String GetExecutablePath() override;
15-
16-
PowerState GetPowerState() override;
17-
int BatteryPercentage() override;
18-
int BatterySecondsLeft() override;
1915

2016
};
2117
}

Lumos/src/Platform/macOS/macOSOS.mm

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -55,28 +55,4 @@
5555
}
5656
return buffer.data();
5757
}
58-
59-
PowerState macOSOS::GetPowerState()
60-
{
61-
auto power = macOSPower();
62-
auto state = power.GetPowerState();
63-
64-
return state;
65-
}
66-
67-
int macOSOS::BatteryPercentage()
68-
{
69-
auto power = macOSPower();
70-
auto percentage = power.GetPowerPercentageLeft();
71-
72-
return percentage;
73-
}
74-
75-
int macOSOS::BatterySecondsLeft()
76-
{
77-
auto power = macOSPower();
78-
auto seconds = power.GetPowerSecondsLeft();
79-
80-
return seconds;
81-
}
8258
}

Lumos/src/Utilities/CommonUtils.h

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,5 @@ namespace Lumos
5050
void AddLightCube(Scene* scene);
5151
void AddSphere(Scene* scene);
5252
void AddPyramid(Scene* scene);
53-
54-
void SecondsToHoursAndMinutes(int seconds, int& hours, int& minutes, int& leftoverSeconds)
55-
{
56-
hours = floor(seconds / 3600);
57-
minutes = seconds % 3600 / 60;
58-
59-
leftoverSeconds = seconds - seconds % 60 * 60;
60-
}
61-
}
53+
};
54+
}

0 commit comments

Comments
 (0)