address more comments

This commit is contained in:
Khangaroo 2019-08-14 01:04:50 -04:00 committed by James Rowe
parent 3534ad0835
commit c2a32e942b
15 changed files with 87 additions and 56 deletions

View file

@ -8,8 +8,8 @@ add_executable(citra
default_ini.h
emu_window/emu_window_sdl2.cpp
emu_window/emu_window_sdl2.h
generic_image_interface.cpp
generic_image_interface.h
lodepng_image_interface.cpp
lodepng_image_interface.h
resource.h
)

View file

@ -20,6 +20,7 @@
#include "citra/config.h"
#include "citra/emu_window/emu_window_sdl2.h"
#include "citra/lodepng_image_interface.h"
#include "common/common_paths.h"
#include "common/detached_tasks.h"
#include "common/file_util.h"
@ -40,7 +41,6 @@
#include "core/loader/loader.h"
#include "core/movie.h"
#include "core/settings.h"
#include "generic_image_interface.h"
#include "network/network.h"
#include "video_core/video_core.h"
@ -344,7 +344,7 @@ int main(int argc, char** argv) {
Frontend::RegisterDefaultApplets();
// Register generic image interface
Core::System::GetInstance().RegisterImageInterface(std::make_shared<GenericImageInterface>());
Core::System::GetInstance().RegisterImageInterface(std::make_shared<LodePNGImageInterface>());
std::unique_ptr<EmuWindow_SDL2> emu_window{std::make_unique<EmuWindow_SDL2>(fullscreen)};

View file

@ -4,9 +4,9 @@
#include <lodepng.h>
#include "common/logging/log.h"
#include "generic_image_interface.h"
#include "lodepng_image_interface.h"
bool GenericImageInterface::DecodePNG(std::vector<u8>& dst, u32& width, u32& height,
bool LodePNGImageInterface::DecodePNG(std::vector<u8>& dst, u32& width, u32& height,
const std::string& path) {
u32 lodepng_ret = lodepng::decode(dst, width, height, path);
if (lodepng_ret) {
@ -17,7 +17,7 @@ bool GenericImageInterface::DecodePNG(std::vector<u8>& dst, u32& width, u32& hei
return true;
}
bool GenericImageInterface::EncodePNG(const std::string& path, const std::vector<u8>& src,
bool LodePNGImageInterface::EncodePNG(const std::string& path, const std::vector<u8>& src,
u32 width, u32 height) {
u32 lodepng_ret = lodepng::encode(path, src, width, height);
if (lodepng_ret) {

View file

@ -6,7 +6,7 @@
#include "core/frontend/image_interface.h"
class GenericImageInterface final : public Frontend::ImageInterface {
class LodePNGImageInterface final : public Frontend::ImageInterface {
public:
bool DecodePNG(std::vector<u8>& dst, u32& width, u32& height, const std::string& path) override;
bool EncodePNG(const std::string& path, const std::vector<u8>& src, u32 width,