Просмотр исходного кода

Merge branch 'master' of https://github.com/samiamwork/Polycode into pullreq_testing

Ivan Safrin 12 лет назад
Родитель
Сommit
91708cc3b0
29 измененных файлов с 150 добавлено и 102 удалено
  1. 6 2
      Core/Contents/Include/PolyGlobals.h
  2. 7 7
      Core/Contents/Include/PolyObject.h
  3. 1 1
      Core/Contents/Include/PolyScene.h
  4. 1 1
      Core/Contents/Include/PolyShader.h
  5. 6 4
      Core/Contents/PolycodeView/Mac OS X/PolycodeView.mm
  6. 65 18
      Core/Contents/Source/PolyCocoaCore.mm
  7. 1 1
      Core/Contents/Source/PolyEntity.cpp
  8. 5 5
      Core/Contents/Source/PolyParticleEmitter.cpp
  9. 0 2
      Core/Contents/Source/PolyPerlin.cpp
  10. 1 1
      Core/Contents/Source/PolyRenderer.cpp
  11. 3 3
      Core/Contents/Source/PolyScreenMesh.cpp
  12. 3 3
      Core/Contents/Source/PolyShader.cpp
  13. 4 1
      Core/Contents/Source/PolySocket.cpp
  14. 4 2
      Core/Contents/Source/PolySound.cpp
  15. 1 1
      Core/Contents/Source/tinyxmlparser.cpp
  16. 1 1
      Modules/Contents/2DPhysics/Source/PolyPhysicsScreenEntity.cpp
  17. 1 1
      Modules/Contents/3DPhysics/Source/PolyCollisionScene.cpp
  18. 2 0
      Modules/Contents/TUIO/Include/TuioObject.h
  19. 0 1
      Modules/Contents/TUIO/Source/TuioClient.cpp
  20. 0 2
      Modules/Contents/UI/Include/PolyUICheckBox.h
  21. 1 5
      Modules/Contents/UI/Include/PolyUIHSlider.h
  22. 0 1
      Modules/Contents/UI/Include/PolyUITree.h
  23. 0 1
      Modules/Contents/UI/Include/PolyUITreeContainer.h
  24. 0 1
      Modules/Contents/UI/Source/PolyUIHSizer.cpp
  25. 1 1
      Modules/Contents/UI/Source/PolyUITextInput.cpp
  26. 0 1
      Modules/Contents/UI/Source/PolyUITreeContainer.cpp
  27. 0 1
      Modules/Contents/UI/Source/PolyUIVSizer.cpp
  28. 33 31
      Player/Contents/Platform/Darwin/MyDocument.h
  29. 3 3
      Tools/Dependencies/unzip11/zip.c

+ 6 - 2
Core/Contents/Include/PolyGlobals.h

@@ -84,8 +84,12 @@ inline Number clampf(Number x, Number a, Number b)
     return x < a ? a : (x > b ? b : x);
 }
 
-#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
-#define MAX(a, b)  (((a) > (b)) ? (a) : (b))
+#ifndef MIN
+	#define MIN(a, b)  (((a) < (b)) ? (a) : (b))
+#endif
+#ifndef MAX
+	#define MAX(a, b)  (((a) > (b)) ? (a) : (b))
+#endif
 
 // Special flag read by create_lua_library parser, suppresses Lua bindings for item.
 #define POLYIGNORE

+ 7 - 7
Core/Contents/Include/PolyObject.h

@@ -177,7 +177,7 @@ namespace Polycode {
 			entry->type = ObjectEntry::CONTAINER_ENTRY;			
 			entry->name = name;
 			children.push_back(entry);
-			length = children.size();
+			length = (int)children.size();
 			return entry;
 		}
 		
@@ -193,7 +193,7 @@ namespace Polycode {
 			entry->NumberVal = val;
 			entry->name = name;
 			children.push_back(entry);
-			length = children.size();			
+			length = (int)children.size();
 			return entry;			
 		}
 
@@ -210,7 +210,7 @@ namespace Polycode {
 			entry->intVal = val;
 			entry->name = name;
 			children.push_back(entry);	
-			length = children.size();			
+			length = (int)children.size();
 			return entry;			
 		}
 		
@@ -226,7 +226,7 @@ namespace Polycode {
 			entry->stringVal = val;
 			entry->name = name;
 			children.push_back(entry);
-			length = children.size();			
+			length = (int)children.size();
 			return entry;			
 		}		
 		
@@ -242,7 +242,7 @@ namespace Polycode {
 			entry->stringVal = val;
 			entry->name = name;
 			children.push_back(entry);
-			length = children.size();			
+			length = (int)children.size();
 			return entry;			
 		}		
 		
@@ -259,13 +259,13 @@ namespace Polycode {
 			entry->boolVal = val;
 			entry->name = name;
 			children.push_back(entry);
-			length = children.size();			
+			length = (int)children.size();
 			return entry;			
 		}
 		
 		ObjectEntry *addChild(ObjectEntry *entry) {
 			children.push_back(entry);
-			length = children.size();			
+			length = (int)children.size();
 			return entry;			
 		}		
 		

+ 1 - 1
Core/Contents/Include/PolyScene.h

@@ -120,7 +120,7 @@ namespace Polycode {
 		bool isEnabled();		
 		void setEnabled(bool enabled);
 		
-		int getNumEntities() { return entities.size(); }
+		int getNumEntities() { return (int)entities.size(); }
 		SceneEntity *getEntity(int index) { return entities[index]; }
 		
 		/**

+ 1 - 1
Core/Contents/Include/PolyShader.h

@@ -142,7 +142,7 @@ namespace Polycode {
 		void setNumber(Number x)   { memcpy(data, &x, sizeof(x)); }
 		void setVector2(Vector2 x) { memcpy(data, &x, sizeof(x)); }
 		void setVector3(Vector3 x) { memcpy(data, &x, sizeof(x)); }
-		void setColor(Color x)     { memcpy(data, &x, sizeof(x)); }
+		void setColor(Color x)     { static_cast<Color*>(data)->setColor(&x); }
 	};	
 	
 	class RenderTargetBinding : public PolyBase {

+ 6 - 4
Core/Contents/PolycodeView/Mac OS X/PolycodeView.mm

@@ -527,7 +527,10 @@
 			} else {
 				newEvent.eventCode = InputEvent::EVENT_KEYUP;			
 			}		
-		break;				
+		break;
+		default:
+			// Don't care otherwise
+			break;
 	}
 	newEvent.unicodeChar = 0;
 	
@@ -549,7 +552,7 @@
 	newEvent.keyCode = keymap[[theEvent keyCode]];	
 	
 	NSString *chars = [theEvent characters];
-	unsigned int numChars = [chars length];
+	NSUInteger numChars = [chars length];
 	
 //	NSLog(@"CHARS: %@", [chars characterAtIndex:0]);
 	if(numChars > 0) {
@@ -569,14 +572,13 @@
 		return;
 	
 	core->lockMutex(core->eventMutex);	
-	NSPoint mouseLoc = [self convertPoint:[theEvent locationInWindow] fromView:self];	
 	CocoaEvent newEvent;
 	newEvent.eventGroup = CocoaEvent::INPUT_EVENT;
 	newEvent.eventCode = InputEvent::EVENT_KEYUP;
 	newEvent.keyCode = keymap[[theEvent keyCode]];
 	
 	NSString *chars = [theEvent characters];
-	unsigned int numChars = [chars length];
+	NSUInteger numChars = [chars length];
 	
 	if(numChars > 0)
 		newEvent.unicodeChar = [chars characterAtIndex:0];

+ 65 - 18
Core/Contents/Source/PolyCocoaCore.mm

@@ -21,6 +21,7 @@
 */
 
 #include "PolyCocoaCore.h"
+#import "PolycodeView.h"
 #include <iostream>
 #include <limits.h>
 
@@ -29,6 +30,44 @@
 
 using namespace Polycode;
 
+static bool DisplayModeIs32Bit(CGDisplayModeRef displayMode)
+{
+	bool is32Bit = false;
+	CFStringRef pixelEncoding = CGDisplayModeCopyPixelEncoding(displayMode);
+    if(CFStringCompare(pixelEncoding, CFSTR(IO32BitDirectPixels), 0) == kCFCompareEqualTo)
+        is32Bit = true;
+    CFRelease(pixelEncoding);
+
+	return is32Bit;
+}
+
+static CGDisplayModeRef GetBestDisplayModeForParameters(size_t bitsPerPixel, size_t xRes, size_t yRes)
+{
+	CGDisplayModeRef bestDisplayMode = CGDisplayCopyDisplayMode(CGMainDisplayID());
+	size_t bestWidth = CGDisplayModeGetWidth(bestDisplayMode);
+	size_t bestHeight = CGDisplayModeGetHeight(bestDisplayMode);
+	NSArray* displayModes = (NSArray*)CGDisplayCopyAllDisplayModes(CGMainDisplayID(), NULL);
+	for(NSUInteger i = 0; i < [displayModes count]; ++i)
+	{
+		CGDisplayModeRef candidate = (CGDisplayModeRef)[displayModes objectAtIndex:i];
+		size_t candidateWidth  = CGDisplayModeGetWidth(candidate);
+		size_t candidateHeight = CGDisplayModeGetHeight(candidate);
+		if(!DisplayModeIs32Bit(candidate))
+			continue;
+		if(candidateWidth >= xRes && candidateWidth < bestWidth
+		   && candidateHeight >= yRes && candidateHeight < bestHeight)
+		{
+			CGDisplayModeRelease(bestDisplayMode);
+			bestDisplayMode = candidate;
+			bestWidth = candidateWidth;
+			bestHeight = candidateHeight;
+			CGDisplayModeRetain(bestDisplayMode);
+		}
+	}
+	[displayModes release];
+	return bestDisplayMode;
+}
+
 long getThreadID() {
 	return (long)pthread_self();
 }
@@ -79,7 +118,7 @@ void CocoaCore::copyStringToClipboard(const String& str) {
     NSArray *types = [NSArray arrayWithObjects:NSStringPboardType, nil];
     [pb declareTypes:types owner:nil];
 	
-	NSString *nsstr = [NSString stringWithCString: str.c_str()];
+	NSString *nsstr = [NSString stringWithCString: str.c_str() encoding:NSUTF8StringEncoding];
 	/*
 	char* data = (char*)str.c_str();
 	unsigned size = str.size() * sizeof(char);
@@ -162,8 +201,18 @@ void CocoaCore::setVideoMode(int xRes, int yRes, bool fullScreen, bool vSync, in
 //	} else {
 //		CGDisplaySwitchToMode (kCGDirectMainDisplay, CGDisplayBestModeForParameters (kCGDirectMainDisplay, 32, xRes, yRes, NULL) );						
 //	}
-	if(fullScreen) {	
-		CGDisplaySwitchToMode (kCGDirectMainDisplay, CGDisplayBestModeForParameters (kCGDirectMainDisplay, 32, xRes, yRes, NULL) );			
+	if(fullScreen) {
+#		if __MAC_OS_X_VERSION_MIN_REQUIRED < 1060
+		{
+			CGDisplaySwitchToMode (kCGDirectMainDisplay, CGDisplayBestModeForParameters (kCGDirectMainDisplay, 32, xRes, yRes, NULL) );
+		}
+#		else
+		{
+			CGDisplayModeRef bestDisplayMode = GetBestDisplayModeForParameters(32, xRes, yRes);
+			CGDisplaySetDisplayMode(CGMainDisplayID(), bestDisplayMode, NULL);
+			CGDisplayModeRelease(bestDisplayMode);
+		}
+#		endif
 		
 		if(monitorIndex > -1) {
 			if(monitorIndex > [[NSScreen screens] count]-1) {
@@ -199,18 +248,18 @@ void CocoaCore::setVideoMode(int xRes, int yRes, bool fullScreen, bool vSync, in
 
 void CocoaCore::openFileWithApplication(String file, String application) {
 	NSWorkspace *workspace = [NSWorkspace sharedWorkspace];
-	NSString *filePath = [NSString stringWithCString:file.c_str()];
-	NSString *appString = [NSString stringWithCString:application.c_str()];
+	NSString *filePath = [NSString stringWithCString:file.c_str() encoding:NSUTF8StringEncoding];
+	NSString *appString = [NSString stringWithCString:application.c_str() encoding:NSUTF8StringEncoding];
 		
 	[workspace openFile: filePath withApplication: appString andDeactivate: YES];
 }
 
 void CocoaCore::launchApplicationWithFile(String application, String file) {
 	NSWorkspace *workspace = [NSWorkspace sharedWorkspace];
-	NSURL *url = [NSURL fileURLWithPath: [NSString stringWithCString:application.c_str()]];
+	NSURL *url = [NSURL fileURLWithPath: [NSString stringWithCString:application.c_str() encoding:NSUTF8StringEncoding]];
 
 	NSError *error = nil;
-	NSArray *arguments = [NSArray arrayWithObjects: [NSString stringWithCString:file.c_str()], nil];
+	NSArray *arguments = [NSArray arrayWithObjects: [NSString stringWithCString:file.c_str() encoding:NSUTF8StringEncoding], nil];
 	[workspace launchApplicationAtURL:url options:0 configuration:[NSDictionary dictionaryWithObject:arguments forKey:NSWorkspaceLaunchConfigurationArguments] error:&error];
 //Handle error
 }
@@ -228,8 +277,6 @@ String CocoaCore::executeExternalCommand(String command,  String args, String in
 		return "Unable to execute command";
 	}	
 	
-	int fd = fileno(fp);
-	
 	char path[1024];
 	String retString;
 	
@@ -485,10 +532,9 @@ String CocoaCore::openFolderPicker() {
 	if ( [attachmentPanel runModal] == NSOKButton )
 	{
 		// files and directories selected.
-		NSArray* files = [attachmentPanel filenames];
-		NSString* fileName = [files objectAtIndex:0];
+		NSURL* url = [attachmentPanel URL];
 		[attachmentPanel release];
-		return [fileName UTF8String];
+		return [[url path] UTF8String];
 	} else {
 		[attachmentPanel release];	
 		return [@"" UTF8String];
@@ -515,13 +561,15 @@ vector<String> CocoaCore::openFilePicker(vector<CoreFileExtension> extensions, b
 		}
 	}
 	
-	if ( [attachmentPanel runModalForDirectory:nil file:nil types:types] == NSOKButton )
+	[attachmentPanel setAllowedFileTypes:types];
+	if ( [attachmentPanel runModal] == NSOKButton )
 	{
-		NSArray* files = [attachmentPanel filenames];
+		NSArray* files = [attachmentPanel URLs];
 	
 		if(files) {
 			for (int i=0; i < [files count]; i++) {		
-				NSString* fileName = [files objectAtIndex:i];
+				NSURL* url = [files objectAtIndex:i];
+				NSString* fileName = [url path];
 				retVector.push_back([fileName UTF8String]);
 			}
 		}
@@ -587,6 +635,8 @@ static void hatValueToXY(CFIndex value, CFIndex range, int * outX, int * outY) {
 }
 
 
+// Marked as unused to avoid a warning, assuming that this is useful for debugging.
+__attribute__((unused))
 static int IOHIDDeviceGetIntProperty(IOHIDDeviceRef deviceRef, CFStringRef key) {
 	CFTypeRef typeRef;
 	int value;
@@ -691,9 +741,7 @@ static void onDeviceMatched(void * context, IOReturn result, void * sender, IOHI
 CFArrayRef elements;
 	CFIndex elementIndex;
 	IOHIDElementRef element;
-	CFStringRef cfProductName;
 	IOHIDElementType type;
-	char * description;
 	
 	GamepadDeviceEntry *entry = new GamepadDeviceEntry();
 	entry->device = device;
@@ -752,7 +800,6 @@ static void onDeviceRemoved(void * context, IOReturn result, void * sender, IOHI
 
 void CocoaCore::shutdownGamepad() {
 	if (hidManager != NULL) {
-		unsigned int deviceIndex;
 		
 		IOHIDManagerRegisterDeviceMatchingCallback(hidManager, NULL, NULL);
 		IOHIDManagerRegisterDeviceRemovalCallback(hidManager, NULL, NULL);		

+ 1 - 1
Core/Contents/Source/PolyEntity.cpp

@@ -100,7 +100,7 @@ void Entity::applyClone(Entity *clone, bool deepClone, bool ignoreEditorOnly) {
 	clone->depthWrite = depthWrite;
 	clone->depthTest = depthTest;
 	clone->blendingMode = blendingMode;
-	clone->colorAffectsChildren;
+	clone->colorAffectsChildren = colorAffectsChildren;
 	clone->visibilityAffectsChildren = visibilityAffectsChildren;
 	clone->depthOnly = depthOnly;
 	clone->setUserData(getUserData());

+ 5 - 5
Core/Contents/Source/PolyParticleEmitter.cpp

@@ -36,8 +36,8 @@
 using namespace Polycode;
 
 SceneParticleEmitter::SceneParticleEmitter(const String& materialName, int particleType, int emitterType, Number lifespan, unsigned int numParticles, Vector3 direction, Vector3 gravity, Vector3 deviation, Vector3 emitterRadius, Mesh *particleMesh, SceneMesh *emitter)
-: ParticleEmitter(materialName, particleMesh, particleType, emitterType, lifespan, numParticles,  direction, gravity, deviation, emitterRadius),
-SceneEntity()
+: SceneEntity(),
+ParticleEmitter(materialName, particleMesh, particleType, emitterType, lifespan, numParticles,  direction, gravity, deviation, emitterRadius)
 {
 	isScreenEmitter = false;
 	emitterMesh = emitter;	
@@ -80,8 +80,8 @@ void SceneParticleEmitter::Update() {
 
 
 ScreenParticleEmitter::ScreenParticleEmitter(const String& imageFile, int particleType, int emitterType, Number lifespan, unsigned int numParticles, Vector3 direction, Vector3 gravity, Vector3 deviation, Vector3 emitterRadius, Mesh *particleMesh, ScreenMesh *emitter)
-		: ParticleEmitter(imageFile, particleMesh, particleType, emitterType, lifespan, numParticles,  direction, gravity, deviation, emitterRadius),
-ScreenEntity()
+		: ScreenEntity(),
+ParticleEmitter(imageFile, particleMesh, particleType, emitterType, lifespan, numParticles,  direction, gravity, deviation, emitterRadius)
 {
 	particleSize = 10.0; 
 	isScreenEmitter = true;
@@ -167,7 +167,7 @@ ParticleEmitter::ParticleEmitter(const String& imageFile, Mesh *particleMesh, in
 	gravVector = gravity;
 	ignoreParentMatrix = false;
 	this->emitterType = emitterType;
-	this->emitSpeed = emitSpeed;
+	// TODO: initialize emitSpeed
 	this->deviation = deviation;
 	pMesh = particleMesh;
 	rotationFollowsPath = false;

+ 0 - 2
Core/Contents/Source/PolyPerlin.cpp

@@ -228,7 +228,6 @@ void Perlin::init(void)
 Number Perlin::perlin_noise_2D(Number vec[2])
 {
   int terms    = mOctaves;
-	Number freq   = mFrequency;
 	Number result = 0.0f;
   Number amp = mAmplitude;
 
@@ -250,7 +249,6 @@ Number Perlin::perlin_noise_2D(Number vec[2])
 Number Perlin::perlin_noise_3D(Number vec[3])
 {
   int terms    = mOctaves;
-	Number freq   = mFrequency;
 	Number result = 0.0f;
   Number amp = mAmplitude;
 

+ 1 - 1
Core/Contents/Source/PolyRenderer.cpp

@@ -25,7 +25,7 @@
 
 using namespace Polycode;
 
-Renderer::Renderer() : currentTexture(NULL), xRes(0), yRes(0), renderMode(0), orthoMode(false), lightingEnabled(false), clearColor(0.2f, 0.2f, 0.2f, 0.0) {
+Renderer::Renderer() : clearColor(0.2f, 0.2f, 0.2f, 0.0), currentTexture(NULL), renderMode(0), lightingEnabled(false), orthoMode(false), xRes(0), yRes(0) {
 	anisotropy = 0;
 	textureFilteringMode = TEX_FILTERING_LINEAR;
 	currentMaterial = NULL;

+ 3 - 3
Core/Contents/Source/PolyScreenMesh.cpp

@@ -29,7 +29,7 @@
 
 using namespace Polycode;
 
-ScreenMesh::ScreenMesh(Mesh *mesh) : ScreenEntity(), texture(NULL), material(NULL) {
+ScreenMesh::ScreenMesh(Mesh *mesh) : ScreenEntity(), material(NULL), texture(NULL) {
 	this->mesh = mesh;
 	lineSmooth = false;
 	lineWidth = 1.0;
@@ -37,14 +37,14 @@ ScreenMesh::ScreenMesh(Mesh *mesh) : ScreenEntity(), texture(NULL), material(NUL
 	updateHitBox();
 }
 
-ScreenMesh::ScreenMesh(const String& fileName) : ScreenEntity(), texture(NULL), material(NULL) {
+ScreenMesh::ScreenMesh(const String& fileName) : ScreenEntity(), material(NULL), texture(NULL) {
 	mesh = new Mesh(fileName);
 	lineSmooth = false;
 	lineWidth = 1.0;
 	
 }
 
-ScreenMesh::ScreenMesh(int meshType) : ScreenEntity(), texture(NULL), material(NULL){
+ScreenMesh::ScreenMesh(int meshType) : ScreenEntity(), material(NULL), texture(NULL) {
 	mesh = new Mesh(meshType);
 	lineSmooth = false;
 	lineWidth = 1.0;

+ 3 - 3
Core/Contents/Source/PolyShader.cpp

@@ -82,7 +82,7 @@ void ProgramParam::createParamData(int *retType, const String& type, const Strin
 			if(values.size() == 2) {
 				val->set(atof(values[0].c_str()), atof(values[1].c_str()));
 			} else {
-				printf("Error: A Vector2 must have 2 values (%d provided)!\n", values.size());
+				printf("Error: A Vector2 must have 2 values (%d provided)!\n", (int)values.size());
 			}
 			return;				
 		} else if(type == "Vector3") {
@@ -93,7 +93,7 @@ void ProgramParam::createParamData(int *retType, const String& type, const Strin
 			if(values.size() == 3) {
 				val->set(atof(values[0].c_str()), atof(values[1].c_str()), atof(values[2].c_str()));
 			} else {
-				printf("Error: A Vector3 must have 3 values (%d provided)!\n", values.size());
+				printf("Error: A Vector3 must have 3 values (%d provided)!\n", (int)values.size());
 			}
 			return;
 		} else if(type == "Color") {
@@ -104,7 +104,7 @@ void ProgramParam::createParamData(int *retType, const String& type, const Strin
 			if(values.size() == 4) {
 				val->setColor(atof(values[0].c_str()), atof(values[1].c_str()), atof(values[2].c_str()), atof(values[3].c_str()));
 			} else {
-				printf("Error: A Color must have 4 values (%d provided)!\n", values.size());
+				printf("Error: A Color must have 4 values (%d provided)!\n", (int)values.size());
 			}
 			return;			
 		} else {

+ 4 - 1
Core/Contents/Source/PolySocket.cpp

@@ -53,7 +53,10 @@ void Address::setAddress(unsigned int ip, unsigned int port) {
 }
 
 void Address::setAddress(String ipAsString, unsigned int port) {
-	unsigned int a,b,c,d;
+	unsigned int a = 127;
+	unsigned int b = 0;
+	unsigned int c = 0;
+	unsigned int d = 1;
 	
 	vector<String> values = ipAsString.split(".");
 	if(values.size() == 4) {

+ 4 - 2
Core/Contents/Source/PolySound.cpp

@@ -21,7 +21,9 @@
 */
 
 #include "PolySound.h"
+#define OV_EXCLUDE_STATIC_CALLBACKS
 #include <vorbis/vorbisfile.h>
+#undef OV_EXCLUDE_STATIC_CALLBACKS
 #include "PolyString.h"
 #include "PolyLogger.h"
 
@@ -55,7 +57,7 @@ long custom_tellfunc(void *datasource) {
 	return OSBasics::tell(file);
 }
 
-Sound::Sound(const String& fileName) : sampleLength(-1), volume(1),pitch(1),referenceDistance(1),maxDistance(MAX_FLOAT) {
+Sound::Sound(const String& fileName) :  referenceDistance(1), maxDistance(MAX_FLOAT), pitch(1), volume(1), sampleLength(-1) {
 	checkALError("Construct: Loose error before construction");
 	soundLoaded = false;	
 
@@ -66,7 +68,7 @@ Sound::Sound(const String& fileName) : sampleLength(-1), volume(1),pitch(1),refe
 	checkALError("Construct from file: Finished");
 }
 
-Sound::Sound(const char *data, int size, int channels, int freq, int bps) : buffer(AL_NONE), soundSource(AL_NONE), sampleLength(-1), volume(1),pitch(1),referenceDistance(1),maxDistance(MAX_FLOAT) {
+Sound::Sound(const char *data, int size, int channels, int freq, int bps) : referenceDistance(1), maxDistance(MAX_FLOAT), pitch(1), volume(1), buffer(AL_NONE), soundSource(AL_NONE), sampleLength(-1) {
 	checkALError("Construct: Loose error before construction");
 	buffer = loadBytes(data, size, freq, channels, bps);
 	

+ 1 - 1
Core/Contents/Source/tinyxmlparser.cpp

@@ -354,7 +354,7 @@ const char* TiXmlBase::SkipWhiteSpace( const char* p, TiXmlEncoding encoding )
 	}
 	else
 	{
-		while ( *p && IsWhiteSpace( *p ) || *p == '\n' || *p =='\r' )
+		while ( *p && (IsWhiteSpace( *p ) || *p == '\n' || *p =='\r') )
 			++p;
 	}
 

+ 1 - 1
Modules/Contents/2DPhysics/Source/PolyPhysicsScreenEntity.cpp

@@ -297,7 +297,7 @@ b2Fixture* PhysicsScreenEntity::getFixture(unsigned short index) {
 	if(fixture)	{
 		short i = 0;
 		for (b2Fixture* f = body->GetFixtureList(); f; f = f->GetNext()) {
-			if (i = index) {
+			if (i == index) {
 				fixture = f;
 				return fixture;
 			}

+ 1 - 1
Modules/Contents/3DPhysics/Source/PolyCollisionScene.cpp

@@ -26,7 +26,7 @@ THE SOFTWARE.
 
 using namespace Polycode;
 
-CollisionScene::CollisionScene(Vector3 size, bool virtualScene, bool deferInitCollision) : Scene(virtualScene), world(NULL), axisSweep(NULL), dispatcher(NULL), collisionConfiguration(NULL){ 
+CollisionScene::CollisionScene(Vector3 size, bool virtualScene, bool deferInitCollision) : Scene(virtualScene), world(NULL), collisionConfiguration(NULL), dispatcher(NULL), axisSweep(NULL) {
 	if(!deferInitCollision) {
 		initCollisionScene(size);
 	}

+ 2 - 0
Modules/Contents/TUIO/Include/TuioObject.h

@@ -109,6 +109,8 @@ namespace TUIO {
 		 */
 		~TuioObject() {};
 		
+		using TuioContainer::update;
+
 		/**
 		 * Takes a TuioTime argument and assigns it along with the provided 
 		 * X and Y coordinate, angle, X and Y velocity, motion acceleration,

+ 0 - 1
Modules/Contents/TUIO/Source/TuioClient.cpp

@@ -115,7 +115,6 @@ void TuioClient::ProcessBundle( const ReceivedBundle& b, const IpEndpointName& r
 void TuioClient::ProcessMessage( const ReceivedMessage& msg, const IpEndpointName& remoteEndpoint) {
 	try {
 		ReceivedMessageArgumentStream args = msg.ArgumentStream();
-		ReceivedMessage::const_iterator arg = msg.ArgumentsBegin();
 		
 		if( strcmp( msg.AddressPattern(), "/tuio/2Dobj" ) == 0 ){
 			

+ 0 - 2
Modules/Contents/UI/Include/PolyUICheckBox.h

@@ -46,9 +46,7 @@ namespace Polycode {
 		private:
 			bool checked;
 			ScreenLabel *captionLabel;
-			ScreenShape *shadowRect;
 			ScreenImage *buttonImageChecked;
 			ScreenImage *buttonImageUnchecked;			
-			bool pressedDown;
 	};
 }

+ 1 - 5
Modules/Contents/UI/Include/PolyUIHSlider.h

@@ -53,8 +53,6 @@ namespace Polycode {
 			
 			Number bgHeight;
 			
-			Number labelXPos;
-			Number labelYPos;
 			UIBox *bgRect;
 			ScreenImage *gripRect;
 			
@@ -64,7 +62,5 @@ namespace Polycode {
 			Number sliderWidth;
 			
 			ScreenShape *bgHitBox;
-			ScreenLabel *buttonLabel;
-			bool pressedDown;
 	};
-}
+}

+ 0 - 1
Modules/Contents/UI/Include/PolyUITree.h

@@ -98,7 +98,6 @@ namespace Polycode {
 			Number treeHeight;
 			vector<UITree*> treeChildren;
 			bool collapsed;
-			bool collapsing;
 			ScreenImage *arrowIconImage;
 			String arrowIcon;
 			Vector2 mouseDownPosition;

+ 0 - 1
Modules/Contents/UI/Include/PolyUITreeContainer.h

@@ -59,7 +59,6 @@ namespace Polycode {
 	private:
 		
 		UIScrollContainer *mainContainer;
-		ScreenShape *maskShape;
 		
 		UITree *rootNode;
 		UIBox *bgBox;

+ 0 - 1
Modules/Contents/UI/Source/PolyUIHSizer.cpp

@@ -86,7 +86,6 @@ UIHSizer::~UIHSizer() {
 
 void UIHSizer::handleEvent(Event *event) {
 	if(event->getDispatcher() == separatorHitShape) {
-		InputEvent *inputEvent = (InputEvent*)event;
 		switch (event->getEventCode()) {
 			case InputEvent::EVENT_MOUSEDOWN:
 				resizing = true;

+ 1 - 1
Modules/Contents/UI/Source/PolyUITextInput.cpp

@@ -705,7 +705,7 @@ void UITextInput::updateCaretPosition() {
 }
 
 void UITextInput::selectLineFromOffset() {
-	lineOffset = lineOffset;
+	// TODO: remove or fill out body
 }
 
 void UITextInput::dragSelectionTo(Number x, Number y) {

+ 0 - 1
Modules/Contents/UI/Source/PolyUITreeContainer.cpp

@@ -37,7 +37,6 @@ UITreeContainer::UITreeContainer(String icon, String text, Number treeWidth, Num
 	Number sr = conf->getNumericValue("Polycode", "uiTreeContainerSkinR");
 	Number sb = conf->getNumericValue("Polycode", "uiTreeContainerSkinB");
 	Number sl = conf->getNumericValue("Polycode", "uiTreeContainerSkinL");	
-	Number padding = conf->getNumericValue("Polycode", "uiTreeContainerSkinPadding");	
 	
 //	Number scrollBarOffset = conf->getNumericValue("Polycode", "uiTreeContainerScrollBarOffset");	
 	

+ 0 - 1
Modules/Contents/UI/Source/PolyUIVSizer.cpp

@@ -88,7 +88,6 @@ UIVSizer::~UIVSizer() {
 
 void UIVSizer::handleEvent(Event *event) {
 	if(event->getDispatcher() == separatorHitShape) {
-		InputEvent *inputEvent = (InputEvent*)event;
 		switch (event->getEventCode()) {
 			case InputEvent::EVENT_MOUSEDOWN:
 				resizing = true;

+ 33 - 31
Player/Contents/Platform/Darwin/MyDocument.h

@@ -24,6 +24,36 @@ THE SOFTWARE.
 #import "PolycodeView.h"
 #include "PolycodeCocoaPlayer.h"
 
+class PolycodeProxy;
+
+@interface MyDocument : NSDocument
+{
+	PolycodeView *mainView;
+	NSString *docFileName;
+	NSTimer* timer;
+	CocoaPolycodePlayer *player;
+	PolycodeProxy *playerProxy;
+	NSWindow *consoleWindow;
+	NSTextView *consoleTextView;
+	bool showingConsole;
+	bool playerRunning;
+	bool needsToClose;
+
+}
+
+- (void) printToConsole: (NSString*) message;
+- (void) handleDebugError: (NSString*) error onLine:(int) lineNumber;
+- (IBAction) showConsoleWindow: (id) sender;
+
+- (void) destroyPlayer;
+- (void) needToClosePlayer;
+
+@property (assign) IBOutlet PolycodeView *mainView;
+@property (assign) IBOutlet NSWindow *consoleWindow;
+@property (assign) IBOutlet NSTextView *consoleTextView;
+
+@end
+
 class PolycodeProxy : public EventHandler {
 public:
 	PolycodeProxy(){ playerDocument = nil; }
@@ -43,11 +73,11 @@ public:
 					fullError += "In file "+debugEvent->backTrace[i].fileName + " on line " + String::IntToString(debugEvent->backTrace[i].lineNumber)+"\n";
 				}
 			
-				[playerDocument handleDebugError: [NSString stringWithCString:fullError.c_str()] onLine: debugEvent->lineNumber];
+				[playerDocument handleDebugError: [NSString stringWithCString:fullError.c_str() encoding:NSUTF8StringEncoding] onLine: debugEvent->lineNumber];
 			}
 				break;
 			case PolycodeDebugEvent::EVENT_PRINT:
-				[playerDocument printToConsole: [NSString stringWithCString:debugEvent->errorString.c_str()]];				
+				[playerDocument printToConsole: [NSString stringWithCString:debugEvent->errorString.c_str() encoding:NSUTF8StringEncoding]];
 				break;
 			case PolycodeDebugEvent::EVENT_CLOSE:
 				[playerDocument needToClosePlayer];
@@ -59,33 +89,5 @@ public:
 		}
 	}
 	
-	id playerDocument;	
+	MyDocument* playerDocument;
 };
-
-@interface MyDocument : NSDocument
-{
-	PolycodeView *mainView;
-	NSString *docFileName;	
-	NSTimer* timer;
-	CocoaPolycodePlayer *player;
-	PolycodeProxy *playerProxy;
-	NSWindow *consoleWindow;
-	NSTextView *consoleTextView;
-	bool showingConsole;
-	bool playerRunning;
-	bool needsToClose;
-	
-}
-
-- (void) printToConsole: (NSString*) message;
-- (void) handleDebugError: (NSString*) error onLine:(int) lineNumber;
-- (IBAction) showConsoleWindow: (id) sender;
-
-- (void) destroyPlayer;
-- (void) needToClosePlayer;
-
-@property (assign) IBOutlet PolycodeView *mainView;
-@property (assign) IBOutlet NSWindow *consoleWindow;
-@property (assign) IBOutlet NSTextView *consoleTextView;
-
-@end

+ 3 - 3
Tools/Dependencies/unzip11/zip.c

@@ -1114,9 +1114,9 @@ extern int ZEXPORT zipOpenNewFileInZip4_64 (zipFile file, const char* filename,
     zi->ci.flag = flagBase;
     if ((level==8) || (level==9))
       zi->ci.flag |= 2;
-    if ((level==2))
+    if (level==2)
       zi->ci.flag |= 4;
-    if ((level==1))
+    if (level==1)
       zi->ci.flag |= 6;
     if (password != NULL)
       zi->ci.flag |= 1;
@@ -1245,7 +1245,7 @@ extern int ZEXPORT zipOpenNewFileInZip4_64 (zipFile file, const char* filename,
         unsigned char bufHead[RAND_HEAD_LEN];
         unsigned int sizeHead;
         zi->ci.encrypt = 1;
-        zi->ci.pcrc_32_tab = get_crc_table();
+        zi->ci.pcrc_32_tab = (const unsigned long*)get_crc_table();
         /*init_keys(password,zi->ci.keys,zi->ci.pcrc_32_tab);*/
 
         sizeHead=crypthead(password,bufHead,RAND_HEAD_LEN,zi->ci.keys,zi->ci.pcrc_32_tab,crcForCrypting);