diff --git a/SConstruct b/SConstruct index a7827a50276..479a56a2c47 100644 --- a/SConstruct +++ b/SConstruct @@ -131,9 +131,6 @@ opts.Add('speex','Speex Audio (yes/no)','yes') opts.Add('xml','XML Save/Load support (yes/no)','yes') opts.Add('libpng','libpng library for image loader support (system/builtin)','builtin') opts.Add('webp','WEBP Image loader support (yes/no)','yes') -opts.Add('dds','DDS Texture loader support (yes/no)','yes') -opts.Add('pvr','PVR (PowerVR) Texture loader support (yes/no)','yes') -opts.Add('etc1','etc1 Texture compression support (yes/no)','yes') opts.Add('builtin_zlib','Use built-in zlib (yes/no)','yes') opts.Add('openssl','Use OpenSSL (yes/no/builtin)','no') opts.Add('musepack','Musepack Audio (yes/no)','yes') @@ -158,7 +155,7 @@ for k in platform_opts.keys(): opts.Add(o[0],o[1],o[2]) for x in module_list: - opts.Add('module_'+x+'_enabled', "Enable module '"+x+"'.", "yes") + opts.Add('module_'+x+'_enabled', "Enable module '"+x+"' (yes/no)", "yes") opts.Update(env_base) # update environment Help(opts.GenerateHelpText(env_base)) # generate help @@ -351,10 +348,6 @@ if selected_platform in platform_list: if (env['theoralib']=='yes'): env.Append(CPPFLAGS=['-DTHEORALIB_ENABLED']); - if (env['dds']=='yes'): - env.Append(CPPFLAGS=['-DDDS_ENABLED']); - if (env['pvr']=='yes'): - env.Append(CPPFLAGS=['-DPVR_ENABLED']); if (env['webp']=='yes'): env.Append(CPPFLAGS=['-DWEBP_ENABLED']); @@ -379,9 +372,6 @@ if selected_platform in platform_list: if (env['colored']=='yes'): methods.colored(sys,env) - if (env['etc1']=='yes'): - env.Append(CPPFLAGS=['-DETC1_ENABLED']) - Export('env') #build subdirs, the build order is dependent on link order. diff --git a/drivers/SCsub b/drivers/SCsub index 03fc6263772..c764e720460 100644 --- a/drivers/SCsub +++ b/drivers/SCsub @@ -14,7 +14,6 @@ SConscript('pulseaudio/SCsub'); SConscript('windows/SCsub'); SConscript('gles2/SCsub'); SConscript('gl_context/SCsub'); -SConscript('pnm/SCsub'); if (env['openssl']!='no'): env_drivers.Append(CPPFLAGS=['-DOPENSSL_ENABLED']); @@ -28,9 +27,6 @@ if (env['openssl']!='no'): SConscript("png/SCsub"); if (env["webp"]=="yes"): SConscript("webp/SCsub"); -SConscript("dds/SCsub"); -SConscript("pvr/SCsub"); -SConscript("etc1/SCsub") if (env["builtin_zlib"]=="yes"): SConscript("builtin_zlib/SCsub"); diff --git a/drivers/dds/SCsub b/drivers/dds/SCsub deleted file mode 100644 index 159829384f8..00000000000 --- a/drivers/dds/SCsub +++ /dev/null @@ -1,10 +0,0 @@ -Import('env') - - -dds_sources = [ - "dds/texture_loader_dds.cpp" - ] - -env.drivers_sources+=dds_sources - -#env.add_source_files(env.drivers_sources, dds_sources) diff --git a/drivers/etc1/SCsub b/drivers/etc1/SCsub deleted file mode 100644 index 2b9dc1b31c7..00000000000 --- a/drivers/etc1/SCsub +++ /dev/null @@ -1,15 +0,0 @@ -Import('env') - - -etc_sources = [ - "etc1/image_etc.cpp", - "etc1/rg_etc1.cpp", - "etc1/texture_loader_pkm.cpp" -] - -if (env["etc1"] != "no"): - env.drivers_sources+=etc_sources - -#env.add_source_files(env.drivers_sources, etc_sources) - -Export('env') diff --git a/drivers/pnm/SCsub b/drivers/pnm/SCsub deleted file mode 100644 index 28b35773a42..00000000000 --- a/drivers/pnm/SCsub +++ /dev/null @@ -1,10 +0,0 @@ -Import('env') - - -pnm_sources = [ - "pnm/bitmap_loader_pnm.cpp" - ] - -env.drivers_sources+=pnm_sources - -#env.add_source_files(env.drivers_sources, pnm_sources) diff --git a/drivers/pvr/SCsub b/drivers/pvr/SCsub deleted file mode 100644 index 44b8c3d6bb0..00000000000 --- a/drivers/pvr/SCsub +++ /dev/null @@ -1,15 +0,0 @@ -Import('env') - - -pvr_sources = [ - "pvr/BitScale.cpp", - "pvr/MortonTable.cpp", - "pvr/PvrTcDecoder.cpp", - "pvr/PvrTcEncoder.cpp", - "pvr/PvrTcPacket.cpp", - "pvr/texture_loader_pvr.cpp" - ] - -env.drivers_sources+=pvr_sources - -#env.add_source_files(env.drivers_sources, pvr_sources) diff --git a/drivers/register_driver_types.cpp b/drivers/register_driver_types.cpp index 9a2a54f6b06..d60c67aa167 100644 --- a/drivers/register_driver_types.cpp +++ b/drivers/register_driver_types.cpp @@ -31,12 +31,7 @@ #include "png/image_loader_png.h" #include "png/resource_saver_png.h" #include "webp/image_loader_webp.h" -#include "dds/texture_loader_dds.h" -#include "etc1/texture_loader_pkm.h" -#include "pvr/texture_loader_pvr.h" -#include "etc1/image_etc.h" #include "chibi/event_stream_chibi.h" -#include "pnm/bitmap_loader_pnm.h" #ifdef TOOLS_ENABLED @@ -85,19 +80,6 @@ static ResourceSaverPNG *resource_saver_png=NULL; static ImageLoaderWEBP *image_loader_webp=NULL; #endif -#ifdef DDS_ENABLED -static ResourceFormatDDS *resource_loader_dds=NULL; -#endif - -#ifdef ETC1_ENABLED -static ResourceFormatPKM *resource_loader_pkm=NULL; -#endif - - -#ifdef PVR_ENABLED -static ResourceFormatPVR *resource_loader_pvr=NULL; -#endif - #ifdef TREMOR_ENABLED static ResourceFormatLoaderAudioStreamOGG *vorbis_stream_loader=NULL; #endif @@ -127,9 +109,6 @@ static ResourceFormatLoaderAudioStreamMPC * mpc_stream_loader=NULL; #endif - -static ResourceFormatPBM * pbm_loader=NULL; - void register_core_driver_types() { image_loader_png = memnew( ImageLoaderPNG ); @@ -143,9 +122,6 @@ void register_core_driver_types() { ImageLoader::add_image_format_loader( image_loader_webp ); #endif - pbm_loader = memnew( ResourceFormatPBM ); - ResourceLoader::add_resource_format_loader(pbm_loader); - ObjectTypeDB::register_type(); } @@ -161,7 +137,6 @@ void unregister_core_driver_types() { memdelete( image_loader_webp ); #endif - memdelete( pbm_loader ); } @@ -185,21 +160,6 @@ void register_driver_types() { ObjectTypeDB::register_type(); #endif -#ifdef DDS_ENABLED - resource_loader_dds = memnew( ResourceFormatDDS ); - ResourceLoader::add_resource_format_loader(resource_loader_dds ); -#endif - -#ifdef ETC1_ENABLED - resource_loader_pkm = memnew( ResourceFormatPKM ); - ResourceLoader::add_resource_format_loader(resource_loader_pkm); -#endif - -#ifdef PVR_ENABLED - resource_loader_pvr = memnew( ResourceFormatPVR ); - ResourceLoader::add_resource_format_loader(resource_loader_pvr ); -#endif - #ifdef TOOLS_ENABLED Geometry::_decompose_func=b2d_decompose; @@ -239,10 +199,6 @@ void register_driver_types() { #endif #endif -#ifdef ETC1_ENABLED - _register_etc1_compress_func(); -#endif - initialize_chibi(); } @@ -275,18 +231,6 @@ void unregister_driver_types() { memdelete (mpc_stream_loader); #endif -#ifdef DDS_ENABLED - memdelete(resource_loader_dds); -#endif - -#ifdef ETC1_ENABLED - memdelete(resource_loader_pkm); -#endif - -#ifdef PVR_ENABLED - memdelete(resource_loader_pvr); -#endif - #ifdef OPENSSL_ENABLED unregister_openssl(); diff --git a/modules/dds/SCsub b/modules/dds/SCsub new file mode 100644 index 00000000000..bcea3a84c04 --- /dev/null +++ b/modules/dds/SCsub @@ -0,0 +1,7 @@ +Import('env') +Import('env_modules') + +env_modules.add_source_files(env.modules_sources, "*.cpp") + +Export('env_modules') +Export('env') diff --git a/modules/dds/config.py b/modules/dds/config.py new file mode 100644 index 00000000000..368e97e152c --- /dev/null +++ b/modules/dds/config.py @@ -0,0 +1,6 @@ + +def can_build(platform): + return True + +def configure(env): + pass diff --git a/modules/dds/register_types.cpp b/modules/dds/register_types.cpp new file mode 100644 index 00000000000..0d28e2bbef4 --- /dev/null +++ b/modules/dds/register_types.cpp @@ -0,0 +1,44 @@ +/*************************************************************************/ +/* register_types.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* 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 "register_types.h" + +#include "texture_loader_dds.h" + +static ResourceFormatDDS *resource_loader_dds = NULL; + +void register_dds_types() { + + resource_loader_dds = memnew( ResourceFormatDDS ); + ResourceLoader::add_resource_format_loader(resource_loader_dds); +} + +void unregister_dds_types() { + + memdelete(resource_loader_dds); +} diff --git a/modules/dds/register_types.h b/modules/dds/register_types.h new file mode 100644 index 00000000000..f9ecfb8ef9a --- /dev/null +++ b/modules/dds/register_types.h @@ -0,0 +1,30 @@ +/*************************************************************************/ +/* register_types.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* 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. */ +/*************************************************************************/ +void register_dds_types(); +void unregister_dds_types(); diff --git a/drivers/dds/texture_loader_dds.cpp b/modules/dds/texture_loader_dds.cpp similarity index 100% rename from drivers/dds/texture_loader_dds.cpp rename to modules/dds/texture_loader_dds.cpp diff --git a/drivers/dds/texture_loader_dds.h b/modules/dds/texture_loader_dds.h similarity index 100% rename from drivers/dds/texture_loader_dds.h rename to modules/dds/texture_loader_dds.h diff --git a/modules/etc1/SCsub b/modules/etc1/SCsub new file mode 100644 index 00000000000..93c304fe7fa --- /dev/null +++ b/modules/etc1/SCsub @@ -0,0 +1,19 @@ +Import('env') +Import('env_modules') + +# Thirdparty source files +# Not unbundled so far since not widespread as shared library +thirdparty_dir = "#thirdparty/rg-etc1/" +thirdparty_etc1_sources = [ + "rg_etc1.cpp", +] +thirdparty_etc1_sources = [thirdparty_dir + file for file in thirdparty_etc1_sources] + +env_modules.add_source_files(env.modules_sources, thirdparty_etc1_sources) +env_modules.Append(CPPPATH = [thirdparty_dir]) + +# Godot source files +env_modules.add_source_files(env.modules_sources, "*.cpp") + +Export('env_modules') +Export('env') diff --git a/modules/etc1/config.py b/modules/etc1/config.py new file mode 100644 index 00000000000..368e97e152c --- /dev/null +++ b/modules/etc1/config.py @@ -0,0 +1,6 @@ + +def can_build(platform): + return True + +def configure(env): + pass diff --git a/drivers/etc1/image_etc.cpp b/modules/etc1/image_etc.cpp similarity index 100% rename from drivers/etc1/image_etc.cpp rename to modules/etc1/image_etc.cpp diff --git a/drivers/etc1/image_etc.h b/modules/etc1/image_etc.h similarity index 100% rename from drivers/etc1/image_etc.h rename to modules/etc1/image_etc.h diff --git a/modules/etc1/register_types.cpp b/modules/etc1/register_types.cpp new file mode 100644 index 00000000000..e9eba6c8648 --- /dev/null +++ b/modules/etc1/register_types.cpp @@ -0,0 +1,47 @@ +/*************************************************************************/ +/* register_types.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* 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 "register_types.h" + +#include "image_etc.h" +#include "texture_loader_pkm.h" + +static ResourceFormatPKM *resource_loader_pkm = NULL; + +void register_etc1_types() { + + resource_loader_pkm = memnew( ResourceFormatPKM ); + ResourceLoader::add_resource_format_loader(resource_loader_pkm); + + _register_etc1_compress_func(); +} + +void unregister_etc1_types() { + + memdelete(resource_loader_pkm); +} diff --git a/modules/etc1/register_types.h b/modules/etc1/register_types.h new file mode 100644 index 00000000000..bc26699d54a --- /dev/null +++ b/modules/etc1/register_types.h @@ -0,0 +1,30 @@ +/*************************************************************************/ +/* register_types.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* 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. */ +/*************************************************************************/ +void register_etc1_types(); +void unregister_etc1_types(); diff --git a/drivers/etc1/texture_loader_pkm.cpp b/modules/etc1/texture_loader_pkm.cpp similarity index 100% rename from drivers/etc1/texture_loader_pkm.cpp rename to modules/etc1/texture_loader_pkm.cpp diff --git a/drivers/etc1/texture_loader_pkm.h b/modules/etc1/texture_loader_pkm.h similarity index 100% rename from drivers/etc1/texture_loader_pkm.h rename to modules/etc1/texture_loader_pkm.h diff --git a/modules/pbm/SCsub b/modules/pbm/SCsub new file mode 100644 index 00000000000..bcea3a84c04 --- /dev/null +++ b/modules/pbm/SCsub @@ -0,0 +1,7 @@ +Import('env') +Import('env_modules') + +env_modules.add_source_files(env.modules_sources, "*.cpp") + +Export('env_modules') +Export('env') diff --git a/drivers/pnm/bitmap_loader_pnm.cpp b/modules/pbm/bitmap_loader_pbm.cpp similarity index 98% rename from drivers/pnm/bitmap_loader_pnm.cpp rename to modules/pbm/bitmap_loader_pbm.cpp index e06d4c80f08..1d08b108241 100644 --- a/drivers/pnm/bitmap_loader_pnm.cpp +++ b/modules/pbm/bitmap_loader_pbm.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* bitmap_loader_pnm.cpp */ +/* bitmap_loader_pbm.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -26,7 +26,7 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "bitmap_loader_pnm.h" +#include "bitmap_loader_pbm.h" #include "os/file_access.h" #include "scene/resources/bit_mask.h" diff --git a/drivers/pnm/bitmap_loader_pnm.h b/modules/pbm/bitmap_loader_pbm.h similarity index 95% rename from drivers/pnm/bitmap_loader_pnm.h rename to modules/pbm/bitmap_loader_pbm.h index 965cf7a451e..4f7144b3e07 100644 --- a/drivers/pnm/bitmap_loader_pnm.h +++ b/modules/pbm/bitmap_loader_pbm.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* bitmap_loader_pnm.h */ +/* bitmap_loader_pbm.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -26,8 +26,8 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#ifndef BITMAP_LOADER_PNM_H -#define BITMAP_LOADER_PNM_H +#ifndef BITMAP_LOADER_PBM_H +#define BITMAP_LOADER_PBM_H #include "io/resource_loader.h" diff --git a/modules/pbm/config.py b/modules/pbm/config.py new file mode 100644 index 00000000000..368e97e152c --- /dev/null +++ b/modules/pbm/config.py @@ -0,0 +1,6 @@ + +def can_build(platform): + return True + +def configure(env): + pass diff --git a/modules/pbm/register_types.cpp b/modules/pbm/register_types.cpp new file mode 100644 index 00000000000..181083773aa --- /dev/null +++ b/modules/pbm/register_types.cpp @@ -0,0 +1,44 @@ +/*************************************************************************/ +/* register_types.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* 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 "register_types.h" + +#include "bitmap_loader_pbm.h" + +static ResourceFormatPBM * pbm_loader = NULL; + +void register_pbm_types() { + + pbm_loader = memnew( ResourceFormatPBM ); + ResourceLoader::add_resource_format_loader(pbm_loader); +} + +void unregister_pbm_types() { + + memdelete( pbm_loader ); +} diff --git a/modules/pbm/register_types.h b/modules/pbm/register_types.h new file mode 100644 index 00000000000..20c8133c2c1 --- /dev/null +++ b/modules/pbm/register_types.h @@ -0,0 +1,30 @@ +/*************************************************************************/ +/* register_types.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* 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. */ +/*************************************************************************/ +void register_pbm_types(); +void unregister_pbm_types(); diff --git a/modules/pvr/SCsub b/modules/pvr/SCsub new file mode 100644 index 00000000000..b1696950187 --- /dev/null +++ b/modules/pvr/SCsub @@ -0,0 +1,23 @@ +Import('env') +Import('env_modules') + +# Thirdparty source files +# Not unbundled so far since not widespread as shared library +thirdparty_dir = "#thirdparty/pvrtccompressor/" +thirdparty_pvr_sources = [ + "BitScale.cpp", + "MortonTable.cpp", + "PvrTcDecoder.cpp", + "PvrTcEncoder.cpp", + "PvrTcPacket.cpp", +] +thirdparty_pvr_sources = [thirdparty_dir + file for file in thirdparty_pvr_sources] + +env_modules.add_source_files(env.modules_sources, thirdparty_pvr_sources) +env_modules.Append(CPPPATH = [thirdparty_dir]) + +# Godot source files +env_modules.add_source_files(env.modules_sources, "*.cpp") + +Export('env_modules') +Export('env') diff --git a/modules/pvr/config.py b/modules/pvr/config.py new file mode 100644 index 00000000000..368e97e152c --- /dev/null +++ b/modules/pvr/config.py @@ -0,0 +1,6 @@ + +def can_build(platform): + return True + +def configure(env): + pass diff --git a/modules/pvr/register_types.cpp b/modules/pvr/register_types.cpp new file mode 100644 index 00000000000..e5e18fb3d1b --- /dev/null +++ b/modules/pvr/register_types.cpp @@ -0,0 +1,44 @@ +/*************************************************************************/ +/* register_types.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* 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 "register_types.h" + +#include "texture_loader_pvr.h" + +static ResourceFormatPVR *resource_loader_pvr = NULL; + +void register_pvr_types() { + + resource_loader_pvr = memnew( ResourceFormatPVR ); + ResourceLoader::add_resource_format_loader(resource_loader_pvr); +} + +void unregister_pvr_types() { + + memdelete(resource_loader_pvr); +} diff --git a/modules/pvr/register_types.h b/modules/pvr/register_types.h new file mode 100644 index 00000000000..d600f54d51b --- /dev/null +++ b/modules/pvr/register_types.h @@ -0,0 +1,30 @@ +/*************************************************************************/ +/* register_types.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* 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. */ +/*************************************************************************/ +void register_pvr_types(); +void unregister_pvr_types(); diff --git a/drivers/pvr/texture_loader_pvr.cpp b/modules/pvr/texture_loader_pvr.cpp similarity index 100% rename from drivers/pvr/texture_loader_pvr.cpp rename to modules/pvr/texture_loader_pvr.cpp diff --git a/drivers/pvr/texture_loader_pvr.h b/modules/pvr/texture_loader_pvr.h similarity index 100% rename from drivers/pvr/texture_loader_pvr.h rename to modules/pvr/texture_loader_pvr.h diff --git a/thirdparty/README.md b/thirdparty/README.md index 0e512fb8678..bf712de84fe 100644 --- a/thirdparty/README.md +++ b/thirdparty/README.md @@ -25,3 +25,26 @@ Files extracted from upstream source: * pngtest.c - the arm/ folder - scripts/pnglibconf.h.prebuilt as pnglibconf.h + + +## pvrtccompressor + +- Upstream: https://bitbucket.org/jthlim/pvrtccompressor +- Version: hg commit cf71777 - 2015-01-08 +- License: BSD-3-Clause + +Files extracted from upstream source: + +- all .cpp and .h files apart from main.cpp +- LICENSE.TXT + + +## rg-etc1 + +- Upstream: https://github.com/richgel999/rg-etc1 +- Version: 1.04 +- License: zlib + +Files extracted from upstream source: + +- all of them: rg_etc1.{cpp,h} diff --git a/drivers/pvr/AlphaBitmap.h b/thirdparty/pvrtccompressor/AlphaBitmap.h similarity index 100% rename from drivers/pvr/AlphaBitmap.h rename to thirdparty/pvrtccompressor/AlphaBitmap.h diff --git a/drivers/pvr/BitScale.cpp b/thirdparty/pvrtccompressor/BitScale.cpp similarity index 100% rename from drivers/pvr/BitScale.cpp rename to thirdparty/pvrtccompressor/BitScale.cpp diff --git a/drivers/pvr/BitScale.h b/thirdparty/pvrtccompressor/BitScale.h similarity index 100% rename from drivers/pvr/BitScale.h rename to thirdparty/pvrtccompressor/BitScale.h diff --git a/drivers/pvr/BitUtility.h b/thirdparty/pvrtccompressor/BitUtility.h similarity index 100% rename from drivers/pvr/BitUtility.h rename to thirdparty/pvrtccompressor/BitUtility.h diff --git a/drivers/pvr/Bitmap.h b/thirdparty/pvrtccompressor/Bitmap.h similarity index 100% rename from drivers/pvr/Bitmap.h rename to thirdparty/pvrtccompressor/Bitmap.h diff --git a/drivers/pvr/ColorRgba.h b/thirdparty/pvrtccompressor/ColorRgba.h similarity index 100% rename from drivers/pvr/ColorRgba.h rename to thirdparty/pvrtccompressor/ColorRgba.h diff --git a/drivers/pvr/Interval.h b/thirdparty/pvrtccompressor/Interval.h similarity index 100% rename from drivers/pvr/Interval.h rename to thirdparty/pvrtccompressor/Interval.h diff --git a/thirdparty/pvrtccompressor/LICENSE.TXT b/thirdparty/pvrtccompressor/LICENSE.TXT new file mode 100644 index 00000000000..974fc09e25d --- /dev/null +++ b/thirdparty/pvrtccompressor/LICENSE.TXT @@ -0,0 +1,25 @@ +Copyright © 2014, Jeffrey Lim. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/drivers/pvr/MortonTable.cpp b/thirdparty/pvrtccompressor/MortonTable.cpp similarity index 100% rename from drivers/pvr/MortonTable.cpp rename to thirdparty/pvrtccompressor/MortonTable.cpp diff --git a/drivers/pvr/MortonTable.h b/thirdparty/pvrtccompressor/MortonTable.h similarity index 100% rename from drivers/pvr/MortonTable.h rename to thirdparty/pvrtccompressor/MortonTable.h diff --git a/drivers/pvr/Point2.h b/thirdparty/pvrtccompressor/Point2.h similarity index 100% rename from drivers/pvr/Point2.h rename to thirdparty/pvrtccompressor/Point2.h diff --git a/drivers/pvr/PvrTcDecoder.cpp b/thirdparty/pvrtccompressor/PvrTcDecoder.cpp similarity index 100% rename from drivers/pvr/PvrTcDecoder.cpp rename to thirdparty/pvrtccompressor/PvrTcDecoder.cpp diff --git a/drivers/pvr/PvrTcDecoder.h b/thirdparty/pvrtccompressor/PvrTcDecoder.h similarity index 100% rename from drivers/pvr/PvrTcDecoder.h rename to thirdparty/pvrtccompressor/PvrTcDecoder.h diff --git a/drivers/pvr/PvrTcEncoder.cpp b/thirdparty/pvrtccompressor/PvrTcEncoder.cpp similarity index 100% rename from drivers/pvr/PvrTcEncoder.cpp rename to thirdparty/pvrtccompressor/PvrTcEncoder.cpp diff --git a/drivers/pvr/PvrTcEncoder.h b/thirdparty/pvrtccompressor/PvrTcEncoder.h similarity index 100% rename from drivers/pvr/PvrTcEncoder.h rename to thirdparty/pvrtccompressor/PvrTcEncoder.h diff --git a/drivers/pvr/PvrTcPacket.cpp b/thirdparty/pvrtccompressor/PvrTcPacket.cpp similarity index 100% rename from drivers/pvr/PvrTcPacket.cpp rename to thirdparty/pvrtccompressor/PvrTcPacket.cpp diff --git a/drivers/pvr/PvrTcPacket.h b/thirdparty/pvrtccompressor/PvrTcPacket.h similarity index 100% rename from drivers/pvr/PvrTcPacket.h rename to thirdparty/pvrtccompressor/PvrTcPacket.h diff --git a/drivers/pvr/RgbBitmap.h b/thirdparty/pvrtccompressor/RgbBitmap.h similarity index 100% rename from drivers/pvr/RgbBitmap.h rename to thirdparty/pvrtccompressor/RgbBitmap.h diff --git a/drivers/pvr/RgbaBitmap.h b/thirdparty/pvrtccompressor/RgbaBitmap.h similarity index 100% rename from drivers/pvr/RgbaBitmap.h rename to thirdparty/pvrtccompressor/RgbaBitmap.h diff --git a/drivers/etc1/rg_etc1.cpp b/thirdparty/rg-etc1/rg_etc1.cpp similarity index 100% rename from drivers/etc1/rg_etc1.cpp rename to thirdparty/rg-etc1/rg_etc1.cpp diff --git a/drivers/etc1/rg_etc1.h b/thirdparty/rg-etc1/rg_etc1.h similarity index 100% rename from drivers/etc1/rg_etc1.h rename to thirdparty/rg-etc1/rg_etc1.h