Skip to content

Commit

Permalink
#1269: fixed console output for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
nesbox committed Dec 16, 2020
1 parent 662d266 commit 1ae0545
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
11 changes: 2 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -740,12 +740,6 @@ if(BUILD_SDL)
configure_file("${PROJECT_SOURCE_DIR}/build/windows/tic80.rc.in" "${PROJECT_SOURCE_DIR}/build/windows/tic80.rc")
set(TIC80_SRC ${TIC80_SRC} "${PROJECT_SOURCE_DIR}/build/windows/tic80.rc")

# Debug build is a console app.
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
else()
set(SYSTEM_TYPE WIN32)
endif()

add_executable(tic80 ${SYSTEM_TYPE} ${TIC80_SRC})

elseif(ANDROID)
Expand Down Expand Up @@ -827,11 +821,10 @@ if(BUILD_SOKOL)
configure_file("${PROJECT_SOURCE_DIR}/build/windows/tic80.rc.in" "${PROJECT_SOURCE_DIR}/build/windows/tic80.rc")
set(TIC80_SRC ${TIC80_SRC} "${PROJECT_SOURCE_DIR}/build/windows/tic80.rc")

add_executable(tic80-sokol WIN32 ${TIC80_SRC})
else()
add_executable(tic80-sokol ${TIC80_SRC})
endif()

add_executable(tic80-sokol ${TIC80_SRC})

target_include_directories(tic80-sokol PRIVATE
${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/src
Expand Down
5 changes: 5 additions & 0 deletions src/system/sdl/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1760,6 +1760,11 @@ static s32 emsStart(s32 argc, char **argv, const char* folder)

s32 main(s32 argc, char **argv)
{
#if defined(__TIC_WINDOWS__)
if (argc == 1)
FreeConsole();
#endif

const char* folder = getAppFolder();

#if defined(__EMSCRIPTEN__)
Expand Down
5 changes: 5 additions & 0 deletions src/system/sokol/sokol.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,11 @@ static void app_cleanup(void)

sapp_desc sokol_main(s32 argc, char* argv[])
{
#if defined(__TIC_WINDOWS__)
if (argc == 1)
FreeConsole();
#endif

memset(&platform, 0, sizeof platform);

platform.audio.desc.num_channels = TIC_STEREO_CHANNELS;
Expand Down

0 comments on commit 1ae0545

Please sign in to comment.