Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Golf 1.18 #119

Merged
merged 238 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
238 commits
Select commit Hold shift + click to select a range
5c6f472
update version number to 1.18
fallahn Jul 10, 2024
04c85ae
implement states and descriptions for Steam timeline
fallahn Jul 11, 2024
cc823c0
implement timeline events for main game
fallahn Jul 11, 2024
70bb6fa
add option to toggle large power bar
fallahn Jul 11, 2024
8c5097a
fix overlapping text in league menu
fallahn Jul 13, 2024
5477a8f
reset driving range animation when resetting round
fallahn Jul 13, 2024
1db061f
add nemesis display to career scoreboard
fallahn Jul 13, 2024
52494ae
allow passing git tag for libgns
Jul 14, 2024
c9aedff
add exception handler
fallahn Jul 15, 2024
c8000bf
begin club update
fallahn Jul 15, 2024
6be28a5
introduce club modifiers
fallahn Jul 16, 2024
10898f2
add input controls for punch and flop shots
fallahn Jul 16, 2024
4b4a6e4
update VOs
fallahn Jul 16, 2024
6e3287d
add HUD elements for flop and punch indicators
fallahn Jul 17, 2024
2a0339d
reduce top spin when taking a flop shot
fallahn Jul 17, 2024
146bc08
always use punch on a club when on stone terrain if it supports it
fallahn Jul 17, 2024
8dcab3d
display if a club supports flop/punch on stats page
fallahn Jul 17, 2024
c092741
add flop/punch shots to the tutorial
fallahn Jul 17, 2024
75e627a
fix controller button animations for flop/punch icons
fallahn Jul 17, 2024
7eba124
refine accuracy of stroke indicator for expoert and pro club sets
fallahn Jul 17, 2024
a3358d6
highlight punch/flop icons when active
fallahn Jul 18, 2024
d0420b0
remove empty page from awards menu if number of awards divides exactl…
fallahn Jul 18, 2024
460ae1e
fix button audio when switching club set on driving range
fallahn Jul 18, 2024
0370098
vary restitution based on velocity and angle of the ball
fallahn Jul 18, 2024
304d18a
update trigger for beefstick callout
fallahn Jul 18, 2024
144bfbd
automatically reset putt view on turn end when putting from fringe
fallahn Jul 18, 2024
b228689
update shot modifier icon colour
fallahn Jul 19, 2024
98ba368
initial pass at enabling parallel execution on Systems
fallahn Jul 19, 2024
fe813bf
add compile time conditional for parallel processing
fallahn Jul 19, 2024
3b2b8d8
add convoluted compiler flags for individual disablement of parallel …
fallahn Jul 19, 2024
0e40bb0
disable parallel execution on macOS
fallahn Jul 19, 2024
5bfbdde
apply mutex to Transform component when querying final transform
fallahn Jul 19, 2024
2c260a3
fix building RenderSystem2D with parallel settings disabled
fallahn Jul 20, 2024
6a001a4
tweak club stats
fallahn Jul 20, 2024
c3c3b51
re-calibrate stroke indicator markings
fallahn Jul 20, 2024
d4c7bae
enable parallel processing on particle system updates
fallahn Jul 20, 2024
11080f5
reduce restitution at low angles
fallahn Jul 20, 2024
cf37363
enable parallel processing for skeletal animation
fallahn Jul 21, 2024
bde8636
prevent ball stopping on steep slopes when rolling
fallahn Jul 21, 2024
f0fc6c3
disable input parser when window loses focus on driving range
fallahn Jul 21, 2024
b09d1ca
update unlocks before parsing unlockable assets
fallahn Jul 21, 2024
8cb4f4d
implement client-side mulligans in career
fallahn Jul 22, 2024
52f6fdd
implement server side rules for mulligan
fallahn Jul 22, 2024
a01eff6
restore terrain after a mulligan
fallahn Jul 22, 2024
abf5508
create shiny materials for headwear
fallahn Jul 22, 2024
86c8db6
fix facing direction of hair models in preview window
fallahn Jul 22, 2024
b9bf235
implement shiny materials for headwear
fallahn Jul 23, 2024
7002216
fudge commit to get around the case insensitivety of windows confusin…
fallahn Jul 23, 2024
50d7b58
update windows OpenAL binaries
fallahn Jul 23, 2024
ad9deab
add mulligan indicator to UI
fallahn Jul 24, 2024
5032320
include total daily streak on unlock screen
fallahn Jul 25, 2024
4fda8a3
followers stop to prevent collision with players
fallahn Jul 25, 2024
7eed3c7
update achievement IDs
fallahn Jul 25, 2024
5c16ca7
polish up menu
fallahn Jul 25, 2024
8431c3a
hack around gcc 10 bug
fallahn Jul 25, 2024
ece7224
add preproc defs for unsupported features of GCC < 11
fallahn Jul 26, 2024
fc4574b
actually understand what TBB is.
fallahn Jul 26, 2024
26d998f
update CI
fallahn Jul 26, 2024
3a9a5b4
update cmake
fallahn Jul 26, 2024
39d84ed
more GCC hacking
fallahn Jul 26, 2024
1da6d1c
measure slope of the ball's lie
fallahn Jul 26, 2024
3e0e711
add profile slot for hats
fallahn Jul 26, 2024
4da39e4
add extra colour slot to profiles for hats
fallahn Jul 26, 2024
e544383
add profile data slots for hair and hat transforms
fallahn Jul 26, 2024
515723b
add option to disable parallel execution to cmake
fallahn Jul 26, 2024
3338d21
tweak unused var
fallahn Jul 26, 2024
9524f79
disable more gcc versions
fallahn Jul 26, 2024
f3c762e
properly lock guard Transform in parallel execution builds
fallahn Jul 27, 2024
19042d5
Merge branch 'golf-1.18' of https://github.com/fallahn/crogine into g…
fallahn Jul 27, 2024
10e783b
groundwork for parallel play mode
fallahn Jul 27, 2024
abea0bd
remove punch modifier from driver
fallahn Jul 28, 2024
323c382
include scale properties for hair/hat objects
fallahn Jul 29, 2024
f01c79c
update server rules to check all player groups before moving to the n…
fallahn Jul 29, 2024
bfdd914
refactor scoring system to account for multiple player groups
fallahn Jul 29, 2024
b6cad8c
fix server rules
fallahn Jul 29, 2024
c4e4c50
implement assigning players to client groups on the server
fallahn Jul 30, 2024
1fa1b1d
broadcast only group-specific packets
fallahn Jul 30, 2024
a4e981c
fix up win condition of Elimination mode in group play
fallahn Jul 30, 2024
b28cdf2
move player turn timer to each active group
fallahn Jul 31, 2024
d143f93
implement group selection based on client ID
fallahn Jul 31, 2024
d819c7b
add grouping type selection button to player management window
fallahn Jul 31, 2024
ba37ed3
tidy up unused vars
fallahn Jul 31, 2024
8d21ef5
use prev/next club buttons to cycle rule sets in lobby
fallahn Aug 1, 2024
bfc0e16
add message for resuming application from system suspension
fallahn Aug 1, 2024
530b7aa
apply custom transforms to hair pieces
fallahn Aug 1, 2024
6b1a976
apply hat attachments to model in golf and driving range modes
fallahn Aug 1, 2024
ce07e5d
fix loading properties of hat attachments
fallahn Aug 1, 2024
7579b49
apply hat model to player preview in roster menu
fallahn Aug 1, 2024
f464af3
don't allow hat and hair to have the same ID
fallahn Aug 1, 2024
4907af7
attempt to reconnect to previous audio device when resuming from slee…
fallahn Aug 1, 2024
809e099
fix server side IOR bug
fallahn Aug 1, 2024
91e5814
add accessors for audio device information to openal impl
fallahn Aug 2, 2024
e34a9c7
add public interface to access audio device
fallahn Aug 2, 2024
9dddb67
refresh audio device list when a new device is connected
fallahn Aug 2, 2024
2204e37
update audio device from options window
fallahn Aug 2, 2024
abe1bcc
set audio device as preferred when manually choosing a device
fallahn Aug 2, 2024
4a9b151
tweak slider positioning
fallahn Aug 2, 2024
30286b7
fix IOR bugs on server with multiple groups
fallahn Aug 3, 2024
37bb3f2
fix up packet broadcast status in group play
fallahn Aug 3, 2024
3d153c2
prep avatar edit layour for hair/hat editor
fallahn Aug 4, 2024
8169223
remove magic numbers and replace with MapSize const
fallahn Aug 4, 2024
6f0726b
assert experiment results with bigger maps
fallahn Aug 4, 2024
7e4ef20
tidy up menus
fallahn Aug 5, 2024
2c913c2
add opening hair editor window
fallahn Aug 5, 2024
ebcf422
implement picking hair model
fallahn Aug 5, 2024
6731567
add button for picking hair colour
fallahn Aug 5, 2024
ad32ab1
first pass at button layout for hair editor
fallahn Aug 5, 2024
5461b65
fix shader on terrain depth map
fallahn Aug 5, 2024
19477c1
attempt to force default audio device on Steam Deck
fallahn Aug 5, 2024
b23d8d4
apply hat model in profile editor
fallahn Aug 6, 2024
07aa77a
apply colour/model selections to hat node in profile editor
fallahn Aug 6, 2024
74e1970
add axis gizmo
fallahn Aug 6, 2024
3c34cdf
update button selection order in hair edit menu
fallahn Aug 6, 2024
2384783
preliminary manipulation of headwear items via transform control
fallahn Aug 6, 2024
e521791
add system for pressing and holding buttons
fallahn Aug 6, 2024
50df9e9
lowered the height at which wind starts to affect ball flight
fallahn Aug 6, 2024
0d96884
fix up hair editor menu
fallahn Aug 7, 2024
518b896
fix up hat selection menu
fallahn Aug 8, 2024
b32abf7
add XP awards for green and fairway in regulation
fallahn Aug 8, 2024
6485a28
send assigned group ID to clients
fallahn Aug 8, 2024
65190aa
refactor group assignments based on client player count in attempt to…
fallahn Aug 8, 2024
d72659d
fix button order on profile menu in Steam biuld
fallahn Aug 8, 2024
b2256da
more groundwork for increasing map size
fallahn Aug 9, 2024
8a6a1a5
notify clients when their group is idle in group play
fallahn Aug 9, 2024
f4a05ae
tell waiting clients to move to next hole if a client disconnects in …
fallahn Aug 9, 2024
c6656e6
fix ball trails in group play match
fallahn Aug 10, 2024
68e2fb4
fix ball model visibility on group play
fallahn Aug 10, 2024
bc10f45
fix hiding balls between holes
fallahn Aug 11, 2024
d8a3e3b
prevent players taking too many turns in NTP when group play active
fallahn Aug 11, 2024
f682762
fix hole winner in NTP in group mode
fallahn Aug 11, 2024
293d802
assert all groups are waiting for next hole before changing
fallahn Aug 11, 2024
fef8dca
fix up buttons on menu
fallahn Aug 11, 2024
1d4f1a7
fix match play rules
fallahn Aug 12, 2024
d40bc77
made skins rules slightly less broken
fallahn Aug 12, 2024
4a9e5a3
finally get something akin to working match/skins scores
fallahn Aug 12, 2024
a1b32a4
scale minimap to bigger map size
fallahn Aug 12, 2024
1b98adc
fix rendering terrain depth map at larger map size
fallahn Aug 12, 2024
4a2d828
make map size variables accessible to water shader
fallahn Aug 12, 2024
986ac79
update player management window with help text on grouping
fallahn Aug 13, 2024
2ef94fe
fix lobby text alignment
fallahn Aug 13, 2024
889323e
update terrain chunker to adapt chunk size to map size
fallahn Aug 13, 2024
965332f
assert that anything but the player camera upsets transition animatio…
fallahn Aug 13, 2024
250d934
track positions of group players and uses them as spectator points wh…
fallahn Aug 13, 2024
0954f51
make sure spectator camera starts on the current client
fallahn Aug 13, 2024
01bf04c
add function to remove animations from Skeleton components
fallahn Aug 14, 2024
b287a48
add option to copy animations from existing Skeleton components
fallahn Aug 14, 2024
99d2151
auto-transition idle camera when waiting for other players
fallahn Aug 14, 2024
489a46c
display ball label of player being spectated
fallahn Aug 14, 2024
e85ef4b
prevent mouse click from overriding CPU input
fallahn Aug 14, 2024
0753639
rename default audio device
fallahn Aug 14, 2024
90b100e
add timer to trigger sound
fallahn Aug 14, 2024
a82ebbb
refactor group indexing in server message handler
fallahn Aug 15, 2024
10713e0
set correct player icon when spectating
fallahn Aug 15, 2024
9b7c072
don't spectate balls already holed
fallahn Aug 15, 2024
67648fa
update shaders to clip geometry below water plane
fallahn Aug 15, 2024
e721e5b
convert water level value to shader include
fallahn Aug 15, 2024
7867d5f
display ghost spectator when in spectate mode
fallahn Aug 15, 2024
1b952c8
allow adding custom material settings to material data
fallahn Aug 15, 2024
c902186
fix up camera switching in group mode
fallahn Aug 15, 2024
0bb2f4f
add applause animation to spectator ghost
fallahn Aug 16, 2024
9afa902
send avatar rotation to remote clients
fallahn Aug 16, 2024
74e8290
interpolate remote player rotation movements
fallahn Aug 16, 2024
e27af45
add new achievements
fallahn Aug 16, 2024
abaa972
ignore grouping when playing skins or match play
fallahn Aug 16, 2024
f8b5e57
fix up gns build
fallahn Aug 16, 2024
bbe0748
switch terrain to clipping from alpha blend
fallahn Aug 17, 2024
773eacc
change trigger condition for top of the flops and punch it achievements
fallahn Aug 17, 2024
e50d09f
refactor minimap consts
fallahn Aug 17, 2024
7968629
rescale minimap view to smaller dimensions
fallahn Aug 17, 2024
5cee864
tidy up minimap zoom
fallahn Aug 17, 2024
d9e2080
fix skins rules
fallahn Aug 17, 2024
1278345
hide spectator ghost on hole change
fallahn Aug 17, 2024
41f5070
include client player count in connect/disconnect messages
fallahn Aug 17, 2024
a795969
automatically end skins, match and elimination rounds if all but 1 pl…
fallahn Aug 17, 2024
50b9745
update modkit
fallahn Aug 18, 2024
63aeaa0
shaders.
fallahn Aug 18, 2024
af245bd
SHADERS
fallahn Aug 18, 2024
f0bca4a
use clip plane on course model and spectator models
fallahn Aug 19, 2024
5eb5eec
add non-const overload for MaterialData accessor in Mesh
fallahn Aug 19, 2024
e0964d8
readjust overview map for updated map size
fallahn Aug 19, 2024
2cdb560
adjust UI element depths
fallahn Aug 19, 2024
16121e5
increase minimap resolution again
fallahn Aug 19, 2024
960a0b3
apply clip plane to instanced geom
fallahn Aug 19, 2024
551694a
fix hat colour button updating avatar texture hair colour
fallahn Aug 19, 2024
41ced2f
attempt to discover source of camera NaN
fallahn Aug 20, 2024
f969da0
send group event packets for hole-out and turn ended
fallahn Aug 20, 2024
06ccf9c
code tidy
fallahn Aug 20, 2024
ccb02f2
add pseuthe boilerplate
fallahn Aug 20, 2024
303e772
first pass bouncing balls
fallahn Aug 20, 2024
8836e42
tweak spectator camera
fallahn Aug 20, 2024
0a07d47
update background rendering
fallahn Aug 21, 2024
c4217ed
switch to twitter emoji font
fallahn Aug 21, 2024
c0f205d
fix multi-target shader
fallahn Aug 21, 2024
cc616fc
add double sided rendering option to Drawable2D
fallahn Aug 22, 2024
1ecaeb5
add particle field
fallahn Aug 22, 2024
eb7dad1
add background fade in
fallahn Aug 22, 2024
3606407
fix collision bug in balls
fallahn Aug 22, 2024
74aeb51
add normal matrix as an optional uniform to Drawable2D
fallahn Aug 22, 2024
a934fbb
add ring effect to shader
fallahn Aug 22, 2024
891cdb4
restore from debug state
fallahn Aug 23, 2024
07db123
switch freecam fast move to toggle
fallahn Aug 23, 2024
74935e1
complete background animation
fallahn Aug 23, 2024
ebdf2c3
disable input parser when taking a mulligan
fallahn Aug 23, 2024
4bcdf26
fix minimap zoom position
fallahn Aug 23, 2024
d6d103e
remove group play for now
fallahn Aug 24, 2024
349ee72
fix shaders on nvidia
fallahn Aug 24, 2024
4aace8f
allow setting full screen mode to exclusive full screen
fallahn Aug 24, 2024
1412186
clamp config settings to something sane when loading
fallahn Aug 24, 2024
ae0aef2
messing with blur
fallahn Aug 24, 2024
1a22c86
display model bounds in model editor
fallahn Aug 25, 2024
fa261ac
embiggen options menu
fallahn Aug 26, 2024
6042ce1
fix shader compilation in playlist editor
fallahn Aug 27, 2024
54fa68e
embiggen stats and achievements windows
fallahn Aug 27, 2024
481a784
add exclusive full screen mode to options menu
fallahn Aug 27, 2024
08ac32e
add menu items for decimated power bar and decimated distances to opt…
fallahn Aug 27, 2024
6d8077f
apply decimated distance option when formatting display strings
fallahn Aug 27, 2024
9c42aa4
implement decimated power bar
fallahn Aug 27, 2024
98038ad
expand mini map zoom clamp
fallahn Aug 27, 2024
58b49f4
update gns
fallahn Aug 27, 2024
60dd72f
read all stats on achievement init, prevents daily streak overwriting…
fallahn Aug 28, 2024
cfc915c
copy image to clipboard when taking screenshots on windows
fallahn Aug 28, 2024
9a5ecca
head
fallahn Aug 28, 2024
0824c8b
tidy up debug lines
fallahn Aug 28, 2024
ad5ec0f
add some checks to text messaging
fallahn Aug 29, 2024
47e2b56
initial player movement
fallahn Aug 29, 2024
4f318fc
preliminary player movement
fallahn Aug 29, 2024
f2455df
implement lens flare on point lights
fallahn Aug 30, 2024
7c0358b
fix utf name string on dynamic scoreboard texture
fallahn Aug 30, 2024
23ccbb6
add socials to news page
fallahn Aug 30, 2024
e0fdbfd
update news page
fallahn Aug 30, 2024
905b241
sooothe
fallahn Sep 1, 2024
58f6ce6
tweakages
fallahn Sep 2, 2024
837f29b
fix world space position of point light lens flares
fallahn Sep 2, 2024
a6f3a42
tweak flares
fallahn Sep 2, 2024
618368a
tweak depth sorting of clubhouse UI
fallahn Sep 3, 2024
fc5e958
release candidate for 1.18
fallahn Sep 3, 2024
78dcab4
fix crash when trying to update the transform of bald headwear
fallahn Sep 4, 2024
500de00
wild stab at trying to fix parsing utf8 strings from config file (AGAIN)
fallahn Sep 4, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

- name: Install linux Dependencies
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install libgtk-3-dev libenet-dev libxrandr-dev libudev-dev libopenal-dev libflac-dev libvorbis-dev libopus-dev libsdl2-dev libunwind-dev libassimp-dev assimp-utils
run: sudo apt-get update && sudo apt-get install libtbb-dev libgtk-3-dev libenet-dev libxrandr-dev libudev-dev libopenal-dev libflac-dev libvorbis-dev libopus-dev libsdl2-dev libunwind-dev libassimp-dev assimp-utils

- name: Install macOS Dependencies
if: runner.os == 'MacOS'
Expand Down
501 changes: 501 additions & 0 deletions crogine.sln

Large diffs are not rendered by default.

30 changes: 28 additions & 2 deletions crogine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ SET(USE_OPENAL TRUE CACHE BOOL "Choose whether to use OpenAL for audio or SDL_Mi
SET(TARGET_ANDROID FALSE CACHE BOOL "Build the library for Android devices")

SET(USE_GL_41 FALSE CACHE BOOL "Use OpenGL 4.1 instead of 4.6 on desktop builds.")
SET(USE_PARALLEL_EXECUTION TRUE CACHE BOOL "Enable parallel execution, requires compiler support")

if(${TARGET_ANDROID})
SET(${CMAKE_TOOLCHAIN_FILE} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/toolchains/android-arm.cmake")
Expand Down Expand Up @@ -58,14 +59,30 @@ if(NOT TARGET_ANDROID)
endif()
endif()

if (msvc)
if (MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
if (NOT USE_PARALLEL_EXECUTION)
add_definitions(-DPARALLEL_GLOBAL_DISABLE)
endif()
endif()

if (APPLE)
add_definitions(-DGL_SILENCE_DEPRECATION)
#silence opengl/openal deprecation warnings
#plus apple clang doesn't support parallel exection policies
add_definitions(-DGL_SILENCE_DEPRECATION -DPARALLEL_GLOBAL_DISABLE)
endif()

#versions of gcc older than 9 don't support parallel execution policies
if(CMAKE_COMPILER_IS_GNUCC AND
CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 8 AND
USE_PARALLEL_EXECUTION)
SET(USE_TBB true)
else()
add_definitions(-DPARALLEL_GLOBAL_DISABLE)
endif()



if (NOT BUILD_SHARED_LIBS)
add_definitions(-DCRO_STATIC)
else()
Expand Down Expand Up @@ -96,6 +113,9 @@ if(MSVC)
find_package(DbgHelp REQUIRED)
elseif(LINUX)
find_package(Libunwind REQUIRED)
if(USE_TBB)
find_package(TBB REQUIRED)
endif()
endif()

include_directories(
Expand Down Expand Up @@ -148,6 +168,8 @@ if(NOT TARGET crogine)
add_library(${PROJECT_NAME} SHARED ${PROJECT_SRC})
endif()



target_compile_definitions(${PROJECT_NAME} PUBLIC $<$<CONFIG:Debug>:CRO_DEBUG_>)

target_link_libraries(${PROJECT_NAME}
Expand All @@ -166,6 +188,10 @@ if(NOT TARGET crogine)
target_link_libraries(${PROJECT_NAME} winmm ws2_32 IPHLPAPI ${DBGHELP_LIBRARIES} shlwapi)
elseif(LINUX)
target_link_libraries(${PROJECT_NAME} ${LIBUNWIND_LIBRARIES})

if(USE_TBB)
target_link_libraries(${PROJECT_NAME} TBB::tbb)
endif()
endif()

target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
Expand Down
19 changes: 18 additions & 1 deletion crogine/include/crogine/Config.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*-----------------------------------------------------------------------

Matt Marchant 2017 - 2020
Matt Marchant 2017 - 2024
http://trederia.blogspot.com

crogine - Zlib license.
Expand Down Expand Up @@ -104,4 +104,21 @@ source distribution.

#endif //CRO_STATIC

//used specifically for the Systems
//which implements parallel execution
//this *doesn't* mean anything is thread-safe
//outside of its defined scope, if anything
//it's probably worse :)
//#define PARALLEL_GLOBAL_DISABLE
#ifndef PARALLEL_GLOBAL_DISABLE
#define USE_PARALLEL_PROCESSING
#endif

#ifdef USE_PARALLEL_PROCESSING
#define EARLY_OUT return
#else
#define EARLY_OUT continue
#endif


#include <crogine/android/Android.hpp>
63 changes: 63 additions & 0 deletions crogine/include/crogine/audio/AudioDevice.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*-----------------------------------------------------------------------

Matt Marchant 2024
http://trederia.blogspot.com

crogine - Zlib license.

This software is provided 'as-is', without any express or
implied warranty.In no event will the authors be held
liable for any damages arising from the use of this software.

Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute
it freely, subject to the following restrictions :

1. The origin of this software must not be misrepresented;
you must not claim that you wrote the original software.
If you use this software in a product, an acknowledgment
in the product documentation would be appreciated but
is not required.

2. Altered source versions must be plainly marked as such,
and must not be misrepresented as being the original software.

3. This notice may not be removed or altered from any
source distribution.

-----------------------------------------------------------------------*/

#pragma once

#include <crogine/Config.hpp>

#include <string>
#include <vector>

namespace cro
{
/*!
\brief Provides access to the current audio device, available audio devices
and the ability to set a specific audio device as active.
*/
class CRO_EXPORT_API AudioDevice final
{
public:
/*!
\brief Returns the name of the currently active device, if available
*/
static const std::string& getActiveDevice();

/*!
\brief Returns a list of audio devices currently connected
*/
static const std::vector<std::string>& getDeviceList();

/*!
\brief Attempts to set the given device as the active audio output
else does nothing if the given device is not available.
\param device The string name, retreived from getDeviceList(), to set active
*/
static void setActiveDevice(const std::string&);
};
}
1 change: 1 addition & 0 deletions crogine/include/crogine/core/App.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ namespace cro
std::int32_t width = 800;
std::int32_t height = 600;
bool fullscreen = false;
bool exclusive = false;
bool vsync = true;
bool useMultisampling = false;
glm::vec2 windowedSize = glm::vec2(0.f);
Expand Down
4 changes: 3 additions & 1 deletion crogine/include/crogine/core/Message.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,9 @@ namespace cro
enum
{
FullScreenToggled,
ScreenshotTaken //note that files are written asynchronously and may not be available when this message is received
ScreenshotTaken, //note that files are written asynchronously and may not be available when this message is received
ResumedFromSuspend,
AudioDeviceChanged
}type = FullScreenToggled;
};

Expand Down
26 changes: 24 additions & 2 deletions crogine/include/crogine/core/MessageBus.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*-----------------------------------------------------------------------

Matt Marchant 2017 - 2020
Matt Marchant 2017 - 2024
http://trederia.blogspot.com

crogine - Zlib license.
Expand Down Expand Up @@ -33,6 +33,10 @@ source distribution.

#include <vector>

#ifdef USE_PARALLEL_PROCESSING
#include <mutex>
#endif

namespace cro
{
/*!
Expand Down Expand Up @@ -85,12 +89,27 @@ namespace cro
{
if (!m_enabled) return static_cast<T*>((void*)m_pendingBuffer.data());

static_assert(sizeof(T) < 128, "MEssage size limit is 128 bytes");

const auto dataSize = sizeof(T);
static const auto msgSize = sizeof(Message);
CRO_ASSERT(dataSize < 128, "message size exceeds 128 bytes"); //limit custom data to 128 bytes
//CRO_ASSERT(dataSize < 128, "message size exceeds 128 bytes"); //limit custom data to 128 bytes
CRO_ASSERT(m_pendingBuffer.size() - (m_inPointer - m_pendingBuffer.data()) > (dataSize + msgSize), "buffer overflow " + std::to_string(m_pendingCount)); //make sure we have enough room in the buffer
//CRO_WARNING(m_pendingBuffer.size() - (m_inPointer - m_pendingBuffer.data()) < 128, "Messagebus buffer is heavily contended!");


//this is probably not ideal - the returned
//message is probably modified outside of the lock
//however what we're *really* protecting here
//is creation of new messages on the bus
//ALSO a lot of threads waiting on this will probably cause
//a stall - if we're smart each thread/group of threads
//would have their own mutexes and the message bus
//would do a collection from all of them each frame
#ifdef USE_PARALLEL_PROCESSING
std::scoped_lock l(m_mutex);
#endif

Message* msg = new (m_inPointer)Message();
m_inPointer += msgSize;
msg->id = id;
Expand Down Expand Up @@ -129,5 +148,8 @@ namespace cro
std::size_t m_pendingCount;

bool m_enabled;
#ifdef USE_PARALLEL_PROCESSING
std::mutex m_mutex;
#endif
};
}
19 changes: 18 additions & 1 deletion crogine/include/crogine/core/Window.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*-----------------------------------------------------------------------

Matt Marchant 2017 - 2020
Matt Marchant 2017 - 2024
http://trederia.blogspot.com

crogine - Zlib license.
Expand Down Expand Up @@ -149,6 +149,22 @@ namespace cro
*/
bool isFullscreen() const { return m_fullscreen; }

/*!
\brief Sets the full screen mode
\param exclusive If set to true the window is set to 'true' full screen
mode at the current resolutions when full screen mode is activated
else the window is set to borderless full screen at the current desktop
resolution.
This has no effect on macOS which is always borderless full screen
*/
void setExclusiveFullscreen(bool exclusive) { m_exclusiveFullScreen = exclusive; }

/*!
\brief Returns the current full screen mode
\see setExclusiveFullScreen()
*/
bool getExclusiveFullscreen() const { return m_exclusiveFullScreen; }

/*!
\brief Set the window position in desktop coordinates.
\param x Horizontal position to place the window. A negative number
Expand Down Expand Up @@ -254,6 +270,7 @@ namespace cro
mutable std::vector<glm::uvec2> m_resolutions;

bool m_fullscreen;
bool m_exclusiveFullScreen;
bool m_multisamplingEnabled;

glm::uvec2 m_previousWindowSize; //restore to this if toggling full screen
Expand Down
2 changes: 1 addition & 1 deletion crogine/include/crogine/ecs/System.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*-----------------------------------------------------------------------

Matt Marchant 2017 - 2022
Matt Marchant 2017 - 2024
http://trederia.blogspot.com

crogine - Zlib license.
Expand Down
16 changes: 16 additions & 0 deletions crogine/include/crogine/ecs/components/Drawable2D.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@ namespace cro
*/
void setBlendMode(Material::BlendMode);

/*!
\brief If set to true the backface culling is disabled for
this drawable and it will render regardless of vertex winding
\param sidedness True to enable double sided, false to disable
*/
void setDoubleSided(bool sidedness) { m_doubleSided = sidedness; }

/*!
\brief Sets the area in local coordinates to crop this drawable.
If this area is larger or does not overlap the local bounds then
Expand Down Expand Up @@ -156,6 +163,13 @@ namespace cro
*/
Material::BlendMode getBlendMode() const;

/*!
\brief Returns true if this drawable is set to be rendered
double sided.
\see setDoubleSided()
*/
bool getDoubleSided() const { return m_doubleSided; }

/*!
\brief Returns the current cropping area.
\see setCroppingArea()
Expand Down Expand Up @@ -311,9 +325,11 @@ namespace cro
bool m_autoCrop;
std::int32_t m_textureUniform;
std::int32_t m_worldUniform;
std::int32_t m_normalMatrixUniform;
std::int32_t m_viewProjectionUniform;

std::uint32_t m_facing;
bool m_doubleSided;

Material::BlendMode m_blendMode;
std::uint32_t m_primitiveType;
Expand Down
1 change: 1 addition & 0 deletions crogine/include/crogine/ecs/components/Model.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ namespace cro
\param sub-mesh Index of the sub-mesh to retrieve.
\returns const reference to the material if it exists
*/
Material::Data& getMaterialData(Mesh::IndexData::Pass pass, std::size_t submesh);
const Material::Data& getMaterialData(Mesh::IndexData::Pass pass, std::size_t submesh) const;

/*!
Expand Down
4 changes: 2 additions & 2 deletions crogine/include/crogine/ecs/components/ParticleEmitter.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*-----------------------------------------------------------------------

Matt Marchant 2017 - 2023
Matt Marchant 2017 - 2024
http://trederia.blogspot.com

crogine - Zlib license.
Expand Down Expand Up @@ -180,7 +180,7 @@ namespace cro
float m_currentTimestamp;
float m_emissionTimestamp;

bool m_pendingUpdate;
//bool m_pendingUpdate;
std::uint64_t m_renderFlags;

std::int32_t m_releaseCount;
Expand Down
Loading