From 4511d71e1d7efd54c56be826bd057b3160941d4b Mon Sep 17 00:00:00 2001 From: kearwood Date: Thu, 15 Mar 2012 20:09:01 +0000 Subject: [PATCH] Optimized to reduce redundant GL state changes Updated header copyright dates Further refactoring to prepare for FBX file compatibility --HG-- extra : convert_revision : svn%3A7752d6cf-9f14-4ad2-affc-04f1e67b81a5/trunk%4010 --- KREngine/KREngine.xcodeproj/project.pbxproj | 56 +++---- .../KREngine/Classes/KRBoundingVolume.cpp | 2 +- KREngine/KREngine/Classes/KRBoundingVolume.h | 2 +- KREngine/KREngine/Classes/KRCamera.cpp | 2 +- KREngine/KREngine/Classes/KRCamera.h | 2 +- KREngine/KREngine/Classes/KREngine.h | 4 +- KREngine/KREngine/Classes/KREngine.mm | 4 +- KREngine/KREngine/Classes/KRInstance.cpp | 2 +- KREngine/KREngine/Classes/KRInstance.h | 2 +- KREngine/KREngine/Classes/KRMat4.cpp | 4 +- KREngine/KREngine/Classes/KRMat4.h | 4 +- KREngine/KREngine/Classes/KRMaterial.cpp | 137 ++++++++++-------- KREngine/KREngine/Classes/KRMaterial.h | 6 +- .../KREngine/Classes/KRMaterialManager.cpp | 4 +- KREngine/KREngine/Classes/KRMaterialManager.h | 4 +- KREngine/KREngine/Classes/KRMesh.cpp | 28 +++- KREngine/KREngine/Classes/KRMesh.h | 27 +++- KREngine/KREngine/Classes/KRModel.cpp | 44 ++++-- KREngine/KREngine/Classes/KRModel.h | 7 +- KREngine/KREngine/Classes/KRModelManager.cpp | 4 +- KREngine/KREngine/Classes/KRModelManager.h | 4 +- KREngine/KREngine/Classes/KRScene.cpp | 2 +- KREngine/KREngine/Classes/KRScene.h | 2 +- KREngine/KREngine/Classes/KRShader.cpp | 9 +- KREngine/KREngine/Classes/KRShader.h | 6 +- KREngine/KREngine/Classes/KRShaderManager.cpp | 4 +- KREngine/KREngine/Classes/KRShaderManager.h | 2 +- KREngine/KREngine/Classes/KRTexture.cpp | 4 +- KREngine/KREngine/Classes/KRTexture.h | 4 +- .../KREngine/Classes/KRTextureManager.cpp | 4 +- KREngine/KREngine/Classes/KRTextureManager.h | 4 +- KREngine/KREngine/Classes/KRVector3.cpp | 4 +- KREngine/KREngine/Classes/KRVector3.h | 4 +- KREngine/KREngine/Shaders/ObjectShader.fsh | 2 +- KREngine/KREngine/Shaders/ObjectShader.vsh | 4 +- KREngine/KREngine/Shaders/PostShader.fsh | 2 +- KREngine/KREngine/Shaders/PostShader.vsh | 2 +- KREngine/KREngine/Shaders/ShadowShader.fsh | 2 +- KREngine/KREngine/Shaders/ShadowShader.vsh | 2 +- objpack/objpack.xcodeproj/project.pbxproj | 10 +- objpack/objpack/KROBJPacker.cpp | 2 +- objpack/objpack/KROBJPacker.h | 2 +- objpack/objpack/KRVector3.cpp | 4 +- objpack/objpack/KRVector3.h | 4 +- objpack/objpack/main.cpp | 2 +- objview/Classes/KRObjViewAppDelegate.h | 2 +- objview/Classes/KRObjViewAppDelegate.mm | 2 +- objview/Classes/KRObjViewGLView.h | 2 +- objview/Classes/KRObjViewGLView.mm | 2 +- objview/Classes/KRObjViewViewController.h | 2 +- objview/Classes/KRObjViewViewController.mm | 2 +- objview/KRObjView.xcodeproj/project.pbxproj | 20 +-- objview/main.m | 2 +- 53 files changed, 282 insertions(+), 188 deletions(-) diff --git a/KREngine/KREngine.xcodeproj/project.pbxproj b/KREngine/KREngine.xcodeproj/project.pbxproj index 722c258..53a6ffa 100644 --- a/KREngine/KREngine.xcodeproj/project.pbxproj +++ b/KREngine/KREngine.xcodeproj/project.pbxproj @@ -55,48 +55,48 @@ /* End PBXBuildRule section */ /* Begin PBXFileReference section */ - E414BAE11435557300A668C4 /* KRInstance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KRInstance.h; path = Classes/KRInstance.h; sourceTree = ""; }; - E414BAE41435558800A668C4 /* KRInstance.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = KRInstance.cpp; path = Classes/KRInstance.cpp; sourceTree = ""; }; + E414BAE11435557300A668C4 /* KRInstance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; name = KRInstance.h; path = Classes/KRInstance.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + E414BAE41435558800A668C4 /* KRInstance.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; name = KRInstance.cpp; path = Classes/KRInstance.cpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; E414BAE6143557D200A668C4 /* KRScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KRScene.h; path = Classes/KRScene.h; sourceTree = ""; }; E414BAE81435585A00A668C4 /* KRScene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = KRScene.cpp; path = Classes/KRScene.cpp; sourceTree = ""; }; - E414BAEA14355E5500A668C4 /* KRBoundingVolume.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KRBoundingVolume.h; path = Classes/KRBoundingVolume.h; sourceTree = ""; }; - E414BAEC14355EFF00A668C4 /* KRBoundingVolume.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = KRBoundingVolume.cpp; path = Classes/KRBoundingVolume.cpp; sourceTree = ""; }; - E45772F113C9A13C0037BEEA /* ShadowShader.vsh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; name = ShadowShader.vsh; path = Shaders/ShadowShader.vsh; sourceTree = ""; }; + E414BAEA14355E5500A668C4 /* KRBoundingVolume.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; name = KRBoundingVolume.h; path = Classes/KRBoundingVolume.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + E414BAEC14355EFF00A668C4 /* KRBoundingVolume.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; name = KRBoundingVolume.cpp; path = Classes/KRBoundingVolume.cpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; + E45772F113C9A13C0037BEEA /* ShadowShader.vsh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; lineEnding = 0; name = ShadowShader.vsh; path = Shaders/ShadowShader.vsh; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.glsl; }; E45772F213C9A13C0037BEEA /* ShadowShader.fsh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; name = ShadowShader.fsh; path = Shaders/ShadowShader.fsh; sourceTree = ""; }; E45772F313C9A13C0037BEEA /* PostShader.fsh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; name = PostShader.fsh; path = Shaders/PostShader.fsh; sourceTree = ""; }; E45772F413C9A13C0037BEEA /* ObjectShader.fsh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; name = ObjectShader.fsh; path = Shaders/ObjectShader.fsh; sourceTree = ""; }; - E45772F513C9A13C0037BEEA /* ObjectShader.vsh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; name = ObjectShader.vsh; path = Shaders/ObjectShader.vsh; sourceTree = ""; }; + E45772F513C9A13C0037BEEA /* ObjectShader.vsh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; lineEnding = 0; name = ObjectShader.vsh; path = Shaders/ObjectShader.vsh; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.glsl; }; E45772F613C9A13C0037BEEA /* PostShader.vsh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; name = PostShader.vsh; path = Shaders/PostShader.vsh; sourceTree = ""; }; E47C25A113F4F65A00FF4370 /* KRShaderManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KRShaderManager.h; path = Classes/KRShaderManager.h; sourceTree = ""; }; E47C25A413F4F66F00FF4370 /* KRShader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KRShader.h; path = Classes/KRShader.h; sourceTree = ""; }; E47C25A613F4F6AB00FF4370 /* KRShaderManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = KRShaderManager.cpp; path = Classes/KRShaderManager.cpp; sourceTree = ""; }; E47C25A813F4F6DD00FF4370 /* KRShader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = KRShader.cpp; path = Classes/KRShader.cpp; sourceTree = ""; }; - E48B3CBC14393DF5000C50E2 /* KRCamera.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KRCamera.h; path = Classes/KRCamera.h; sourceTree = ""; }; - E48B3CBF14393E2F000C50E2 /* KRCamera.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = KRCamera.cpp; path = Classes/KRCamera.cpp; sourceTree = ""; }; + E48B3CBC14393DF5000C50E2 /* KRCamera.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; name = KRCamera.h; path = Classes/KRCamera.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + E48B3CBF14393E2F000C50E2 /* KRCamera.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; name = KRCamera.cpp; path = Classes/KRCamera.cpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; E491016113C99B9E0098455B /* libKREngine.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libKREngine.a; sourceTree = BUILT_PRODUCTS_DIR; }; E491016413C99B9E0098455B /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; E491016813C99B9E0098455B /* KREngine-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "KREngine-Prefix.pch"; sourceTree = ""; }; - E491016F13C99BDC0098455B /* KREngine.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = KREngine.mm; path = Classes/KREngine.mm; sourceTree = ""; }; - E491017213C99BDC0098455B /* KREngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KREngine.h; path = Classes/KREngine.h; sourceTree = ""; }; - E491017613C99BDC0098455B /* KRMat4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KRMat4.h; path = Classes/KRMat4.h; sourceTree = ""; }; - E491017713C99BDC0098455B /* KRMat4.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = KRMat4.cpp; path = Classes/KRMat4.cpp; sourceTree = ""; }; - E491017913C99BDC0098455B /* KRModel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = KRModel.cpp; path = Classes/KRModel.cpp; sourceTree = ""; }; - E491017A13C99BDC0098455B /* KRModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KRModel.h; path = Classes/KRModel.h; sourceTree = ""; }; - E491017B13C99BDC0098455B /* KRMaterialManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = KRMaterialManager.cpp; path = Classes/KRMaterialManager.cpp; sourceTree = ""; }; - E491017C13C99BDC0098455B /* KRMaterial.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = KRMaterial.cpp; path = Classes/KRMaterial.cpp; sourceTree = ""; }; - E491017D13C99BDC0098455B /* KRMaterial.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KRMaterial.h; path = Classes/KRMaterial.h; sourceTree = ""; }; - E491017E13C99BDC0098455B /* KRVector3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KRVector3.h; path = Classes/KRVector3.h; sourceTree = ""; }; - E491017F13C99BDC0098455B /* KRVector3.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = KRVector3.cpp; path = Classes/KRVector3.cpp; sourceTree = ""; }; - E491018013C99BDC0098455B /* KRTextureManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = KRTextureManager.cpp; path = Classes/KRTextureManager.cpp; sourceTree = ""; }; - E491018113C99BDC0098455B /* KRTexture.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = KRTexture.cpp; path = Classes/KRTexture.cpp; sourceTree = ""; }; - E491018213C99BDC0098455B /* KRModelManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = KRModelManager.cpp; path = Classes/KRModelManager.cpp; sourceTree = ""; }; - E491018313C99BDC0098455B /* KRModelManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KRModelManager.h; path = Classes/KRModelManager.h; sourceTree = ""; }; - E491018413C99BDC0098455B /* KRMaterialManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KRMaterialManager.h; path = Classes/KRMaterialManager.h; sourceTree = ""; }; - E491018513C99BDC0098455B /* KRTextureManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KRTextureManager.h; path = Classes/KRTextureManager.h; sourceTree = ""; }; - E491018613C99BDC0098455B /* KRTexture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KRTexture.h; path = Classes/KRTexture.h; sourceTree = ""; }; + E491016F13C99BDC0098455B /* KREngine.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; name = KREngine.mm; path = Classes/KREngine.mm; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + E491017213C99BDC0098455B /* KREngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; name = KREngine.h; path = Classes/KREngine.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + E491017613C99BDC0098455B /* KRMat4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; name = KRMat4.h; path = Classes/KRMat4.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + E491017713C99BDC0098455B /* KRMat4.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; name = KRMat4.cpp; path = Classes/KRMat4.cpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; + E491017913C99BDC0098455B /* KRModel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; name = KRModel.cpp; path = Classes/KRModel.cpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; + E491017A13C99BDC0098455B /* KRModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; name = KRModel.h; path = Classes/KRModel.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + E491017B13C99BDC0098455B /* KRMaterialManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; name = KRMaterialManager.cpp; path = Classes/KRMaterialManager.cpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; + E491017C13C99BDC0098455B /* KRMaterial.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; name = KRMaterial.cpp; path = Classes/KRMaterial.cpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; + E491017D13C99BDC0098455B /* KRMaterial.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; name = KRMaterial.h; path = Classes/KRMaterial.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + E491017E13C99BDC0098455B /* KRVector3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; name = KRVector3.h; path = Classes/KRVector3.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + E491017F13C99BDC0098455B /* KRVector3.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; name = KRVector3.cpp; path = Classes/KRVector3.cpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; + E491018013C99BDC0098455B /* KRTextureManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; name = KRTextureManager.cpp; path = Classes/KRTextureManager.cpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; + E491018113C99BDC0098455B /* KRTexture.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; name = KRTexture.cpp; path = Classes/KRTexture.cpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; + E491018213C99BDC0098455B /* KRModelManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; name = KRModelManager.cpp; path = Classes/KRModelManager.cpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; + E491018313C99BDC0098455B /* KRModelManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; name = KRModelManager.h; path = Classes/KRModelManager.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + E491018413C99BDC0098455B /* KRMaterialManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; name = KRMaterialManager.h; path = Classes/KRMaterialManager.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + E491018513C99BDC0098455B /* KRTextureManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; name = KRTextureManager.h; path = Classes/KRTextureManager.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + E491018613C99BDC0098455B /* KRTexture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; name = KRTexture.h; path = Classes/KRTexture.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; E491019F13C99BF50098455B /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; - E49E79FC15126146009CF99C /* KRMesh.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = KRMesh.h; path = Classes/KRMesh.h; sourceTree = ""; }; - E49E79FE1512615F009CF99C /* KRMesh.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = KRMesh.cpp; path = Classes/KRMesh.cpp; sourceTree = ""; }; + E49E79FC15126146009CF99C /* KRMesh.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; name = KRMesh.h; path = Classes/KRMesh.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + E49E79FE1512615F009CF99C /* KRMesh.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; name = KRMesh.cpp; path = Classes/KRMesh.cpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ diff --git a/KREngine/KREngine/Classes/KRBoundingVolume.cpp b/KREngine/KREngine/Classes/KRBoundingVolume.cpp index a5d4026..edd9362 100644 --- a/KREngine/KREngine/Classes/KRBoundingVolume.cpp +++ b/KREngine/KREngine/Classes/KRBoundingVolume.cpp @@ -2,7 +2,7 @@ // KRBoundingVolume.cpp // KREngine // -// Copyright 2011 Kearwood Gilbert. All rights reserved. +// Copyright 2012 Kearwood Gilbert. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: diff --git a/KREngine/KREngine/Classes/KRBoundingVolume.h b/KREngine/KREngine/Classes/KRBoundingVolume.h index 8516768..99240d2 100644 --- a/KREngine/KREngine/Classes/KRBoundingVolume.h +++ b/KREngine/KREngine/Classes/KRBoundingVolume.h @@ -2,7 +2,7 @@ // KRBoundingVolume.h // KREngine // -// Copyright 2011 Kearwood Gilbert. All rights reserved. +// Copyright 2012 Kearwood Gilbert. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: diff --git a/KREngine/KREngine/Classes/KRCamera.cpp b/KREngine/KREngine/Classes/KRCamera.cpp index 5b71a89..b707814 100644 --- a/KREngine/KREngine/Classes/KRCamera.cpp +++ b/KREngine/KREngine/Classes/KRCamera.cpp @@ -2,7 +2,7 @@ // KRSettings.cpp // KREngine // -// Copyright 2011 Kearwood Gilbert. All rights reserved. +// Copyright 2012 Kearwood Gilbert. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: diff --git a/KREngine/KREngine/Classes/KRCamera.h b/KREngine/KREngine/Classes/KRCamera.h index 12094af..4ab7674 100644 --- a/KREngine/KREngine/Classes/KRCamera.h +++ b/KREngine/KREngine/Classes/KRCamera.h @@ -2,7 +2,7 @@ // KRSettings.h // KREngine // -// Copyright 2011 Kearwood Gilbert. All rights reserved. +// Copyright 2012 Kearwood Gilbert. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: diff --git a/KREngine/KREngine/Classes/KREngine.h b/KREngine/KREngine/Classes/KREngine.h index 0524684..1876adb 100644 --- a/KREngine/KREngine/Classes/KREngine.h +++ b/KREngine/KREngine/Classes/KREngine.h @@ -1,8 +1,8 @@ // // KREngine.h -// gldemo +// KREngine // -// Copyright 2011 Kearwood Gilbert. All rights reserved. +// Copyright 2012 Kearwood Gilbert. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: diff --git a/KREngine/KREngine/Classes/KREngine.mm b/KREngine/KREngine/Classes/KREngine.mm index c21c754..9ae4d73 100644 --- a/KREngine/KREngine/Classes/KREngine.mm +++ b/KREngine/KREngine/Classes/KREngine.mm @@ -1,8 +1,8 @@ // // KREngine.mm -// gldemo +// KREngine // -// Copyright 2011 Kearwood Gilbert. All rights reserved. +// Copyright 2012 Kearwood Gilbert. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: diff --git a/KREngine/KREngine/Classes/KRInstance.cpp b/KREngine/KREngine/Classes/KRInstance.cpp index e313910..e1a6295 100644 --- a/KREngine/KREngine/Classes/KRInstance.cpp +++ b/KREngine/KREngine/Classes/KRInstance.cpp @@ -2,7 +2,7 @@ // KRInstance.cpp // KREngine // -// Copyright 2011 Kearwood Gilbert. All rights reserved. +// Copyright 2012 Kearwood Gilbert. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: diff --git a/KREngine/KREngine/Classes/KRInstance.h b/KREngine/KREngine/Classes/KRInstance.h index c0dcc9f..171f9fc 100644 --- a/KREngine/KREngine/Classes/KRInstance.h +++ b/KREngine/KREngine/Classes/KRInstance.h @@ -2,7 +2,7 @@ // KRInstance.h // KREngine // -// Copyright 2011 Kearwood Gilbert. All rights reserved. +// Copyright 2012 Kearwood Gilbert. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: diff --git a/KREngine/KREngine/Classes/KRMat4.cpp b/KREngine/KREngine/Classes/KRMat4.cpp index ed77db7..54de49f 100644 --- a/KREngine/KREngine/Classes/KRMat4.cpp +++ b/KREngine/KREngine/Classes/KRMat4.cpp @@ -1,8 +1,8 @@ // // KRMat4.cpp -// gldemo +// KREngine // -// Copyright 2011 Kearwood Gilbert. All rights reserved. +// Copyright 2012 Kearwood Gilbert. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: diff --git a/KREngine/KREngine/Classes/KRMat4.h b/KREngine/KREngine/Classes/KRMat4.h index 4c9b2fb..d28c2ef 100644 --- a/KREngine/KREngine/Classes/KRMat4.h +++ b/KREngine/KREngine/Classes/KRMat4.h @@ -1,8 +1,8 @@ // // KRMat4.h -// gldemo +// KREngine // -// Copyright 2011 Kearwood Gilbert. All rights reserved. +// Copyright 2012 Kearwood Gilbert. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: diff --git a/KREngine/KREngine/Classes/KRMaterial.cpp b/KREngine/KREngine/Classes/KRMaterial.cpp index d54b359..6184b52 100644 --- a/KREngine/KREngine/Classes/KRMaterial.cpp +++ b/KREngine/KREngine/Classes/KRMaterial.cpp @@ -1,8 +1,8 @@ // // KRMaterial.cpp -// gldemo +// KREngine // -// Copyright 2011 Kearwood Gilbert. All rights reserved. +// Copyright 2012 Kearwood Gilbert. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: @@ -102,69 +102,90 @@ bool KRMaterial::isTransparent() { return m_tr != 0.0; } -void KRMaterial::bind(KRCamera *pCamera, KRMat4 &mvpMatrix, Vector3 &cameraPosition, Vector3 &lightDirection, KRMat4 *pShadowMatrices, GLuint *shadowDepthTextures, int cShadowBuffers) { +void KRMaterial::bind(KRMaterial **prevBoundMaterial, char *szPrevShaderKey, KRCamera *pCamera, KRMat4 &mvpMatrix, Vector3 &cameraPosition, Vector3 &lightDirection, KRMat4 *pShadowMatrices, GLuint *shadowDepthTextures, int cShadowBuffers) { + bool bSameMaterial = *prevBoundMaterial == this; bool bDiffuseMap = m_pDiffuseMap != NULL && pCamera->bEnableDiffuseMap; bool bNormalMap = m_pNormalMap != NULL && pCamera->bEnableNormalMap; bool bSpecMap = m_pSpecularMap != NULL && pCamera->bEnableSpecMap; - KRShader *pShader = m_pShaderManager->getShader(pCamera, bDiffuseMap, bNormalMap, bSpecMap, cShadowBuffers); - pShader->bind(pCamera, mvpMatrix, cameraPosition, lightDirection, pShadowMatrices, shadowDepthTextures, cShadowBuffers); - - glUniform3f( - pShader->m_uniforms[KRShader::KRENGINE_UNIFORM_MATERIAL_AMBIENT], - m_ka_r + pCamera->dAmbientR, - m_ka_g + pCamera->dAmbientG, - m_ka_b + pCamera->dAmbientB - ); - - glUniform3f( - pShader->m_uniforms[KRShader::KRENGINE_UNIFORM_MATERIAL_DIFFUSE], - m_kd_r * pCamera->dSunR, - m_kd_g * pCamera->dSunG, - m_kd_b * pCamera->dSunB - ); - - glUniform3f( - pShader->m_uniforms[KRShader::KRENGINE_UNIFORM_MATERIAL_SPECULAR], - m_ks_r * pCamera->dSunR, - m_ks_g * pCamera->dSunG, - m_ks_b * pCamera->dSunB - ); - - glUniform1f(pShader->m_uniforms[KRShader::KRENGINE_UNIFORM_MATERIAL_ALPHA], 1.0f - m_tr); - glUniform1f(pShader->m_uniforms[KRShader::KRENGINE_UNIFORM_MATERIAL_SHININESS], pCamera->bDebugSuperShiny ? 20.0 : m_ns); + if(!bSameMaterial) { + KRShader *pShader = m_pShaderManager->getShader(pCamera, bDiffuseMap, bNormalMap, bSpecMap, cShadowBuffers); - int iTextureName = 0; - if(bDiffuseMap) { - iTextureName = m_pDiffuseMap->getName(); - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, iTextureName); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.0f); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); - } - - iTextureName = 0; - if(bSpecMap) { - iTextureName = m_pSpecularMap->getName(); - glActiveTexture(GL_TEXTURE1); - glBindTexture(GL_TEXTURE_2D, iTextureName); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.0f); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); - } + bool bSameShader = strcmp(pShader->getKey(), szPrevShaderKey) == 0; + if(!bSameShader) { + pShader->bind(pCamera, mvpMatrix, cameraPosition, lightDirection, pShadowMatrices, shadowDepthTextures, cShadowBuffers); + glUniform1f(pShader->m_uniforms[KRShader::KRENGINE_UNIFORM_MATERIAL_SHININESS], pCamera->bDebugSuperShiny ? 20.0 : m_ns); + strcpy(szPrevShaderKey, pShader->getKey()); + } + + glUniform3f( + pShader->m_uniforms[KRShader::KRENGINE_UNIFORM_MATERIAL_AMBIENT], + m_ka_r + pCamera->dAmbientR, + m_ka_g + pCamera->dAmbientG, + m_ka_b + pCamera->dAmbientB + ); + + glUniform3f( + pShader->m_uniforms[KRShader::KRENGINE_UNIFORM_MATERIAL_DIFFUSE], + m_kd_r * pCamera->dSunR, + m_kd_g * pCamera->dSunG, + m_kd_b * pCamera->dSunB + ); + + glUniform3f( + pShader->m_uniforms[KRShader::KRENGINE_UNIFORM_MATERIAL_SPECULAR], + m_ks_r * pCamera->dSunR, + m_ks_g * pCamera->dSunG, + m_ks_b * pCamera->dSunB + ); + + glUniform1f(pShader->m_uniforms[KRShader::KRENGINE_UNIFORM_MATERIAL_ALPHA], 1.0f - m_tr); - - iTextureName = 0; - if(bNormalMap) { - iTextureName = m_pNormalMap->getName(); - glActiveTexture(GL_TEXTURE2); - glBindTexture(GL_TEXTURE_2D, iTextureName); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.0f); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); - } + + bool bSameDiffuseMap = false; + bool bSameSpecMap = false; + bool bSameNormalMap = false; + if(*prevBoundMaterial) { + if((*prevBoundMaterial)->m_pDiffuseMap == m_pDiffuseMap) { + bSameDiffuseMap = true; + } + if((*prevBoundMaterial)->m_pSpecularMap == m_pSpecularMap) { + bSameSpecMap = true; + } + if((*prevBoundMaterial)->m_pNormalMap == m_pNormalMap) { + bSameNormalMap = true; + } + } + if(bDiffuseMap && !bSameDiffuseMap) { + int iTextureName = m_pDiffuseMap->getName(); + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D, iTextureName); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.0f); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); + } + + if(bSpecMap && !bSameSpecMap) { + int iTextureName = m_pSpecularMap->getName(); + glActiveTexture(GL_TEXTURE1); + glBindTexture(GL_TEXTURE_2D, iTextureName); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.0f); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); + } + + if(bNormalMap && !bSameNormalMap) { + int iTextureName = m_pNormalMap->getName(); + glActiveTexture(GL_TEXTURE2); + glBindTexture(GL_TEXTURE_2D, iTextureName); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.0f); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); + } + + *prevBoundMaterial = this; + } // if(!bSameMaterial) } char *KRMaterial::getName() { diff --git a/KREngine/KREngine/Classes/KRMaterial.h b/KREngine/KREngine/Classes/KRMaterial.h index c8cfb94..b5b94df 100644 --- a/KREngine/KREngine/Classes/KRMaterial.h +++ b/KREngine/KREngine/Classes/KRMaterial.h @@ -1,8 +1,8 @@ // // KRMaterial.h -// gldemo +// KREngine // -// Copyright 2011 Kearwood Gilbert. All rights reserved. +// Copyright 2012 Kearwood Gilbert. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: @@ -60,7 +60,7 @@ public: void setTransparency(GLfloat a); void setShininess(GLfloat s); - void bind(KRCamera *pCamera, KRMat4 &mvpMatrix, Vector3 &cameraPosition, Vector3 &lightDirection, KRMat4 *pShadowMatrices, GLuint *shadowDepthTextures, int cShadowBuffers); + void bind(KRMaterial **prevBoundMaterial, char *szPrevShaderKey, KRCamera *pCamera, KRMat4 &mvpMatrix, Vector3 &cameraPosition, Vector3 &lightDirection, KRMat4 *pShadowMatrices, GLuint *shadowDepthTextures, int cShadowBuffers); bool isTransparent(); char *getName(); diff --git a/KREngine/KREngine/Classes/KRMaterialManager.cpp b/KREngine/KREngine/Classes/KRMaterialManager.cpp index 0c1aa9b..e3beb8d 100644 --- a/KREngine/KREngine/Classes/KRMaterialManager.cpp +++ b/KREngine/KREngine/Classes/KRMaterialManager.cpp @@ -1,8 +1,8 @@ // // KRMaterialManager.cpp -// gldemo +// KREngine // -// Copyright 2011 Kearwood Gilbert. All rights reserved. +// Copyright 2012 Kearwood Gilbert. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: diff --git a/KREngine/KREngine/Classes/KRMaterialManager.h b/KREngine/KREngine/Classes/KRMaterialManager.h index f47e337..12019ae 100644 --- a/KREngine/KREngine/Classes/KRMaterialManager.h +++ b/KREngine/KREngine/Classes/KRMaterialManager.h @@ -1,8 +1,8 @@ // // KRMaterialManager.h -// gldemo +// KREngine // -// Copyright 2011 Kearwood Gilbert. All rights reserved. +// Copyright 2012 Kearwood Gilbert. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: diff --git a/KREngine/KREngine/Classes/KRMesh.cpp b/KREngine/KREngine/Classes/KRMesh.cpp index 843472d..2d7a761 100644 --- a/KREngine/KREngine/Classes/KRMesh.cpp +++ b/KREngine/KREngine/Classes/KRMesh.cpp @@ -2,8 +2,31 @@ // KRMesh.cpp // KREngine // -// Created by Kearwood Gilbert on 12-03-15. -// Copyright (c) 2012 Kearwood Software. All rights reserved. +// Copyright 2012 Kearwood Gilbert. 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. +// +// THIS SOFTWARE IS PROVIDED BY KEARWOOD GILBERT ''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 KEARWOOD GILBERT OR +// CONTRIBUTORS 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. +// +// The views and conclusions contained in the software and documentation are those of the +// authors and should not be interpreted as representing official policies, either expressed +// or implied, of Kearwood Gilbert. // #include "KRMesh.h" @@ -160,4 +183,5 @@ void KRMesh::renderSubmesh(int iSubmesh) { cVertexes = 0; } } + glBindBuffer(GL_ARRAY_BUFFER, 0); } diff --git a/KREngine/KREngine/Classes/KRMesh.h b/KREngine/KREngine/Classes/KRMesh.h index 882de70..fbc0fa9 100644 --- a/KREngine/KREngine/Classes/KRMesh.h +++ b/KREngine/KREngine/Classes/KRMesh.h @@ -2,8 +2,31 @@ // KRMesh.h // KREngine // -// Created by Kearwood Gilbert on 12-03-15. -// Copyright (c) 2012 Kearwood Software. All rights reserved. +// Copyright 2012 Kearwood Gilbert. 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. +// +// THIS SOFTWARE IS PROVIDED BY KEARWOOD GILBERT ''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 KEARWOOD GILBERT OR +// CONTRIBUTORS 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. +// +// The views and conclusions contained in the software and documentation are those of the +// authors and should not be interpreted as representing official policies, either expressed +// or implied, of Kearwood Gilbert. // #import diff --git a/KREngine/KREngine/Classes/KRModel.cpp b/KREngine/KREngine/Classes/KRModel.cpp index c9d5269..ace53fe 100644 --- a/KREngine/KREngine/Classes/KRModel.cpp +++ b/KREngine/KREngine/Classes/KRModel.cpp @@ -1,8 +1,8 @@ // // KRModel.cpp -// gldemo +// KREngine // -// Copyright 2011 Kearwood Gilbert. All rights reserved. +// Copyright 2012 Kearwood Gilbert. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: @@ -55,7 +55,9 @@ void KRModel::loadPack(std::string path, KRMaterialManager *pMaterialManager) { vector submeshes = m_mesh.getSubmeshes(); for(std::vector::iterator itr = submeshes.begin(); itr != submeshes.end(); itr++) { - m_materials.push_back(pMaterialManager->getMaterial((*itr)->szMaterialName)); + KRMaterial *pMaterial = pMaterialManager->getMaterial((*itr)->szMaterialName); + m_materials.push_back(pMaterial); + m_uniqueMaterials.insert(pMaterial); } } @@ -64,21 +66,35 @@ KRModel::~KRModel() { } void KRModel::render(KRCamera *pCamera, KRMaterialManager *pMaterialManager, bool bRenderShadowMap, KRMat4 &mvpMatrix, Vector3 &cameraPosition, Vector3 &lightDirection, KRMat4 *pShadowMatrices, GLuint *shadowDepthTextures, int cShadowBuffers) { + KRMaterial *pPrevBoundMaterial = NULL; + char szPrevShaderKey[128]; + szPrevShaderKey[0] = '\0'; int cSubmeshes = m_mesh.getSubmeshes().size(); - for(int iSubmesh=0; iSubmeshbind(pCamera, mvpMatrix, cameraPosition, lightDirection, pShadowMatrices, shadowDepthTextures, cShadowBuffers); - } + if(bRenderShadowMap) { + for(int iSubmesh=0; iSubmeshisTransparent()) { - // Exclude transparent and semi-transparent meshes from shadow maps - m_mesh.renderSubmesh(iSubmesh); + if(pMaterial->isTransparent()) { + // Exclude transparent and semi-transparent meshes from shadow maps + m_mesh.renderSubmesh(iSubmesh); + } + } + + } + } else { + // Apply submeshes in per-material batches to reduce number of state changes + for(std::set::iterator mat_itr = m_uniqueMaterials.begin(); mat_itr != m_uniqueMaterials.end(); mat_itr++) { + for(int iSubmesh=0; iSubmeshbind(&pPrevBoundMaterial, szPrevShaderKey, pCamera, mvpMatrix, cameraPosition, lightDirection, pShadowMatrices, shadowDepthTextures, cShadowBuffers); + m_mesh.renderSubmesh(iSubmesh); + } } } - glBindBuffer(GL_ARRAY_BUFFER, 0); } } diff --git a/KREngine/KREngine/Classes/KRModel.h b/KREngine/KREngine/Classes/KRModel.h index da4ab00..8d5afea 100644 --- a/KREngine/KREngine/Classes/KRModel.h +++ b/KREngine/KREngine/Classes/KRModel.h @@ -1,8 +1,8 @@ // // KRModel.h -// gldemo +// KREngine // -// Copyright 2011 Kearwood Gilbert. All rights reserved. +// Copyright 2012 Kearwood Gilbert. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: @@ -33,10 +33,12 @@ #import #import #import +#import #import #import "KRMesh.h" using std::vector; +using std::set; #ifndef KRMODEL_I #define KRMODEL_I @@ -58,6 +60,7 @@ private: void loadPack(std::string path, KRMaterialManager *pMaterialManager); vector m_materials; + set m_uniqueMaterials; KRMesh m_mesh; }; diff --git a/KREngine/KREngine/Classes/KRModelManager.cpp b/KREngine/KREngine/Classes/KRModelManager.cpp index bd1ea83..7c1d030 100644 --- a/KREngine/KREngine/Classes/KRModelManager.cpp +++ b/KREngine/KREngine/Classes/KRModelManager.cpp @@ -1,8 +1,8 @@ // // KRModelManager.cpp -// gldemo +// KREngine // -// Copyright 2011 Kearwood Gilbert. All rights reserved. +// Copyright 2012 Kearwood Gilbert. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: diff --git a/KREngine/KREngine/Classes/KRModelManager.h b/KREngine/KREngine/Classes/KRModelManager.h index 916eda9..e2dc671 100644 --- a/KREngine/KREngine/Classes/KRModelManager.h +++ b/KREngine/KREngine/Classes/KRModelManager.h @@ -1,8 +1,8 @@ // // KRModelManager.h -// gldemo +// KREngine // -// Copyright 2011 Kearwood Gilbert. All rights reserved. +// Copyright 2012 Kearwood Gilbert. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: diff --git a/KREngine/KREngine/Classes/KRScene.cpp b/KREngine/KREngine/Classes/KRScene.cpp index e77fcb0..e25cad9 100644 --- a/KREngine/KREngine/Classes/KRScene.cpp +++ b/KREngine/KREngine/Classes/KRScene.cpp @@ -2,7 +2,7 @@ // KRScene.cpp // KREngine // -// Copyright 2011 Kearwood Gilbert. All rights reserved. +// Copyright 2012 Kearwood Gilbert. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: diff --git a/KREngine/KREngine/Classes/KRScene.h b/KREngine/KREngine/Classes/KRScene.h index 6f62a43..f396680 100644 --- a/KREngine/KREngine/Classes/KRScene.h +++ b/KREngine/KREngine/Classes/KRScene.h @@ -2,7 +2,7 @@ // KRScene.h // KREngine // -// Copyright 2011 Kearwood Gilbert. All rights reserved. +// Copyright 2012 Kearwood Gilbert. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: diff --git a/KREngine/KREngine/Classes/KRShader.cpp b/KREngine/KREngine/Classes/KRShader.cpp index 0d4635d..c26c87a 100644 --- a/KREngine/KREngine/Classes/KRShader.cpp +++ b/KREngine/KREngine/Classes/KRShader.cpp @@ -2,7 +2,7 @@ // KRShader.cpp // KREngine // -// Copyright 2011 Kearwood Gilbert. All rights reserved. +// Copyright 2012 Kearwood Gilbert. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: @@ -31,7 +31,8 @@ #include "KRShader.h" -KRShader::KRShader(std::string options, const GLchar *szVertShaderSource, const GLchar *szFragShaderSource) { +KRShader::KRShader(char *szKey, std::string options, const GLchar *szVertShaderSource, const GLchar *szFragShaderSource) { + strcpy(m_szKey, szKey); m_iProgram = 0; GLuint vertexShader = 0, fragShader = 0; try { @@ -185,3 +186,7 @@ void KRShader::bind(KRCamera *pCamera, KRMat4 &mvpMatrix, Vector3 &cameraPositio GLuint KRShader::getProgram() { return m_iProgram; } + +char *KRShader::getKey() { + return m_szKey; +} diff --git a/KREngine/KREngine/Classes/KRShader.h b/KREngine/KREngine/Classes/KRShader.h index bc56686..881793d 100644 --- a/KREngine/KREngine/Classes/KRShader.h +++ b/KREngine/KREngine/Classes/KRShader.h @@ -2,7 +2,7 @@ // KRShader.h // KREngine // -// Copyright 2011 Kearwood Gilbert. All rights reserved. +// Copyright 2012 Kearwood Gilbert. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: @@ -46,9 +46,10 @@ using std::vector; class KRShader { public: - KRShader(std::string options, const GLchar *szVertShaderSource, const GLchar *szFragShaderSource); + KRShader(char *szKey, std::string options, const GLchar *szVertShaderSource, const GLchar *szFragShaderSource); ~KRShader(); GLuint getProgram(); + char *getKey(); void bind(KRCamera *pCamera, KRMat4 &mvpMatrix, Vector3 &cameraPosition, Vector3 &lightDirection, KRMat4 *pShadowMatrices, GLuint *shadowDepthTextures, int cShadowBuffers); @@ -82,6 +83,7 @@ public: KRENGINE_NUM_UNIFORMS }; GLint m_uniforms[KRENGINE_NUM_UNIFORMS]; + char m_szKey[128]; private: GLuint m_iProgram; diff --git a/KREngine/KREngine/Classes/KRShaderManager.cpp b/KREngine/KREngine/Classes/KRShaderManager.cpp index 66009e2..16176cb 100644 --- a/KREngine/KREngine/Classes/KRShaderManager.cpp +++ b/KREngine/KREngine/Classes/KRShaderManager.cpp @@ -2,7 +2,7 @@ // KRShaderManager.cpp // KREngine // -// Copyright 2011 Kearwood Gilbert. All rights reserved. +// Copyright 2012 Kearwood Gilbert. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: @@ -83,7 +83,7 @@ KRShader *KRShaderManager::getShader(KRCamera *pCamera, bool bDiffuseMap, bool b stream << "\n"; std::string options = stream.str(); - pShader = new KRShader(options, m_szVertShaderSource, m_szFragShaderSource); + pShader = new KRShader(szKey, options, m_szVertShaderSource, m_szFragShaderSource); m_shaders[szKey] = pShader; } diff --git a/KREngine/KREngine/Classes/KRShaderManager.h b/KREngine/KREngine/Classes/KRShaderManager.h index e34f2c4..b366d45 100644 --- a/KREngine/KREngine/Classes/KRShaderManager.h +++ b/KREngine/KREngine/Classes/KRShaderManager.h @@ -2,7 +2,7 @@ // KRShaderManager.h // KREngine // -// Copyright 2011 Kearwood Gilbert. All rights reserved. +// Copyright 2012 Kearwood Gilbert. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: diff --git a/KREngine/KREngine/Classes/KRTexture.cpp b/KREngine/KREngine/Classes/KRTexture.cpp index e3aba73..5d957b6 100644 --- a/KREngine/KREngine/Classes/KRTexture.cpp +++ b/KREngine/KREngine/Classes/KRTexture.cpp @@ -1,8 +1,8 @@ // // KRTexture.cpp -// gldemo +// KREngine // -// Copyright 2011 Kearwood Gilbert. All rights reserved. +// Copyright 2012 Kearwood Gilbert. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: diff --git a/KREngine/KREngine/Classes/KRTexture.h b/KREngine/KREngine/Classes/KRTexture.h index cbe871a..2e67dae 100644 --- a/KREngine/KREngine/Classes/KRTexture.h +++ b/KREngine/KREngine/Classes/KRTexture.h @@ -1,8 +1,8 @@ // // KRTexture.h -// gldemo +// KREngine // -// Copyright 2011 Kearwood Gilbert. All rights reserved. +// Copyright 2012 Kearwood Gilbert. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: diff --git a/KREngine/KREngine/Classes/KRTextureManager.cpp b/KREngine/KREngine/Classes/KRTextureManager.cpp index 10bd2aa..071ab45 100644 --- a/KREngine/KREngine/Classes/KRTextureManager.cpp +++ b/KREngine/KREngine/Classes/KRTextureManager.cpp @@ -1,8 +1,8 @@ // // KRTextureManager.cpp -// gldemo +// KREngine // -// Copyright 2011 Kearwood Gilbert. All rights reserved. +// Copyright 2012 Kearwood Gilbert. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: diff --git a/KREngine/KREngine/Classes/KRTextureManager.h b/KREngine/KREngine/Classes/KRTextureManager.h index 4be6ade..25df4ab 100644 --- a/KREngine/KREngine/Classes/KRTextureManager.h +++ b/KREngine/KREngine/Classes/KRTextureManager.h @@ -1,8 +1,8 @@ // // KRTextureManager.h -// gldemo +// KREngine // -// Copyright 2011 Kearwood Gilbert. All rights reserved. +// Copyright 2012 Kearwood Gilbert. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: diff --git a/KREngine/KREngine/Classes/KRVector3.cpp b/KREngine/KREngine/Classes/KRVector3.cpp index 7a52550..127f8f1 100644 --- a/KREngine/KREngine/Classes/KRVector3.cpp +++ b/KREngine/KREngine/Classes/KRVector3.cpp @@ -1,8 +1,8 @@ // // KRVector3.cpp -// gldemo +// KREngine // -// Copyright 2011 Kearwood Gilbert. All rights reserved. +// Copyright 2012 Kearwood Gilbert. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: diff --git a/KREngine/KREngine/Classes/KRVector3.h b/KREngine/KREngine/Classes/KRVector3.h index 4941d59..edda186 100644 --- a/KREngine/KREngine/Classes/KRVector3.h +++ b/KREngine/KREngine/Classes/KRVector3.h @@ -1,8 +1,8 @@ // // KRVector3.h -// gldemo +// KREngine // -// Copyright 2011 Kearwood Gilbert. All rights reserved. +// Copyright 2012 Kearwood Gilbert. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: diff --git a/KREngine/KREngine/Shaders/ObjectShader.fsh b/KREngine/KREngine/Shaders/ObjectShader.fsh index fb461a5..d374aa1 100644 --- a/KREngine/KREngine/Shaders/ObjectShader.fsh +++ b/KREngine/KREngine/Shaders/ObjectShader.fsh @@ -1,4 +1,4 @@ -// Copyright 2011 Kearwood Gilbert. All rights reserved. +// Copyright 2012 Kearwood Gilbert. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: diff --git a/KREngine/KREngine/Shaders/ObjectShader.vsh b/KREngine/KREngine/Shaders/ObjectShader.vsh index 44ad469..8baa007 100644 --- a/KREngine/KREngine/Shaders/ObjectShader.vsh +++ b/KREngine/KREngine/Shaders/ObjectShader.vsh @@ -1,8 +1,8 @@ // // Shader.vsh -// gldemo +// KREngine // -// Copyright 2011 Kearwood Gilbert. All rights reserved. +// Copyright 2012 Kearwood Gilbert. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: diff --git a/KREngine/KREngine/Shaders/PostShader.fsh b/KREngine/KREngine/Shaders/PostShader.fsh index 83002ad..2f5659b 100644 --- a/KREngine/KREngine/Shaders/PostShader.fsh +++ b/KREngine/KREngine/Shaders/PostShader.fsh @@ -1,4 +1,4 @@ -// Copyright 2011 Kearwood Gilbert. All rights reserved. +// Copyright 2012 Kearwood Gilbert. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: diff --git a/KREngine/KREngine/Shaders/PostShader.vsh b/KREngine/KREngine/Shaders/PostShader.vsh index 13784ee..9d0b089 100644 --- a/KREngine/KREngine/Shaders/PostShader.vsh +++ b/KREngine/KREngine/Shaders/PostShader.vsh @@ -1,4 +1,4 @@ -// Copyright 2011 Kearwood Gilbert. All rights reserved. +// Copyright 2012 Kearwood Gilbert. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: diff --git a/KREngine/KREngine/Shaders/ShadowShader.fsh b/KREngine/KREngine/Shaders/ShadowShader.fsh index e18af48..61c18cb 100644 --- a/KREngine/KREngine/Shaders/ShadowShader.fsh +++ b/KREngine/KREngine/Shaders/ShadowShader.fsh @@ -1,4 +1,4 @@ -// Copyright 2011 Kearwood Gilbert. All rights reserved. +// Copyright 2012 Kearwood Gilbert. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: diff --git a/KREngine/KREngine/Shaders/ShadowShader.vsh b/KREngine/KREngine/Shaders/ShadowShader.vsh index ccdc7be..d04c1f3 100644 --- a/KREngine/KREngine/Shaders/ShadowShader.vsh +++ b/KREngine/KREngine/Shaders/ShadowShader.vsh @@ -1,4 +1,4 @@ -// Copyright 2011 Kearwood Gilbert. All rights reserved. +// Copyright 2012 Kearwood Gilbert. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: diff --git a/objpack/objpack.xcodeproj/project.pbxproj b/objpack/objpack.xcodeproj/project.pbxproj index ec6087e..a27497f 100644 --- a/objpack/objpack.xcodeproj/project.pbxproj +++ b/objpack/objpack.xcodeproj/project.pbxproj @@ -28,12 +28,12 @@ /* Begin PBXFileReference section */ E404C898136B8E2F00B6C99B /* objpack */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = objpack; sourceTree = BUILT_PRODUCTS_DIR; }; - E404C89C136B8E2F00B6C99B /* main.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; + E404C89C136B8E2F00B6C99B /* main.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = main.cpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; E404C89E136B8E2F00B6C99B /* objpack.1 */ = {isa = PBXFileReference; lastKnownFileType = text.man; path = objpack.1; sourceTree = ""; }; - E404C8A4136B901400B6C99B /* KROBJPacker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KROBJPacker.cpp; sourceTree = ""; }; - E404C8A5136B901400B6C99B /* KROBJPacker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KROBJPacker.h; sourceTree = ""; }; - E404C8A7136B919F00B6C99B /* KRVector3.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KRVector3.cpp; sourceTree = ""; }; - E404C8A8136B919F00B6C99B /* KRVector3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KRVector3.h; sourceTree = ""; }; + E404C8A4136B901400B6C99B /* KROBJPacker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = KROBJPacker.cpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; + E404C8A5136B901400B6C99B /* KROBJPacker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = KROBJPacker.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + E404C8A7136B919F00B6C99B /* KRVector3.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = KRVector3.cpp; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; + E404C8A8136B919F00B6C99B /* KRVector3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = KRVector3.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; E4082873150175FA0095DDCD /* libfbxsdk-2012.2-static.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libfbxsdk-2012.2-static.a"; path = "../../../../../../../../Applications/Autodesk/FBXSDK20122/lib/gcc4/ub/libfbxsdk-2012.2-static.a"; sourceTree = ""; }; E4082876150176300095DDCD /* libPVRTexLib.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libPVRTexLib.a; path = "../../../../../../../../Applications/PVR SDK Package/Utilities/PVRTexLib/MacOS/libPVRTexLib.a"; sourceTree = ""; }; /* End PBXFileReference section */ diff --git a/objpack/objpack/KROBJPacker.cpp b/objpack/objpack/KROBJPacker.cpp index 90478be..7116a42 100644 --- a/objpack/objpack/KROBJPacker.cpp +++ b/objpack/objpack/KROBJPacker.cpp @@ -2,7 +2,7 @@ // objpacker.cpp // objpack // -// Copyright 2011 Kearwood Gilbert. All rights reserved. +// Copyright 2012 Kearwood Gilbert. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: diff --git a/objpack/objpack/KROBJPacker.h b/objpack/objpack/KROBJPacker.h index e37c6f6..6d0a1b0 100644 --- a/objpack/objpack/KROBJPacker.h +++ b/objpack/objpack/KROBJPacker.h @@ -2,7 +2,7 @@ // objpacker.h // objpack // -// Copyright 2011 Kearwood Gilbert. All rights reserved. +// Copyright 2012 Kearwood Gilbert. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: diff --git a/objpack/objpack/KRVector3.cpp b/objpack/objpack/KRVector3.cpp index 4017d32..471f4b4 100644 --- a/objpack/objpack/KRVector3.cpp +++ b/objpack/objpack/KRVector3.cpp @@ -1,8 +1,8 @@ // // KRVector3.cpp -// gldemo +// KREngine // -// Copyright 2011 Kearwood Gilbert. All rights reserved. +// Copyright 2012 Kearwood Gilbert. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: diff --git a/objpack/objpack/KRVector3.h b/objpack/objpack/KRVector3.h index 1434633..ad37b06 100644 --- a/objpack/objpack/KRVector3.h +++ b/objpack/objpack/KRVector3.h @@ -1,8 +1,8 @@ // // KRVector3.h -// gldemo +// KREngine // -// Copyright 2011 Kearwood Gilbert. All rights reserved. +// Copyright 2012 Kearwood Gilbert. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: diff --git a/objpack/objpack/main.cpp b/objpack/objpack/main.cpp index 5f2824f..f84c5e8 100644 --- a/objpack/objpack/main.cpp +++ b/objpack/objpack/main.cpp @@ -2,7 +2,7 @@ // main.cpp // objpack // -// Copyright 2011 Kearwood Gilbert. All rights reserved. +// Copyright 2012 Kearwood Gilbert. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: diff --git a/objview/Classes/KRObjViewAppDelegate.h b/objview/Classes/KRObjViewAppDelegate.h index 8dc2b25..1202d2d 100644 --- a/objview/Classes/KRObjViewAppDelegate.h +++ b/objview/Classes/KRObjViewAppDelegate.h @@ -2,7 +2,7 @@ // KRObjViewAppDelegate.h // KRObjView // -// Copyright 2011 Kearwood Gilbert. All rights reserved. +// Copyright 2012 Kearwood Gilbert. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: diff --git a/objview/Classes/KRObjViewAppDelegate.mm b/objview/Classes/KRObjViewAppDelegate.mm index 015851d..e38fb4a 100644 --- a/objview/Classes/KRObjViewAppDelegate.mm +++ b/objview/Classes/KRObjViewAppDelegate.mm @@ -2,7 +2,7 @@ // KRObjViewAppDelegate.m // KRObjView // -// Copyright 2011 Kearwood Gilbert. All rights reserved. +// Copyright 2012 Kearwood Gilbert. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: diff --git a/objview/Classes/KRObjViewGLView.h b/objview/Classes/KRObjViewGLView.h index 65e7f81..0df1280 100644 --- a/objview/Classes/KRObjViewGLView.h +++ b/objview/Classes/KRObjViewGLView.h @@ -2,7 +2,7 @@ // KRObjViewGLView.h // KRObjView // -// Copyright 2011 Kearwood Gilbert. All rights reserved. +// Copyright 2012 Kearwood Gilbert. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: diff --git a/objview/Classes/KRObjViewGLView.mm b/objview/Classes/KRObjViewGLView.mm index c395d0f..ab4916a 100644 --- a/objview/Classes/KRObjViewGLView.mm +++ b/objview/Classes/KRObjViewGLView.mm @@ -2,7 +2,7 @@ // KRObjViewGLView.m // KRObjView // -// Copyright 2011 Kearwood Gilbert. All rights reserved. +// Copyright 2012 Kearwood Gilbert. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: diff --git a/objview/Classes/KRObjViewViewController.h b/objview/Classes/KRObjViewViewController.h index bd8f9df..0aebaf0 100644 --- a/objview/Classes/KRObjViewViewController.h +++ b/objview/Classes/KRObjViewViewController.h @@ -2,7 +2,7 @@ // KRObjViewViewController.h // KRObjView // -// Copyright 2011 Kearwood Gilbert. All rights reserved. +// Copyright 2012 Kearwood Gilbert. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: diff --git a/objview/Classes/KRObjViewViewController.mm b/objview/Classes/KRObjViewViewController.mm index 6c0f029..80efc81 100644 --- a/objview/Classes/KRObjViewViewController.mm +++ b/objview/Classes/KRObjViewViewController.mm @@ -2,7 +2,7 @@ // KRObjViewViewController.m // KRObjView // -// Copyright 2011 Kearwood Gilbert. All rights reserved. +// Copyright 2012 Kearwood Gilbert. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: diff --git a/objview/KRObjView.xcodeproj/project.pbxproj b/objview/KRObjView.xcodeproj/project.pbxproj index 3a38a80..52f157e 100644 --- a/objview/KRObjView.xcodeproj/project.pbxproj +++ b/objview/KRObjView.xcodeproj/project.pbxproj @@ -37,30 +37,30 @@ 1063FBAD136BA13F00EE555B /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = System/Library/Frameworks/CoreVideo.framework; sourceTree = SDKROOT; }; 1063FBAF136BA13F00EE555B /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; 1063FBB1136BA13F00EE555B /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; - 1063FC75136D6A1B00EE555B /* KRObjViewGLView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KRObjViewGLView.h; sourceTree = ""; }; - 1063FC76136D6A1B00EE555B /* KRObjViewGLView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KRObjViewGLView.mm; sourceTree = ""; }; + 1063FC75136D6A1B00EE555B /* KRObjViewGLView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = KRObjViewGLView.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 1063FC76136D6A1B00EE555B /* KRObjViewGLView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = KRObjViewGLView.mm; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - 1D3623240D0F684500981E51 /* KRObjViewAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KRObjViewAppDelegate.h; sourceTree = ""; }; - 1D3623250D0F684500981E51 /* KRObjViewAppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KRObjViewAppDelegate.mm; sourceTree = ""; }; + 1D3623240D0F684500981E51 /* KRObjViewAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = KRObjViewAppDelegate.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 1D3623250D0F684500981E51 /* KRObjViewAppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = KRObjViewAppDelegate.mm; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 1D6058910D05DD3D006BFB54 /* KRObjView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = KRObjView.app; sourceTree = BUILT_PRODUCTS_DIR; }; 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 288765A40DF7441C002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 28AD733E0D9D9553002E5188 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = ""; }; - 28D7ACF60DDB3853001CB0EB /* KRObjViewViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KRObjViewViewController.h; sourceTree = ""; }; - 28D7ACF70DDB3853001CB0EB /* KRObjViewViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KRObjViewViewController.mm; sourceTree = ""; }; - 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 28D7ACF60DDB3853001CB0EB /* KRObjViewViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = KRObjViewViewController.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 28D7ACF70DDB3853001CB0EB /* KRObjViewViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = KRObjViewViewController.mm; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = main.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 32CA4F630368D1EE00C91783 /* KRObjView_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KRObjView_Prefix.pch; sourceTree = ""; }; 8D1107310486CEB800E47090 /* KRObjView-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "KRObjView-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = ""; }; E40611D214E4E98B0065996A /* libTestFlight.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libTestFlight.a; sourceTree = ""; }; E40611D314E4E98B0065996A /* README.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README.txt; sourceTree = ""; }; E40611D414E4E98B0065996A /* release_notes.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = release_notes.txt; sourceTree = ""; }; - E40611D514E4E98B0065996A /* TestFlight.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestFlight.h; sourceTree = ""; }; + E40611D514E4E98B0065996A /* TestFlight.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = TestFlight.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; E43A7A6D13CA2BA2000A565E /* libKREngine.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libKREngine.a; sourceTree = BUILT_PRODUCTS_DIR; }; - E46FED2113C9A488009F5814 /* ShadowShader.vsh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; name = ShadowShader.vsh; path = ../KREngine/KREngine/Shaders/ShadowShader.vsh; sourceTree = ""; }; + E46FED2113C9A488009F5814 /* ShadowShader.vsh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; lineEnding = 0; name = ShadowShader.vsh; path = ../KREngine/KREngine/Shaders/ShadowShader.vsh; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.glsl; }; E46FED2213C9A488009F5814 /* ShadowShader.fsh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; name = ShadowShader.fsh; path = ../KREngine/KREngine/Shaders/ShadowShader.fsh; sourceTree = ""; }; E46FED2313C9A488009F5814 /* PostShader.fsh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; name = PostShader.fsh; path = ../KREngine/KREngine/Shaders/PostShader.fsh; sourceTree = ""; }; E46FED2413C9A488009F5814 /* ObjectShader.fsh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; name = ObjectShader.fsh; path = ../KREngine/KREngine/Shaders/ObjectShader.fsh; sourceTree = ""; }; - E46FED2513C9A488009F5814 /* ObjectShader.vsh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; name = ObjectShader.vsh; path = ../KREngine/KREngine/Shaders/ObjectShader.vsh; sourceTree = ""; }; + E46FED2513C9A488009F5814 /* ObjectShader.vsh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; lineEnding = 0; name = ObjectShader.vsh; path = ../KREngine/KREngine/Shaders/ObjectShader.vsh; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.glsl; }; E46FED2613C9A488009F5814 /* PostShader.vsh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; name = PostShader.vsh; path = ../KREngine/KREngine/Shaders/PostShader.vsh; sourceTree = ""; }; E49EB29B13806C5D00A4E727 /* MainWindow-iPad.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = "MainWindow-iPad.xib"; path = "iPad/MainWindow-iPad.xib"; sourceTree = ""; }; /* End PBXFileReference section */ diff --git a/objview/main.m b/objview/main.m index bf700ba..2f05be1 100644 --- a/objview/main.m +++ b/objview/main.m @@ -2,7 +2,7 @@ // main.m // KRObjView // -// Copyright 2011 Kearwood Gilbert. All rights reserved. +// Copyright 2012 Kearwood Gilbert. All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are // permitted provided that the following conditions are met: