diff --git a/Makefile.common b/Makefile.common index 28692d589c..358bb5dbaa 100644 --- a/Makefile.common +++ b/Makefile.common @@ -534,7 +534,7 @@ endif #LIBS += $(LIBXML2_LIBS) #DEFINES += $(LIBXML2_CFLAGS) #else - #OBJ += compat/rxml/rxml.o + #OBJ += libretro-sdk/formats/xml/rxml.o #endif # Compression/Archive @@ -564,7 +564,7 @@ endif ifeq ($(HAVE_ZLIB), 1) ZLIB_OBJS = decompress/zip_support.o - OBJ += gfx/rpng/rpng.o file_extract.o + OBJ += libretro-sdk/formats/png/rpng.o file_extract.o OBJ += $(ZLIB_OBJS) DEFINES += -DHAVE_ZLIB HAVE_COMPRESSION = 1 diff --git a/gfx/image/image_rpng.c b/gfx/image/image_rpng.c index 6ec68cdc81..cf2aed2647 100644 --- a/gfx/image/image_rpng.c +++ b/gfx/image/image_rpng.c @@ -25,7 +25,7 @@ #include #include #include "../../general.h" -#include "../rpng/rpng.h" +#include static bool rpng_image_load_tga_shift(const char *path, struct texture_image *out_img, diff --git a/gfx/rpng/rpng.h b/gfx/rpng/rpng.h deleted file mode 100644 index 95fa96d512..0000000000 --- a/gfx/rpng/rpng.h +++ /dev/null @@ -1,46 +0,0 @@ -/* RetroArch - A frontend for libretro. - * Copyright (C) 2010-2014 - Hans-Kristian Arntzen - * - * RetroArch is free software: you can redistribute it and/or modify it under the terms - * of the GNU General Public License as published by the Free Software Found- - * ation, either version 3 of the License, or (at your option) any later version. - * - * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with RetroArch. - * If not, see . - */ - -#ifndef RPNG_H__ -#define RPNG_H__ - -#include - -#include - -#ifdef HAVE_CONFIG_H -#include "../../config.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -bool rpng_load_image_argb(const char *path, uint32_t **data, - unsigned *width, unsigned *height); - -#ifdef HAVE_ZLIB_DEFLATE -bool rpng_save_image_argb(const char *path, const uint32_t *data, - unsigned width, unsigned height, unsigned pitch); -bool rpng_save_image_bgr24(const char *path, const uint8_t *data, - unsigned width, unsigned height, unsigned pitch); -#endif - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/griffin/griffin.c b/griffin/griffin.c index 30b1f14f13..588d9d2837 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -180,7 +180,7 @@ VIDEO IMAGE #include "../gfx/image/image_rpng.c" #endif -#include "../gfx/rpng/rpng.c" +#include "../libretro-sdk/formats/png/rpng.c" /*============================================================ VIDEO DRIVER diff --git a/gfx/rpng/Makefile b/libretro-sdk/formats/png/Makefile similarity index 100% rename from gfx/rpng/Makefile rename to libretro-sdk/formats/png/Makefile diff --git a/gfx/rpng/rpng.c b/libretro-sdk/formats/png/rpng.c similarity index 95% rename from gfx/rpng/rpng.c rename to libretro-sdk/formats/png/rpng.c index 2f9d01f5c9..80344edbf5 100644 --- a/gfx/rpng/rpng.c +++ b/libretro-sdk/formats/png/rpng.c @@ -1,19 +1,26 @@ -/* RetroArch - A frontend for libretro. - * Copyright (C) 2010-2014 - Hans-Kristian Arntzen - * - * RetroArch is free software: you can redistribute it and/or modify it under the terms - * of the GNU General Public License as published by the Free Software Found- - * ation, either version 3 of the License, or (at your option) any later version. +/* Copyright (C) 2010-2015 The RetroArch team * - * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. + * --------------------------------------------------------------------------------------- + * The following license statement only applies to this file (rpng.c). + * --------------------------------------------------------------------------------------- * - * You should have received a copy of the GNU General Public License along with RetroArch. - * If not, see . + * Permission is hereby granted, free of charge, + * to any person obtaining a copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "rpng.h" +#include #include @@ -26,8 +33,9 @@ #endif #ifdef RARCH_INTERNAL -#include "../../hash.h" +#include "../../../hash.h" #else + static inline uint32_t crc32_calculate(const uint8_t *data, size_t length) { return crc32(0, data, length); diff --git a/gfx/rpng/rpng_test.c b/libretro-sdk/formats/png/rpng_test.c similarity index 60% rename from gfx/rpng/rpng_test.c rename to libretro-sdk/formats/png/rpng_test.c index 0870de0f32..0d3ad73265 100644 --- a/gfx/rpng/rpng_test.c +++ b/libretro-sdk/formats/png/rpng_test.c @@ -1,19 +1,26 @@ -/* RetroArch - A frontend for libretro. - * Copyright (C) 2010-2014 - Hans-Kristian Arntzen - * - * RetroArch is free software: you can redistribute it and/or modify it under the terms - * of the GNU General Public License as published by the Free Software Found- - * ation, either version 3 of the License, or (at your option) any later version. +/* Copyright (C) 2010-2015 The RetroArch team * - * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. + * --------------------------------------------------------------------------------------- + * The following license statement only applies to this file (rpng_test.c). + * --------------------------------------------------------------------------------------- * - * You should have received a copy of the GNU General Public License along with RetroArch. - * If not, see . + * Permission is hereby granted, free of charge, + * to any person obtaining a copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "rpng.h" +#include #include #include #include diff --git a/libretro-sdk/include/formats/rpng.h b/libretro-sdk/include/formats/rpng.h new file mode 100644 index 0000000000..077afc67e5 --- /dev/null +++ b/libretro-sdk/include/formats/rpng.h @@ -0,0 +1,53 @@ +/* Copyright (C) 2010-2015 The RetroArch team + * + * --------------------------------------------------------------------------------------- + * The following license statement only applies to this file (rpng.h). + * --------------------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, + * to any person obtaining a copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef __LIBRETRO_SDK_FORMAT_RPNG_H__ +#define __LIBRETRO_SDK_FORMAT_RPNG_H__ + +#include + +#include + +#ifdef HAVE_CONFIG_H +#include "../../config.h" +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +bool rpng_load_image_argb(const char *path, uint32_t **data, + unsigned *width, unsigned *height); + +#ifdef HAVE_ZLIB_DEFLATE +bool rpng_save_image_argb(const char *path, const uint32_t *data, + unsigned width, unsigned height, unsigned pitch); +bool rpng_save_image_bgr24(const char *path, const uint8_t *data, + unsigned width, unsigned height, unsigned pitch); +#endif + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/screenshot.c b/screenshot.c index 127b20d1f0..13233aa011 100644 --- a/screenshot.c +++ b/screenshot.c @@ -35,7 +35,7 @@ #ifdef HAVE_ZLIB_DEFLATE -#include "gfx/rpng/rpng.h" +#include #define IMG_EXT "png" #else