[go: nahoru, domu]

Skip to content

Commit

Permalink
wiiu: remove more files to work with libutils and libgui
Browse files Browse the repository at this point in the history
  • Loading branch information
vgmoose committed May 3, 2018
1 parent f2641ad commit 7df3be8
Show file tree
Hide file tree
Showing 138 changed files with 280 additions and 19,061 deletions.
11 changes: 7 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
DO_LOGGING := 1

#---------------------------------------------------------------------------------
# Clear the implicit built in rules
#---------------------------------------------------------------------------------
Expand Down Expand Up @@ -33,7 +35,6 @@ BUILD := build
BUILD_DBG := $(TARGET)_dbg
SOURCES := src \
src/common \
src/dynamic_libs \
src/fs \
src/game \
src/gui \
Expand All @@ -49,7 +50,7 @@ SOURCES := src \
src/utils \
src/video \
src/video/shaders \
src/quark
src/custom
DATA := data \
data/images \
data/fonts \
Expand All @@ -73,7 +74,7 @@ MAKEFLAGS += --no-print-directory
#---------------------------------------------------------------------------------
# any extra libraries we wish to link with the project
#---------------------------------------------------------------------------------
LIBS := -lgcc -lgd -lpng -lz -lfreetype -lmad -lzip
LIBS := -lgui -lutils -ldynamiclibs -lfreetype -lgd -lpng -ljpeg -lz -lmad -lvorbisidec

#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing
Expand Down Expand Up @@ -126,7 +127,9 @@ export OFILES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) \
export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
-I$(CURDIR)/$(BUILD) -I$(LIBOGC_INC) \
-I$(PORTLIBS)/include -I$(PORTLIBS)/include/freetype2
-I$(PORTLIBS)/include -I$(PORTLIBS)/include/freetype2 \
-I$(PORTLIBS)/include/zip \
-I$(PORTLIBS)/include/libutils -I$(PORTLIBS)/include/libgui

#---------------------------------------------------------------------------------
# build a list of library paths
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
**The 1.5 version of HBAS [is released!](http://github.com/vgmoose/hbas/releases)** See [the post here](https://gbatemp.net/threads/release-homebrew-app-store-for-wiiu.433275) for more info.

<!---
![icon](https://raw.githubusercontent.com/vgmoose/hbas/master/meta/icon.png)
-->

Known Homebrew app store repos:
- [WiiUBru - wiiubru.com/appstore](http://wiiubru.com/appstore) (default)
Expand Down
Binary file added src/.DS_Store
Binary file not shown.
128 changes: 65 additions & 63 deletions src/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
****************************************************************************/
#include "Application.h"
#include "common/common.h"
#include "dynamic_libs/os_functions.h"
#include "gui/FreeTypeGX.h"
#include "gui/VPadController.h"
#include "gui/WPadController.h"
#include "gui/DVPadController.h"
#include "gui/DWPadController.h"
#include <dynamic_libs/os_functions.h>
#include <gui/FreeTypeGX.h>
#include <gui/VPadController.h>
#include <gui/WPadController.h>
#include <gui/DVPadController.h>
#include <gui/DWPadController.h>
#include "resources/Resources.h"
#include "sounds/SoundHandler.hpp"
#include "utils/logger.h"
#include <utils/logger.h>

Application *Application::applicationInstance = NULL;
bool Application::exitApplication = false;
Expand Down Expand Up @@ -170,62 +170,64 @@ void Application::executeThread(void)
mainWindow->update(controller[i]);

//If the + button on the GamePad is pressed, switch to DPAD mode and vice versa.
if((i == 0) && (controller[i]->data.buttons_d & GuiTrigger::BUTTON_PLUS))
{
if(controller[i]->isDPadMode)
{
delete controller[i];
controller[i] = new VPadController(GuiTrigger::CHANNEL_1);
}
else
{
delete controller[i];
controller[i] = new DVPadController(GuiTrigger::CHANNEL_1);
}
}

//If the + button on any other controller is pressed, switch to DPAD mode and vice versa.
else if(controller[i]->data.buttons_d & GuiTrigger::BUTTON_PLUS)
{
if(controller[i]->isDPadMode)
{
delete controller[i];
switch(i)
{
case 1:
controller[i] = new WPadController(GuiTrigger::CHANNEL_2);
break;
case 2:
controller[i] = new WPadController(GuiTrigger::CHANNEL_3);
break;
case 3:
controller[i] = new WPadController(GuiTrigger::CHANNEL_4);
break;
case 4:
controller[i] = new WPadController(GuiTrigger::CHANNEL_5);
break;
}
}
else
{
delete controller[i];
switch(i)
{
case 1:
controller[i] = new DWPadController(GuiTrigger::CHANNEL_2);
break;
case 2:
controller[i] = new DWPadController(GuiTrigger::CHANNEL_3);
break;
case 3:
controller[i] = new DWPadController(GuiTrigger::CHANNEL_4);
break;
case 4:
controller[i] = new DWPadController(GuiTrigger::CHANNEL_5);
break;
}
}
}

// TODO: enable dpad mode again
// if((i == 0) && (controller[i]->data.buttons_d & GuiTrigger::BUTTON_PLUS))
// {
// if(controller[i]->isDPadMode)
// {
// delete controller[i];
// controller[i] = new VPadController(GuiTrigger::CHANNEL_1);
// }
// else
// {
// delete controller[i];
// controller[i] = new DVPadController(GuiTrigger::CHANNEL_1);
// }
// }
//
// //If the + button on any other controller is pressed, switch to DPAD mode and vice versa.
// else if(controller[i]->data.buttons_d & GuiTrigger::BUTTON_PLUS)
// {
// if(controller[i]->isDPadMode)
// {
// delete controller[i];
// switch(i)
// {
// case 1:
// controller[i] = new WPadController(GuiTrigger::CHANNEL_2);
// break;
// case 2:
// controller[i] = new WPadController(GuiTrigger::CHANNEL_3);
// break;
// case 3:
// controller[i] = new WPadController(GuiTrigger::CHANNEL_4);
// break;
// case 4:
// controller[i] = new WPadController(GuiTrigger::CHANNEL_5);
// break;
// }
// }
// else
// {
// delete controller[i];
// switch(i)
// {
// case 1:
// controller[i] = new DWPadController(GuiTrigger::CHANNEL_2);
// break;
// case 2:
// controller[i] = new DWPadController(GuiTrigger::CHANNEL_3);
// break;
// case 3:
// controller[i] = new DWPadController(GuiTrigger::CHANNEL_4);
// break;
// case 4:
// controller[i] = new DWPadController(GuiTrigger::CHANNEL_5);
// break;
// }
// }
// }
}

//! start rendering DRC
Expand Down
2 changes: 1 addition & 1 deletion src/Application.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include "menu/MainWindow.h"
#include "video/CVideo.h"
#include "system/CThread.h"
#include <system/CThread.h>

extern char* repoUrl;

Expand Down
152 changes: 76 additions & 76 deletions src/utils/HomebrewManager.cpp → src/HomebrewManager.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
#include "menu/HomebrewLaunchWindow.h"
#include "common/common.h"
#include "fs/DirList.h"
#include "fs/fs_utils.h"
#include "utils/HomebrewXML.h"
#include <fs/DirList.h>
#include <fs/FSUtils.h>
#include "HomebrewXML.h"
#include "Application.h"
#include "dynamic_libs/sys_functions.h"
#include <dynamic_libs/sys_functions.h>
#include "network/FileDownloader.h"
#include "utils/Zip.h"
#include <algorithm>
#include <sstream>
#include "HomebrewManager.h"
Expand Down Expand Up @@ -123,7 +122,7 @@ void HomebrewManager::Delete()


log_printf("Homebrew removed");
}
}

std::string HomebrewManager::downloadZip()
{
Expand All @@ -135,7 +134,7 @@ std::string HomebrewManager::downloadZip()

std::string mRepoUrl = std::string(repoUrl);
std::string tmpFilePath = "sd:/hbas_zips"; //! Temporary path for zip files
CreateSubfolder(tmpFilePath.c_str()); //! Make sure temp folder is here
FSUtils::CreateSubfolder(tmpFilePath.c_str()); //! Make sure temp folder is here

//! Generate zip filename, url and path
std::string zipFileName = ShortName + ".zip";
Expand All @@ -149,14 +148,15 @@ std::string HomebrewManager::downloadZip()
log_printf("zipPath = %s", zipPath.c_str());

//! Download the zip file to the temp folder
// TODO: re-add downloading to SD
if(UseProgressBar)
{
Progress->setTitle("Downloading " + zipFileName + "...");
FileDownloader::getFileToSd(zibUrl, zipPath, &updateProgress);
// FileDownloader::getFileToSd(zibUrl, zipPath, &updateProgress);
}
else
{
FileDownloader::getFileToSd(zibUrl, zipPath);
// FileDownloader::getFileToSd(zibUrl, zipPath);
}

log_printf("Downloaded %s", zipFileName.c_str());
Expand All @@ -171,73 +171,73 @@ void HomebrewManager::installZip(std::string & ZipPath)
Progress->setTitle("Installing Homebrew to SDCard...");

//! Open the Zip file
UnZip * HomebrewZip = new UnZip(ZipPath.c_str());

//! First extract the Manifest
std::string ManifestPathInternal = ShortName + ".install";
std::string ManifestPath = "sd:/""wiiu/apps/appstore/.manifest/" + ManifestPathInternal;
HomebrewZip->ExtractFile(ManifestPathInternal.c_str(), ManifestPath.c_str());

//! Open the Manifest
CFile * ManifestFile = new CFile(ManifestPath, CFile::ReadOnly);

//! Make sure the manifest is present and not empty
if (ManifestFile->size() > 0)
{
//! Parse the manifest
log_printf("Parsing the manifest");

char * Manifest_cstr = (char *)malloc(ManifestFile->size());
ManifestFile->read((u8*)Manifest_cstr, ManifestFile->size());
std::stringstream Manifest(Manifest_cstr);

std::string CurrentLine;
while(std::getline(Manifest, CurrentLine))
{
char Mode = CurrentLine.at(0);
std::string Path = CurrentLine.substr(3);
std::string ExtractPath = "sd:/" + Path;

switch(Mode)
{
case 'E':
//! Simply Extract, with no checks or anything, won't be deleted upon removal
log_printf("%s : EXTRACT", Path.c_str());
HomebrewZip->ExtractFile(Path.c_str(), ExtractPath.c_str());
break;
case 'U':
log_printf("%s : UPDATE", Path.c_str());
HomebrewZip->ExtractFile(Path.c_str(), ExtractPath.c_str());
break;
case 'G':
log_printf("%s : GET", Path.c_str());
struct stat sbuff;
if (stat(ExtractPath.c_str(), &sbuff) != 0) //! File doesn't exist, extract
HomebrewZip->ExtractFile(Path.c_str(), ExtractPath.c_str());
else
log_printf("File already exists, skipping...");
break;
default:
log_printf("%s : NOP", Path.c_str());
break;
}
}

//! Close the manifest
Manifest.str("");
free(Manifest_cstr);
}
else
{
//! Extract the whole zip
log_printf("No manifest found: extracting the Zip");
HomebrewZip->ExtractAll("sd:/");
}

ManifestFile->close();

//! Close the Zip file
delete HomebrewZip;
// UnZip * HomebrewZip = new UnZip(ZipPath.c_str());
//
// //! First extract the Manifest
// std::string ManifestPathInternal = ShortName + ".install";
// std::string ManifestPath = "sd:/""wiiu/apps/appstore/.manifest/" + ManifestPathInternal;
// HomebrewZip->ExtractFile(ManifestPathInternal.c_str(), ManifestPath.c_str());
//
// //! Open the Manifest
// CFile * ManifestFile = new CFile(ManifestPath, CFile::ReadOnly);
//
// //! Make sure the manifest is present and not empty
// if (ManifestFile->size() > 0)
// {
// //! Parse the manifest
// log_printf("Parsing the manifest");
//
// char * Manifest_cstr = (char *)malloc(ManifestFile->size());
// ManifestFile->read((u8*)Manifest_cstr, ManifestFile->size());
// std::stringstream Manifest(Manifest_cstr);
//
// std::string CurrentLine;
// while(std::getline(Manifest, CurrentLine))
// {
// char Mode = CurrentLine.at(0);
// std::string Path = CurrentLine.substr(3);
// std::string ExtractPath = "sd:/" + Path;
//
// switch(Mode)
// {
// case 'E':
// //! Simply Extract, with no checks or anything, won't be deleted upon removal
// log_printf("%s : EXTRACT", Path.c_str());
// HomebrewZip->ExtractFile(Path.c_str(), ExtractPath.c_str());
// break;
// case 'U':
// log_printf("%s : UPDATE", Path.c_str());
// HomebrewZip->ExtractFile(Path.c_str(), ExtractPath.c_str());
// break;
// case 'G':
// log_printf("%s : GET", Path.c_str());
// struct stat sbuff;
// if (stat(ExtractPath.c_str(), &sbuff) != 0) //! File doesn't exist, extract
// HomebrewZip->ExtractFile(Path.c_str(), ExtractPath.c_str());
// else
// log_printf("File already exists, skipping...");
// break;
// default:
// log_printf("%s : NOP", Path.c_str());
// break;
// }
// }
//
// //! Close the manifest
// Manifest.str("");
// free(Manifest_cstr);
// }
// else
// {
// //! Extract the whole zip
// log_printf("No manifest found: extracting the Zip");
// HomebrewZip->ExtractAll("sd:/");
// }
//
// ManifestFile->close();
//
// //! Close the Zip file
// delete HomebrewZip;

//! Delete the Zip file
std::remove(ZipPath.c_str());
Expand Down
Loading

0 comments on commit 7df3be8

Please sign in to comment.