From 5b7da978d1944a5bdb16e60232aead38f80eefc7 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Sat, 12 Jul 2014 04:29:12 -0700 Subject: [PATCH] Remove project name strings from the code --- CMakeLists.txt | 2 ++ src/debugger/cli-debugger.c | 2 +- src/platform/sdl/gl-main.c | 2 +- src/platform/sdl/sw-main.c | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 53211cd7f..59ef51cec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,6 +19,8 @@ include_directories(${CMAKE_SOURCE_DIR}/src/arm) include_directories(${CMAKE_SOURCE_DIR}/src/gba) include_directories(${CMAKE_SOURCE_DIR}/src) +add_definitions(-DBINARY_NAME="${BINARY_NAME}" -DPROJECT_NAME="${PROJECT_NAME}") + if(WIN32) add_definitions(-D_WIN32_WINNT=0x0600) set(OS_LIB "${OS_LIB};Ws2_32") diff --git a/src/debugger/cli-debugger.c b/src/debugger/cli-debugger.c index 0aa7a7b3c..531260be2 100644 --- a/src/debugger/cli-debugger.c +++ b/src/debugger/cli-debugger.c @@ -732,7 +732,7 @@ static unsigned char _tabComplete(EditLine* elstate, int ch) { static void _cliDebuggerInit(struct ARMDebugger* debugger) { struct CLIDebugger* cliDebugger = (struct CLIDebugger*) debugger; // TODO: get argv[0] - cliDebugger->elstate = el_init("gbac", stdin, stdout, stderr); + cliDebugger->elstate = el_init(BINARY_NAME, stdin, stdout, stderr); el_set(cliDebugger->elstate, EL_PROMPT, _prompt); el_set(cliDebugger->elstate, EL_EDITOR, "emacs"); diff --git a/src/platform/sdl/gl-main.c b/src/platform/sdl/gl-main.c index a79a4cdb0..e5fce9644 100644 --- a/src/platform/sdl/gl-main.c +++ b/src/platform/sdl/gl-main.c @@ -139,7 +139,7 @@ static int _GBASDLInit(struct GLSoftwareRenderer* renderer) { #endif #if SDL_VERSION_ATLEAST(2, 0, 0) - renderer->window = SDL_CreateWindow("GBAc", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, renderer->viewportWidth, renderer->viewportHeight, SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE | (SDL_WINDOW_FULLSCREEN_DESKTOP * renderer->events.fullscreen)); + renderer->window = SDL_CreateWindow(PROJECT_NAME, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, renderer->viewportWidth, renderer->viewportHeight, SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE | (SDL_WINDOW_FULLSCREEN_DESKTOP * renderer->events.fullscreen)); SDL_GL_CreateContext(renderer->window); SDL_GetWindowSize(renderer->window, &renderer->viewportWidth, &renderer->viewportHeight); renderer->events.window = renderer->window; diff --git a/src/platform/sdl/sw-main.c b/src/platform/sdl/sw-main.c index 93194fa9b..ff8bab550 100644 --- a/src/platform/sdl/sw-main.c +++ b/src/platform/sdl/sw-main.c @@ -79,7 +79,7 @@ int main(int argc, char** argv) { #if SDL_VERSION_ATLEAST(2, 0, 0) renderer.events.fullscreen = graphicsOpts.fullscreen; - renderer.window = SDL_CreateWindow("GBAc", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, renderer.viewportWidth, renderer.viewportHeight, SDL_WINDOW_OPENGL | (SDL_WINDOW_FULLSCREEN_DESKTOP * renderer.events.fullscreen)); + renderer.window = SDL_CreateWindow(PROJECT_NAME, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, renderer.viewportWidth, renderer.viewportHeight, SDL_WINDOW_OPENGL | (SDL_WINDOW_FULLSCREEN_DESKTOP * renderer.events.fullscreen)); SDL_GetWindowSize(renderer.window, &renderer.viewportWidth, &renderer.viewportHeight); renderer.events.window = renderer.window; renderer.sdlRenderer = SDL_CreateRenderer(renderer.window, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);