mirror of
https://github.com/azahar-emu/azahar.git
synced 2025-04-28 13:47:59 +03:00
citra_room: Merge functionality into citra_meta
This commit is contained in:
parent
e90930b0b9
commit
2670b517e8
6 changed files with 48 additions and 21 deletions
|
@ -118,6 +118,9 @@ endif()
|
|||
if (ENABLE_QT_TRANSLATION)
|
||||
add_definitions(-DENABLE_QT_TRANSLATION)
|
||||
endif()
|
||||
if (ENABLE_ROOM)
|
||||
add_definitions(-DENABLE_ROOM)
|
||||
endif()
|
||||
if (ENABLE_SDL2_FRONTEND)
|
||||
add_definitions(-DENABLE_SDL2_FRONTEND)
|
||||
endif()
|
||||
|
@ -484,10 +487,6 @@ if (NOT ANDROID AND NOT IOS)
|
|||
elseif (ENABLE_SDL2_FRONTEND)
|
||||
bundle_target(citra_meta)
|
||||
endif()
|
||||
|
||||
if (ENABLE_ROOM)
|
||||
bundle_target(citra_room)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Installation instructions
|
||||
|
|
|
@ -52,6 +52,10 @@ if (ENABLE_QT)
|
|||
target_link_libraries(citra_meta PRIVATE Boost::boost Qt6::Widgets)
|
||||
endif()
|
||||
|
||||
if (ENABLE_ROOM)
|
||||
target_link_libraries(citra_meta PRIVATE citra_room)
|
||||
endif()
|
||||
|
||||
if (ENABLE_QT AND UNIX AND NOT APPLE)
|
||||
target_link_libraries(citra_meta PRIVATE Qt6::DBus gamemode)
|
||||
endif()
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright Citra Emulator Project / Lime3DS Emulator Project
|
||||
// Copyright Citra Emulator Project / Azahar Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
|
@ -7,6 +7,9 @@
|
|||
#ifdef ENABLE_QT
|
||||
#include "citra_qt/citra_qt.h"
|
||||
#endif
|
||||
#ifdef ENABLE_ROOM
|
||||
#include "citra_room/citra_room.h"
|
||||
#endif
|
||||
#ifdef ENABLE_SDL2_FRONTEND
|
||||
#include "citra_sdl/citra_sdl.h"
|
||||
#endif
|
||||
|
@ -19,6 +22,20 @@ __declspec(dllexport) unsigned long NvOptimusEnablement = 0x00000001;
|
|||
#endif
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
#if ENABLE_ROOM
|
||||
bool launch_room = false;
|
||||
for (int i = 1; i < argc; i++) {
|
||||
if (strcmp(argv[i], "--room") == 0) {
|
||||
launch_room = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (launch_room) {
|
||||
LaunchRoom(argc, argv);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if ENABLE_QT
|
||||
bool no_gui = false;
|
||||
for (int i = 1; i < argc; i++) {
|
||||
|
@ -42,4 +59,4 @@ int main(int argc, char* argv[]) {
|
|||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/CMakeModules)
|
||||
|
||||
add_executable(citra_room
|
||||
add_library(citra_room STATIC EXCLUDE_FROM_ALL
|
||||
precompiled_headers.h
|
||||
citra_room.cpp
|
||||
citra_room.h
|
||||
citra_room.rc
|
||||
)
|
||||
|
||||
set_target_properties(citra_room PROPERTIES OUTPUT_NAME "azahar-room")
|
||||
|
||||
create_target_directory_groups(citra_room)
|
||||
|
||||
target_link_libraries(citra_room PRIVATE citra_common network)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2017 Citra Emulator Project
|
||||
// Copyright Citra Emulator Project / Azahar Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
|
@ -161,7 +161,7 @@ static void InitializeLogging(const std::string& log_file) {
|
|||
}
|
||||
|
||||
/// Application entry point
|
||||
int main(int argc, char** argv) {
|
||||
void LaunchRoom(int argc, char** argv) {
|
||||
Common::DetachedTasks detached_tasks;
|
||||
int option_index = 0;
|
||||
char* endarg;
|
||||
|
@ -199,6 +199,8 @@ int main(int argc, char** argv) {
|
|||
// Removed options
|
||||
{"preferred-game", optional_argument, 0, 'g'},
|
||||
{"preferred-game-id", optional_argument, 0, 0},
|
||||
// Entry option
|
||||
{"room", 0, 0, 0},
|
||||
|
||||
{0, 0, 0, 0},
|
||||
};
|
||||
|
@ -248,17 +250,17 @@ int main(int argc, char** argv) {
|
|||
break;
|
||||
case 'h':
|
||||
PrintHelp(argv[0]);
|
||||
return 0;
|
||||
exit(0);
|
||||
case 'v':
|
||||
PrintVersion();
|
||||
return 0;
|
||||
exit(0);
|
||||
case 'g':
|
||||
PrintRemovedOptionWarning(argv[0], "--preferred-game/-g");
|
||||
return 255;
|
||||
exit(255);
|
||||
case 0:
|
||||
if (strcmp(long_options[option_index].name, "preferred-game-id") == 0) {
|
||||
PrintRemovedOptionWarning(argv[0], "--preferred-game-id");
|
||||
return 255;
|
||||
exit(255);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -267,12 +269,12 @@ int main(int argc, char** argv) {
|
|||
if (room_name.empty()) {
|
||||
std::cout << "room name is empty!\n\n";
|
||||
PrintHelp(argv[0]);
|
||||
return -1;
|
||||
exit(-1);
|
||||
}
|
||||
if (preferred_game.empty()) {
|
||||
std::cout << "preferred application is empty!\n\n";
|
||||
PrintHelp(argv[0]);
|
||||
return -1;
|
||||
exit(-1);
|
||||
}
|
||||
if (preferred_game_id == 0) {
|
||||
std::cout
|
||||
|
@ -283,12 +285,12 @@ int main(int argc, char** argv) {
|
|||
std::cout << "max_members needs to be in the range 2 - "
|
||||
<< Network::MaxConcurrentConnections << "!\n\n";
|
||||
PrintHelp(argv[0]);
|
||||
return -1;
|
||||
exit(-1);
|
||||
}
|
||||
if (port > 65535) {
|
||||
std::cout << "port needs to be in the range 0 - 65535!\n\n";
|
||||
PrintHelp(argv[0]);
|
||||
return -1;
|
||||
exit(-1);
|
||||
}
|
||||
if (ban_list_file.empty()) {
|
||||
std::cout << "Ban list file not set!\nThis should get set to load and save room ban "
|
||||
|
@ -350,7 +352,7 @@ int main(int argc, char** argv) {
|
|||
preferred_game, preferred_game_id, std::move(verify_backend), ban_list,
|
||||
enable_citra_mods)) {
|
||||
std::cout << "Failed to create room: \n\n";
|
||||
return -1;
|
||||
exit(-1);
|
||||
}
|
||||
std::cout << "Room is open. Close with Q+Enter...\n\n";
|
||||
auto announce_session = std::make_unique<Network::AnnounceMultiplayerSession>();
|
||||
|
@ -377,5 +379,4 @@ int main(int argc, char** argv) {
|
|||
}
|
||||
Network::Shutdown();
|
||||
detached_tasks.WaitForAllTasks();
|
||||
return 0;
|
||||
}
|
||||
|
|
7
src/citra_room/citra_room.h
Normal file
7
src/citra_room/citra_room.h
Normal file
|
@ -0,0 +1,7 @@
|
|||
// Copyright Citra Emulator Project / Azahar Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
void LaunchRoom(int argc, char** argv);
|
Loading…
Add table
Add a link
Reference in a new issue