From e61368bc733af032ce7ea1a70e760dfb19ae6a58 Mon Sep 17 00:00:00 2001 From: cinnaboot Date: Sat, 7 Jul 2018 19:32:36 -0400 Subject: [PATCH] remove unneeded use of std::string --- src/hexgame.cpp | 3 +-- src/renderer.h | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/hexgame.cpp b/src/hexgame.cpp index b3fc550..2bb8810 100644 --- a/src/hexgame.cpp +++ b/src/hexgame.cpp @@ -11,7 +11,6 @@ #define CONE_ANGLE 30 -#include #include #if defined(_WIN32) @@ -491,7 +490,7 @@ int main(int argc, char* argv[]) } // pre-load textures - std::string path = "../data/coords.layout.flat.png"; + const char * path = "../data/coords.layout.flat.png"; if (!addTexture(handles, path)) { LOG(ERROR) << "Error adding " << path << "\n"; diff --git a/src/renderer.h b/src/renderer.h index b96ccb6..5101300 100644 --- a/src/renderer.h +++ b/src/renderer.h @@ -121,7 +121,7 @@ camera g_camera; // Interface bool initRenderer(SDL_Handles &handles, v2i vpDims); -bool addTexture(SDL_Handles &handles, std::string path); +bool addTexture(SDL_Handles &handles, const char * path); bool createScene(std::vector* hexes); void moveCamera(bool up, bool left, bool down, bool right, bool forward, bool backward); void rollCamera(bool CW, bool CCW); @@ -217,11 +217,11 @@ initRenderer(SDL_Handles &handles, v2i vpDims) } bool -addTexture(SDL_Handles &handles, std::string path) +addTexture(SDL_Handles &handles, const char * path) { // testing LOG(INFO) << "Loading image: " << path << "\n"; - SDL_Surface* image = IMG_Load(path.c_str()); + SDL_Surface* image = IMG_Load(path); if (!image) {