1
0
Fork 0
Commit graph

4513 commits

Author SHA1 Message Date
Patryk Obara
0506aaf436 Stop silencing disabled C4786 MSVC warning
This is old, and disabled by default in new MSVC compilers.
It was purely infomational warning:

"object name was truncated to 'number' characters in the debug
information"

Regardless, even if we'll decide to silence it again for any reason,
then it should be configured in VS project and not using ifdefed
pragma in the code.
2019-12-29 20:04:39 +01:00
Patryk Obara
475e315943 Stop silencing 'throw' warnings in MSVC
Warning C4290 informs users, that MSVC ignores throw specification. This
is very good warning, because 'throw' specifications were faulty design
and got deprecated in C++11 and REMOVED from the language in C++20.

Throw specifications were replaced by much better 'noexcept' keyword,
which allows for compile-time checks, unlike 'throw', which might
silently inject exception 'std::unexpected'.
2019-12-29 20:04:39 +01:00
Patryk Obara
bbf4e80ac1 Stop silencing deprecation warnings in MSVC
Warning C4996 informs users about deprecation, using either MSVC
__declspec(deprecated) modifier, or the C++14 [[deprecated]]
attribute.
2019-12-29 20:04:39 +01:00
Patryk Obara
aff02450d1 Move GCC_ATTRIBUTE out of autoconf 2019-12-29 20:04:39 +01:00
Patryk Obara
670654fc7b Remove unnecessary check for XKBlib.h 2019-12-29 20:04:39 +01:00
Patryk Obara
3b157cd785 Add missing headers to autoconfig file
Also sort list of headers, so it's easier to assure no files are
missing.
2019-12-29 20:04:39 +01:00
Patryk Obara
ff2968df3f Move 'likely' macros to the compiler support header
This makes it easier to move away from autoconfig in the future.

Also, use '!!' C trick to prevent accidental incorrect usage of
these macros.
2019-12-29 20:04:39 +01:00
Patryk Obara
cac7ba136c Update allowed warnings limits 2019-12-29 08:12:28 +01:00
Patryk Obara
6cd5f84466 Silence switch warnings for int10 scanline 2019-12-29 08:12:28 +01:00
Patryk Obara
494eee2ea7 Silence format warning 2019-12-29 08:12:28 +01:00
Patryk Obara
bdac00740b Disable unused function in adlib 2019-12-29 08:12:28 +01:00
Patryk Obara
6ed2396a2e Print a newline after 'path' command 2019-12-29 08:12:28 +01:00
Patryk Obara
5c1c653098 Print a newline after user makes a choice
Previously, this command expected newline to be injected by the shell
(which was incorrect behaviour, as shell was skipping it in batch
files).
2019-12-29 08:12:28 +01:00
Patryk Obara
1bdb67b2c3 Add an assert in 'choice' command
Static analyzer indicates that in this context `rem` can be NULL,
therefore should not be passed to strchr, but in this context `rem`
cannot be NULL becasuse `args` is not NULL (even after StripSpaces).
2019-12-29 08:12:28 +01:00
krcroft
a16543d2ee Add -framework CoreFoundation, which CoreMIDI depends on 2019-12-27 07:41:12 +01:00
Patryk Obara
d726f59d83 Hide SoundBlaster autoexec line 2019-12-27 07:34:48 +01:00
Patryk Obara
bb2088eb72 Fix a number of effc++ warnings in shell code 2019-12-27 07:34:48 +01:00
Patryk Obara
08a7f47c2b Fix output of 'dir /w /p' and edge cases
Previous implementation avoided invocation of 'pause' in many edge
cases, e.g.: when pause should be invoked between summary lines.

Avoid displaying '.' and '..' in root directory of mounted drive (just
like other dir implementations do).

Use C++11 for-each loop for iterating over directory entries.

Split code inside the loop by option, resulting in more readable
implementation.

Use "%*s" to inject empty whitespace of calculated size instead of
outputting spaces in a loop.

Leave some TODO notes describing further improvements.
2019-12-27 07:34:48 +01:00
Patryk Obara
64949a6e8c Print volume/drive label in 'dir' cmd
This is in line with any other implementation of 'dir' command. It's
also very useful for identifying e.g. which floppy is currently mounted.

MS-DOS and cmd.exe display Volume Serial Number, but it emulating it in
DOSBox doesn't seem to be very useful.
2019-12-27 07:34:48 +01:00
Patryk Obara
c3e7997f75 Fix conversion warnings after SDL2 transition
Detected by MSVC compiler; several warnings:
"(…) conversion from 'Sint64' to '<type>', possible loss of data"
2019-12-26 03:23:19 +01:00
Patryk Obara
dc0d174824 Remove unused macro definitions 2019-12-26 03:23:19 +01:00
Patryk Obara
9bca78bc77 Remove note about additional dependencies. 2019-12-26 03:23:19 +01:00
Patryk Obara
a7280cf1f7 Query SDL for available texture renderers
There's no point in hardcoding these values - they can be different to
every user (it depends on hardware, OS, SDL version, etc).

Also, future versions of SDL might introduce more renderers, so this way
the code is more future-proof.
2019-12-26 03:23:19 +01:00
Patryk Obara
6ce7ff8b58 Change sdl.renderer to sdl.texture_renderer
Otherwise users might easily miss, that this option is supposed to work
only for 'texture' output.

Also, do slight adjustments to formatting in generated .conf file.
2019-12-26 03:23:19 +01:00
Patryk Obara
cb82a60341 Surround WIN32_LEAN_AND_MEAN with ifndef
Otherwise it redefines macro definition in SDL_opengl.h.
2019-12-26 03:23:19 +01:00
Patryk Obara
3a68ba2b26 Indicate system includes for relevant SDL headers 2019-12-26 03:23:19 +01:00
Patryk Obara
ce7c27a48b Remove irrelevant ifdefs from unifdef-all script
OS/2 and DirectDraw support were removed during upgrade to SDL2.
2019-12-26 03:23:19 +01:00
Patryk Obara
3748ae569a Update note about CD-DA support 2019-12-26 03:23:19 +01:00
Patryk Obara
9d04beaea4 Update allowed warnings limits 2019-12-26 03:23:19 +01:00
Patryk Obara
015f1087b0 Remove reference to SDL 1.2 Caps Lock hack 2019-12-26 03:23:19 +01:00
Patryk Obara
f89f87ced5 Fix large number of effc++ warnings in sdl_mapper 2019-12-26 03:23:19 +01:00
Patryk Obara
6a0d712404 Re-enable screenshots feature for snapshot builds
With SDL2 in place, the silent dependency on libpng12 on Ubuntu 16.04 is
now gone. Unfortunately, development packages for libpng16 are named
differently for Ubuntu 16.04 and 18.04, so we can't add new package to
the global list.
2019-12-26 03:23:19 +01:00
Patryk Obara
bcc7bf326c Update README.md with SDL2 information 2019-12-26 03:23:19 +01:00
Patryk Obara
0d108a7df5 Remove GFX_SetPalette
After move to SDL2, this function is no longer useful.
2019-12-26 03:23:19 +01:00
Patryk Obara
5df38b5cdc Update SDL2 description in INSTALL file 2019-12-26 03:23:19 +01:00
Patryk Obara
ac601ee019 Update the list of output values in README
Initial testing indicates, that problem described in this section in
README file might be fixed with SDL 2.0, but it is not fully confirmed
that it's fixed yet.
2019-12-26 03:23:19 +01:00
Patryk Obara
51d535bd66 Remove patch for SDL1 sources
We don't patch external projects before builds.
2019-12-26 03:23:19 +01:00
Patryk Obara
7a415e3b8d Remove last remains of DirectDraw renderer
SDL2 patch replaced it with output=texture renderer=direct3d
2019-12-26 03:23:19 +01:00
Patryk Obara
1a58ccb14f Reorder includes in sdl_mapper 2019-12-26 03:23:19 +01:00
Patryk Obara
532345f70e Fix warnings related to misuse of SDL2 types
Use the opportunity to implement a bunch of formatting changes and fix
other warnings.
2019-12-26 03:23:19 +01:00
Patryk Obara
f9f97573dd Update VS solution to target SDL2 2019-12-26 03:23:19 +01:00
Patryk Obara
58a4ff067d Update fake SDL headers for MSVC 2019-12-26 03:23:19 +01:00
Patryk Obara
44c7fb9165 Update CI to target SDL2 2019-12-26 03:23:19 +01:00
Patryk Obara
185c8af6f5 Update buildsystem to target SDL2
Replace sdl-config with sdl2-config, and add few smaller changes.
2019-12-26 03:23:19 +01:00
Patryk Obara
a06035a35e Replace SDL 1.2 with SDL 2.0
This massive patch is based on work of NY00123, which was published on
Vogons forum in 2013 and was waiting for inclusion in SVN since then:

https://www.vogons.org/viewtopic.php?f=41&t=34770

Revision from December 2018 was used to kickstart this work. However, a
number of changes were implemented:

- Original patch preserves all SDL 1.2 code by ifdefing it; this patch
  completely removes all code ifdefed for several versions of SDL 1.2.*
  This way the code will be easier to maintain going forward and
  features enabled by SDL 2.0 do not need to be backported.
  A side-effect of this change is almost-complete removal of DirectDraw
  support - but users can now use Direct3D based acceleration (without
  any ifdefs in code).
- Code ifdefed for Android was removed to make the project easier to
  understand and modify. Android port should still be possible, but it
  requires more work (mostly CI and buildsystem work).
  Android-related functionalities that were cross-platform were
  preserved.
- Code ifdefed for OpenGL ES (which was only used for Android) was
  removed - this should not affect Android support, as
  hardware-accelerated 2D should still be viable via "texture" output,
  but it was not tested, as buildsystem does not support Android ATM.
- SDL_cdrom code is not included; it was outside of scope of SDL2
  changes. Inclusion of that library did not justify supporting one
  small usecase (playblack of CD audio from physical CDs).
- Few code warning were fixed (but new sdl_mapper implementation
  introduces many, many new warnings).
- Some formatting changes were implemented.

Overall, the original patch had ~40k lines of code - here it was
trimmed to +769,-972 (so more old code got removed than new code added).

This implementation was extensively tested on Linux and somewhat tested
on Windows 10.  It fixes numerous issues (too many too list).

Testing found two small regressions:

- Starting game in fullscreen makes it impossible to switch back to
  windowed mode correctly (Windows 10)
- Scaling works a bit worse, only in text mode, only in window (Linux)

This implementation introduces revised user settings in sdl section - it
is only partly compatible with settings from SDL 1.2; this is an issue,
but it will need to be addressed in a separete commit.
2019-12-26 03:23:19 +01:00
Patryk Obara
3eaabb41c1 Fix output formatting of 'dir' command
Adapt to 'pause' command working correctly (assuming the terminal height
is 25, this will need further adjustments for supporting 80x50 and
different modes).

Adjust "intro" by 1 space to make formatting the same as MS-DOS 'dir'
command - this makes intro not "merge" visually with the files listed.

Adjust placing of files and directories counters, to make it resemble
most 'dir' implementations.

Count intro lines for purpose of correct pagination with 'dir /p'.

Skip counting not printed lines with 'dir /b /p'.

Output of 'dir /w /p' is still broken, but fixing it will require more
invasive changes.

Fixes: #75
2019-12-23 21:52:37 +01:00
Patryk Obara
e68a64aade Adjust 'help /all' to fixed 'pause' 2019-12-23 21:52:37 +01:00
Patryk Obara
b0cdfa5161 Do not print newline after every command
This newline is already ommitted from batch files and noecho commands,
this change makes the behaviour consistent in interactive mode.

Additional newline is a behaviour inherited from MS-DOS, and even still
visible in Windows cmd.exe, but all modern DOS implementations,
PowerShell, unix terminals, etc - they all prefer consistent behaviour
over addtional newline. Also, there's no point in wasting 4% of screen
estate just to show empty line.

This fixes CLS command, which is now able to properly clean the screen
and place prompt in the first line.
2019-12-23 21:52:37 +01:00
Patryk Obara
c20579a835 Display newline after key was pressed in 'pause' cmd
Move newline from the string message to the WriteOut in command itself.
This makes the PAUSE command behave like the original, which is
important for commands like DIR /P.
2019-12-23 21:52:37 +01:00
krcroft
12ab0da9c8 Adjust time at which "Config heavy" runs
An unfortunately pattern has emerged where Chocolately's repository
servers have been offline or returning error-codes at roughly
5am GMT.

This commit moves the start inside "office hours" for the
majority of Chocolatey's user-base:
 - 9am in California & Vancouver
 - 11am in New York
 - 4pm in London
 - 5pm in Poland and Germany
2019-12-19 20:01:32 +01:00