Age | Commit message (Collapse) | Author | Files | Lines |
|
There were some inconsistencies between the values set up in
`Client::initConfiguration` and those in `getConfigDefaults`. These
duplicates have now been removed.
For some of these settings the code getting the values had to be
adjusted to use getBoolValue, to actually rely on the provided default
instead of one provided as a parameter.
|
|
The logic update now uses Time::deltaTimeMs() where needed to make it
framerate-independent. This means there will no longer be multiple logic
calls per frame (as was usually the case with logic ticking at 100 fps
whereas the game would generally run at 60 fps).
At the same time, the game can be more precise at higher framerates and
should now run smoother at 144 Hz, for example. Previously the game would
sometimes skip logic ticks at that rate.
This change affects:
* Updating of animations
* Being movement speed
* More moving of manual time variables to Timer
Notoriously, the particle system still does 100 ticks/second.
|
|
The Timer is efficient because it does not depend on incrementing a
counter to keep track of time, nor does it call SDL_GetTicks every time
its state is checked (this happens once per frame instead).
Along with global functions Time::absoluteTimeMs() and
Time::deltaTimeMs(), this replaces previous globals tick_time, cur_time
and get_elapsed_time().
For now, there is still a fixed 100 times per second logic call rate,
but the new Time::deltaTimeMs() function should allow getting rid of
this.
|
|
This was already done in the log, when responding to the --version
parameter and for the label on the Desktop widget, but not in the Setup
window. Now it is consistently part of the FULL_VERSION define.
|
|
- Updated STATE_WORLD_SELECT case to automatically select the first
world and proceed to update state when mOptions.chooseDefault is true.
- This change ensures that the world selection window is bypassed for a
smoother user experience when the default selection option is enabled.
- Improved logic to handle cases with only one available world and
directly proceed without showing the dialog.
|
|
Also enable using `cpack -G DragNDrop` to create a DMG to easily drag
Mana into the Applications folder.
The DMG is also available as a CI artifact.
The minimum deployment target has been set to 10.15, as required due to
usage of std::filesystem::create_directories.
|
|
This should make CMake options a little more standardized. The Windows
part could potentially still be unified further.
Absolute paths are now only used for the defines and not for values
going to install() commands.
|
|
Set SDL_HINT_WINDOWS_DPI_AWARENESS to "permonitorv2", which tells
Windows the application will handle all scaling.
We don't currently adjust the window size when it changes monitors, but
mainly use this hint to disable scaling by the system, since that blurs
fonts and pixel art. Once we can properly handle fractional scaling
(which is common on Windows), we can set SDL_HINT_WINDOWS_DPI_SCALING to
"1" instead.
|
|
Ported from CSIDL to newer FOLDERID API and used wcstombs_s to
convert the returned path to a multi-byte string.
Fixes issues when the Windows username contains special characters.
|
|
Also added instructions for installing the dependencies on MSYS2.
The selection of the default language is commented out for now. It will
be fixed in another change.
|
|
* Removed some unused includes
* Removed unused ListBox::mFont
* Removed wrong cast to SDL_Scancode
* Removed superfluous .c_str()
* Removed superfluous explicit std::string construction
* Removed unused variable
* Use more emplace_back
* Turned FindBeingFunctor into a lambda
* Avoid needless pointer references for ambient layers and use a vector
|
|
* TrueTypeFont class now takes into account the graphics scale, in order
to render an appropriate higher-resolution texture.
* Removed TrueTypeFont::fontCounter, since TTF_Init/TTF_Quit already
keep a counter.
* Avoid copying the rendered string needlessly, when it already exists
in the cache. Avoid another copy, when inserting a new chunk into the
cache.
|
|
This is generally expected on Linux, where it feels annoying that the
initial click just focuses the window.
On macOS it's a little bit different, since applications can be specific
about which elements are directly clickable and which aren't, but in
general it feels better to me when the UI can be interacted with
directly.
|
|
* Added "Scale" user option, which can either by "Auto" or an explicit
scaling factor. Its maximum value depends on the current resolution.
The "Auto" factor is based on keeping the logical resolution on at
least 800x600, wheres the maximum scale is based on keeping the
logical resolution on at least 640x480.
* Enabled support for High DPI. This means the rendering target can now
have a different resolution than the window size, which can happen on
macOS, Windows and Wayland. The resulting scale is multiplied by the
above user-controlled scale.
Currently, this looks ugly for non-integer scales, which are not used
on macOS and can only be configured on some Wayland compositors.
Has not been tested on Windows.
* Simplified OpenGL initialization (moved out of _beginDraw).
* Made sure _beginDraw/_endDraw sets a clip area also for SDLGraphics.
|
|
* Use default member initializers
* Use range-based for loops
* Avoid needless pointer references for ShopItem::mDuplicates
* Removed type aliases that are only used once or twice
* Removed more unused includes
* Removed some unused functions
* Removed superfluous .c_str()
* Rely on default copy and assignment operators for Vector class
* Use std::unique_ptr in some places
* Removed duplicated mPlayerMoney updating in SellDialog
* Removed duplicated Game::handleInput call
* Removed unused SDLInput::mMouseInWindow
* Removed remnant of manual widget positioning in HelpWindow
* Removed superfluous initialization of static pointers
|
|
Since the upgrade to SDL2 it was only used for framerate limiting, which
I've replicated in a small helper class.
Also reduced the framerate limit while minimized from 100 to 10 FPS.
|
|
* Use final for all message handlers, Client, LocalPlayer,
Being::getType, Being::setPosition and Being::setMap.
(avoids some warnings about virtual dispatch in constructors)
* Use auto in more places
* Use emplace_back instead of push_back in some places
* Use default member initializers
* Less else after return
* Removed superfluous .c_str()
* Removed type aliases that are only used once
* Removed more unused includes
|
|
Also made it exit with error when there is an unknown option or missing
argument.
|
|
|
|
Usually this would be guessed correctly by the port, but now it is also
possible to just specify the server type and the port will be derived
from there, unless a default port is given in the branding file.
Closes #56
|
|
The configuration and setup UI were adjusted to the new options.
This also fixes issues in applying new video settings.
Default resolution was changed from 800x600 to 1280x720. VSync is
enabled by default while FPS limit was disabled.
Display aspect ratio for the resolution options.
I had to work around some macOS issues:
* Don't change window size when it appears to be "maximized", since it
just changes the rendering area while leaving the window maximized.
* Unset fullscreen display mode temporarily to allow changing resolutions,
otherwise the rendering area no longer matches the screen and mouse
input is also off.
* Removed SDL_WINDOW_ALLOW_HIGHDPI for now because it causes issues on
macOS, since we're not actually handling the scaling factor.
A Video class and an SDLGraphics subclass were split off from Graphics.
This setup has Less duplication and leaves the OpenGLGraphics and
SDLGraphics better separated.
Fixes #57
Fixes #58
|
|
* Use default member initializers
* Use range-based loops
* Don't use 'else' after 'return'
* Removed some unused includes
* Construct empty strings with std::string() instead of ""
* Clear strings with .clear() instead of assigning ""
* Check whether strings are empty with .empty() instead of comparing to ""
* Removed redundant initializations
|
|
Unfortunately, since we're making a difference between config and data,
and also want to know where to write screenshots, we can't get rid of
PHYSFS_getUserDir entirely. We'd need a replacement to get rid of the
deprecation warnings.
Also removed copying of old config file at "/.tmw/config.xml".
|
|
modernize-use-auto
modernize-use-nullptr
modernize-use-override
modernize-use-using
|
|
Since we now use SDL2, OpenGL is used through the SDL2 API. This appears
to work very well and handles resizing better (with less flicker). Our
manual OpenGL rendering code is probably obsolete.
The "hwaccel" option referred to hardware accelerations supported by
SDL1 and is no longer relevant.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This file was introduced by ManaPlus as a way of configuring the
character creation process. It defines the number of hair styles
and colors, how stat points should be divided and what the starting
equipment of the player is.
The minimum and maximum hair color/style IDs are not supported at
the moment.
This is mostly a backport of ManaPlus commits 10cf52b5 and dcc18eba,
with some style changes.
Mantis-issue: 501
Reviewed-by: Ablu
|
|
Reviewed-by: Erik Schilling
|
|
Before it was only enabled by default for Mac.
Reviewed-by: Erik Schilling
|
|
One of the sound channels is reserved for notification sounds, of which the
volume can be configured separately. Currently, the only notification sound
that is played is for receiving whispers. That can be extended later.
The newmessage.ogg sound used currently is the one for receiving a message
with the Psi instant messenger.
Parts of this patch are based on the new message notification in ManaPlus.
Reviewed-by: Erik Schilling
|
|
Unified Graphics:setFullscreen and Graphics:resize into a single
Graphics:changeVideoMode function that tries to restore the existing mode when
changing to the new mode didn't work, and exists with an error when that also
fails.
Split up handling of SDL_VIDEORESIZE and the adapting to new resolution in the
Client class, so that the second part could also be called when changing
resolution fullscreen mode.
The Video tab in the Setup window now also filters out any modes smaller than
640x480 since the game won't properly adapt to that resolution anyway.
Reviewed-by: Yohann Ferreira
|
|
If the player switches login, then the password field in the
login window should be empty. This was not the case after
registering or password change.
Reviewed-by: Ablu, Bertram
|
|
I also made the button not readjust its size when deleted
to avoid a crash.
Reviewed-by: Erik Schilling
|
|
- I made the charCreatedialog handle a possible
max permitted color Id and a minimum hair style id for tA.
- Added a foundation to later load the styles and colors from
the same file, to handle the Mana-issue #224 for manaserv.
- Support for non-contiguous hair color and style ids
has also been added.
- I also replaced the < and > arrow signs with images.
Reviewed-by: Ben Longbons, Thorbjørn Lindeijer
|
|
Previously it was interfering with the 'switch character' functionality.
Reviewed-by: Erik Schilling
|
|
|
|
Makes sure that the client starts up again in the same size.
Reviewed-by: Erik Schilling
|
|
Use Mix_LoadMUS_RW to stream music files directly from PhysFS. I kept
around ResourceManager:copyFile for now, since it may have other uses.
Also cleaned up some initialization of configuration defaults.
Reviewed-by: Yohann Ferreira
|
|
Window positions are semi-smartly corrected as a result of the resize.
Not supported when using OpenGL on Windows for now.
Reviewed-by: Yohann Ferreira
|
|
This will ease the reading of the next patch about hair handling
at character creation time in tAthena.
As requested by bjorn.
Reviewed-by: bjorn
|
|
This was already done by ManaPlus. It's a good idea anyway and it makes
comparing the code a little easier.
Reviewed-by: Yohann Ferreira
|
|
Reviewed-by: Ablu
|
|
Resolves: Mana-Mantis #381.
Reviewed-by: Ablu.
|
|
enforced by -std=c++0x
Reviewed-by: Thorbjørn Lindeijer
|
|
Just some stuff that piles up while "looking" at the code, which
eventually gets annoying to ignore while staging real changes.
* Replaced a few NULL occurrences with 0
* Rely on default parameter for std::vector::resize.
* Replaced a few "" with std::string()
* Prefer .empty() to == ""
* Removed a few comparisons with NULL
* Don't check pointers before deleting them
* Removed a bunch of redundant semicolons
* Made some global variables static (local to their compilation unit)
* Prefer prefix ++/-- operators to postfix versions when possible
* Corrected location of a comment
|