From 7d1bc064d6290a56d202ff4c3fccc9c10c4f4dd2 Mon Sep 17 00:00:00 2001 From: Nick Gasson Date: Tue, 15 Jul 2008 20:44:41 +0100 Subject: [PATCH] Some more performance hacks --- src/AnimatedImage.hpp | 4 ++-- src/Makefile.am | 4 ++-- src/OpenGL.cpp | 2 +- src/Texture.hpp | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/AnimatedImage.hpp b/src/AnimatedImage.hpp index 45b935b..f77afde 100644 --- a/src/AnimatedImage.hpp +++ b/src/AnimatedImage.hpp @@ -30,8 +30,8 @@ public: void SetFrame(int f); int GetFrame() const; - int GetWidth() const { return frameWidth; } - int GetHeight() const { return frameHeight; } + int GetFrameWidth() const { return frameWidth; } + int GetFrameHeight() const { return frameHeight; } private: int FramesPerRow() const; int FramesPerCol() const; diff --git a/src/Makefile.am b/src/Makefile.am index f08faf8..aeb3248 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,7 +1,7 @@ bin_PROGRAMS = lander # Add -pg for profiling -AM_CXXFLAGS=$(LANDER_CFLAGS) $(SDL_CFLAGS) -Wall -pg +AM_CXXFLAGS=$(LANDER_CFLAGS) $(SDL_CFLAGS) -Wall AM_LDFLAGS=$(LANDER_LIBS) $(SDL_LIBS) -lGLU $(LTLIBINTL) lander_SOURCES = Main.cpp Game.hpp Game.cpp \ Font.cpp Font.hpp HighScores.cpp HighScores.hpp Input.cpp \ @@ -22,4 +22,4 @@ localedir = $(datadir)/locale # Add -DSHOW_FPS here to show FPS in title bar DEFS = -DLOCALEDIR=\"$(localedir)\" -DLINUX -DUNIX \ - -DDATADIR=\"$(pkgdatadir)\" @DEFS@ + -DDATADIR=\"$(pkgdatadir)\" -DSHOW_FPS @DEFS@ diff --git a/src/OpenGL.cpp b/src/OpenGL.cpp index ad06b06..c757804 100644 --- a/src/OpenGL.cpp +++ b/src/OpenGL.cpp @@ -290,10 +290,10 @@ bool OpenGL::InitGL() glShadeModel(GL_SMOOTH); // Enable smooth shading glClearColor(0.0f, 0.0f, 0.0f, 0.0f); // Black background glClearDepth(1.0f); // Depth buffer setup - glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); // Nicest perspective correction glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // Basic blending function glEnable(GL_ALPHA_TEST); // Enable alpha testing glAlphaFunc(GL_GREATER, 0.0); // Alpha testing function + glDisable(GL_NORMALIZE); // All went OK return true; diff --git a/src/Texture.hpp b/src/Texture.hpp index dd9786a..eddbd8e 100644 --- a/src/Texture.hpp +++ b/src/Texture.hpp @@ -27,8 +27,8 @@ public: GLuint GetGLTexture() const { return texture; } - virtual int GetWidth() const { return width; } - virtual int GetHeight() const { return height; } + int GetWidth() const { return width; } + int GetHeight() const { return height; } private: GLuint texture; -- 2.39.2