Commit Graph
37 Commits
Author SHA1 Message Date
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.
2019-10-03 08:07:51 +02:00
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 };
```
2019-09-29 16:32:17 +02:00
Anders Jenbo 1d03064fee Clean up sound code 2019-09-25 11:32:30 +02:00
Anders Jenbo 88813c4042 Strip some now unused parts of miniwin and windows api 2019-09-25 01:18:42 +02:00
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
2019-09-23 01:42:05 +02:00
Anders Jenbo 6a73d98e25 Remove reamaning dummy methodes only used in sound.cpp and dx.cpp 2019-08-27 04:35:34 +02:00
Anders Jenbo 7479f3a4ff Strip more dummy code 2019-08-27 02:50:31 +02:00
Anders Jenbo 288f31a1f1 Clean up unused code 2019-08-27 02:41:44 +02:00
Anders Jenbo 9925b2d7b8 Remove uninitialized parameteres 2019-08-27 02:30:14 +02:00
Anders Jenbo 1ebf8fe27d Remove unused fallbacks 2019-08-26 14:05:04 +02:00
Alex Yatskov f1da6e6a38 Fix invalid file and line constants (#222)
* Fix invalid file and line constants

* add macros

* remove ASSERT_FAIL macro
2019-08-07 15:49:20 +02:00
Anders Jenbo a2211ea1a4 update dx.cpp 2019-06-28 22:10:06 +02:00
Anders Jenbo b81ca8502d Fix some memory leaks 2019-05-12 23:35:48 +02:00
Anders Jenbo 897c090338 Merge dx.cpp 2019-04-25 23:50:42 +02:00
Xadhoom 6856fb74e2 Merge upstream beanch 'devilution/master' 2019-04-25 20:44:01 +00:00
Anders Jenbo 9a1d4be89b Merge branch 'merge' of github.com:diasurgical/devilutionX 2019-04-25 02:17:29 +02:00
Anders Jenbo b791b1093c Clean up DDraw implementation 2019-04-25 01:31:57 +02:00
Anders Jenbo 631305035a Brute fix compile errors 2019-04-24 21:16:05 +02:00
Anders Jenbo a77c75a097 Make graphics modes configurable (#44)
* Make graphics modes configurable

[devilutionx]
scale quality=2
fullscreen=1
grab input=1

* Update dx.cpp
2019-03-21 10:04:58 +01:00
Anders Jenbo cc3abbe92c Implement screen shots 2019-03-20 03:34:50 +01:00
Xadhoom 3feccdc989 Fixes, fix some warnings 2019-03-18 21:21:53 +00:00
Anders Jenbo bc26a2f730 Merge branch 'master' of github.com:diasurgical/devilution 2019-03-18 21:52:35 +01:00
Xadhoom 456aa70f16 More cleanup 2019-03-18 07:24:29 +00:00
Xadhoom f00e427ed2 Remove pch.h 2019-03-17 18:28:37 +00:00
Xadhoom 545009f729 Fix merge 2019-03-16 13:15:07 +00:00
Xadhoom 83d902c4a4 Merge branch 'master' 2019-03-16 12:37:02 +00:00
Anders Jenbo 0bd6375969 Implementing dsound wrapper 2019-03-16 03:16:08 +01:00
Xadhoom c1ba436e69 miniwin_misc.h macro-clean 2019-03-13 13:23:05 +00:00
Xadhoom 30fbfa36a1 Progress with miniwin macros 2019-03-11 23:48:35 +00:00
Xadhoom 8b7f30b669 Continue refactoring macros from miniwin 2019-03-11 20:10:23 +00:00
Xadhoom 5283a9ffd1 Put everything into namespace dvl 2019-03-11 20:10:23 +00:00
Anders Jenbo 4223512c72 Implement most of sound.cpp (#34)
* Implement most of sound.cpp

This fixes
- Menu sounds being cut short
- Spartial sound in game
- Memory leaks
- Sound volume

* Some minor bugfixes
2019-03-10 04:14:29 +01:00
Anders Jenbo 9611057b08 Some simple fixes and clean ups to better support macOS 2019-03-06 17:45:11 +01:00
Anders Jenbo c77c97de9a Fix some minor LLVM compatability issues 2019-02-25 20:41:14 +01:00
Anders Jenbo 2a5a4859f3 Fix release builds 2019-02-25 04:12:59 +01:00
Xadhoom 4d557709e0 Clean headers for network code 2019-02-24 10:46:16 +00:00
Xadhoom af47577446 Begin restructuring headers 2019-02-23 07:49:22 +00:00