diff --git a/src/GameEngine.cpp b/src/GameEngine.cpp index 68c3f8e..aa433a6 100644 --- a/src/GameEngine.cpp +++ b/src/GameEngine.cpp @@ -123,21 +123,11 @@ GameEngine::GameEngine(const McRogueFaceConfig& cfg) !config.python_mode; if (should_load_game) { - std::cerr << "[DEBUG] GameEngine: loading default game.py" << std::endl; - std::cerr.flush(); if (!Py_IsInitialized()) { - std::cerr << "[DEBUG] GameEngine: initializing Python API" << std::endl; - std::cerr.flush(); McRFPy_API::api_init(); } - std::cerr << "[DEBUG] GameEngine: importing mcrfpy" << std::endl; - std::cerr.flush(); McRFPy_API::executePyString("import mcrfpy"); - std::cerr << "[DEBUG] GameEngine: executing scripts/game.py" << std::endl; - std::cerr.flush(); McRFPy_API::executeScript("scripts/game.py"); - std::cerr << "[DEBUG] GameEngine: game.py execution complete" << std::endl; - std::cerr.flush(); } // Note: --exec scripts are NOT executed here. diff --git a/src/McRFPy_API.cpp b/src/McRFPy_API.cpp index 292236d..94e2c85 100644 --- a/src/McRFPy_API.cpp +++ b/src/McRFPy_API.cpp @@ -699,28 +699,18 @@ PyObject* PyInit_mcrfpy() // init_python - configure interpreter details here PyStatus init_python(const char *program_name) { - std::cerr << "[DEBUG] api_init: starting" << std::endl; - std::cerr.flush(); - PyStatus status; - //**preconfig to establish locale** + // Preconfig to establish locale PyPreConfig preconfig; PyPreConfig_InitIsolatedConfig(&preconfig); preconfig.utf8_mode = 1; - std::cerr << "[DEBUG] api_init: Py_PreInitialize" << std::endl; - std::cerr.flush(); - status = Py_PreInitialize(&preconfig); if (PyStatus_Exception(status)) { - std::cerr << "[DEBUG] api_init: PreInit failed" << std::endl; Py_ExitStatusException(status); } - std::cerr << "[DEBUG] api_init: PyConfig setup" << std::endl; - std::cerr.flush(); - PyConfig config; PyConfig_InitIsolatedConfig(&config); config.dev_mode = 0; @@ -731,9 +721,6 @@ PyStatus init_python(const char *program_name) config.configure_c_stdio = 1; #ifdef __EMSCRIPTEN__ - std::cerr << "[DEBUG] api_init: WASM path config" << std::endl; - std::cerr.flush(); - // WASM: Use absolute paths in virtual filesystem PyConfig_SetString(&config, &config.executable, L"/mcrogueface"); PyConfig_SetString(&config, &config.home, L"/lib/python3.14"); @@ -814,18 +801,11 @@ PyStatus init_python(const char *program_name) PyStatus McRFPy_API::init_python_with_config(const McRogueFaceConfig& config) { - std::cerr << "[DEBUG] init_python_with_config: starting" << std::endl; - std::cerr.flush(); - // If Python is already initialized, just return success if (Py_IsInitialized()) { - std::cerr << "[DEBUG] init_python_with_config: already initialized" << std::endl; return PyStatus_Ok(); } - std::cerr << "[DEBUG] init_python_with_config: PyConfig_InitIsolatedConfig" << std::endl; - std::cerr.flush(); - PyStatus status; PyConfig pyconfig; PyConfig_InitIsolatedConfig(&pyconfig); diff --git a/src/platform/SDL2Renderer.cpp b/src/platform/SDL2Renderer.cpp index 1968ed4..3ed9a13 100644 --- a/src/platform/SDL2Renderer.cpp +++ b/src/platform/SDL2Renderer.cpp @@ -377,16 +377,9 @@ void SDL2Renderer::setProjection(float left, float right, float bottom, float to projectionMatrix_[15] = 1.0f; } -static int clearCount = 0; void SDL2Renderer::clear(float r, float g, float b, float a) { glClearColor(r, g, b, a); glClear(GL_COLOR_BUFFER_BIT); - - // Debug: Log first few clears to confirm render loop is running - if (clearCount < 5) { - std::cout << "SDL2Renderer::clear(" << r << ", " << g << ", " << b << ", " << a << ") #" << clearCount << std::endl; - clearCount++; - } } void SDL2Renderer::pushRenderState(unsigned int width, unsigned int height) { @@ -466,22 +459,6 @@ void SDL2Renderer::drawTriangles(const float* vertices, size_t vertexCount, glBindTexture(GL_TEXTURE_2D, textureId); int texLoc = glGetUniformLocation(program, "u_texture"); glUniform1i(texLoc, 0); - - // Debug: verify texture binding for text shader - static int texBindDebug = 0; - if (texBindDebug < 2 && shaderType == ShaderType::Text) { - std::cout << "drawTriangles(Text): textureId=" << textureId - << " texLoc=" << texLoc << " program=" << program << std::endl; - texBindDebug++; - } - } else if (shaderType == ShaderType::Text) { - // This would explain solid boxes - texture not being bound! - static bool warnOnce = true; - if (warnOnce) { - std::cerr << "WARNING: Text shader used but texture not bound! texCoords=" - << (texCoords ? "valid" : "null") << " textureId=" << textureId << std::endl; - warnOnce = false; - } } // Draw @@ -541,8 +518,6 @@ void RenderWindow::create(VideoMode mode, const std::string& title, uint32_t sty // Set the canvas size explicitly before creating the window emscripten_set_canvas_element_size("#canvas", mode.width, mode.height); - - std::cout << "Emscripten: Setting canvas to " << mode.width << "x" << mode.height << std::endl; #endif // Create window @@ -605,37 +580,16 @@ void RenderWindow::create(VideoMode mode, const std::string& title, uint32_t sty // Set up OpenGL state glViewport(0, 0, mode.width, mode.height); - std::cout << "GL viewport set to " << mode.width << "x" << mode.height << std::endl; - - GLenum err = glGetError(); - if (err != GL_NO_ERROR) { - std::cerr << "GL error after viewport: " << err << std::endl; - } - SDL2Renderer::getInstance().setProjection(0, mode.width, mode.height, 0); // Enable blending for transparency glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - // Initial clear to a visible color to confirm GL is working - glClearColor(0.2f, 0.3f, 0.4f, 1.0f); // Blue-gray + // Initial clear + glClearColor(0.2f, 0.3f, 0.4f, 1.0f); glClear(GL_COLOR_BUFFER_BIT); - - err = glGetError(); - if (err != GL_NO_ERROR) { - std::cerr << "GL error after clear: " << err << std::endl; - } - SDL_GL_SwapWindow(window); - - err = glGetError(); - if (err != GL_NO_ERROR) { - std::cerr << "GL error after swap: " << err << std::endl; - } - - std::cout << "RenderWindow: Created " << mode.width << "x" << mode.height << " window" << std::endl; - std::cout << "WebGL context should now show blue-gray" << std::endl; } void RenderWindow::close() { @@ -1277,7 +1231,6 @@ bool Font::loadFromFile(const std::string& filename) { ftStroker_ = stroker; loaded_ = true; - std::cout << "Font: Loaded " << filename << " with FreeType" << std::endl; return true; } @@ -2129,10 +2082,6 @@ bool FontAtlas::load(const Font* font, float fontSize) { } textureId_ = SDL2Renderer::getInstance().createTexture(ATLAS_SIZE, ATLAS_SIZE, rgbaPixels.data()); - - std::cout << "FontAtlas: created " << ATLAS_SIZE << "x" << ATLAS_SIZE - << " atlas with " << simpleGlyphCache_.size() << " glyphs, textureId=" << textureId_ << std::endl; - return true; } @@ -2234,10 +2183,6 @@ bool FontAtlas::load(const unsigned char* fontData, size_t dataSize, float fontS } textureId_ = SDL2Renderer::getInstance().createTexture(ATLAS_SIZE, ATLAS_SIZE, rgbaPixels.data()); - - std::cout << "FontAtlas: created " << ATLAS_SIZE << "x" << ATLAS_SIZE - << " atlas with " << simpleGlyphCache_.size() << " glyphs, textureId=" << textureId_ << std::endl; - return true; }