Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 59 additions & 34 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ endif ()
find_package(FMOD)

if(NOT FMOD_FOUND AND NOT WIN32)
set (CMAKE_CXX_FLAGS "-DDISABLE_SOUND ${CMAKE_CXX_FLAGS}")
set (CMAKE_CXX_FLAGS "-DDISABLE_SOUND ${CMAKE_CXX_FLAGS}")
set (FMOD_INCLUDE_DIR "")
set (FMOD_LIBRARY "")
endif()
Expand Down Expand Up @@ -110,79 +110,104 @@ endif()

if(WIN32)
file(GLOB FRONTEND_FILES
src/frontend/*.h
src/frontend/*.cpp
msvc/Skyscraper.rc
)
else()
file(GLOB FRONTEND_FILES
src/frontend/*.cpp
)
src/frontend/*.h
Comment thread
avrdude-t marked this conversation as resolved.
src/frontend/*.cpp
)
endif()

if(WIN32 AND wxWidgets_FOUND)
file(GLOB VM_FILES
src/vm/*.h
src/vm/*.cpp
src/gui/*.h
src/gui/*.cpp
src/editor/*.h
src/editor/*.cpp
msvc/VM.rc
)
else()
file(GLOB VM_FILES
src/vm/*.h
src/vm/*.cpp
msvc/VM.rc
)
endif()

if (NOT WIN32 AND wxWidgets_FOUND)
file(GLOB GUI_FILES
src/gui/*.h
src/gui/*.cpp
)
endif ()

file(GLOB EDITOR_FILES
src/editor/*.h
src/editor/*.cpp
)

file(GLOB NETWORK_FILES
src/net/*.h
src/net/*.cpp
)

file(GLOB SCRIPTPROC_FILES
src/script/*.h
src/script/*.cpp
)

file(GLOB SBS_FILES
src/sbs/*.h
src/sbs/*.cpp
src/sbs/polymesh/*.h
src/sbs/polymesh/*.cpp
src/sbs/controllers/*.h
src/sbs/controllers/*.cpp
src/sbs/objects/*.h
src/sbs/objects/*.cpp
src/sbs/system/*.h
src/sbs/system/*.cpp
msvc/SBS.rc
)

file(GLOB ALLOC_FILES
src/alloc/*.h
src/alloc/*.cpp
)

file(GLOB OPENXR_FILES
src/openxr/src/*.h
src/openxr/src/*.cpp
msvc/OpenXR.rc
)

file(GLOB OGREBULLET_COLL_FILES
ogrebullet/Collisions/src/*.h
ogrebullet/Collisions/src/*.cpp
ogrebullet/Collisions/src/Debug/*.h
ogrebullet/Collisions/src/Debug/*.cpp
ogrebullet/Collisions/src/Shapes/*.h
ogrebullet/Collisions/src/Shapes/*.cpp
ogrebullet/Collisions/src/Utils/*.h
ogrebullet/Collisions/src/Utils/*.cpp
)

file (GLOB OGREBULLET_DYN_FILES
ogrebullet/Dynamics/src/*.h
ogrebullet/Dynamics/src/*.cpp
ogrebullet/Dynamics/src/Constraints/*.h
ogrebullet/Dynamics/src/Constraints/*.cpp
ogrebullet/Dynamics/src/Prefab/*.h
ogrebullet/Dynamics/src/Prefab/*.cpp
)

file (GLOB IMGUIZMO_FILES
dependencies/ImGuizmo/*.h
dependencies/ImGuizmo/*.cpp
)

Expand Down Expand Up @@ -225,34 +250,34 @@ include_directories( ${OGRE_INCLUDE_DIRS}
)
else()
include_directories( ${OGRE_INCLUDE_DIRS}
${OGRE_Overlay_INCLUDE_DIRS}
${OGRE_RTShaderSystem_INCLUDE_DIRS}
${OGRE_Bites_INCLUDE_DIRS}
${GTK3_INCLUDE_DIRS}
${BULLET_INCLUDE_DIRS}
${Caelum_INCLUDE_DIRS}
${OpenXR_INCLUDE_DIR}
src/frontend
src/vm
src/net
src/sbs
${OGRE_Overlay_INCLUDE_DIRS}
${OGRE_RTShaderSystem_INCLUDE_DIRS}
${OGRE_Bites_INCLUDE_DIRS}
${GTK3_INCLUDE_DIRS}
${BULLET_INCLUDE_DIRS}
${Caelum_INCLUDE_DIRS}
${OpenXR_INCLUDE_DIR}
src/frontend
src/vm
src/net
src/sbs
src/sbs/polymesh
src/sbs/controllers
src/sbs/objects
src/sbs/system
src/script
src/gui
src/alloc
src/openxr/include
src/openxr
src/script
src/gui
src/alloc
src/openxr/include
src/openxr
src/editor
ogrebullet/Collisions/include
ogrebullet/Collisions/include/Debug
ogrebullet/Collisions/include/Shapes
ogrebullet/Collisions/include/Utils
ogrebullet/Dynamics/include
ogrebullet/Dynamics/include/Constraints
ogrebullet/Dynamics/include/Prefab
ogrebullet/Collisions/include
ogrebullet/Collisions/include/Debug
ogrebullet/Collisions/include/Shapes
ogrebullet/Collisions/include/Utils
ogrebullet/Dynamics/include
ogrebullet/Dynamics/include/Constraints
ogrebullet/Dynamics/include/Prefab
dependencies/ImGuizmo
dependencies/imgui
dependencies/angelscript/include
Expand Down Expand Up @@ -370,8 +395,8 @@ endif ()
if (NOT WIN32 AND NOT wxWidgets_FOUND)
target_link_libraries(ScriptProc SBS ${OGRE_LIBRARIES} ${wxWidgets_LIBRARIES})
target_link_libraries(Editor SBS ${OGRE_LIBRARIES})
target_link_libraries(VM SBS Network Editor dylib ${OGRE_LIBRARIES} ${Caelum_LIBRARIES} ${FMOD_LIBRARY} ${wxWidgets_LIBRARIES})
target_link_libraries(skyscraper VM ScriptProc SBS ${OGRE_LIBRARIES} ${wxWidgets_LIBRARIES} ${FMOD_LIBRARY} ${GTK3_LIBRARIES} ${FRONTENDGLINC})
target_link_libraries(VM SBS Network Editor dylib ${OGRE_LIBRARIES} ${Caelum_LIBRARIES} ${FMOD_LIBRARY} ${wxWidgets_LIBRARIES})
target_link_libraries(skyscraper VM ScriptProc SBS ${OGRE_LIBRARIES} ${wxWidgets_LIBRARIES} ${FMOD_LIBRARY} ${GTK3_LIBRARIES} ${FRONTENDGLINC})
endif ()


Expand Down Expand Up @@ -405,15 +430,15 @@ endif ()

#if (APPLE)
#ADD_CUSTOM_COMMAND(TARGET VM
# POST_BUILD
# COMMAND install_name_tool -change libOgreProcedural.dylib "@rpath/libOgreProcedural.dylib" libVM.dylib)
# POST_BUILD
# COMMAND install_name_tool -change libOgreProcedural.dylib "@rpath/libOgreProcedural.dylib" libVM.dylib)
#ADD_CUSTOM_COMMAND(TARGET SBS
# POST_BUILD
# COMMAND install_name_tool -change libOgreProcedural.dylib "@rpath/libOgreProcedural.dylib" libSBS.dylib)

#ADD_CUSTOM_COMMAND(TARGET ScriptProc
# POST_BUILD
# COMMAND install_name_tool -change libOgreProcedural.dylib "@rpath/libOgreProcedural.dylib" libScriptProc.dylib)
# POST_BUILD
# COMMAND install_name_tool -change libOgreProcedural.dylib "@rpath/libOgreProcedural.dylib" libScriptProc.dylib)

#ADD_CUSTOM_COMMAND(TARGET skyscraper
# POST_BUILD
Expand All @@ -422,8 +447,8 @@ endif ()

#if (APPLE AND wxWidgets_FOUND)
#ADD_CUSTOM_COMMAND(TARGET GUI
# POST_BUILD
# COMMAND install_name_tool -change libOgreProcedural.dylib "@rpath/libOgreProcedural.dylib" libGUI.dylib)
# POST_BUILD
# COMMAND install_name_tool -change libOgreProcedural.dylib "@rpath/libOgreProcedural.dylib" libGUI.dylib)
#endif ()

if (UNIX AND NOT APPLE)
Expand Down
3 changes: 2 additions & 1 deletion src/frontend/skyscraper.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@
#ifndef SKYSCRAPER_H
#define SKYSCRAPER_H

#include "globals.h"

#ifndef USING_WX
#include <filesystem>
#include "Ogre.h"
#include "OgreApplicationContext.h"
#include "OgreInput.h"
#include "OgreRTShaderSystem.h"
Expand Down
34 changes: 14 additions & 20 deletions src/frontend/startscreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -422,35 +422,29 @@ bool StartScreen::GetMenuInput()
//change button status based on mouse position and button press status
if (mouse_x_rel > button->x && mouse_x_rel < button->x + button->size_x && mouse_y_rel > button->y && mouse_y_rel < button->y + button->size_y)
{
if (button->drawn_selected == false && wxGetMouseState().LeftIsDown() == false)
if (button->drawn_pressed == true && wxGetMouseState().LeftIsDown() == false && wxGetMouseState().RightIsDown() == false)
{
if (button->drawn_pressed == true)
{
//user clicked on button
button->drawn_selected = true;
if (right_down_last == true)
RightClick(i);
return true;
}
button->drawn_selected = true;
}
if (button->drawn_selected == false && wxGetMouseState().RightIsDown() == false)
{
if (button->drawn_pressed == true)
{
//user clicked on button
button->drawn_selected = true;
else
Click(i);
return true;
}

button->drawn_pressed = false;
button->drawn_selected = true;
return true;
}
if (button->drawn_pressed == false && (wxGetMouseState().LeftIsDown() == true || wxGetMouseState().RightIsDown() == true))
if (wxGetMouseState().LeftIsDown() == true || wxGetMouseState().RightIsDown() == true)
{
button->drawn_pressed = true;
right_down_last = wxGetMouseState().RightIsDown();
button->drawn_selected = false;
button->drawn_pressed = true;
}
else
{
button->drawn_selected = true;
}
}
else if (button->drawn_selected == true || button->drawn_pressed == true)
else
{
button->drawn_selected = false;
button->drawn_pressed = false;
Expand Down
1 change: 1 addition & 0 deletions src/frontend/startscreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class StartScreen
};
buttondata *buttons;
int buttoncount;
bool right_down_last;

Ogre::Rectangle2D* background_rect;
Ogre::SceneNode* background_node;
Expand Down
5 changes: 3 additions & 2 deletions src/vm/vm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,22 @@
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/

#include "vm.h"

#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
#include <sys/sysctl.h>
#endif
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
#include <windows.h>
#undef LoadLibrary
#endif
#if OGRE_PLATFORM == OGRE_PLATFORM_LINUX
#include <sys/utsname.h>
#endif
#include <iostream>
#include "dylib.hpp"
#include "globals.h"
#include "sbs.h"
#include "polymesh.h"
#include "vm.h"
#include "camera.h"
#include "scenenode.h"
#include "soundsystem.h"
Expand Down
2 changes: 1 addition & 1 deletion src/vm/vm.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#define VM_H

#include <thread>
#include <vector>
#include "globals.h"

//DLL Exporting
#ifdef _WIN32
Expand Down