Skip to content

Commit

Permalink
0.7.0 minor fix and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
proconsule committed Sep 5, 2023
1 parent c0c1175 commit 1a451d1
Show file tree
Hide file tree
Showing 14 changed files with 75 additions and 78 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ FAQ
-----
**Question:** My 4K file dont work? Why?

**Answer** ~~Keep in mind that currently Homebrew apps can't access the HW Decoder, so all is done with CPU, 4K file is too heavy to be decoded~~ **From version 0.7.0 NXMP have HW Decoding for format H264,HEVC,VP9,MPEG2 it can decode up to 4K HDR@30fps
**Answer** ~~Keep in mind that currently Homebrew apps can't access the HW Decoder, so all is done with CPU, 4K file is too heavy to be decoded~~ **From version 0.7.0 NXMP have HW Decoding for format H264,HEVC,VP9,MPEG2 it can decode up to 4K HDR@30fps**


**Q:** What is Enigma2?
Expand All @@ -74,7 +74,7 @@ Thanks to
-----
- Cpasjuste for pPlay https://github.com/Cpasjuste/pplay some code was taken here (mpv and Overclock part)
- DarkMatterCore for libusbhsfs https://github.com/DarkMatterCore/libusbhsfs (this gives NXMP USB support)
- Averne for HW Decoding on Tegra X1 and for all the hints and help (thanks a lot!)
- Averne for HW Decoding on Tegra X1 https://github.com/averne/FFmpeg and for all the hints and help (thanks a lot!)
- Chocola @ GBATemp forum for usage guide and beta testing
- sashka69 @ GBATemp forum for beta testing
- bodyXY @ GBATemp forum for banner and icons
Expand Down
4 changes: 4 additions & 0 deletions include/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ typedef struct{
int slang;
bool useoc;
bool hwdec = true;
bool vsync = false;
int subfontsize;
float subfontscale;
int deint;
Expand Down Expand Up @@ -76,6 +77,9 @@ class Config{

bool getHWDec(bool tmpvalue);
void setHWDec(bool _val);

bool getVSYNC(bool tmpvalue);
void setVSYNC(bool _val);

int getSubFontSize(bool tmpvalue);
void setSubFontSize(int val);
Expand Down
5 changes: 0 additions & 5 deletions include/custom_widgets.h

This file was deleted.

2 changes: 1 addition & 1 deletion include/gui.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ typedef struct {
Tex FolderTexture;
Tex FileTexture;


Tex ShareAddTexture;
Tex FTPTexture;
Tex HTTPTexture;
Tex SFTPTexture;
Expand Down
Binary file added romfs/shareadd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions source/UI/UIHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ namespace Windows {
float currstartpos = ImGui::GetCursorPosX();
ImGui::Text(data.c_str());
ImGui::SetCursorPosX(currstartpos);
ImGui::SetCursorPosY(ImGui::GetCursorPosY()-26.0f);
ImGui::SetCursorPosY(ImGui::GetCursorPosY()-26.0f*multiplyRes);
if (ImGui::Selectable(uuid.c_str(), false)){
SwkbdConfig kbd;
char tmpoutstr[256] = {0};
Expand All @@ -88,7 +88,7 @@ namespace Windows {
//swkbdConfigSetOkButtonText(&kbd, "Submit");
//swkbdConfigSetLeftOptionalSymbolKey(&kbd, "a");
//swkbdConfigSetRightOptionalSymbolKey(&kbd, "b");
//swkbdConfigSetHeaderText(&kbd, "Header");
swkbdConfigSetHeaderText(&kbd, label.c_str());
//swkbdConfigSetSubText(&kbd, "Sub");
//swkbdConfigSetGuideText(&kbd, "Guide");

Expand Down
37 changes: 0 additions & 37 deletions source/UI/custom_widgets.cpp

This file was deleted.

11 changes: 0 additions & 11 deletions source/UI/mainMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,13 @@
#include "Enigma2.h"
#include "curldownloader.h"

#include "custom_widgets.h"

namespace Windows {
void MainMenuWindow(bool *focus, bool *first_item) {
Windows::SetupMainWindow();
std::vector<std::string> topmenu = configini->topmenu;
/*
if(isHandheld == true){
batteryIcon(ImVec2(1230.0f,5.0f),true,batteryPercent,40,20);
}
else{
batteryIcon(ImVec2(1230.0f*multiplyRes + 20,5.0f),true,batteryPercent,40,20);
}
*/

GUI::newbatteryIcon(ImVec2(1180.0f*multiplyRes,5.0f),true,batteryPercent,40,20,true);


if (ImGui::Begin(nxmpTitle.c_str(), nullptr, ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse)) {
static int selected = -1;
for (unsigned int n = 0; n < topmenu.size(); n++){
Expand Down
40 changes: 38 additions & 2 deletions source/UI/networkBrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,43 @@ namespace Windows {

ImGui::Text("Protocol: ");
ImGui::SameLine();
ImGui::Combo("##protocombo", (int *)&NewNetworkShare->type, NewNetworkShare->protonames, 5);
//ImGui::Combo("##protocombo", (int *)&NewNetworkShare->type, NewNetworkShare->protonames, 5);
static const char* item_current = NULL;
if (ImGui::BeginCombo("##protocombo", item_current, NULL)) // The second parameter is the label previewed before opening the combo.
{
for (int n = 0; n < IM_ARRAYSIZE(NewNetworkShare->protonames); n++)
{
bool is_selected = (item_current == NewNetworkShare->protonames[n]);

if(NewNetworkShare->protonames[n] == "FTP"){
GUI::NXMPImage((void*)(intptr_t)nxmpicons.FTPTexture.id, ImVec2(30,30));
}
if(NewNetworkShare->protonames[n] == "HTTP"){
GUI::NXMPImage((void*)(intptr_t)nxmpicons.HTTPTexture.id, ImVec2(30,30));
}
if(NewNetworkShare->protonames[n] == "SMB"){
GUI::NXMPImage((void*)(intptr_t)nxmpicons.NFSTexture.id, ImVec2(30,30));
}
if(NewNetworkShare->protonames[n] == "NFS"){
GUI::NXMPImage((void*)(intptr_t)nxmpicons.FTPTexture.id, ImVec2(30,30));
}
if(NewNetworkShare->protonames[n] == "SSH"){
GUI::NXMPImage((void*)(intptr_t)nxmpicons.SFTPTexture.id, ImVec2(30,30));
}

ImGui::SameLine();

if (ImGui::Selectable(NewNetworkShare->protonames[n], is_selected)){
item_current = NewNetworkShare->protonames[n];
NewNetworkShare->type = n;
}

if (is_selected)
ImGui::SetItemDefaultFocus(); // Set the initial focus when opening the combo (scrolling + for keyboard navigation support in the upcoming navigation branch)
}
ImGui::EndCombo();
}


if(NewNetworkShare->type == 0){
NewNetworkShare->httpstring = InputSwitchKeyboard("##httpstring","HTTP String",NewNetworkShare->httpstring);
Expand Down Expand Up @@ -794,7 +830,7 @@ namespace Windows {

if(item.networkselect){
if (ImGui::BeginListBox("Network Source Menu",ImVec2(1280.0f*multiplyRes, 720.0f*multiplyRes))){
GUI::NXMPImage((void*)(intptr_t)nxmpicons.SMBTexture.id, ImVec2(50,50));
GUI::NXMPImage((void*)(intptr_t)nxmpicons.ShareAddTexture.id, ImVec2(50,50));
ImGui::SameLine();
ImGui::SetCursorPos({ImGui::GetCursorPos().x, ImGui::GetCursorPos().y + (50 - ImGui::GetFont()->FontSize) / 2});
static int selected = -1;
Expand Down
17 changes: 2 additions & 15 deletions source/UI/playerWindows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include "imgui.h"
#include "utils.h"
#include "imgui_internal.h"
#include "custom_widgets.h"
#include "SwitchSys.h"


Expand Down Expand Up @@ -90,13 +89,13 @@ namespace playerWindows{
}*/
}
}
ImGui::Checkbox("Show Power Stats", &item.showstats);
ImGui::Checkbox("Power Stats", &item.showstats);
if (*first_item) {
ImGui::SetFocusID(ImGui::GetID(topmenu[0].c_str()), ImGui::GetCurrentWindow());
*first_item = false;
}

ImGui::Checkbox("Show Decoding Stats", &item.showdecstats);
ImGui::Checkbox("Dec Stats", &item.showdecstats);
if (*first_item) {
ImGui::SetFocusID(ImGui::GetID(topmenu[0].c_str()), ImGui::GetCurrentWindow());
*first_item = false;
Expand All @@ -110,20 +109,8 @@ namespace playerWindows{

ImGui::SetCursorPosY(ImGui::GetWindowSize().y -40*multiplyRes);
ImGui::Separator();
if(isHandheld)
GUI::newbatteryIcon(ImVec2((rightmenuposX*multiplyRes) + 13.0f,ImGui::GetWindowSize().y -24),true,batteryPercent,40,18,true);
else
GUI::newbatteryIcon(ImVec2((rightmenuposX*multiplyRes) + 13.0f,ImGui::GetWindowSize().y -24*multiplyRes),true,batteryPercent,40*multiplyRes,18*multiplyRes,true);



//if(isHandheld)
//batteryIcon(ImVec2((rightmenuposX) + 13.0f,ImGui::GetWindowSize().y -24),true,batteryPercent,40,18);
//else
//batteryIcon(ImVec2((rightmenuposX*multiplyRes) + 113.0f,ImGui::GetWindowSize().y -24),true,batteryPercent,40,18);
//ImGui::Text(" %d%%",batteryPercent);

//endBattery

ImGui::EndListBox();
}
Expand Down
7 changes: 6 additions & 1 deletion source/UI/settingsMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,16 @@ namespace Windows {
if(ImGui::Checkbox("OverClock at Startup", &ocdefault)){
configini->setUseOc(ocdefault);
}

ImGui::Text("Misc (Need Restart))");
ImGui::Separator();
bool hwdecdefault = configini->getHWDec(true);
if(ImGui::Checkbox("HW Decoder", &hwdecdefault)){
configini->setHWDec(hwdecdefault);
}
bool vsyncdefault = configini->getVSYNC(true);
if(ImGui::Checkbox("VSYNC", &vsyncdefault)){
configini->setVSYNC(vsyncdefault);
}

ImGui::EndTabItem();
}
Expand Down
14 changes: 14 additions & 0 deletions source/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ Config::Config(std::string inifile){
nxmpconfig.useoc = ini->GetBoolValue("Main", "useoc");

nxmpconfig.hwdec = ini->GetBoolValue("Main", "hwdec",true);
nxmpconfig.vsync = ini->GetBoolValue("Main", "vsync",false);

const char* themenamepv;
themenamepv = ini->GetValue("Main", "theme");
Expand Down Expand Up @@ -326,6 +327,16 @@ void Config::setHWDec(bool _val){
nxmptmpconfig.hwdec = _val;
}

bool Config::getVSYNC(bool tmpvalue){
if(tmpvalue){
return nxmptmpconfig.vsync;
}
return nxmpconfig.vsync;
}
void Config::setVSYNC(bool _val){
nxmptmpconfig.vsync = _val;
}

int Config::getSubFontSize(bool tmpvalue){
if(tmpvalue){
return nxmptmpconfig.subfontsize;
Expand Down Expand Up @@ -540,6 +551,9 @@ void Config::saveSettings(){

ini->Delete("Main", "hwdec");
ini->SetBoolValue("Main", "hwdec", nxmpconfig.hwdec, NULL, false);

ini->Delete("Main", "vsync");
ini->SetBoolValue("Main", "vsync", nxmpconfig.vsync, NULL, false);

ini->Delete("Main", "subfontsize");
ini->SetLongValue("Main", "subfontsize", nxmpconfig.subfontsize, NULL, false);
Expand Down
7 changes: 6 additions & 1 deletion source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,11 @@ static bool init() {
else {
gladLoadGL();
}
SDL_GL_SetSwapInterval(1);
if(configini->getVSYNC(false)){
SDL_GL_SetSwapInterval(1);
}else{
SDL_GL_SetSwapInterval(0);
}
}
}
return success;
Expand Down Expand Up @@ -302,6 +306,7 @@ int main() {
Utility::TxtLoadFromFile("romfs:/sdcard.png",&nxmpicons.SdCardTexture.id,&nxmpicons.SdCardTexture.width,&nxmpicons.SdCardTexture.height);
Utility::TxtLoadFromFile("romfs:/usb.png",&nxmpicons.UsbTexture.id,&nxmpicons.UsbTexture.width,&nxmpicons.UsbTexture.height);
Utility::TxtLoadFromFile("romfs:/network.png",&nxmpicons.NetworkTexture.id,&nxmpicons.NetworkTexture.width,&nxmpicons.NetworkTexture.height);
Utility::TxtLoadFromFile("romfs:/shareadd.png",&nxmpicons.ShareAddTexture.id,&nxmpicons.ShareAddTexture.width,&nxmpicons.ShareAddTexture.height);
Utility::TxtLoadFromFile("romfs:/enigma2.png",&nxmpicons.Enigma2Texture.id,&nxmpicons.Enigma2Texture.width,&nxmpicons.Enigma2Texture.height);
Utility::TxtLoadFromFile("romfs:/folder.png",&nxmpicons.FolderTexture.id,&nxmpicons.FolderTexture.width,&nxmpicons.FolderTexture.height);
Utility::TxtLoadFromFile("romfs:/file.png",&nxmpicons.FileTexture.id,&nxmpicons.FileTexture.width,&nxmpicons.FileTexture.height);
Expand Down
1 change: 0 additions & 1 deletion source/stats/stats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ void CheckCore2(void *arg) {

void Misc(void*arg) {
CStats * ctx = (CStats *)arg;
int ret = 0;
//Service* psmService = 0;
//Result nvCheck = 1;

Expand Down

0 comments on commit 1a451d1

Please sign in to comment.