diff --git a/lib/irrlicht/current_version b/lib/irrlicht/current_version
index b6b1b08b5..b2892fedf 100644
--- a/lib/irrlicht/current_version
+++ b/lib/irrlicht/current_version
@@ -1 +1 @@
-4357
+4370
diff --git a/lib/irrlicht/doc/irrlicht-license.txt b/lib/irrlicht/doc/irrlicht-license.txt
new file mode 100644
index 000000000..19e40eca8
--- /dev/null
+++ b/lib/irrlicht/doc/irrlicht-license.txt
@@ -0,0 +1,26 @@
+Copyright (C) 2002-2012 Nikolaus Gebhardt
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+
+ Please note that the Irrlicht Engine is based in part on the work of the
+ Independent JPEG Group, the zlib, libPng and aesGladman. This means that if you use
+ the Irrlicht Engine in your product, you must acknowledge somewhere in your
+ documentation that you've used the IJPG code. It would also be nice to mention
+ that you use the Irrlicht Engine, the zlib, libPng and aesGladman. See the
+ corresponding license files for further informations. It is also possible to disable
+ usage of those additional libraries by defines in the IrrCompileConfig.h header and
+ recompiling the engine.
diff --git a/lib/irrlicht/doc/jpglib-license.txt b/lib/irrlicht/doc/jpglib-license.txt
new file mode 100644
index 000000000..07bb50b20
--- /dev/null
+++ b/lib/irrlicht/doc/jpglib-license.txt
@@ -0,0 +1,351 @@
+The Independent JPEG Group's JPEG software
+==========================================
+
+README for release 8d of 15-Jan-2012
+====================================
+
+This distribution contains the eighth public release of the Independent JPEG
+Group's free JPEG software. You are welcome to redistribute this software and
+to use it for any purpose, subject to the conditions under LEGAL ISSUES, below.
+
+This software is the work of Tom Lane, Guido Vollbeding, Philip Gladstone,
+Bill Allombert, Jim Boucher, Lee Crocker, Bob Friesenhahn, Ben Jackson,
+Julian Minguillon, Luis Ortiz, George Phillips, Davide Rossi, Ge' Weijers,
+and other members of the Independent JPEG Group.
+
+IJG is not affiliated with the ISO/IEC JTC1/SC29/WG1 standards committee
+(also known as JPEG, together with ITU-T SG16).
+
+
+DOCUMENTATION ROADMAP
+=====================
+
+This file contains the following sections:
+
+OVERVIEW General description of JPEG and the IJG software.
+LEGAL ISSUES Copyright, lack of warranty, terms of distribution.
+REFERENCES Where to learn more about JPEG.
+ARCHIVE LOCATIONS Where to find newer versions of this software.
+ACKNOWLEDGMENTS Special thanks.
+FILE FORMAT WARS Software *not* to get.
+TO DO Plans for future IJG releases.
+
+Other documentation files in the distribution are:
+
+User documentation:
+ install.txt How to configure and install the IJG software.
+ usage.txt Usage instructions for cjpeg, djpeg, jpegtran,
+ rdjpgcom, and wrjpgcom.
+ *.1 Unix-style man pages for programs (same info as usage.txt).
+ wizard.txt Advanced usage instructions for JPEG wizards only.
+ change.log Version-to-version change highlights.
+Programmer and internal documentation:
+ libjpeg.txt How to use the JPEG library in your own programs.
+ example.c Sample code for calling the JPEG library.
+ structure.txt Overview of the JPEG library's internal structure.
+ filelist.txt Road map of IJG files.
+ coderules.txt Coding style rules --- please read if you contribute code.
+
+Please read at least the files install.txt and usage.txt. Some information
+can also be found in the JPEG FAQ (Frequently Asked Questions) article. See
+ARCHIVE LOCATIONS below to find out where to obtain the FAQ article.
+
+If you want to understand how the JPEG code works, we suggest reading one or
+more of the REFERENCES, then looking at the documentation files (in roughly
+the order listed) before diving into the code.
+
+
+OVERVIEW
+========
+
+This package contains C software to implement JPEG image encoding, decoding,
+and transcoding. JPEG (pronounced "jay-peg") is a standardized compression
+method for full-color and gray-scale images.
+
+This software implements JPEG baseline, extended-sequential, and progressive
+compression processes. Provision is made for supporting all variants of these
+processes, although some uncommon parameter settings aren't implemented yet.
+We have made no provision for supporting the hierarchical or lossless
+processes defined in the standard.
+
+We provide a set of library routines for reading and writing JPEG image files,
+plus two sample applications "cjpeg" and "djpeg", which use the library to
+perform conversion between JPEG and some other popular image file formats.
+The library is intended to be reused in other applications.
+
+In order to support file conversion and viewing software, we have included
+considerable functionality beyond the bare JPEG coding/decoding capability;
+for example, the color quantization modules are not strictly part of JPEG
+decoding, but they are essential for output to colormapped file formats or
+colormapped displays. These extra functions can be compiled out of the
+library if not required for a particular application.
+
+We have also included "jpegtran", a utility for lossless transcoding between
+different JPEG processes, and "rdjpgcom" and "wrjpgcom", two simple
+applications for inserting and extracting textual comments in JFIF files.
+
+The emphasis in designing this software has been on achieving portability and
+flexibility, while also making it fast enough to be useful. In particular,
+the software is not intended to be read as a tutorial on JPEG. (See the
+REFERENCES section for introductory material.) Rather, it is intended to
+be reliable, portable, industrial-strength code. We do not claim to have
+achieved that goal in every aspect of the software, but we strive for it.
+
+We welcome the use of this software as a component of commercial products.
+No royalty is required, but we do ask for an acknowledgement in product
+documentation, as described under LEGAL ISSUES.
+
+
+LEGAL ISSUES
+============
+
+In plain English:
+
+1. We don't promise that this software works. (But if you find any bugs,
+ please let us know!)
+2. You can use this software for whatever you want. You don't have to pay us.
+3. You may not pretend that you wrote this software. If you use it in a
+ program, you must acknowledge somewhere in your documentation that
+ you've used the IJG code.
+
+In legalese:
+
+The authors make NO WARRANTY or representation, either express or implied,
+with respect to this software, its quality, accuracy, merchantability, or
+fitness for a particular purpose. This software is provided "AS IS", and you,
+its user, assume the entire risk as to its quality and accuracy.
+
+This software is copyright (C) 1991-2012, Thomas G. Lane, Guido Vollbeding.
+All Rights Reserved except as specified below.
+
+Permission is hereby granted to use, copy, modify, and distribute this
+software (or portions thereof) for any purpose, without fee, subject to these
+conditions:
+(1) If any part of the source code for this software is distributed, then this
+README file must be included, with this copyright and no-warranty notice
+unaltered; and any additions, deletions, or changes to the original files
+must be clearly indicated in accompanying documentation.
+(2) If only executable code is distributed, then the accompanying
+documentation must state that "this software is based in part on the work of
+the Independent JPEG Group".
+(3) Permission for use of this software is granted only if the user accepts
+full responsibility for any undesirable consequences; the authors accept
+NO LIABILITY for damages of any kind.
+
+These conditions apply to any software derived from or based on the IJG code,
+not just to the unmodified library. If you use our work, you ought to
+acknowledge us.
+
+Permission is NOT granted for the use of any IJG author's name or company name
+in advertising or publicity relating to this software or products derived from
+it. This software may be referred to only as "the Independent JPEG Group's
+software".
+
+We specifically permit and encourage the use of this software as the basis of
+commercial products, provided that all warranty or liability claims are
+assumed by the product vendor.
+
+
+ansi2knr.c is included in this distribution by permission of L. Peter Deutsch,
+sole proprietor of its copyright holder, Aladdin Enterprises of Menlo Park, CA.
+ansi2knr.c is NOT covered by the above copyright and conditions, but instead
+by the usual distribution terms of the Free Software Foundation; principally,
+that you must include source code if you redistribute it. (See the file
+ansi2knr.c for full details.) However, since ansi2knr.c is not needed as part
+of any program generated from the IJG code, this does not limit you more than
+the foregoing paragraphs do.
+
+The Unix configuration script "configure" was produced with GNU Autoconf.
+It is copyright by the Free Software Foundation but is freely distributable.
+The same holds for its supporting scripts (config.guess, config.sub,
+ltmain.sh). Another support script, install-sh, is copyright by X Consortium
+but is also freely distributable.
+
+The IJG distribution formerly included code to read and write GIF files.
+To avoid entanglement with the Unisys LZW patent, GIF reading support has
+been removed altogether, and the GIF writer has been simplified to produce
+"uncompressed GIFs". This technique does not use the LZW algorithm; the
+resulting GIF files are larger than usual, but are readable by all standard
+GIF decoders.
+
+We are required to state that
+ "The Graphics Interchange Format(c) is the Copyright property of
+ CompuServe Incorporated. GIF(sm) is a Service Mark property of
+ CompuServe Incorporated."
+
+
+REFERENCES
+==========
+
+We recommend reading one or more of these references before trying to
+understand the innards of the JPEG software.
+
+The best short technical introduction to the JPEG compression algorithm is
+ Wallace, Gregory K. "The JPEG Still Picture Compression Standard",
+ Communications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44.
+(Adjacent articles in that issue discuss MPEG motion picture compression,
+applications of JPEG, and related topics.) If you don't have the CACM issue
+handy, a PostScript file containing a revised version of Wallace's article is
+available at http://www.ijg.org/files/wallace.ps.gz. The file (actually
+a preprint for an article that appeared in IEEE Trans. Consumer Electronics)
+omits the sample images that appeared in CACM, but it includes corrections
+and some added material. Note: the Wallace article is copyright ACM and IEEE,
+and it may not be used for commercial purposes.
+
+A somewhat less technical, more leisurely introduction to JPEG can be found in
+"The Data Compression Book" by Mark Nelson and Jean-loup Gailly, published by
+M&T Books (New York), 2nd ed. 1996, ISBN 1-55851-434-1. This book provides
+good explanations and example C code for a multitude of compression methods
+including JPEG. It is an excellent source if you are comfortable reading C
+code but don't know much about data compression in general. The book's JPEG
+sample code is far from industrial-strength, but when you are ready to look
+at a full implementation, you've got one here...
+
+The best currently available description of JPEG is the textbook "JPEG Still
+Image Data Compression Standard" by William B. Pennebaker and Joan L.
+Mitchell, published by Van Nostrand Reinhold, 1993, ISBN 0-442-01272-1.
+Price US$59.95, 638 pp. The book includes the complete text of the ISO JPEG
+standards (DIS 10918-1 and draft DIS 10918-2).
+Although this is by far the most detailed and comprehensive exposition of
+JPEG publicly available, we point out that it is still missing an explanation
+of the most essential properties and algorithms of the underlying DCT
+technology.
+If you think that you know about DCT-based JPEG after reading this book,
+then you are in delusion. The real fundamentals and corresponding potential
+of DCT-based JPEG are not publicly known so far, and that is the reason for
+all the mistaken developments taking place in the image coding domain.
+
+The original JPEG standard is divided into two parts, Part 1 being the actual
+specification, while Part 2 covers compliance testing methods. Part 1 is
+titled "Digital Compression and Coding of Continuous-tone Still Images,
+Part 1: Requirements and guidelines" and has document numbers ISO/IEC IS
+10918-1, ITU-T T.81. Part 2 is titled "Digital Compression and Coding of
+Continuous-tone Still Images, Part 2: Compliance testing" and has document
+numbers ISO/IEC IS 10918-2, ITU-T T.83.
+IJG JPEG 8 introduces an implementation of the JPEG SmartScale extension
+which is specified in two documents: A contributed document at ITU and ISO
+with title "ITU-T JPEG-Plus Proposal for Extending ITU-T T.81 for Advanced
+Image Coding", April 2006, Geneva, Switzerland. The latest version of this
+document is Revision 3. And a contributed document ISO/IEC JTC1/SC29/WG1 N
+5799 with title "Evolution of JPEG", June/July 2011, Berlin, Germany.
+
+The JPEG standard does not specify all details of an interchangeable file
+format. For the omitted details we follow the "JFIF" conventions, revision
+1.02. JFIF 1.02 has been adopted as an Ecma International Technical Report
+and thus received a formal publication status. It is available as a free
+download in PDF format from
+http://www.ecma-international.org/publications/techreports/E-TR-098.htm.
+A PostScript version of the JFIF document is available at
+http://www.ijg.org/files/jfif.ps.gz. There is also a plain text version at
+http://www.ijg.org/files/jfif.txt.gz, but it is missing the figures.
+
+The TIFF 6.0 file format specification can be obtained by FTP from
+ftp://ftp.sgi.com/graphics/tiff/TIFF6.ps.gz. The JPEG incorporation scheme
+found in the TIFF 6.0 spec of 3-June-92 has a number of serious problems.
+IJG does not recommend use of the TIFF 6.0 design (TIFF Compression tag 6).
+Instead, we recommend the JPEG design proposed by TIFF Technical Note #2
+(Compression tag 7). Copies of this Note can be obtained from
+http://www.ijg.org/files/. It is expected that the next revision
+of the TIFF spec will replace the 6.0 JPEG design with the Note's design.
+Although IJG's own code does not support TIFF/JPEG, the free libtiff library
+uses our library to implement TIFF/JPEG per the Note.
+
+
+ARCHIVE LOCATIONS
+=================
+
+The "official" archive site for this software is www.ijg.org.
+The most recent released version can always be found there in
+directory "files". This particular version will be archived as
+http://www.ijg.org/files/jpegsrc.v8d.tar.gz, and in Windows-compatible
+"zip" archive format as http://www.ijg.org/files/jpegsr8d.zip.
+
+The JPEG FAQ (Frequently Asked Questions) article is a source of some
+general information about JPEG.
+It is available on the World Wide Web at http://www.faqs.org/faqs/jpeg-faq/
+and other news.answers archive sites, including the official news.answers
+archive at rtfm.mit.edu: ftp://rtfm.mit.edu/pub/usenet/news.answers/jpeg-faq/.
+If you don't have Web or FTP access, send e-mail to mail-server@rtfm.mit.edu
+with body
+ send usenet/news.answers/jpeg-faq/part1
+ send usenet/news.answers/jpeg-faq/part2
+
+
+ACKNOWLEDGMENTS
+===============
+
+Thank to Juergen Bruder for providing me with a copy of the common DCT
+algorithm article, only to find out that I had come to the same result
+in a more direct and comprehensible way with a more generative approach.
+
+Thank to Istvan Sebestyen and Joan L. Mitchell for inviting me to the
+ITU JPEG (Study Group 16) meeting in Geneva, Switzerland.
+
+Thank to Thomas Wiegand and Gary Sullivan for inviting me to the
+Joint Video Team (MPEG & ITU) meeting in Geneva, Switzerland.
+
+Thank to Thomas Richter and Daniel Lee for inviting me to the
+ISO/IEC JTC1/SC29/WG1 (also known as JPEG, together with ITU-T SG16)
+meeting in Berlin, Germany.
+
+Thank to John Korejwa and Massimo Ballerini for inviting me to
+fruitful consultations in Boston, MA and Milan, Italy.
+
+Thank to Hendrik Elstner, Roland Fassauer, Simone Zuck, Guenther
+Maier-Gerber, Walter Stoeber, Fred Schmitz, and Norbert Braunagel
+for corresponding business development.
+
+Thank to Nico Zschach and Dirk Stelling of the technical support team
+at the Digital Images company in Halle for providing me with extra
+equipment for configuration tests.
+
+Thank to Richard F. Lyon (then of Foveon Inc.) for fruitful
+communication about JPEG configuration in Sigma Photo Pro software.
+
+Thank to Andrew Finkenstadt for hosting the ijg.org site.
+
+Last but not least special thank to Thomas G. Lane for the original
+design and development of this singular software package.
+
+
+FILE FORMAT WARS
+================
+
+The ISO/IEC JTC1/SC29/WG1 standards committee (also known as JPEG, together
+with ITU-T SG16) currently promotes different formats containing the name
+"JPEG" which is misleading because these formats are incompatible with
+original DCT-based JPEG and are based on faulty technologies.
+IJG therefore does not and will not support such momentary mistakes
+(see REFERENCES).
+There exist also distributions under the name "OpenJPEG" promoting such
+kind of formats which is misleading because they don't support original
+JPEG images.
+We have no sympathy for the promotion of inferior formats. Indeed, one of
+the original reasons for developing this free software was to help force
+convergence on common, interoperable format standards for JPEG files.
+Don't use an incompatible file format!
+(In any case, our decoder will remain capable of reading existing JPEG
+image files indefinitely.)
+
+Furthermore, the ISO committee pretends to be "responsible for the popular
+JPEG" in their public reports which is not true because they don't respond to
+actual requirements for the maintenance of the original JPEG specification.
+
+There are currently distributions in circulation containing the name
+"libjpeg" which claim to be a "derivative" or "fork" of the original
+libjpeg, but don't have the features and are incompatible with formats
+supported by actual IJG libjpeg distributions. Furthermore, they
+violate the license conditions as described under LEGAL ISSUES above.
+We have no sympathy for the release of misleading and illegal
+distributions derived from obsolete code bases.
+Don't use an obsolete code base!
+
+
+TO DO
+=====
+
+Version 8 is the first release of a new generation JPEG standard
+to overcome the limitations of the original JPEG specification.
+More features are being prepared for coming releases...
+
+Please send bug reports, offers of help, etc. to jpeg-info@jpegclub.org.
diff --git a/lib/irrlicht/doc/libpng-license.txt b/lib/irrlicht/doc/libpng-license.txt
new file mode 100644
index 000000000..0c927409a
--- /dev/null
+++ b/lib/irrlicht/doc/libpng-license.txt
@@ -0,0 +1,111 @@
+
+This copy of the libpng notices is provided for your convenience. In case of
+any discrepancy between this copy and the notices in the file png.h that is
+included in the libpng distribution, the latter shall prevail.
+
+COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:
+
+If you modify libpng you may insert additional notices immediately following
+this sentence.
+
+This code is released under the libpng license.
+
+libpng versions 1.2.6, August 15, 2004, through 1.5.9, February 18, 2012, are
+Copyright (c) 2004, 2006-2011 Glenn Randers-Pehrson, and are
+distributed according to the same disclaimer and license as libpng-1.2.5
+with the following individual added to the list of Contributing Authors
+
+ Cosmin Truta
+
+libpng versions 1.0.7, July 1, 2000, through 1.2.5 - October 3, 2002, are
+Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are
+distributed according to the same disclaimer and license as libpng-1.0.6
+with the following individuals added to the list of Contributing Authors
+
+ Simon-Pierre Cadieux
+ Eric S. Raymond
+ Gilles Vollant
+
+and with the following additions to the disclaimer:
+
+ There is no warranty against interference with your enjoyment of the
+ library or against infringement. There is no warranty that our
+ efforts or the library will fulfill any of your particular purposes
+ or needs. This library is provided with all faults, and the entire
+ risk of satisfactory quality, performance, accuracy, and effort is with
+ the user.
+
+libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
+Copyright (c) 1998, 1999 Glenn Randers-Pehrson, and are
+distributed according to the same disclaimer and license as libpng-0.96,
+with the following individuals added to the list of Contributing Authors:
+
+ Tom Lane
+ Glenn Randers-Pehrson
+ Willem van Schaik
+
+libpng versions 0.89, June 1996, through 0.96, May 1997, are
+Copyright (c) 1996, 1997 Andreas Dilger
+Distributed according to the same disclaimer and license as libpng-0.88,
+with the following individuals added to the list of Contributing Authors:
+
+ John Bowler
+ Kevin Bracey
+ Sam Bushell
+ Magnus Holmgren
+ Greg Roelofs
+ Tom Tanner
+
+libpng versions 0.5, May 1995, through 0.88, January 1996, are
+Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
+
+For the purposes of this copyright and license, "Contributing Authors"
+is defined as the following set of individuals:
+
+ Andreas Dilger
+ Dave Martindale
+ Guy Eric Schalnat
+ Paul Schmidt
+ Tim Wegner
+
+The PNG Reference Library is supplied "AS IS". The Contributing Authors
+and Group 42, Inc. disclaim all warranties, expressed or implied,
+including, without limitation, the warranties of merchantability and of
+fitness for any purpose. The Contributing Authors and Group 42, Inc.
+assume no liability for direct, indirect, incidental, special, exemplary,
+or consequential damages, which may result from the use of the PNG
+Reference Library, even if advised of the possibility of such damage.
+
+Permission is hereby granted to use, copy, modify, and distribute this
+source code, or portions hereof, for any purpose, without fee, subject
+to the following restrictions:
+
+1. The origin of this source code must not be misrepresented.
+
+2. Altered versions must be plainly marked as such and must not
+ be misrepresented as being the original source.
+
+3. This Copyright notice may not be removed or altered from any
+ source or altered source distribution.
+
+The Contributing Authors and Group 42, Inc. specifically permit, without
+fee, and encourage the use of this source code as a component to
+supporting the PNG file format in commercial products. If you use this
+source code in a product, acknowledgment is not required but would be
+appreciated.
+
+
+A "png_get_copyright" function is available, for convenient use in "about"
+boxes and the like:
+
+ printf("%s",png_get_copyright(NULL));
+
+Also, the PNG logo (in PNG format, of course) is supplied in the
+files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31).
+
+Libpng is OSI Certified Open Source Software. OSI Certified Open Source is a
+certification mark of the Open Source Initiative.
+
+Glenn Randers-Pehrson
+glennrp at users.sourceforge.net
+February 18, 2012
diff --git a/lib/irrlicht/include/SColor.h b/lib/irrlicht/include/SColor.h
index d6a386e39..b61bbef97 100644
--- a/lib/irrlicht/include/SColor.h
+++ b/lib/irrlicht/include/SColor.h
@@ -395,6 +395,7 @@ namespace video
}
break;
default:
+ color = 0xffffffff;
break;
}
}
diff --git a/lib/irrlicht/source/Irrlicht/CBlit.h b/lib/irrlicht/source/Irrlicht/CBlit.h
index bee845e86..a8572e929 100644
--- a/lib/irrlicht/source/Irrlicht/CBlit.h
+++ b/lib/irrlicht/source/Irrlicht/CBlit.h
@@ -926,30 +926,13 @@ static void executeBlit_TextureBlendColor_32_to_32( const SBlitJob * job )
*/
static void executeBlit_Color_16_to_16( const SBlitJob * job )
{
+ const u16 c = video::A8R8G8B8toA1R5G5B5(job->argb);
u16 *dst = (u16*) job->dst;
- u16 c0 = video::A8R8G8B8toA1R5G5B5( job->argb );
- u32 c = c0 | c0 << 16;
-
- if ( 0 == (job->srcPitch & 3 ) )
+ for ( s32 dy = 0; dy != job->height; ++dy )
{
- for ( s32 dy = 0; dy != job->height; ++dy )
- {
- memset32( dst, c, job->srcPitch );
- dst = (u16*) ( (u8*) (dst) + job->dstPitch );
- }
- }
- else
- {
- s32 dx = job->width - 1;
-
- for ( s32 dy = 0; dy != job->height; ++dy )
- {
- memset32( dst, c, job->srcPitch );
- dst[dx] = c0;
- dst = (u16*) ( (u8*) (dst) + job->dstPitch );
- }
-
+ memset16(dst, c, job->srcPitch);
+ dst = (u16*) ( (u8*) (dst) + job->dstPitch );
}
}
diff --git a/lib/irrlicht/source/Irrlicht/CSTLMeshFileLoader.cpp b/lib/irrlicht/source/Irrlicht/CSTLMeshFileLoader.cpp
index af0ba3bee..bf9ffb309 100644
--- a/lib/irrlicht/source/Irrlicht/CSTLMeshFileLoader.cpp
+++ b/lib/irrlicht/source/Irrlicht/CSTLMeshFileLoader.cpp
@@ -40,8 +40,6 @@ IAnimatedMesh* CSTLMeshFileLoader::createMesh(io::IReadFile* file)
if (filesize < 6) // we need a header
return 0;
- const u32 WORD_BUFFER_LENGTH = 512;
-
SMesh* mesh = new SMesh();
SMeshBuffer* meshBuffer = new SMeshBuffer();
mesh->addMeshBuffer(meshBuffer);
@@ -50,8 +48,6 @@ IAnimatedMesh* CSTLMeshFileLoader::createMesh(io::IReadFile* file)
core::vector3df vertex[3];
core::vector3df normal;
- c8 buffer[WORD_BUFFER_LENGTH];
-
bool binary = false;
core::stringc token;
if (getNextToken(file, token) != "solid")
diff --git a/lib/irrlicht/source/Irrlicht/CSoftwareDriver2.cpp b/lib/irrlicht/source/Irrlicht/CSoftwareDriver2.cpp
index e60e206c6..bdde9298c 100644
--- a/lib/irrlicht/source/Irrlicht/CSoftwareDriver2.cpp
+++ b/lib/irrlicht/source/Irrlicht/CSoftwareDriver2.cpp
@@ -1490,7 +1490,7 @@ REALINLINE s4DVertex * CBurningVideoDriver::VertexCache_getVertex ( const u32 so
fill blockwise on the next 16(Cache_Size) unique vertices in indexlist
merge the next 16 vertices with the current
*/
-REALINLINE void CBurningVideoDriver::VertexCache_get ( s4DVertex ** face )
+REALINLINE void CBurningVideoDriver::VertexCache_get(const s4DVertex ** face)
{
SCacheInfo info[VERTEXCACHE_ELEMENT];
@@ -1595,7 +1595,8 @@ REALINLINE void CBurningVideoDriver::VertexCache_get ( s4DVertex ** face )
face[0] = VertexCache_getVertex ( p[ i0 ] );
face[1] = VertexCache_getVertex ( p[ VertexCache.indicesRun + 1] );
face[2] = VertexCache_getVertex ( p[ VertexCache.indicesRun + 2] );
- } break;
+ }
+ break;
case 2:
{
@@ -1603,12 +1604,17 @@ REALINLINE void CBurningVideoDriver::VertexCache_get ( s4DVertex ** face )
face[0] = VertexCache_getVertex ( p[ i0 ] );
face[1] = VertexCache_getVertex ( p[ VertexCache.indicesRun + 1] );
face[2] = VertexCache_getVertex ( p[ VertexCache.indicesRun + 2] );
- } break;
+ }
+ break;
+
case 4:
face[0] = VertexCache_getVertex ( VertexCache.indicesRun + 0 );
face[1] = VertexCache_getVertex ( VertexCache.indicesRun + 1 );
face[2] = VertexCache_getVertex ( VertexCache.indicesRun + 2 );
- break;
+ break;
+ default:
+ face[0] = face[1] = face[2] = VertexCache_getVertex(VertexCache.indicesRun + 0);
+ break;
}
VertexCache.indicesRun += VertexCache.primitivePitch;
@@ -1759,7 +1765,7 @@ void CBurningVideoDriver::drawVertexPrimitiveList(const void* vertices, u32 vert
for ( i = 0; i < (u32) primitiveCount; ++i )
{
- VertexCache_get ( (s4DVertex**) face );
+ VertexCache_get(face);
// if fully outside or outside on same side
if ( ( (face[0]->flag | face[1]->flag | face[2]->flag) & VERTEX4D_CLIPMASK )
diff --git a/lib/irrlicht/source/Irrlicht/CSoftwareDriver2.h b/lib/irrlicht/source/Irrlicht/CSoftwareDriver2.h
index 976e23b3a..120bad2e1 100644
--- a/lib/irrlicht/source/Irrlicht/CSoftwareDriver2.h
+++ b/lib/irrlicht/source/Irrlicht/CSoftwareDriver2.h
@@ -238,7 +238,7 @@ namespace video
const void* indices, u32 indexCount,
E_VERTEX_TYPE vType,scene::E_PRIMITIVE_TYPE pType,
E_INDEX_TYPE iType);
- void VertexCache_get ( s4DVertex ** face );
+ void VertexCache_get ( const s4DVertex ** face );
void VertexCache_getbypass ( s4DVertex ** face );
void VertexCache_fill ( const u32 sourceIndex,const u32 destIndex );
diff --git a/lib/irrlicht/source/Irrlicht/Irrlicht-gcc.cbp b/lib/irrlicht/source/Irrlicht/Irrlicht-gcc.cbp
index db39e271a..5d4c0250a 100644
--- a/lib/irrlicht/source/Irrlicht/Irrlicht-gcc.cbp
+++ b/lib/irrlicht/source/Irrlicht/Irrlicht-gcc.cbp
@@ -60,8 +60,8 @@
-
+
@@ -267,7 +267,6 @@
-
@@ -296,7 +295,6 @@
-
@@ -323,7 +321,6 @@
-
@@ -352,7 +349,6 @@
-
@@ -380,7 +376,6 @@
-
@@ -406,7 +401,6 @@
-
@@ -628,6 +622,7 @@
+
diff --git a/lib/irrlicht/source/Irrlicht/SoftwareDriver2_helper.h b/lib/irrlicht/source/Irrlicht/SoftwareDriver2_helper.h
index bb9413666..263548b50 100644
--- a/lib/irrlicht/source/Irrlicht/SoftwareDriver2_helper.h
+++ b/lib/irrlicht/source/Irrlicht/SoftwareDriver2_helper.h
@@ -67,14 +67,16 @@ namespace irr
// ----------------------- Generic ----------------------------------
//! a more useful memset for pixel
-inline void memset32 ( void * dest, const u32 value, u32 bytesize )
+// (standard memset only works with 8-bit values)
+inline void memset32(void * dest, const u32 value, u32 bytesize)
{
u32 * d = (u32*) dest;
u32 i;
- i = bytesize >> ( 2 + 3 );
- while( i )
+ // loops unrolled to reduce the number of increments by factor ~8.
+ i = bytesize >> (2 + 3);
+ while (i)
{
d[0] = value;
d[1] = value;
@@ -91,13 +93,47 @@ inline void memset32 ( void * dest, const u32 value, u32 bytesize )
}
i = (bytesize >> 2 ) & 7;
- while( i )
+ while (i)
{
d[0] = value;
d += 1;
i -= 1;
}
+}
+//! a more useful memset for pixel
+// (standard memset only works with 8-bit values)
+inline void memset16(void * dest, const u16 value, u32 bytesize)
+{
+ u16 * d = (u16*) dest;
+
+ u32 i;
+
+ // loops unrolled to reduce the number of increments by factor ~8.
+ i = bytesize >> (1 + 3);
+ while (i)
+ {
+ d[0] = value;
+ d[1] = value;
+ d[2] = value;
+ d[3] = value;
+
+ d[4] = value;
+ d[5] = value;
+ d[6] = value;
+ d[7] = value;
+
+ d += 8;
+ --i;
+ }
+
+ i = (bytesize >> 1 ) & 7;
+ while (i)
+ {
+ d[0] = value;
+ ++d;
+ --i;
+ }
}
/*
diff --git a/lib/irrlicht/tests/anti-aliasing.cpp b/lib/irrlicht/tests/anti-aliasing.cpp
index 6fe31e30e..09205be4a 100644
--- a/lib/irrlicht/tests/anti-aliasing.cpp
+++ b/lib/irrlicht/tests/anti-aliasing.cpp
@@ -29,7 +29,7 @@ static bool testLineRendering(video::E_DRIVER_TYPE type)
scene::ISceneManager* smgr = device->getSceneManager();
- scene::IAnimatedMesh* mesh = smgr->getMesh("../media/sydney.md2");
+ scene::IAnimatedMesh* mesh = smgr->getMesh("./media/sydney.md2");
if (!mesh)
{
device->closeDevice();
@@ -46,7 +46,7 @@ static bool testLineRendering(video::E_DRIVER_TYPE type)
{
node->setMaterialFlag(video::EMF_LIGHTING, false);
node->setMD2Animation(scene::EMAT_STAND);
- node->setMaterialTexture( 0, driver->getTexture("../media/sydney.bmp") );
+ node->setMaterialTexture( 0, driver->getTexture("./media/sydney.bmp") );
}
smgr->addCameraSceneNode(0, core::vector3df(0,30,-40), core::vector3df(0,5,0));
@@ -64,7 +64,7 @@ static bool testLineRendering(video::E_DRIVER_TYPE type)
device->run();
device->drop();
return result;
-}
+}
bool antiAliasing()
{
diff --git a/lib/irrlicht/tests/md2Animation.cpp b/lib/irrlicht/tests/md2Animation.cpp
index dbd9a9f40..9feebd909 100644
--- a/lib/irrlicht/tests/md2Animation.cpp
+++ b/lib/irrlicht/tests/md2Animation.cpp
@@ -20,7 +20,7 @@ bool testLastFrame()
video::IVideoDriver* driver = device->getVideoDriver();
scene::ISceneManager * smgr = device->getSceneManager();
- scene::IAnimatedMesh* mesh = smgr->getMesh("../media/sydney.md2");
+ scene::IAnimatedMesh* mesh = smgr->getMesh("./media/sydney.md2");
bool result = (mesh != 0);
if (mesh)
@@ -31,7 +31,7 @@ bool testLastFrame()
{
node->setPosition(vector3df(20, 0, 30));
node->setMaterialFlag(video::EMF_LIGHTING, false);
- node->setMaterialTexture(0, driver->getTexture("../media/sydney.bmp"));
+ node->setMaterialTexture(0, driver->getTexture("./media/sydney.bmp"));
node->setLoopMode(false);
(void)smgr->addCameraSceneNode();
@@ -84,7 +84,7 @@ bool testNormals()
video::IVideoDriver* driver = device->getVideoDriver();
scene::ISceneManager * smgr = device->getSceneManager();
- scene::IAnimatedMesh* mesh = smgr->getMesh("../media/sydney.md2");
+ scene::IAnimatedMesh* mesh = smgr->getMesh("./media/sydney.md2");
bool result = (mesh != 0);
if (mesh)
@@ -95,7 +95,7 @@ bool testNormals()
node->setPosition(vector3df(20, 0, 30));
node->setMaterialFlag(video::EMF_LIGHTING, false);
node->setDebugDataVisible(scene::EDS_NORMALS);
- node->setMaterialTexture(0, driver->getTexture("../media/sydney.bmp"));
+ node->setMaterialTexture(0, driver->getTexture("./media/sydney.bmp"));
node->setLoopMode(false);
(void)smgr->addCameraSceneNode();
diff --git a/lib/irrlicht/tests/userClipPlane.cpp b/lib/irrlicht/tests/userClipPlane.cpp
index fbf5a88d8..64c1e16bc 100644
--- a/lib/irrlicht/tests/userClipPlane.cpp
+++ b/lib/irrlicht/tests/userClipPlane.cpp
@@ -54,6 +54,7 @@ static bool withSphere(video::E_DRIVER_TYPE type)
bool result = takeScreenshotAndCompareAgainstReference(driver, "-ucpsphere.png");
device->closeDevice();
+ device->run();
device->drop();
return result;
}