Commit Graph

794 Commits

Author SHA1 Message Date
panos
4f55f11000
Revert "Haiku graphics mode scheduler low latency rather power saving for" (#4515)
This reverts commit 087ad350d7.
2021-04-07 17:42:34 +08:00
David Carlier
087ad350d7 Haiku graphics mode scheduler low latency rather power saving for
insuring best performance.
2021-04-01 17:10:08 +00:00
Mary
0dd3c62a43
Discord rich presence (#4500)
* WIP RPC support

* Might have windows support now, don't peek

* Windows support

* RichPresence: __SWITCH__ => DISABLE_RPC (for MOBILE_STK support)

* RichPresence: Handle JSON strings according to spec, support for addons icon

* RichPresence: use translated difficulty name

* RichPresence: disable when client_id=-1

* RichPresence: thread connection, show server name on RPC

* RichPresence: destroy on close

* RichPresence: don't compile methods at all if DISABLE_RPC

* RichPresence: fix windows compile (untested)

* RichPresence: fix for mac

* RichPresence: Linux needs MSG_NOSIGNAL still

* RichPresence: fix memory leaks, don't spam update while not connected

* RichPresence: free thread on terminate

* RichPresence: handle initial registration

* RichPresence: fix compiler warning
2021-03-10 10:47:33 +08:00
Richard Qian
969de9e751
Improved artist debug mode (#4501)
* Add more functionality to the debug menu

Includes:
* Front of kart view
* Inverse side of kart view
* Change to kart #9 or #10
* Attachments for AI karts

* Fix enumeration value not handled in switch for debug camera

* More enhancements to the debug menu, part 2

Includes:
* Restore access to the anchor/anvil powerup
* Clear the current powerup or attachment
* Change to kart #11 or #12
* Flatten karts as if they were hit by a swatter
* Block most of the view with plungers

* Enable executing some keypress actions from the debug menu in a new sub-menu

Includes:
* Rescuing karts from menu
* Pausing the game from menu (but keypresses will cause the game to crash)
* Moved "To next kart" menu entry to be right below "To previous kart" for easier reach

* Change print kart positions to info level, better labeling of side kart views

* Prevent crashes when trying to use 'Behind wheel view' on a ghost kart

* Add close button to the debug slider dialog, and a function to enable/disable spinners

* Make it easier to read and select kart camera targets from the debug menu

* Add another dialog (reusing the debug slider code) to allow the user to select
from a slider the kart number to change to

* The 11th and 12th target slots have been removed to make the submenu cleaner,
but the 9th and 10th slots have been left in place

* The predefined slots (1st place to 10th place) actually use numbers

* Improve the appearance of the FPS (frames per second) counter

* Shift the position closer to the center, so that in-race kart icons are not obscured
* The box and text position adapt based on the screen resolution
* Use a thin black border for the font, and make the font white-colored
* Decrease the font scaling to 0.7, so that other UI elements can be seen more easily

* Improve debug keyboard shortcuts handling, rearrange some shortcuts

Most shortcuts are now handled by Debug instead of InputManager directly
Other changes include:
* Fix moving right in 1st-person view not working
* Change the 1st-person view shortcuts to work more like in Blender
* Add more keyboard shortcuts for quickly seeing the top and sides of a kart
* The key to show player list in soccer mode no longer needs to be held down
* Rearrange some shortcuts to flow more naturally

New list of debug keyboard shortcuts:
* F1 - Normal view
* F2 - Top view
* F3 - Right side of kart view
* F4 - Left side of kart view
* F5 - 1st-person view
* F6 - Reload SP textures
* F7 - Next kart
* F8 - Previous kart
* F9 - Show player list in soccer mode
* Q - Move 1st-person view camera down
* E - Move 1st-person view camera up
* R - Rotate 1st-person view camera right
* F - Rotate 1st-person view camera left

* Exit demo mode when there also are no dialogs active; fixes related crashes

* Improve the debug menu, various fixes to some menu items, and mouse-accessible actions

Includes:
* Debug menu opens at the cursor position, but not at off-screen places
* Ensure that the debug menu stays (almost) within the actual window
* Middle mouse button can also be used to access the debug menu
* Move all items into submenus, rearrange most submenus to keep a compact size
* Add ability to set powerup and nitro amount by debug slider dialog
* Label the some commands with the new keyboard shortcuts
* Screenshots can now be saved via the debug menu
* Texture reloading can now be done via the debug menu

* Add more debug shortcut keys, change many of the existing ones

The full shortcuts list will be explained later

Includes:
* Use Control and Shift keys to fit more shortcuts onto fewer keys
* Label the debug menu items with the keys that can be used to activate them
* Fix more debug menu items causing game crashes in certain situations
* Add help message dialog to tell users the list of static/debug shortcuts; incomplete
* Slightly alter the free margins that the debug menu can appear in
* Render target textures (RTT) can now be dumped via the debug menu
* Replace the 10th kart camera target with the last kart camera target
* Switch the shortcuts used for activating history save and manual replay saving

* Finish labelling the remaining debug actions, complete the debug keys help dialog

Unfortunately, the now unused tutorial message dialog has been repurposed for this use,
and the font sizes greater than 'Large' will cause some text to draw outside the dialog

* Document the remaining command-line parameters, clean up some of them

This adds another method that will print out the previously undocumented debug options

Rename --gamepad-visuali[s,z]ation to --gamepad-visuals

Also fix some comments related to the user config, including the game mode numbers

* The AI cannot handle the anvil powerup anymore, but it won't spam logs anymore
2021-03-08 11:23:28 +08:00
Mary Strodl
b93a24a184
Clock up CPU while loading 2021-03-04 09:57:02 -05:00
Mary
7509e1bc0a
Support broadcast address on switch (and better service calls) (#4498)
* Support broadcast address on switch. Also use R_SUCCEEDED for service calls

* servers_manager: fallback to default broadcast address
2021-03-04 11:23:03 +08:00
Mary
d9b8b7acad
Support for Nintendo Switch (#4491)
* WIP support for Nintendo Switch

* OpenAL is usable

* Remove some debug code, add manual crash when DEBUG_NXLINK is on

* Remove more debug logs

* Support touch, account name detection, language detection. Remove resolution settings

* Stylistic changes

* SFXManager: update on main thread

* Add build script, remove crypto.hpp changes, disable opengl recorder on switch

* make: use sudo where needed, libs=>lib, portlib=>portlibs

* make: build harfbuzz with freetype

* main: remove DEBUG_NXLINK

* socket_address: this comment is no longer relevant

* Fix indentation in SDL, remove extra debug logs from InputManager

* InputManager: make log debug, not info

* CMakeLists: add mbedtls include dirs on switch

* main: deinitialize stuff

* main_loop: fix format
2021-03-04 09:23:23 +08:00
Richard Qian
f136c6fe36
In-game high scores management (#4483)
* Add in-game high score selection screens, based on the ghost replay screens

Its functionality is basic for now, mainly to let players have a central place to view
their high scores

Other things to improve:
* Allow sorting the high score entries by criteria
* Allow deleting high score nodes and possibly entries
* Use better icons

* The string for the high scores title in the track info screen can now be translated

* Refine in-game high score selection screens

Includes:
* High score info dialog now shows track and setup information
* A race can be started with the displayed setup, using the current player and kart
* Icon to access the screen now placed between the tutorial and achievements buttons
* It is possible to delete a specific high score group or all of the high score groups
* Change the order of some columns to make them easier to hide for non-linear modes
* The list will now filter out enpty high score groups

* Replace bomb icon (as used in the help menu) with the full object version from STK 0.8

It has been edited to remove most of the transparency in the object itself

* Implement column clicking in the high score selection screen, and minor GUI fixes

Note that high score entry sorting is not yet working properly

Includes:
* Top right buttons replaced by button bar containing them; fixes unreliable clicking
* High score manager has some one-line functions moved into its header file
* High scores can be sorted by some criteria
* Sorting is done before every time high scores are saved

* Fix header define names for the high score info dialog

* Fix high score sorting, reorganize its associated code

* More refinements to the high score selection screen

Includes:
* Clearing high scores no longer causes memory leaks
* The manual refresh button has been removed, as it has been deemed useless

* Remove unused header files for the high scores information dialog header

* The high scores box in the track information screen no longer has '='

* Fix pressing escape key in the high score information dialog crashing the game

Also remove unused widget variables and unnecessary function overrides

* Do not write high scores for races that have 0 laps and/or have no real karts

* Allow passing a parameter to prevent high scores from temporarily being written

This setting lasts only as long as the game runs; it is useful during track and
kart animation testing, where unwanted high score entries should not be written

* Force update sources.cmake, as new source files are being added for high scores screens

* Fix memory leak and strings

Co-authored-by: Benau <Benau@users.noreply.github.com>
2021-02-12 11:12:43 +08:00
Benau
85cea43077 Allow starting offline CTF from command line 2021-02-08 10:32:10 +08:00
Benau
06500e18ca Make init android dialog header more visible 2021-02-03 01:24:58 +08:00
Richard Qian
0db8d50359
More configurable music (loop end support, different race result music) (#4445)
* Allow setting [again] track reverse mode via command line

* Make composer field in music information files optional

* Add support for loop end of music

* Remove print statements used for checking current music play time

* Support playing different music on race results screen

Also make them configurable in stk_config.xml

* Allow configuring grand prix win/lose and feature unlocked music in stk_config.xml

* Fix coding indentation style

* Fix warning when scrolling track screenshots in grand prix results

* Display the rank a player kart finishes in if not in 1st place
2020-12-21 02:14:52 +01:00
Benau
ccd3f8144c Update first time internet dialog string for removed hardware stats 2020-10-24 09:25:24 +08:00
Benau
618eb87df0 Use TCP stun for more reliable IP type detection 2020-09-03 13:24:49 +08:00
Benau
4a4da3c96c Add splash screen to hide black screen in android during launching 2020-08-27 12:52:58 +08:00
Benau
33fb8d3f5b Update code for android tv 2020-07-14 15:22:25 +08:00
Benau
d8beb5bdb6 Allow main menu auto resize if missed a resize event 2020-07-12 12:14:46 +08:00
Benau
8cc4dd3383 Initial work to make android STK use SDL2 completely 2020-07-12 08:25:06 +08:00
Benau
ea0380ae16 Use SDL2 to create iOS device 2020-06-11 11:40:25 +08:00
Benau
d4cd6d6fc9 Add minimum window size 2020-06-06 01:02:01 +08:00
Benau
da1d41bf85 Add resizing of GUIEngine (only works with some screen) 2020-06-04 15:49:34 +08:00
Benau
2eaca2091e Use SDL2 to handle window creation 2020-06-02 10:36:06 +08:00
Benau
32e3e4a504 Make gamepad visualization work with SDL2 2020-04-21 19:40:30 +08:00
Benau
93cf4bab52 Fix crash in case system doesn't support IPv4 or IPv6 2020-04-14 11:35:43 +08:00
Benau
6b08a873a2 Allow world to have 2 process instances
Also add specific process type handling to world
2020-02-28 09:43:25 +08:00
Benau
63bad92765 Turn race event manager into a singleton get for 2 processes 2020-02-28 09:43:00 +08:00
Benau
ccdca532b5 Turn projectile manager into a singleton get for 2 processes 2020-02-28 09:42:52 +08:00
Benau
6a3e606c2d Turn race manager into a singleton get for 2 processes 2020-02-28 09:42:44 +08:00
Benau
c8ea01d264 Initial work on client server within same process 2020-02-28 09:41:07 +08:00
Benau
b7f2a9614d Add tool for server creation in the same process
For iOS or Android App Bundle (or other platform) where create process
or fork is not possible or can not be easily done
2020-02-28 09:35:25 +08:00
Benau
4a9135c8c0 Avoid pushing and using screen in no graphics 2020-02-15 16:38:49 +08:00
Benau
88bbdbdc92 Move no graphics setting to guiengine which is a better place 2020-02-15 14:00:48 +08:00
Benau
e0f494abcd Allow server AI starting in a same process with client 2020-02-10 16:39:47 +08:00
Benau
92a11c075a Rename NetworkAITester to NetworkAIInstance for a proper name 2020-02-10 09:38:23 +08:00
Benau
99a5675abe Add UserDefinedServer class to allow saving the server name easier 2020-02-05 14:06:51 +08:00
Benau
33d228bb6d Clean up header files and remove unused class 2020-02-01 10:45:15 +08:00
Benau
23ad6f09a6 Clean up direct connection code with full IPv6 support 2020-02-01 09:30:40 +08:00
Benau
e1188c5532 Fix non random client port (NetworkConfig initialized too early) 2020-01-30 11:30:54 +08:00
Benau
6abd3bbf69 Add socket address to support both IPv4 and IPv6 2020-01-27 11:50:15 +08:00
Benau
63c7c711d5 Fix IPv4 only server in dual stack network 2020-01-23 16:43:46 +08:00
Benau
8486b11da6 Allow setting public address for IPv6 client 2020-01-23 01:16:02 +08:00
QwertyChouskie
594cfefeed Fix CMD flags in main.cpp (#4180)
Came across these when working in my branch.
2019-12-25 10:44:28 +08:00
Benau
a46f82420f Bigger confirm internet dialog size for small iPhone screen 2019-12-23 09:15:01 +08:00
Benau
4d0952c716 Clear up tips manager 2019-12-18 12:52:45 +08:00
杜茂森
1ade00462d Simple tips manager (#4146) 2019-12-18 02:23:06 +01:00
Benau
49651cca4f Allow connect to server with domain in IPv4, fixed #3969 2019-12-14 09:52:04 +08:00
Benau
5f32b81ab8 Fix stk server crash 2019-11-03 02:43:31 +08:00
Benau
5c9df8d9a2 Fix profiling mode of stk 2019-11-02 00:07:10 +08:00
Alayan-stk-2
770d02b19b
Compute and display a story mode timer (#4121)
This is the result of my previous work, with a port of the timer version that was developed for a 1.0 mod. It has been used by several players so no major issue should exist, though UI and other elements may require adjustment to smooth some rough edges.

It features both a casual story mode timer storing the total time to complete the story mode (on by default) and a "speedrun" timer (off by default). The casual timer is paused whenever the player exits story mode, and supports play over multiple sessions. It is only displayed in the overworld and during challenges ; while the speedrun timer is permanently displayed.

Fix #2907
2019-11-01 13:25:27 +01:00
Alayan
50988c6c60 Fix #3687 2019-10-26 02:28:42 +02:00
kxxvii
816cd3f3bf Additional trivial type/word fixes for man page and '-h' (#4102)
* Command-line help typo, fix
	modified:   src/main.cpp

* Typo fix, GNU/Linux manual
	new file:   doc/supertuxkart.1
	modified:   src/main.cpp

* More word and typo fixes in man/'-h'
	modified:   doc/supertuxkart.1
	modified:   src/main.cpp
2019-10-22 01:54:54 +08:00