Browse Source

remove unneeded use of std::string

master
cinnaboot 8 years ago
parent
commit
e61368bc73
  1. 3
      src/hexgame.cpp
  2. 6
      src/renderer.h

3
src/hexgame.cpp

@ -11,7 +11,6 @@
#define CONE_ANGLE 30 #define CONE_ANGLE 30
#include <string>
#include <vector> #include <vector>
#if defined(_WIN32) #if defined(_WIN32)
@ -491,7 +490,7 @@ int main(int argc, char* argv[])
} }
// pre-load textures // pre-load textures
std::string path = "../data/coords.layout.flat.png"; const char * path = "../data/coords.layout.flat.png";
if (!addTexture(handles, path)) if (!addTexture(handles, path))
{ {
LOG(ERROR) << "Error adding " << path << "\n"; LOG(ERROR) << "Error adding " << path << "\n";

6
src/renderer.h

@ -121,7 +121,7 @@ camera g_camera;
// Interface // Interface
bool initRenderer(SDL_Handles &handles, v2i vpDims); 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<hex_info>* hexes); bool createScene(std::vector<hex_info>* hexes);
void moveCamera(bool up, bool left, bool down, bool right, bool forward, bool backward); void moveCamera(bool up, bool left, bool down, bool right, bool forward, bool backward);
void rollCamera(bool CW, bool CCW); void rollCamera(bool CW, bool CCW);
@ -217,11 +217,11 @@ initRenderer(SDL_Handles &handles, v2i vpDims)
} }
bool bool
addTexture(SDL_Handles &handles, std::string path) addTexture(SDL_Handles &handles, const char * path)
{ {
// testing // testing
LOG(INFO) << "Loading image: " << path << "\n"; LOG(INFO) << "Loading image: " << path << "\n";
SDL_Surface* image = IMG_Load(path.c_str()); SDL_Surface* image = IMG_Load(path);
if (!image) if (!image)
{ {

Loading…
Cancel
Save