Skip to content

Commit 6ce908d

Browse files
committed
chore: rebrand libswitch to SimCore
1 parent 7d624c5 commit 6ce908d

4 files changed

Lines changed: 25 additions & 19 deletions

File tree

CMakeLists.txt

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.21)
2-
project(libswitch C)
2+
project(simcore C)
33

44
set(CMAKE_C_STANDARD 17)
55

@@ -19,15 +19,15 @@ add_definitions(
1919
)
2020

2121
# Include source code
22-
add_library(libswitch
23-
${CMAKE_CURRENT_SOURCE_DIR}/libswitch.c
24-
${CMAKE_CURRENT_SOURCE_DIR}/libswitch.h
22+
add_library(simcore
23+
${CMAKE_CURRENT_SOURCE_DIR}/src/manips.c
24+
${CMAKE_CURRENT_SOURCE_DIR}/src/simcore/manips.h
2525
)
2626

27-
# Include directories for both libswitch & its dependencies
28-
target_include_directories(libswitch
27+
# Include directories for both SimCore & its dependencies
28+
target_include_directories(simcore
2929
PUBLIC
30-
${CMAKE_CURRENT_SOURCE_DIR}
30+
${CMAKE_CURRENT_SOURCE_DIR}/src
3131

3232
PRIVATE
3333
${CMAKE_CURRENT_SOURCE_DIR}/deps/XPSDK/CHeaders/XPLM
@@ -43,35 +43,37 @@ if (WIN32)
4343
)
4444

4545
# Libraries to link
46-
target_link_libraries(libswitch
46+
target_link_libraries(simcore
47+
${LINK_LIBRARIES}
4748
${CMAKE_CURRENT_SOURCE_DIR}/deps/XPSDK/Libraries/Win/XPLM_64.lib
4849
${CMAKE_CURRENT_SOURCE_DIR}/deps/XPSDK/Libraries/Win/XPWidgets_64.lib
4950
)
5051

5152
# Output Directory
52-
set_target_properties(libswitch PROPERTIES
53+
set_target_properties(simcore PROPERTIES
5354
ARCHIVE_OUTPUT_DIRECTORY ./build/win
5455
)
5556
elseif (APPLE)
5657
# Compiler Definitions
5758
add_definitions(-DAPL)
5859

5960
# Libraries to link
60-
target_link_libraries(libswitch
61+
target_link_libraries(simcore
62+
${LINK_LIBRARIES}
6163
${CMAKE_CURRENT_SOURCE_DIR}/deps/XPSDK/Libraries/Mac/XPLM.framework
6264
${CMAKE_CURRENT_SOURCE_DIR}/deps/XPSDK/Libraries/Mac/XPWidgets.framework
6365
)
6466

6567
# Output Directory
66-
set_target_properties(libswitch PROPERTIES
68+
set_target_properties(simcore PROPERTIES
6769
ARCHIVE_OUTPUT_DIRECTORY ./build/mac
6870
)
6971
else ()
7072
# Compiler Definitions
7173
add_definitions(-DLIN)
7274

7375
# Output Directory
74-
set_target_properties(libswitch PROPERTIES
76+
set_target_properties(simcore PROPERTIES
7577
ARCHIVE_OUTPUT_DIRECTORY ./build/lin
7678
)
7779
endif ()

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# libswitch
2-
libswitch is a WIP WIP WIP library to handle the registration of cockpit switches in X-Plane, complete with animation datarefs.
1+
# SimCore
2+
SimCore is an internal solution with common functions across SimSolution's X-Plane projects.
33

4-
You probably don't want to use this.
4+
The project currently consists of the following:
5+
* [manips.h](src/simcore/manips.h), formerly the open-source **libswitch**, which handles callbacks for switch manipulators and animation datarefs.
6+
7+
In the future, the project plans to include:
8+
* [persist.h](src/simcore/persist.h), a continuation of the persistence system first introduced in the DA40.

libswitch.c renamed to src/manips.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "libswitch.h"
1+
#include "simcore/manips.h"
22

33
#include <assert.h>
44
#include <stdlib.h>
@@ -89,7 +89,7 @@ int sw_multi_r_cb(XPLMCommandRef inCommand, XPLMCommandPhase inPhase, void *inRe
8989
}
9090

9191
// Refresh all animation datarefs
92-
void sw_ref() {
92+
void sw_ref(void) {
9393
for (int i = 0; i < all_sw_size; i++) {
9494
if (all_sw[i].act_gain != 0) {
9595
all_sw[i].anim_pos += all_sw[i].act_gain;
@@ -144,7 +144,7 @@ double sw_multi_get_anim(void *inRefcon) {
144144
return all_sw[(int)inRefcon].anim_pos;
145145
}
146146

147-
switch_t sw_init() {
147+
switch_t sw_init(void) {
148148
int idx;
149149
if (all_sw == NULL) {
150150
// Allocate initial memory if the array doesn't already exist
@@ -377,7 +377,7 @@ switch_t sw_multi_init(const char *dr_name, const char *dr_anim_name, const char
377377
return idx;
378378
}
379379

380-
void sw_destroy() {
380+
void sw_destroy(void) {
381381
// Unregister all commands
382382
for (int i = 0; i < all_sw_size; i++) {
383383
switch (all_sw[i].type) {
File renamed without changes.

0 commit comments

Comments
 (0)