Anders Jenbo
a2656637e4
🎨 Format source
5 years ago
Juliano Leal Goncalves
800dbce066
♻️ Move options-related structs to new 'options.h' file
5 years ago
Gleb Mazovetskiy
70d1d633bd
Get rid of SCREEN_X / SCREEN_Y
...
GlobalOutputBuffer() now returns a clipped subregion
5 years ago
Gleb Mazovetskiy
cd59a1c323
Completely replace gpBuffer with CelOutputBuffer
...
`CelOutputBuffer` now contains an `SDL_Surface` and an `SDL_Rect`.
We now have access to SDL surface manipulation functions.
`gpBuffer` and `gpBufEnd` are completely gone 🧹
This results in some FPS loss (250 -> 195) recovered in a subsequent
commit.
5 years ago
Trihedraf
a4c34112af
🚩 Add ini toggle for FPS Limit. Enabled by default. ( #1165 )
5 years ago
Juliano Leal Goncalves
103cde53ff
♻️ Make options struct hierarchical
5 years ago
Anders Jenbo
d0248caf8d
💚 Fix SDL1 builds
5 years ago
Anders Jenbo
b8e38ec560
Correct typo
5 years ago
Gleb Mazovetskiy
21bb021641
Clean up gpBufEnd initialization
...
Initialization of `gpBufEnd` was done in a convoluted way
that only happened to work.
Cleans up initialization and moves it to dx.cpp.
5 years ago
Anders Jenbo
39999791b3
Revamp ini options and sync in multiplayer
...
[NetMsg]
F12=Now you DIE!
F11=Here's something for you.
F10=Follow me.
F9=I need help! Come Here!
[Game]
Speed=50
Fast Walk=1
Grab Input=0
Theo Quest=0
Cow Quest=0
[Audio]
Sound Volume=0
Music Volume=0
Walking Sound=1
[Graphics]
Fullscreen=1
Fit to Screen=1
Scaling Quality=2
Integer Scaling=0
Vertical Sync=1
Blended Transparency=1
Gamma Correction=100
Color Cycling=1
[Diablo]
Intro=0
[Hellfire]
Intro=0
SItem=
[Phone Book]
Entry1=127.0.0.1
[Network]
Bind Address=0.0.0.0
5 years ago
Anders Jenbo
36a196389b
Fix remaning basic compiler errors and warnings
5 years ago
Ivan Epifanov
85be8ed77e
[vita] Speed up. Add option to disable back touch
5 years ago
MrHuu
7e35651b2f
[3DS] CMake re-visited
...
Reflect latest devkitpro libctru / 3ds-sdl-1.2 changes
- Controls now use SDL_JOYSTICK with circlepad enabled
- Shutdown / suspend / sleep are functional
5 years ago
MrHuu
1fa8b6f4e4
[3DS] Initial port
5 years ago
Juliano Leal Goncalves
8d896d54f7
Softcode VSYNC setting. Enabled by default. ( #783 )
6 years ago
qndel
f66339a9ac
clean unused variables
6 years ago
Anders Jenbo
69ad34f58f
Consistently use NULL instead of nullptr
...
While nullptr does have extra checking, most of the code uses NULL and
nullptr makes it harder to port the code to some targets like the
original XBox
6 years ago
Manuel Alfayate Corchete
03662be548
Remove atexit() calls and implement a diablo_deinit() function instea… ( #694 )
...
* Remove atexit() calls and implement a diablo_deinit() function instead that cleans up every subsystem if it has been init before.
6 years ago
Robin Eklind
21e2d2f9de
Resolve CreatePalette name conflict
...
Fixes #641 .
6 years ago
Gleb Mazovetskiy
803217538a
DiabloUI: Fix software scaling along the X axis
6 years ago
Gleb Mazovetskiy
58fde28a2a
Blit: ifdef all SDL1 stretching code
...
OutputRequiresScaling is always false on SDL2 so we don't need SDL2
compatibility there
6 years ago
Gleb Mazovetskiy
114a166a01
Blit: Fix scaled output handling
...
Fixes #594
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
32d91cb446
Render menu directly to the output surface
...
Fixes fades not reset when switching to a new menu before fade had
ended.
Fixes incorrect start position for credits.
6 years ago
Anders Jenbo
edeca6574d
Replace tagRECT with SDL_Rect
6 years ago
Anders Jenbo
08aa6a860a
Move generic helpers out of miniwin
6 years ago
Anders Jenbo
67c58583d8
Implement fullscreen toggeling via alt+enter
6 years ago
Anders Jenbo
913de17a56
Use SDL_Color nativly instead of converting betwen it and PALETTEENTRY
6 years ago
Gleb Mazovetskiy
f3ad0c37e1
dx_create_back_buffer: Minor improvement for SDL2
...
Previously, we were copying the colors onto the surface's own palette
that was then immediately replaced by `palette`.
6 years ago
Anders Jenbo
c3f283429b
Fix high CPU load when game is minimized
6 years ago
Anders Jenbo
e577f9bdc7
Remove more old save game format code
...
Multiplayer save games from before 1.08 where using the system name as
the password, so they would need to be converted on the original machine
by 1.08-1.09b before they can be transfered to another system.
6 years ago
Anders Jenbo
a261e8ad65
Better frame delay pressision
...
- Most refresh rates aliging poorly with integer ms
- Adaptive frame limit for low spec devices
6 years ago
Anders Jenbo
0127478673
Improve frame delay for non-v-synced rendering
...
Thanks to @glebm for pointing out the issue, hopfuly this is a better
solution :)
6 years ago
Anders Jenbo
dffc89e41c
Limit FPS when upscaling is disabled
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
afaa25193a
Set surface size to be the logical size
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
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
850d09b0a5
Minor cleanup of internal error handling
...
1. TTF no longer crashes on exit.
2. Art failing to load simply isn't rendered instead of crashing in random places.
3. Fixes empty line rendering in ttf_render_wrapped.cpp
4. dx_cleanup is now idempotent.
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
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
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
6a73d98e25
Remove reamaning dummy methodes only used in sound.cpp and dx.cpp
7 years ago
Anders Jenbo
7479f3a4ff
Strip more dummy code
7 years ago
Anders Jenbo
288f31a1f1
Clean up unused code
7 years ago