Explorar o código

More const methods.

Cameron Hart %!s(int64=14) %!d(string=hai) anos
pai
achega
77b46c7ef9
Modificáronse 2 ficheiros con 10 adicións e 10 borrados
  1. 7 7
      Core/Contents/Include/PolyScreen.h
  2. 3 3
      Core/Contents/Source/PolyScreen.cpp

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

@@ -73,7 +73,7 @@ namespace Polycode {
 		* Returns the screen's offset.
 		* Returns the screen's offset.
 		* @return The screen's offset as 2d vector.
 		* @return The screen's offset as 2d vector.
 		*/		
 		*/		
-		Vector2 getScreenOffset();
+		Vector2 getScreenOffset() const;
 				
 				
 		virtual void Shutdown();
 		virtual void Shutdown();
 		virtual void Update();
 		virtual void Update();
@@ -105,7 +105,7 @@ namespace Polycode {
 		void clearScreenShader();
 		void clearScreenShader();
 		
 		
 		void handleEvent(Event *event);
 		void handleEvent(Event *event);
-		int getHighestZIndex();
+		int getHighestZIndex() const;
 		
 		
 		/**
 		/**
 		* Sorts the screen's children based on their z index.
 		* Sorts the screen's children based on their z index.
@@ -119,11 +119,11 @@ namespace Polycode {
 		/**
 		/**
 		* Returns true if the screen has a shader applied to it.
 		* Returns true if the screen has a shader applied to it.
 		*/				
 		*/				
-		bool hasFilterShader();
+		bool hasFilterShader() const;
 		void drawFilter();
 		void drawFilter();
 		
 		
-		bool usesNormalizedCoordinates() { return useNormalizedCoordinates; }
-		Number getYCoordinateSize() { return yCoordinateSize; }	
+		bool usesNormalizedCoordinates() const { return useNormalizedCoordinates; }
+		Number getYCoordinateSize() const { return yCoordinateSize; }
 		
 		
 		/**
 		/**
 		* Returns the root entity. The root entity can be used to transform the entire screen and change its color.
 		* Returns the root entity. The root entity can be used to transform the entire screen and change its color.
@@ -139,12 +139,12 @@ namespace Polycode {
 		/**
 		/**
 		* Returns the local shader options for the camera post processing material.
 		* Returns the local shader options for the camera post processing material.
 		*/				
 		*/				
-		vector<ShaderBinding*> getLocalShaderOptions() { return localShaderOptions; }
+		const vector<ShaderBinding*>& getLocalShaderOptions() const { return localShaderOptions; }
 		
 		
 		/**
 		/**
 		* Returns the shader material applied to the camera.
 		* Returns the shader material applied to the camera.
 		*/					
 		*/					
-		Material *getScreenShaderMaterial() { return filterShaderMaterial; }
+		Material *getScreenShaderMaterial() const { return filterShaderMaterial; }
 		
 		
 	protected:
 	protected:
 		
 		

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

@@ -92,11 +92,11 @@ void Screen::setScreenOffset(Number x, Number y) {
 	offset.y = y;
 	offset.y = y;
 }
 }
 
 
-Vector2 Screen::getScreenOffset() {
+Vector2 Screen::getScreenOffset() const {
 	return offset;
 	return offset;
 }
 }
 
 
-int Screen::getHighestZIndex() {
+int Screen::getHighestZIndex() const {
 	int highestZ = 1;
 	int highestZ = 1;
 	for(int i=0; i<children.size();i++) {
 	for(int i=0; i<children.size();i++) {
 		if(children[i]->zindex > highestZ)
 		if(children[i]->zindex > highestZ)
@@ -227,7 +227,7 @@ void Screen::drawFilter() {
 	
 	
 }
 }
 
 
-bool Screen::hasFilterShader() {
+bool Screen::hasFilterShader() const {
 	return _hasFilterShader;
 	return _hasFilterShader;
 }
 }