Merged default into Mesh

--HG--
branch : Mesh
This commit is contained in:
Alex Szpakowski
2013-09-30 04:00:28 -03:00
12 changed files with 1207 additions and 36 deletions
+1150
View File
File diff suppressed because it is too large Load Diff
@@ -2267,7 +2267,7 @@
10D5479E63C26BB35EB5482E /* Release */ = { 10D5479E63C26BB35EB5482E /* Release */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; ARCHS = "$(ARCHS_STANDARD_64_BIT)";
CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
DEAD_CODE_STRIPPING = YES; DEAD_CODE_STRIPPING = YES;
@@ -2303,7 +2303,7 @@
64274E785071353E1A1D0D4B /* Debug */ = { 64274E785071353E1A1D0D4B /* Debug */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; ARCHS = "$(ARCHS_STANDARD_64_BIT)";
CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
COPY_PHASE_STRIP = NO; COPY_PHASE_STRIP = NO;
@@ -301,7 +301,7 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; ARCHS = "$(ARCHS_STANDARD_64_BIT)";
CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
FRAMEWORK_SEARCH_PATHS = /Library/Frameworks; FRAMEWORK_SEARCH_PATHS = /Library/Frameworks;
@@ -353,7 +353,7 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; ARCHS = "$(ARCHS_STANDARD_64_BIT)";
CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
DEPLOYMENT_POSTPROCESSING = NO; DEPLOYMENT_POSTPROCESSING = NO;
+16
View File
@@ -13,9 +13,25 @@ AC_PROG_CXX
AC_PROG_SED AC_PROG_SED
AC_PROG_MKDIR_P AC_PROG_MKDIR_P
AC_C_BIGENDIAN AC_C_BIGENDIAN
AC_LANG([C++])
includes= includes=
AC_DEFUN([ACLOVE_CXX_FLAG_TEST], # WARNING: NOT REENTRANT
[aclove_cxx_flag_test_save_cflags="$CXXFLAGS"
CXXFLAGS="$1"
AC_MSG_CHECKING([whether $CXX supports flag $1])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
[AC_MSG_RESULT([yes])]; $2,
[AC_MSG_RESULT([no]); $3])
CXXFLAGS="$aclove_cxx_flag_test_save_cflags"])
# C++11 support
cxx11name="no"
ACLOVE_CXX_FLAG_TEST([-std=c++0x], cxx11name="c++0x", [])
ACLOVE_CXX_FLAG_TEST([-std=c++11], cxx11name="c++11", [])
AS_VAR_IF([cxx11name], [no], AC_MSG_ERROR([Can't LÖVE without C++11]), CXXFLAGS="$CXXFLAGS -std=$cxx11name")
# Libraries # Libraries
AC_SEARCH_LIBS([sqrt], [m], [], AC_MSG_ERROR([Can't LÖVE without C math library])) AC_SEARCH_LIBS([sqrt], [m], [], AC_MSG_ERROR([Can't LÖVE without C math library]))
AC_SEARCH_LIBS([SDL_Init], [SDL2], [], AC_MSG_ERROR([Can't LÖVE without SDL 2])) AC_SEARCH_LIBS([SDL_Init], [SDL2], [], AC_MSG_ERROR([Can't LÖVE without SDL 2]))
@@ -14,6 +14,9 @@
* 2. Altered source versions must be plainly marked as such, and must not be * 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software. * misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution. * 3. This notice may not be removed or altered from any source distribution.
*
*
* THIS FILE HAS BEEN MODIFIED BY THE LÖVE DEVELOPMENT TEAM
*/ */
#ifndef B2_CHAIN_SHAPE_H #ifndef B2_CHAIN_SHAPE_H
@@ -95,8 +98,8 @@ inline b2ChainShape::b2ChainShape()
m_radius = b2_polygonRadius; m_radius = b2_polygonRadius;
m_vertices = NULL; m_vertices = NULL;
m_count = 0; m_count = 0;
m_hasPrevVertex = NULL; m_hasPrevVertex = false;
m_hasNextVertex = NULL; m_hasNextVertex = false;
} }
#endif #endif
+1
View File
@@ -0,0 +1 @@
PLEASE NOTE, this version of Box2D is NOT original, it has been MODIFIED by the LÖVE Development Team.
@@ -110,7 +110,7 @@ static int base_open(lua_State *L) {
/*-------------------------------------------------------------------------*\ /*-------------------------------------------------------------------------*\
* Initializes all library modules. * Initializes all library modules.
\*-------------------------------------------------------------------------*/ \*-------------------------------------------------------------------------*/
LUASOCKET_API luaopen_socket_core(lua_State *L) { int LUASOCKET_API luaopen_socket_core(lua_State *L) {
int i; int i;
base_open(L); base_open(L);
for (i = 0; mod[i].name; i++) mod[i].func(L); for (i = 0; mod[i].name; i++) mod[i].func(L);
+5 -5
View File
@@ -76,7 +76,7 @@ bool Pool::isPlaying(Source *s)
bool p = false; bool p = false;
{ {
thread::Lock lock(mutex); thread::Lock lock(mutex);
for (std::map<Source *, ALuint>::iterator i = playing.begin(); i != playing.end(); i++) for (auto i = playing.begin(); i != playing.end(); i++)
{ {
if (i->first == s) if (i->first == s)
p = true; p = true;
@@ -161,7 +161,7 @@ bool Pool::play(Source *source, ALuint &out)
void Pool::stop() void Pool::stop()
{ {
thread::Lock lock(mutex); thread::Lock lock(mutex);
for (std::map<Source *, ALuint>::iterator i = playing.begin(); i != playing.end(); i++) for (auto i = playing.begin(); i != playing.end(); i++)
{ {
i->first->stopAtomic(); i->first->stopAtomic();
i->first->release(); i->first->release();
@@ -180,7 +180,7 @@ void Pool::stop(Source *source)
void Pool::pause() void Pool::pause()
{ {
thread::Lock lock(mutex); thread::Lock lock(mutex);
for (std::map<Source *, ALuint>::iterator i = playing.begin(); i != playing.end(); i++) for (auto i = playing.begin(); i != playing.end(); i++)
i->first->pauseAtomic(); i->first->pauseAtomic();
} }
@@ -195,7 +195,7 @@ void Pool::pause(Source *source)
void Pool::resume() void Pool::resume()
{ {
thread::Lock lock(mutex); thread::Lock lock(mutex);
for (std::map<Source *, ALuint>::iterator i = playing.begin(); i != playing.end(); i++) for (auto i = playing.begin(); i != playing.end(); i++)
i->first->resumeAtomic(); i->first->resumeAtomic();
} }
@@ -210,7 +210,7 @@ void Pool::resume(Source *source)
void Pool::rewind() void Pool::rewind()
{ {
thread::Lock lock(mutex); thread::Lock lock(mutex);
for (std::map<Source *, ALuint>::iterator i = playing.begin(); i != playing.end(); i++) for (auto i = playing.begin(); i != playing.end(); i++)
i->first->rewindAtomic(); i->first->rewindAtomic();
} }
+2 -3
View File
@@ -244,7 +244,7 @@ Font::Glyph *Font::addGlyph(uint32 glyph)
Font::Glyph *Font::findGlyph(uint32 glyph) Font::Glyph *Font::findGlyph(uint32 glyph)
{ {
std::map<uint32, Glyph *>::const_iterator it = glyphs.find(glyph); auto it = glyphs.find(glyph);
if (it != glyphs.end()) if (it != glyphs.end())
return it->second; return it->second;
@@ -498,8 +498,7 @@ void Font::setFilter(const Image::Filter &f)
{ {
filter = f; filter = f;
std::vector<GLuint>::const_iterator it; for (auto it = textures.begin(); it != textures.end(); ++it)
for (it = textures.begin(); it != textures.end(); ++it)
{ {
gl.bindTexture(*it); gl.bindTexture(*it);
filter.anisotropy = gl.setTextureFilter(f); filter.anisotropy = gl.setTextureFilter(f);
+12 -8
View File
@@ -554,7 +554,7 @@ void Shader::sendTexture(const std::string &name, GLuint texture)
if (activeTextureUnits[textureunit-1] == 0) if (activeTextureUnits[textureunit-1] == 0)
++textureCounters[textureunit-1]; ++textureCounters[textureunit-1];
// store texture id so it can be re-bound to the proper texture unit when necessary // store texture id so it can be re-bound to the proper texture unit later
activeTextureUnits[textureunit-1] = texture; activeTextureUnits[textureunit-1] = texture;
} }
@@ -570,7 +570,7 @@ void Shader::sendCanvas(const std::string &name, const Canvas &canvas)
int Shader::getTextureUnit(const std::string &name) int Shader::getTextureUnit(const std::string &name)
{ {
std::map<std::string, GLint>::const_iterator it = textureUnitPool.find(name); auto it = textureUnitPool.find(name);
if (it != textureUnitPool.end()) if (it != textureUnitPool.end())
return it->second; return it->second;
@@ -578,19 +578,23 @@ int Shader::getTextureUnit(const std::string &name)
int textureunit = 1; int textureunit = 1;
// prefer texture units which are unused by all other shaders // prefer texture units which are unused by all other shaders
std::vector<int>::iterator nextfreeunit = std::find(textureCounters.begin(), textureCounters.end(), 0); auto freeunit_it = std::find(textureCounters.begin(), textureCounters.end(), 0);
if (nextfreeunit != textureCounters.end()) if (freeunit_it != textureCounters.end())
textureunit = std::distance(textureCounters.begin(), nextfreeunit) + 1; // we don't want to use unit 0 {
// we don't want to use unit 0
textureunit = std::distance(textureCounters.begin(), freeunit_it) + 1;
}
else else
{ {
// no completely unused texture units exist, try to use next free slot in our own list // no completely unused texture units exist, try to use next free slot in our own list
std::vector<GLuint>::iterator nexttexunit = std::find(activeTextureUnits.begin(), activeTextureUnits.end(), 0); auto nextunit_it = std::find(activeTextureUnits.begin(), activeTextureUnits.end(), 0);
if (nexttexunit == activeTextureUnits.end()) if (nextunit_it == activeTextureUnits.end())
throw love::Exception("No more texture units available for shader."); throw love::Exception("No more texture units available for shader.");
textureunit = std::distance(activeTextureUnits.begin(), nexttexunit) + 1; // we don't want to use unit 0 // we don't want to use unit 0
textureunit = std::distance(activeTextureUnits.begin(), nextunit_it) + 1;
} }
textureUnitPool[name] = textureunit; textureUnitPool[name] = textureunit;
+8 -10
View File
@@ -57,8 +57,7 @@ JoystickModule::JoystickModule()
JoystickModule::~JoystickModule() JoystickModule::~JoystickModule()
{ {
// Close any open Joysticks. // Close any open Joysticks.
std::list<joystick::Joystick *>::iterator it; for (auto it = joysticks.begin(); it != joysticks.end(); ++it)
for (it = joysticks.begin(); it != joysticks.end(); ++it)
{ {
(*it)->close(); (*it)->close();
(*it)->release(); (*it)->release();
@@ -117,8 +116,7 @@ love::joystick::Joystick *JoystickModule::addJoystick(int deviceindex)
joystick::Joystick *joystick = 0; joystick::Joystick *joystick = 0;
bool reused = false; bool reused = false;
std::list<joystick::Joystick *>::iterator it; for (auto it = joysticks.begin(); it != joysticks.end(); ++it)
for (it = joysticks.begin(); it != joysticks.end(); ++it)
{ {
// Try to re-use a disconnected Joystick with the same GUID. // Try to re-use a disconnected Joystick with the same GUID.
if (!(*it)->isConnected() && (*it)->getGUID() == guidstr) if (!(*it)->isConnected() && (*it)->getGUID() == guidstr)
@@ -143,19 +141,20 @@ love::joystick::Joystick *JoystickModule::addJoystick(int deviceindex)
// Make sure multiple instances of the same physical joystick aren't added // Make sure multiple instances of the same physical joystick aren't added
// to the active list. // to the active list.
for (size_t i = 0; i < activeSticks.size(); i++) for (auto it = activeSticks.begin(); it != activeSticks.end(); ++it)
{ {
if (joystick->getHandle() == activeSticks[i]->getHandle()) if (joystick->getHandle() == (*it)->getHandle())
{ {
joystick->close(); joystick->close();
// If we just created the stick, remove it since it's a duplicate.
if (!reused) if (!reused)
{ {
joysticks.remove(joystick); joysticks.remove(joystick);
joystick->release(); joystick->release();
} }
return activeSticks[i]; return *it;
} }
} }
@@ -169,7 +168,7 @@ void JoystickModule::removeJoystick(love::joystick::Joystick *joystick)
return; return;
// Close the Joystick and remove it from the active joystick list. // Close the Joystick and remove it from the active joystick list.
std::vector<joystick::Joystick *>::iterator it = std::find(activeSticks.begin(), activeSticks.end(), joystick); auto it = std::find(activeSticks.begin(), activeSticks.end(), joystick);
if (it != activeSticks.end()) if (it != activeSticks.end())
{ {
(*it)->close(); (*it)->close();
@@ -425,8 +424,7 @@ void JoystickModule::checkGamepads(const std::string &guid) const
if (guid.compare(getDeviceGUID(d_index)) != 0) if (guid.compare(getDeviceGUID(d_index)) != 0)
continue; continue;
std::vector<love::joystick::Joystick *>::const_iterator it; for (auto it = activeSticks.begin(); it != activeSticks.end(); ++it)
for (it = activeSticks.begin(); it != activeSticks.end(); ++it)
{ {
if ((*it)->isGamepad() || guid.compare((*it)->getGUID()) != 0) if ((*it)->isGamepad() || guid.compare((*it)->getGUID()) != 0)
continue; continue;
+3 -3
View File
@@ -257,21 +257,21 @@ void World::update(float dt)
world->Step(dt, 8, 6); world->Step(dt, 8, 6);
// Destroy all objects marked during the time step. // Destroy all objects marked during the time step.
for (std::vector<Body *>::iterator i = destructBodies.begin(); i < destructBodies.end(); i++) for (auto i = destructBodies.begin(); i < destructBodies.end(); i++)
{ {
Body *b = *i; Body *b = *i;
if (b->body != 0) b->destroy(); if (b->body != 0) b->destroy();
// Release for reference in vector. // Release for reference in vector.
b->release(); b->release();
} }
for (std::vector<Fixture *>::iterator i = destructFixtures.begin(); i < destructFixtures.end(); i++) for (auto i = destructFixtures.begin(); i < destructFixtures.end(); i++)
{ {
Fixture *f = *i; Fixture *f = *i;
if (f->isValid()) f->destroy(); if (f->isValid()) f->destroy();
// Release for reference in vector. // Release for reference in vector.
f->release(); f->release();
} }
for (std::vector<Joint *>::iterator i = destructJoints.begin(); i < destructJoints.end(); i++) for (auto i = destructJoints.begin(); i < destructJoints.end(); i++)
{ {
Joint *j = *i; Joint *j = *i;
if (j->isValid()) j->destroyJoint(); if (j->isValid()) j->destroyJoint();