فهرست منبع

Made SceneMesh clear the material before wireframe render, added UnlitMaterial to default.pak, 3d editor can now place meshes, primitives and lights and edit entity and material properties

Ivan Safrin 12 سال پیش
والد
کامیت
6787ee41f6

BIN
Assets/Default asset pack/default.pak


+ 7 - 1
Assets/Default asset pack/default/default.mat

@@ -52,6 +52,12 @@
 				<textures>
 				</textures>				
 			</shader>
-		</material>					
+		</material>
+		<material name="UnlitMaterial">
+			<shader name="Unlit">
+				<textures>
+				</textures>				
+			</shader>
+		</material>							
 	</materials>
 </polycode>

+ 7 - 6
Core/Contents/Source/PolySceneMesh.cpp

@@ -323,6 +323,12 @@ void SceneMesh::Render() {
 		renderMeshLocally();
 	}
 	
+	if(material)  {
+		renderer->clearShader();
+	}
+    
+    renderer->setTexture(NULL);
+    
 	if(overlayWireframe) {
 		bool depthTestVal = depthTest;
 		renderer->enableDepthTest(false);
@@ -338,10 +344,5 @@ void SceneMesh::Render() {
 		renderer->setWireframePolygonMode(false);
 	}	
 	
-	if(material) 
-		renderer->clearShader();
-	
-	if(showVertexNormals) {	
-		renderer->setTexture(NULL);
-	}	
+    
 }

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 3 - 3
IDE/Assets/ide_icons.ai


+ 6 - 0
IDE/Build/Mac OS X/Polycode.xcodeproj/project.pbxproj

@@ -20,6 +20,7 @@
 		6D3DC79D1622043A003ED2C9 /* PolycodeConsole.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D3DC79C1622043A003ED2C9 /* PolycodeConsole.cpp */; };
 		6D6D3FA614B446A600219173 /* PolycodeToolLauncher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D6D3FA514B446A600219173 /* PolycodeToolLauncher.cpp */; };
 		6D70AB2A12B29BF200EB6D94 /* NewFileWindow.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D70AB2912B29BF200EB6D94 /* NewFileWindow.cpp */; };
+		6D7234B11829E33100BB3D96 /* EntityEditorPropertyView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D7234B01829E33100BB3D96 /* EntityEditorPropertyView.cpp */; };
 		6D79732E167F0D4600646407 /* PolycodeSpriteEditor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D79732D167F0D4600646407 /* PolycodeSpriteEditor.cpp */; };
 		6D797333167F0EB100646407 /* PolycodeProps.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D797332167F0EB100646407 /* PolycodeProps.cpp */; };
 		6D80B0CE163B14CB00EF3C04 /* PolycodeMaterialEditor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D80B0CD163B14CB00EF3C04 /* PolycodeMaterialEditor.cpp */; };
@@ -102,6 +103,8 @@
 		6D6D3FA814B446AF00219173 /* PolycodeToolLauncher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolycodeToolLauncher.h; sourceTree = "<group>"; };
 		6D70AB2812B29BEC00EB6D94 /* NewFileWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NewFileWindow.h; sourceTree = "<group>"; };
 		6D70AB2912B29BF200EB6D94 /* NewFileWindow.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NewFileWindow.cpp; sourceTree = "<group>"; };
+		6D7234AF1829E32800BB3D96 /* EntityEditorPropertyView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = EntityEditorPropertyView.h; sourceTree = "<group>"; };
+		6D7234B01829E33100BB3D96 /* EntityEditorPropertyView.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EntityEditorPropertyView.cpp; sourceTree = "<group>"; };
 		6D79732D167F0D4600646407 /* PolycodeSpriteEditor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolycodeSpriteEditor.cpp; sourceTree = "<group>"; };
 		6D797330167F0D4D00646407 /* PolycodeSpriteEditor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolycodeSpriteEditor.h; sourceTree = "<group>"; };
 		6D797331167F0EA500646407 /* PolycodeProps.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolycodeProps.h; sourceTree = "<group>"; };
@@ -380,6 +383,7 @@
 		6DCB602C1822EA4A006701AF /* entity_editor */ = {
 			isa = PBXGroup;
 			children = (
+				6D7234AF1829E32800BB3D96 /* EntityEditorPropertyView.h */,
 				6DCB60361822EDB1006701AF /* EditorGrid.h */,
 				6DCB60331822EAE5006701AF /* TransformGizmo.h */,
 			);
@@ -389,6 +393,7 @@
 		6DCB60301822EAD5006701AF /* entity_editor */ = {
 			isa = PBXGroup;
 			children = (
+				6D7234B01829E33100BB3D96 /* EntityEditorPropertyView.cpp */,
 				6DCB60341822EBDD006701AF /* EditorGrid.cpp */,
 				6DCB60311822EADE006701AF /* TransformGizmo.cpp */,
 			);
@@ -504,6 +509,7 @@
 				6DD1835D1628A4CC005A5682 /* PolycodeRemoteDebugger.cpp in Sources */,
 				6D80B0CE163B14CB00EF3C04 /* PolycodeMaterialEditor.cpp in Sources */,
 				6DC825791648571E006AFC03 /* ExportProjectWindow.cpp in Sources */,
+				6D7234B11829E33100BB3D96 /* EntityEditorPropertyView.cpp in Sources */,
 				6DC67A541656F693004FD1EF /* TextureBrowser.cpp in Sources */,
 				6D79732E167F0D4600646407 /* PolycodeSpriteEditor.cpp in Sources */,
 				6D797333167F0EB100646407 /* PolycodeProps.cpp in Sources */,

+ 48 - 0
IDE/Contents/Include/EntityEditorPropertyView.h

@@ -0,0 +1,48 @@
+/*
+ Copyright (C) 2013 by Ivan Safrin
+ 
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+ */
+
+#pragma once
+
+#include "Polycode.h"
+#include "PolycodeUI.h"
+#include "PolycodeProps.h"
+#include "OSBasics.h"
+
+using namespace Polycode;
+
+class EntityEditorPropertyView : public UIElement {
+    public:
+    
+        EntityEditorPropertyView();
+        ~EntityEditorPropertyView();
+    
+        void setEntity(Entity *entity);
+    
+        void Resize(Number width, Number height);
+    
+    protected:
+    
+        PropList *entityProps;
+        EntitySheet *entitySheet;
+        MaterialPropSheet *materialSheet;
+};
+

+ 15 - 2
IDE/Contents/Include/PolycodeEntityEditor.h

@@ -26,6 +26,7 @@
 #include "PolyUIElement.h"
 #include <Polycode.h>
 #include "PolycodeUI.h"
+#include "EntityEditorPropertyView.h"
 
 #include "TrackballCamera.h"
 
@@ -39,14 +40,19 @@ class EntityEditorMainView : public UIElement {
 			EntityEditorMainView();
 			~EntityEditorMainView();
 			
+            void createIcon(Entity *entity, String iconFile);
             void setEditorProps(Entity *entity);
     
+            void selectEntity(Entity *targetEntity);
+    
 			void handleEvent(Event *event);
 			void Resize(Number width, Number height);
 			void Update();
     
             void addEntityFromMenu(String command);
 			
+            Entity *getSelectedEntity();
+    
 		protected:
 			
 			Entity *sideBar;
@@ -68,13 +74,14 @@ class EntityEditorMainView : public UIElement {
             UIImageButton *addEntityButton;
             UIMenu *addEntityMenu;
     
+            std::vector<ScenePrimitive*> icons;
+    
             Vector3 cursorPosition;
     
             String assetSelectType;
     
 };
 
-
 class PolycodeEntityEditor : public PolycodeEditor {
 	public:
 		PolycodeEntityEditor();
@@ -83,11 +90,17 @@ class PolycodeEntityEditor : public PolycodeEditor {
 		bool openFile(OSFileEntry filePath);
 		void Resize(int x, int y);
 		
+        void handleEvent(Event *event);
+    
 	protected:
 	
 		EntityEditorMainView *mainView;
+        EntityEditorPropertyView *propertyView;
+    
 		UIHSizer *mainSizer;
-	
+        UIVSizer *rightSizer;
+    
+    
 };
 
 class PolycodeEntityEditorFactory : public PolycodeEditorFactory {

+ 19 - 5
IDE/Contents/Include/PolycodeProps.h

@@ -437,10 +437,10 @@ class EntitySheet : public PropSheet {
 		~EntitySheet();	
 	
 		void handleEvent(Event *event);
-		void Update();
-				
+        void setEntity(Entity *entity);
+
+    protected:
 		Entity *entity;
-		Entity *lastEntity;
 		
 		StringProp *idProp;
 		StringProp *tagProp;
@@ -509,6 +509,21 @@ class RenderTargetsSheet : public PropSheet {
 		int removeIndex;
 };
 
+class MaterialPropSheet : public PropSheet {
+    public:
+        MaterialPropSheet();
+        ~MaterialPropSheet();
+    
+        void handleEvent(Event *event);
+        void reloadMaterials();
+    
+        void setSceneMesh(SceneMesh *sceneMesh);
+    
+    protected:
+        SceneMesh *sceneMesh;
+        ComboProp *materialProp;
+};
+
 class EntityPropSheet : public PropSheet {
 	public:
 		EntityPropSheet();		
@@ -517,12 +532,11 @@ class EntityPropSheet : public PropSheet {
 		void refreshProps();
 		void applyPropActionData(PolycodeEditorPropActionData *data);
 
-
 		UIButton *addButton;
 		
 		Entity *entity;
 		Entity *lastEntity;
-		
+    
 		int lastNumProps;		
 		int removeIndex;
 };

BIN
IDE/Contents/Resources/ImagesRetina/entityEditor/light_icon.png


+ 56 - 0
IDE/Contents/Source/EntityEditorPropertyView.cpp

@@ -0,0 +1,56 @@
+/*
+ Copyright (C) 2013 by Ivan Safrin
+ 
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+ */
+ 
+#include "EntityEditorPropertyView.h"
+
+
+EntityEditorPropertyView::EntityEditorPropertyView() : UIElement() {
+    entityProps = new PropList();
+    addChild(entityProps);
+    
+    materialSheet = new MaterialPropSheet();
+    entityProps->addPropSheet(materialSheet);
+    materialSheet->addEventListener(this, PropEvent::EVENT_PROP_CHANGE);
+    
+    
+    entitySheet = new EntitySheet();
+    entityProps->addPropSheet(entitySheet);
+    entitySheet->addEventListener(this, PropEvent::EVENT_PROP_CHANGE);
+    
+}
+
+void EntityEditorPropertyView::Resize(Number width, Number height) {
+    entityProps->Resize(width, height);
+    UIElement::Resize(width, height);
+}
+
+void EntityEditorPropertyView::setEntity(Entity *entity) {
+    
+    SceneMesh *sceneMesh = dynamic_cast<SceneMesh*>(entity);
+    materialSheet->setSceneMesh(sceneMesh);
+    
+    entitySheet->setEntity(entity);
+    Resize(getWidth(), getHeight());
+}
+
+EntityEditorPropertyView::~EntityEditorPropertyView() {
+}

+ 95 - 19
IDE/Contents/Source/PolycodeEntityEditor.cpp

@@ -40,12 +40,12 @@ EntityEditorMainView::EntityEditorMainView() {
 	renderTextureShape->setTexture(renderTexture->getTargetTexture());
 	addChild(renderTextureShape);
 	renderTextureShape->setPosition(0, 30);
-				
 			
 	headerBg = new UIRect(10,10);
 	addChild(headerBg);
 	headerBg->setAnchorPoint(-1.0, -1.0, 0.0);
 	headerBg->color.setColorHexFromString(CoreServices::getInstance()->getConfig()->getStringValue("Polycode", "uiHeaderBgColor"));
+    
 	
 	sideBar = new Entity();
 	addChild(sideBar);
@@ -78,7 +78,37 @@ EntityEditorMainView::EntityEditorMainView() {
     
 }
 
+Entity *EntityEditorMainView::getSelectedEntity() {
+    if(selectedEntities.size() > 0) {
+        return selectedEntities[selectedEntities.size()-1];
+    } else {
+        return NULL;
+    }
+}
+
 void EntityEditorMainView::Update() {
+    for(int i=0; i < icons.size(); i++) {
+        Number scale = mainScene->getDefaultCamera()->getPosition().distance(icons[i]->getConcatenatedMatrix().getPosition()) * 0.1;
+        icons[i]->setScale(scale, scale, scale);
+    }
+}
+
+void EntityEditorMainView::createIcon(Entity *entity, String iconFile) {
+    ScenePrimitive *iconPrimitive = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 0.3, 0.3);
+    
+    iconPrimitive->setMaterialByName("UnlitMaterial");
+	Texture *tex = CoreServices::getInstance()->getMaterialManager()->createTextureFromFile("entityEditor/"+iconFile);
+	if(iconPrimitive->getLocalShaderOptions()) {
+        iconPrimitive->getLocalShaderOptions()->addTexture("diffuse", tex);
+	}
+    
+    entity->addChild(iconPrimitive);
+    iconPrimitive->billboardMode = true;
+    iconPrimitive->depthTest = false;
+    iconPrimitive->depthWrite = false;
+    iconPrimitive->editorOnly = true;
+    iconPrimitive->alphaTest = true;
+    icons.push_back(iconPrimitive);
 }
 
 void EntityEditorMainView::setEditorProps(Entity *entity) {
@@ -89,6 +119,12 @@ void EntityEditorMainView::setEditorProps(Entity *entity) {
     if(sceneMesh) {
         sceneMesh->wireFrameColor = Color(1.0, 0.8, 0.3, 1.0);
         sceneMesh->setLineWidth(CoreServices::getInstance()->getRenderer()->getBackingResolutionScaleX());
+        sceneMesh->useGeometryHitDetection = true;
+    }
+    
+    SceneLight *sceneLight = dynamic_cast<SceneLight*>(entity);
+    if(sceneLight) {
+        createIcon(entity, "light_icon.png");
     }
 }
 
@@ -99,9 +135,23 @@ void EntityEditorMainView::addEntityFromMenu(String command) {
         sceneObjectRoot->addChild(newPrimitive);
         setEditorProps(newPrimitive);
         newPrimitive->setPosition(cursorPosition);
+        selectEntity(newPrimitive);
+        newPrimitive->getMesh()->calculateNormals(false);
         return;
     }
 
+    if(command == "add_light") {
+        SceneLight *newLight = new SceneLight(SceneLight::AREA_LIGHT, mainScene, 50);
+        
+        newLight->bBox = Vector3(0.5, 0.5, 0.5);
+        mainScene->addLight(newLight);
+        sceneObjectRoot->addChild(newLight);
+        setEditorProps(newLight);
+        newLight->setPosition(cursorPosition);
+        selectEntity(newLight);
+        return;
+    }
+    
     if(command == "add_mesh") {
         assetSelectType = "mesh";
         globalFrame->assetBrowser->addEventListener(this, UIEvent::OK_EVENT);
@@ -122,6 +172,7 @@ void EntityEditorMainView::handleEvent(Event *event) {
                 sceneObjectRoot->addChild(newMesh);
                 setEditorProps(newMesh);
                 newMesh->setPosition(cursorPosition);
+                selectEntity(newMesh);
             }
             
             globalFrame->assetBrowser->removeAllHandlersForListener(this);
@@ -154,31 +205,36 @@ void EntityEditorMainView::handleEvent(Event *event) {
 
             if(inputEvent->mouseButton == CoreInput::MOUSE_BUTTON2) {
                 Entity* targetEntity = (Entity*) event->getDispatcher();
-                
-                for(int i=0; i < selectedEntities.size(); i++) {
-                    SceneMesh *sceneMesh = dynamic_cast<SceneMesh*>(selectedEntities[i]);
-                    if(sceneMesh) {
-                        sceneMesh->overlayWireframe = false;
-                    }
-                }
-                
-                selectedEntities.clear();			
-                selectedEntities.push_back(targetEntity);
-                transformGizmo->setTransformSelection(selectedEntities);
-                                
-                SceneMesh *sceneMesh = dynamic_cast<SceneMesh*>(targetEntity);
-                if(sceneMesh) {
-                    sceneMesh->overlayWireframe = true;
-                }
+                selectEntity(targetEntity);
             }
         }
     }
 }
 
+void EntityEditorMainView::selectEntity(Entity *targetEntity) {
+    for(int i=0; i < selectedEntities.size(); i++) {
+        SceneMesh *sceneMesh = dynamic_cast<SceneMesh*>(selectedEntities[i]);
+        if(sceneMesh) {
+            sceneMesh->overlayWireframe = false;
+        }
+    }
+    
+    selectedEntities.clear();
+    selectedEntities.push_back(targetEntity);
+    transformGizmo->setTransformSelection(selectedEntities);
+    dispatchEvent(new Event(), Event::CHANGE_EVENT);
+    
+    SceneMesh *sceneMesh = dynamic_cast<SceneMesh*>(targetEntity);
+    if(sceneMesh) {
+        sceneMesh->overlayWireframe = true;
+    }
+    
+}
+
 EntityEditorMainView::~EntityEditorMainView() {
 	
 }
-			
+
 void EntityEditorMainView::Resize(Number width, Number height) {
 	headerBg->Resize(width, 30);
 	
@@ -191,11 +247,31 @@ void EntityEditorMainView::Resize(Number width, Number height) {
 }
 
 PolycodeEntityEditor::PolycodeEntityEditor() : PolycodeEditor(true){
-	mainSizer = new UIHSizer(300, 300, 200, false);
+	mainSizer = new UIHSizer(300, 300, 300, false);
 	addChild(mainSizer);
 	
 	mainView = new EntityEditorMainView();
+    mainView->addEventListener(this, Event::CHANGE_EVENT);
 	mainSizer->addLeftChild(mainView);
+    
+    rightSizer = new UIVSizer(10, 10, 150, true);
+    mainSizer->addRightChild(rightSizer);
+    
+    propertyView = new EntityEditorPropertyView();
+    rightSizer->addBottomChild(propertyView);
+}
+
+void PolycodeEntityEditor::handleEvent(Event *event) {
+    
+    if(event->getDispatcher() == mainView) {
+        switch(event->getEventCode()) {
+            case Event::CHANGE_EVENT:
+                propertyView->setEntity(mainView->getSelectedEntity());
+            break;
+        }
+    }
+    
+    PolycodeEditor::handleEvent(event);
 }
 
 PolycodeEntityEditor::~PolycodeEntityEditor() {

+ 82 - 28
IDE/Contents/Source/PolycodeProps.cpp

@@ -323,7 +323,6 @@ PropProp::PropProp(String caption, String type) : UIElement() {
 	suppressChangeEvent = false;
 	propType = type;
 	label = new UILabel(caption, 12);
-	label->color.a = 1.0;
 	label->setPosition(0, 5);
 	addChild(label);
 	
@@ -2039,6 +2038,63 @@ void ShaderTexturesSheet::setShader(Shader *shader, Material *material, ShaderBi
 	Resize(getWidth(), getHeight());
 }
 
+MaterialPropSheet::MaterialPropSheet() : PropSheet("MATERIAL", "material") {
+    materialProp = new ComboProp("Material");
+    addProp(materialProp);
+    
+    propHeight = 70;
+    enabled = false;
+}
+
+MaterialPropSheet::~MaterialPropSheet() {
+    
+}
+
+void MaterialPropSheet::setSceneMesh(SceneMesh *sceneMesh) {
+    this->sceneMesh = sceneMesh;
+    
+    if(sceneMesh) {
+        enabled = true;
+        reloadMaterials();
+    } else {
+        enabled = false;
+    }
+}
+
+void MaterialPropSheet::reloadMaterials() {
+
+	Resource *selectedMaterial = NULL;
+    
+    selectedMaterial = NULL;
+    if(sceneMesh) {
+        selectedMaterial = (Resource*)sceneMesh->getMaterial();
+    }
+		
+	materialProp->comboEntry->clearItems();
+	std::vector<Resource*> materials = CoreServices::getInstance()->getResourceManager()->getResources(Resource::RESOURCE_MATERIAL);
+	for(int i=0; i < materials.size(); i++) {
+        if(((Material*)materials[i])->screenMaterial) {
+            continue;
+        }
+		materialProp->comboEntry->addComboItem(materials[i]->getResourceName(), (void*) materials[i]);
+		if(selectedMaterial == materials[i]) {
+			materialProp->comboEntry->setSelectedIndex(i);
+		}
+	}
+}
+
+void MaterialPropSheet::handleEvent(Event *event) {
+    if(!sceneMesh) {
+        PropSheet::handleEvent(event);
+        return;
+    }
+        
+    if(event->getDispatcher() == materialProp  && event->getEventCode() == Event::CHANGE_EVENT) {
+        Material *newMaterial = (Material*)materialProp->comboEntry->getSelectedItem()->data;
+        sceneMesh->setMaterial(newMaterial);
+    }
+    PropSheet::handleEvent(event);
+}
 
 EntitySheet::EntitySheet() : PropSheet("ENTITY", "entity"){
 	idProp = new StringProp("ID");
@@ -2052,7 +2108,8 @@ EntitySheet::EntitySheet() : PropSheet("ENTITY", "entity"){
 	
 	blendingProp = new ComboProp("Blend mode");
 	addProp(blendingProp);
-	
+
+    blendingProp->comboEntry->addComboItem("None");
 	blendingProp->comboEntry->addComboItem("Normal");
 	blendingProp->comboEntry->addComboItem("Lighten");
 	blendingProp->comboEntry->addComboItem("Color");
@@ -2062,7 +2119,7 @@ EntitySheet::EntitySheet() : PropSheet("ENTITY", "entity"){
 	propHeight = 160;
 	
 	entity = NULL;
-	lastEntity = NULL;
+    enabled = false;
 }
 
 EntitySheet::~EntitySheet() {
@@ -2101,31 +2158,28 @@ void EntitySheet::handleEvent(Event *event) {
 	PropSheet::handleEvent(event);	
 }
 
-void EntitySheet::Update() {
-	if(entity) {
-		
-		enabled = true;
-		
-		if(entity != lastEntity) {	
-			idProp->set(entity->id);			
-			
-			String tagString = "";
-			for(int i=0; i < entity->getNumTags(); i++) {
-				if(i != 0) {
-					tagString += ",";
-				}
-				tagString += entity->getTagAtIndex(i);
-			}
-			tagProp->set(tagString);
-			
-			colorProp->set(entity->color);			
-			blendingProp->set(entity->blendingMode);
-			
-			lastEntity = entity;			
-		}
-	} else {
-		enabled = false;
-	}
+
+void EntitySheet::setEntity(Entity *entity) {
+    this->entity = entity;
+    if(entity) {
+        idProp->set(entity->id);
+        
+        String tagString = "";
+        for(int i=0; i < entity->getNumTags(); i++) {
+            if(i != 0) {
+                tagString += ",";
+            }
+            tagString += entity->getTagAtIndex(i);
+        }
+        tagProp->set(tagString);
+        
+        colorProp->set(entity->color);
+        blendingProp->set(entity->blendingMode);
+        
+        enabled = true;
+    } else {
+        enabled = false;
+    }
 }
 
 SceneSpriteSheet::SceneSpriteSheet() : PropSheet("SCREEN SPRITE", "SceneSprite") {

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است