Anders Jenbo
93358a290c
[SDL1.2] Check if an appropriate video mode exists for the given movie
...
This lets us fall back to software scaling for devices that do not
support a video mode that matches the given video.
6 years ago
Marcin Konicki
9a70a5c644
Prevent double free of sound chunk in storm ( #744 )
6 years ago
Marcin Konicki
aace1b46de
Implement `--save-dir` CLI option
...
* Lazy load ini, this also fixes launching the game on Android
6 years ago
BDC
741cdb2494
Fix memory leak with audio stream not been released
...
SFileChunk was not been release.
6 years ago
Anders Jenbo
6d9089ec87
Fix compiler warning
6 years ago
Anders Jenbo
bd6eebedb1
Drop storm_dx.cpp
6 years ago
Gleb Mazovetskiy
658b44f613
SVid: Only switch video mode if full-screen
...
borderless counts as full-screen here (this is what RetroFW reports when
fullscreen=0)
6 years ago
Gleb Mazovetskiy
ea32475ce9
SDL1: Avoid software-scaling SVid when possible
...
Set the video mode close to the SVid resolution while preserving aspect ratio.
Restore the video mode once the video has finished playing.
Also avoids allocating a tmp surface unless scaling.
6 years ago
Anders Jenbo
08aa6a860a
Move generic helpers out of miniwin
6 years ago
Anders Jenbo
cc4d6b57d8
Remove unused miniwin IO
6 years ago
Anders Jenbo
913de17a56
Use SDL_Color nativly instead of converting betwen it and PALETTEENTRY
6 years ago
Anders Jenbo
c3f283429b
Fix high CPU load when game is minimized
6 years ago
Anders Jenbo
e5d4e99a69
Fix end movie not looping
6 years ago
Anders Jenbo
50661842b0
Implement SFileSetBasePath
6 years ago
Anders Jenbo
40d272241b
Implement --data-dir for setting mpq path
...
This also implements a much cleaner version of diablo_parse_flags
Fixes #219
6 years ago
Anders Jenbo
adad63cc72
Revert "Lazy load ini"
...
This reverts commit e316bce4d0 .
6 years ago
Anders Jenbo
e316bce4d0
Lazy load ini
...
This will hopfully solve the crash issues on Android
6 years ago
Anders Jenbo
a4d612d509
Clear video buffer
...
This avoids garbage appearing in the video boarder when not using a render
6 years ago
Anders Jenbo
4532f009ff
Remove old anti-cheat code from save function
...
Tthis code simply logs the save time of a multiplayer game in the
register database, this was likly done as part of an anti cheat scheme
(the key was "Video Player"), but appears to have since been disabled.
Probably to allow moving save games between PC's which was supported
when better Windows 2000 support was added.
6 years ago
Gleb Mazovetskiy
ddce870dda
Handle scaling for SDL1 ( #370 )
...
Only some handheld devices support auto-scaling.
On desktop and some handhelds we need to downscale manually.
Hardware auto-scaler check for jz4760 provided by @jbanes and @scooterpsu
6 years ago
Gleb Mazovetskiy
f0eab35672
SDL 2.0.3 SVid: Use non-device Audio API
...
Fixes audio in movies on RG350!
From SDL docs: The legacy calls are good both for backwards compatibility and when you don't care about multiple, specific, or capture devices.
7 years ago
Gleb Mazovetskiy
f13d2d193a
SDL 2.0.3 SVid: Zero audio buffer before MixAudio
7 years ago
Gleb Mazovetskiy
df8d7a1f46
Compatibility with SDL v2.0.3
...
RG350 and GCW0 devices have an ancient version of SDL2.
7 years ago
Gleb Mazovetskiy
dd5bc39816
Get a fresh window surface before rendering to it ( #358 )
...
* Get a fresh window surface before rendering to it
It is possible that a window surface gets invalidated since we initially
obtained it. We need to call GetWindowSurface every time we want one,
instead of keeping a pointer to a possibly stale one.
See https://hg.libsdl.org/SDL/file/369b01006eb2/src/video/SDL_video.c#l2312
Fixes #351
7 years ago
Anders Jenbo
810b12a37d
Drop unused code
7 years ago
Anders Jenbo
a8e4db538f
Display SDL error messages in UI dialog
...
This will also end the application in most cases
7 years ago
Gleb Mazovetskiy
426c246535
Simplify SDL1/2 palette handling
...
SDL 1 and 2 handle surface palettes very differently.
This adds a few compatibility functions that do the right thing
depending on the SDL version.
7 years ago
Gleb Mazovetskiy
2fb84d5f60
Renderer texture: use RGB888 instead of RGBA8888
...
Massively improves renderer performance.
7 years ago
Anders Jenbo
73a7a1ae6d
Remove unimplemented functions that aren't needed with SDL
7 years ago
Anders Jenbo
ba9288c6cf
Unify error dialogs, for looks and portability
...
- Use UiOkDialog() to display all error messages
- Add SDL simple message, and console fallbacks to UiOkDialog()
- Boot graphics early on to facilitate most error messages with build in
gui
- Some more miniwin clean ups
7 years ago
Gleb Mazovetskiy
e2a1c90979
storm.cpp: simplify getIniPath
7 years ago
Gleb Mazovetskiy
7f61128d32
Fix more compilation warnings
...
```
SourceX/storm/storm.cpp:27:10: note: ‘snprintf’ output between 11 and 270 bytes into a destination of size 260
snprintf(file_path, DVL_MAX_PATH, "%sdiablo.ini", path);
```
SDL1 warnings:
```
devilutionX/SourceX/dx.cpp:199:24: warning: narrowing conversion of ‘(int)dwX’ from ‘int’ to ‘Sint16’ {aka ‘short int’} inside { } [-Wnarrowing]
SDL_Rect dst_rect = { (int)dwX, (int)dwY, w, h };
SourceS/sdl2_to_1_2_backports.h:616:18: warning: comparison is always false due to limited range of data type [-Wtype-limits]
if (final_dst.w < 0)
SourceS/sdl2_to_1_2_backports.h:777:24: warning: comparison of integer expressions of different signedness: ‘const int’ and ‘long unsigned int’ [-Wsign-compare]
if ((rc > 0) && (rc < sizeof(path))) {
~~~^~~~~~~~~~~~~~
SourceX/storm/storm.cpp:479:16: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare]
if (out_len <= item->len) {
SourceX/storm/storm.cpp:716:60: warning: narrowing conversion of ‘((640 - scaledW) / 2)’ from ‘int’ to ‘Sint16’ {aka ‘short int’} inside { } [-Wnarrowing]
SDL_Rect pal_surface_offset = { (SCREEN_WIDTH - scaledW) / 2, (SCREEN_HEIGHT - scaledH) / 2, scaledW, scaledH };
DiabloUI/credits.cpp:525:30: warning: narrowing conversion of ‘- y’ from ‘int’ to ‘Sint16’ {aka ‘short int’} inside { } [-Wnarrowing]
SDL_Rect src_rect = { 0, -y, text_surface->w, 251 };
```
7 years ago
Anders Jenbo
bd2c08183c
Fall back to relative path when unable to use SDL
7 years ago
Gleb Mazovetskiy
4f6c5791a7
Fix some compiler warnings
7 years ago
Anders Jenbo
e88e574c5f
Drop unimplemented code
7 years ago
Anders Jenbo
06bcd3c3f9
Handle file paths in a clean way
...
Belated birthday present for @mewmew
Functions for gettings paths have sensible names
It's using snprintf for safe? string concat
Paths don't use \ as path reporator, or magic marker
Drop code for copying pre 1.09 save games from the windows folder
7 years ago
Anders Jenbo
3b2ba952b2
Fix video audio on Big Endian
7 years ago
Anders Jenbo
4ef30b9612
Fix menu on Big Endian systems
7 years ago
Anders Jenbo
1d03064fee
Clean up sound code
7 years ago
Anders Jenbo
88813c4042
Strip some now unused parts of miniwin and windows api
7 years ago
Gleb Mazovetskiy
cf0f867ca0
DrawArt via SDL
7 years ago
Gleb Mazovetskiy
5359149a38
SDL1: Audio and video support
...
1. Implements audio support for SDL1
2. Implements blit scaling and correct video rendering for SDL1
7 years ago
Gleb Mazovetskiy
85295838a4
An option to use SDL1 instead of SDL2
...
Adds a USE_SDL1 build option to use SDL v1 instead of v2.
This is useful for porting Diablo on devices that don't support SDL2,
such as the RetroFW / OpenDingux devices (e.g. RG300 Retro Gaming Handheld)
Not yet supported:
* Fullscreen
* Upscaling
* Audio
7 years ago
Anders Jenbo
5cadee74c2
Fix a few compiler warnings
7 years ago
Anders Jenbo
6a73d98e25
Remove reamaning dummy methodes only used in sound.cpp and dx.cpp
7 years ago
Anders Jenbo
1ebf8fe27d
Remove unused fallbacks
7 years ago
Anders Jenbo
6207832d6e
Update to latest upstream headers
7 years ago
Anders Jenbo
b919548f55
Avoid audio system conflicts during video playback
7 years ago
Anders Jenbo
6cd0a55089
Scale video in software when upscale is disabled.
...
Also fix some warnings when upscaling is disabled
7 years ago
Anders Jenbo
79711f4dcd
Avoid double copying on video playback
7 years ago