Browse Source

dds/etc1/pbm/pvr: Make those modules and split thirdparty files

They are not particularly packaged in Linux distros so we do not
facilitate unbundling via SCons. There could be done if/when there
is interest.

Also s/pnm/pbm/, long-lived typo :)
Rémi Verschelde 8 years ago
parent
commit
b1e8889d96
55 changed files with 433 additions and 126 deletions
  1. 1 11
      SConstruct
  2. 0 4
      drivers/SCsub
  3. 0 10
      drivers/dds/SCsub
  4. 0 15
      drivers/etc1/SCsub
  5. 0 10
      drivers/pnm/SCsub
  6. 0 15
      drivers/pvr/SCsub
  7. 0 56
      drivers/register_driver_types.cpp
  8. 7 0
      modules/dds/SCsub
  9. 6 0
      modules/dds/config.py
  10. 44 0
      modules/dds/register_types.cpp
  11. 30 0
      modules/dds/register_types.h
  12. 0 0
      modules/dds/texture_loader_dds.cpp
  13. 0 0
      modules/dds/texture_loader_dds.h
  14. 19 0
      modules/etc1/SCsub
  15. 6 0
      modules/etc1/config.py
  16. 0 0
      modules/etc1/image_etc.cpp
  17. 0 0
      modules/etc1/image_etc.h
  18. 47 0
      modules/etc1/register_types.cpp
  19. 30 0
      modules/etc1/register_types.h
  20. 0 0
      modules/etc1/texture_loader_pkm.cpp
  21. 0 0
      modules/etc1/texture_loader_pkm.h
  22. 7 0
      modules/pbm/SCsub
  23. 2 2
      modules/pbm/bitmap_loader_pbm.cpp
  24. 3 3
      modules/pbm/bitmap_loader_pbm.h
  25. 6 0
      modules/pbm/config.py
  26. 44 0
      modules/pbm/register_types.cpp
  27. 30 0
      modules/pbm/register_types.h
  28. 23 0
      modules/pvr/SCsub
  29. 6 0
      modules/pvr/config.py
  30. 44 0
      modules/pvr/register_types.cpp
  31. 30 0
      modules/pvr/register_types.h
  32. 0 0
      modules/pvr/texture_loader_pvr.cpp
  33. 0 0
      modules/pvr/texture_loader_pvr.h
  34. 23 0
      thirdparty/README.md
  35. 0 0
      thirdparty/pvrtccompressor/AlphaBitmap.h
  36. 0 0
      thirdparty/pvrtccompressor/BitScale.cpp
  37. 0 0
      thirdparty/pvrtccompressor/BitScale.h
  38. 0 0
      thirdparty/pvrtccompressor/BitUtility.h
  39. 0 0
      thirdparty/pvrtccompressor/Bitmap.h
  40. 0 0
      thirdparty/pvrtccompressor/ColorRgba.h
  41. 0 0
      thirdparty/pvrtccompressor/Interval.h
  42. 25 0
      thirdparty/pvrtccompressor/LICENSE.TXT
  43. 0 0
      thirdparty/pvrtccompressor/MortonTable.cpp
  44. 0 0
      thirdparty/pvrtccompressor/MortonTable.h
  45. 0 0
      thirdparty/pvrtccompressor/Point2.h
  46. 0 0
      thirdparty/pvrtccompressor/PvrTcDecoder.cpp
  47. 0 0
      thirdparty/pvrtccompressor/PvrTcDecoder.h
  48. 0 0
      thirdparty/pvrtccompressor/PvrTcEncoder.cpp
  49. 0 0
      thirdparty/pvrtccompressor/PvrTcEncoder.h
  50. 0 0
      thirdparty/pvrtccompressor/PvrTcPacket.cpp
  51. 0 0
      thirdparty/pvrtccompressor/PvrTcPacket.h
  52. 0 0
      thirdparty/pvrtccompressor/RgbBitmap.h
  53. 0 0
      thirdparty/pvrtccompressor/RgbaBitmap.h
  54. 0 0
      thirdparty/rg-etc1/rg_etc1.cpp
  55. 0 0
      thirdparty/rg-etc1/rg_etc1.h

+ 1 - 11
SConstruct

@@ -129,9 +129,6 @@ opts.Add('freetype','Freetype support in editor','builtin')
 opts.Add('xml','XML Save/Load support (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('libpng','libpng library for image loader support (system/builtin)','builtin')
 opts.Add('webp','WEBP Image loader support (yes/no)','yes')
 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('builtin_zlib','Use built-in zlib (yes/no)','yes')
 opts.Add('openssl','Use OpenSSL (yes/no/builtin)','no')
 opts.Add('openssl','Use OpenSSL (yes/no/builtin)','no')
 opts.Add('musepack','Musepack Audio (yes/no)','yes')
 opts.Add('musepack','Musepack Audio (yes/no)','yes')
@@ -157,7 +154,7 @@ for k in platform_opts.keys():
 		opts.Add(o[0],o[1],o[2])
 		opts.Add(o[0],o[1],o[2])
 
 
 for x in module_list:
 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
 opts.Update(env_base) # update environment
 Help(opts.GenerateHelpText(env_base)) # generate help
 Help(opts.GenerateHelpText(env_base)) # generate help
@@ -350,10 +347,6 @@ if selected_platform in platform_list:
 	if (env['theoralib']=='yes'):
 	if (env['theoralib']=='yes'):
 		env.Append(CPPFLAGS=['-DTHEORALIB_ENABLED']);
 		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'):
 	if (env['webp']=='yes'):
 		env.Append(CPPFLAGS=['-DWEBP_ENABLED']);
 		env.Append(CPPFLAGS=['-DWEBP_ENABLED']);
 
 
@@ -375,9 +368,6 @@ if selected_platform in platform_list:
 	if (env['colored']=='yes'):
 	if (env['colored']=='yes'):
 		methods.colored(sys,env)
 		methods.colored(sys,env)
 
 
-	if (env['etc1']=='yes'):
-		env.Append(CPPFLAGS=['-DETC1_ENABLED'])
-
 	Export('env')
 	Export('env')
 
 
 	#build subdirs, the build order is dependent on link order.
 	#build subdirs, the build order is dependent on link order.

+ 0 - 4
drivers/SCsub

@@ -14,7 +14,6 @@ SConscript('pulseaudio/SCsub');
 SConscript('windows/SCsub');
 SConscript('windows/SCsub');
 SConscript('gles2/SCsub');
 SConscript('gles2/SCsub');
 SConscript('gl_context/SCsub');
 SConscript('gl_context/SCsub');
-SConscript('pnm/SCsub');
 
 
 if (env['openssl']!='no'):
 if (env['openssl']!='no'):
 	env.Append(CPPFLAGS=['-DOPENSSL_ENABLED']);
 	env.Append(CPPFLAGS=['-DOPENSSL_ENABLED']);
@@ -29,9 +28,6 @@ if (env['openssl']!='no'):
 SConscript("png/SCsub");
 SConscript("png/SCsub");
 if (env["webp"]=="yes"):
 if (env["webp"]=="yes"):
 	SConscript("webp/SCsub");
 	SConscript("webp/SCsub");
-SConscript("dds/SCsub");
-SConscript("pvr/SCsub");
-SConscript("etc1/SCsub")
 if (env["builtin_zlib"]=="yes"):
 if (env["builtin_zlib"]=="yes"):
 	SConscript("builtin_zlib/SCsub");
 	SConscript("builtin_zlib/SCsub");
 
 

+ 0 - 10
drivers/dds/SCsub

@@ -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)

+ 0 - 15
drivers/etc1/SCsub

@@ -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')

+ 0 - 10
drivers/pnm/SCsub

@@ -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)

+ 0 - 15
drivers/pvr/SCsub

@@ -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)

+ 0 - 56
drivers/register_driver_types.cpp

@@ -31,12 +31,7 @@
 #include "png/image_loader_png.h"
 #include "png/image_loader_png.h"
 #include "png/resource_saver_png.h"
 #include "png/resource_saver_png.h"
 #include "webp/image_loader_webp.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 "chibi/event_stream_chibi.h"
-#include "pnm/bitmap_loader_pnm.h"
 
 
 
 
 #ifdef TOOLS_ENABLED
 #ifdef TOOLS_ENABLED
@@ -81,19 +76,6 @@ static ResourceSaverPNG *resource_saver_png=NULL;
 static ImageLoaderWEBP *image_loader_webp=NULL;
 static ImageLoaderWEBP *image_loader_webp=NULL;
 #endif
 #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
 #ifdef TREMOR_ENABLED
 static ResourceFormatLoaderAudioStreamOGG *vorbis_stream_loader=NULL;
 static ResourceFormatLoaderAudioStreamOGG *vorbis_stream_loader=NULL;
 #endif
 #endif
@@ -119,9 +101,6 @@ static ResourceFormatLoaderAudioStreamMPC * mpc_stream_loader=NULL;
 #endif
 #endif
 
 
 
 
-
-static ResourceFormatPBM * pbm_loader=NULL;
-
 void register_core_driver_types() {
 void register_core_driver_types() {
 
 
 	image_loader_png = memnew( ImageLoaderPNG );
 	image_loader_png = memnew( ImageLoaderPNG );
@@ -135,9 +114,6 @@ void register_core_driver_types() {
 	ImageLoader::add_image_format_loader( image_loader_webp );
 	ImageLoader::add_image_format_loader( image_loader_webp );
 #endif
 #endif
 
 
-	pbm_loader = memnew( ResourceFormatPBM );
-	ResourceLoader::add_resource_format_loader(pbm_loader);
-
 	ObjectTypeDB::register_type<RegEx>();
 	ObjectTypeDB::register_type<RegEx>();
 }
 }
 
 
@@ -153,7 +129,6 @@ void unregister_core_driver_types() {
 		memdelete( image_loader_webp );
 		memdelete( image_loader_webp );
 #endif
 #endif
 
 
-	memdelete( pbm_loader );
 }
 }
 
 
 
 
@@ -177,21 +152,6 @@ void register_driver_types() {
 	ObjectTypeDB::register_type<AudioStreamOpus>();
 	ObjectTypeDB::register_type<AudioStreamOpus>();
 #endif
 #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
 #ifdef TOOLS_ENABLED
 
 
 	Geometry::_decompose_func=b2d_decompose;
 	Geometry::_decompose_func=b2d_decompose;
@@ -225,10 +185,6 @@ void register_driver_types() {
 #endif
 #endif
 #endif
 #endif
 
 
-#ifdef ETC1_ENABLED
-	_register_etc1_compress_func();
-#endif
-	
 	initialize_chibi();
 	initialize_chibi();
 }
 }
 
 
@@ -257,18 +213,6 @@ void unregister_driver_types() {
 	memdelete (mpc_stream_loader);
 	memdelete (mpc_stream_loader);
 #endif
 #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
 #ifdef OPENSSL_ENABLED
 
 
 	unregister_openssl();
 	unregister_openssl();

+ 7 - 0
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')

+ 6 - 0
modules/dds/config.py

@@ -0,0 +1,6 @@
+
+def can_build(platform):
+	return True
+
+def configure(env):
+	pass

+ 44 - 0
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);
+}

+ 30 - 0
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();

+ 0 - 0
drivers/dds/texture_loader_dds.cpp → modules/dds/texture_loader_dds.cpp


+ 0 - 0
drivers/dds/texture_loader_dds.h → modules/dds/texture_loader_dds.h


+ 19 - 0
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')

+ 6 - 0
modules/etc1/config.py

@@ -0,0 +1,6 @@
+
+def can_build(platform):
+	return True
+
+def configure(env):
+	pass

+ 0 - 0
drivers/etc1/image_etc.cpp → modules/etc1/image_etc.cpp


+ 0 - 0
drivers/etc1/image_etc.h → modules/etc1/image_etc.h


+ 47 - 0
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);
+}

+ 30 - 0
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();

+ 0 - 0
drivers/etc1/texture_loader_pkm.cpp → modules/etc1/texture_loader_pkm.cpp


+ 0 - 0
drivers/etc1/texture_loader_pkm.h → modules/etc1/texture_loader_pkm.h


+ 7 - 0
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')

+ 2 - 2
drivers/pnm/bitmap_loader_pnm.cpp → modules/pbm/bitmap_loader_pbm.cpp

@@ -1,5 +1,5 @@
 /*************************************************************************/
 /*************************************************************************/
-/*  bitmap_loader_pnm.cpp                                                */
+/*  bitmap_loader_pbm.cpp                                                */
 /*************************************************************************/
 /*************************************************************************/
 /*                       This file is part of:                           */
 /*                       This file is part of:                           */
 /*                           GODOT ENGINE                                */
 /*                           GODOT ENGINE                                */
@@ -26,7 +26,7 @@
 /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE     */
 /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE     */
 /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                */
 /* 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 "os/file_access.h"
 #include "scene/resources/bit_mask.h"
 #include "scene/resources/bit_mask.h"
 
 

+ 3 - 3
drivers/pnm/bitmap_loader_pnm.h → modules/pbm/bitmap_loader_pbm.h

@@ -1,5 +1,5 @@
 /*************************************************************************/
 /*************************************************************************/
-/*  bitmap_loader_pnm.h                                                  */
+/*  bitmap_loader_pbm.h                                                  */
 /*************************************************************************/
 /*************************************************************************/
 /*                       This file is part of:                           */
 /*                       This file is part of:                           */
 /*                           GODOT ENGINE                                */
 /*                           GODOT ENGINE                                */
@@ -26,8 +26,8 @@
 /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE     */
 /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE     */
 /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                */
 /* 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"
 #include "io/resource_loader.h"
 
 

+ 6 - 0
modules/pbm/config.py

@@ -0,0 +1,6 @@
+
+def can_build(platform):
+	return True
+
+def configure(env):
+	pass

+ 44 - 0
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 );
+}

+ 30 - 0
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();

+ 23 - 0
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')

+ 6 - 0
modules/pvr/config.py

@@ -0,0 +1,6 @@
+
+def can_build(platform):
+	return True
+
+def configure(env):
+	pass

+ 44 - 0
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);
+}

+ 30 - 0
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();

+ 0 - 0
drivers/pvr/texture_loader_pvr.cpp → modules/pvr/texture_loader_pvr.cpp


+ 0 - 0
drivers/pvr/texture_loader_pvr.h → modules/pvr/texture_loader_pvr.h


+ 23 - 0
thirdparty/README.md

@@ -42,3 +42,26 @@ Files extracted from upstream source:
   * pngtest.c
   * pngtest.c
 - the arm/ folder
 - the arm/ folder
 - scripts/pnglibconf.h.prebuilt as pnglibconf.h
 - 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}

+ 0 - 0
drivers/pvr/AlphaBitmap.h → thirdparty/pvrtccompressor/AlphaBitmap.h


+ 0 - 0
drivers/pvr/BitScale.cpp → thirdparty/pvrtccompressor/BitScale.cpp


+ 0 - 0
drivers/pvr/BitScale.h → thirdparty/pvrtccompressor/BitScale.h


+ 0 - 0
drivers/pvr/BitUtility.h → thirdparty/pvrtccompressor/BitUtility.h


+ 0 - 0
drivers/pvr/Bitmap.h → thirdparty/pvrtccompressor/Bitmap.h


+ 0 - 0
drivers/pvr/ColorRgba.h → thirdparty/pvrtccompressor/ColorRgba.h


+ 0 - 0
drivers/pvr/Interval.h → thirdparty/pvrtccompressor/Interval.h


+ 25 - 0
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.

+ 0 - 0
drivers/pvr/MortonTable.cpp → thirdparty/pvrtccompressor/MortonTable.cpp


+ 0 - 0
drivers/pvr/MortonTable.h → thirdparty/pvrtccompressor/MortonTable.h


+ 0 - 0
drivers/pvr/Point2.h → thirdparty/pvrtccompressor/Point2.h


+ 0 - 0
drivers/pvr/PvrTcDecoder.cpp → thirdparty/pvrtccompressor/PvrTcDecoder.cpp


+ 0 - 0
drivers/pvr/PvrTcDecoder.h → thirdparty/pvrtccompressor/PvrTcDecoder.h


+ 0 - 0
drivers/pvr/PvrTcEncoder.cpp → thirdparty/pvrtccompressor/PvrTcEncoder.cpp


+ 0 - 0
drivers/pvr/PvrTcEncoder.h → thirdparty/pvrtccompressor/PvrTcEncoder.h


+ 0 - 0
drivers/pvr/PvrTcPacket.cpp → thirdparty/pvrtccompressor/PvrTcPacket.cpp


+ 0 - 0
drivers/pvr/PvrTcPacket.h → thirdparty/pvrtccompressor/PvrTcPacket.h


+ 0 - 0
drivers/pvr/RgbBitmap.h → thirdparty/pvrtccompressor/RgbBitmap.h


+ 0 - 0
drivers/pvr/RgbaBitmap.h → thirdparty/pvrtccompressor/RgbaBitmap.h


+ 0 - 0
drivers/etc1/rg_etc1.cpp → thirdparty/rg-etc1/rg_etc1.cpp


+ 0 - 0
drivers/etc1/rg_etc1.h → thirdparty/rg-etc1/rg_etc1.h