Aaron van Geffen
551fdabc7f
Make the hinting threshold configurable per font.
...
This addresses the issue that tofu would not show up in Arial on macOS if the
threshold was set to 60. It being the fallback font, it is important that they
do, which requires lowering to at most 43.
However, it is even more important that the threshold is left at 60 for kanji
in e.g. Japanese to render properly.
Hence, for the moment, Arial is the only font now using a hinting threshold
of 40, for now.
2017-10-15 22:31:11 +02:00
Aaron van Geffen
899c859948
Use light hinting mode iff hinting is enabled.
...
This makes use of TTF_SetFontHinting, which was ported from SDL_ttf for the occasion.
2017-10-15 22:31:11 +02:00
Aaron van Geffen
5e7f9c4762
Allow enabling/disabling hinting through console.
2017-10-15 22:31:11 +02:00
Aaron van Geffen
d4c5218ba2
Move blending code to colour.c.
2017-10-15 22:31:11 +02:00
Marijn van der Werf
d6349d0095
Calculate blended palette index
2017-10-15 22:31:11 +02:00
Aaron van Geffen
0ed3ef3704
Use ColourMapA where possible.
2017-10-15 22:31:11 +02:00
Aaron van Geffen
4b7ebcb51c
Handle two rare cases: for red losses in finance window, and text in theme window.
2017-10-15 22:31:11 +02:00
Aaron van Geffen
fec0568b29
Shade black backgrounds differently (e.g. IME)
2017-10-15 22:31:11 +02:00
Aaron van Geffen
f2e795b4ef
Handle hinted font rendering in scrolled texts, too.
2017-10-15 22:31:11 +02:00
Aaron van Geffen
346cfdf135
Account for colour intensity as well as outlined texts.
2017-10-15 22:31:11 +02:00
Aaron van Geffen
2dcf9c73e7
Make font hinting optional through config.ini.
2017-10-15 22:31:11 +02:00
Aaron van Geffen
ea034e85fa
Simulate font hinting when using TrueType fonts for better legibility.
2017-10-15 22:31:11 +02:00
Aaron van Geffen
3357d32ec4
Port TTF_RenderUTF8_Shaded and TTF_drawLine_Shaded from SDL_ttf.
2017-10-15 22:31:11 +02:00
Tomas Dittmann
e393ff1f22
Stop using (void*)-1 for invalid pointers
2017-10-15 15:53:16 +02:00
Ted John
a65192b141
Do not use float
2017-10-14 23:38:51 +02:00
Ted John
a8c9c758f4
Fix a couple of bugs
2017-10-14 23:38:51 +02:00
Ted John
55c420b738
Fix code style
2017-10-14 23:38:51 +02:00
Marijn van der Werf
d596c0139f
Combine text paint functions
2017-10-14 23:38:51 +02:00
Marijn van der Werf
c01bcea391
Introduce more constants for text rendering
2017-10-14 23:38:50 +02:00
Michael Steenbeek
7f9c25a7a9
Use constant for LOCATION_NULL, split off location stuff to Location.h
2017-10-13 22:23:07 +02:00
Michael Steenbeek
3c8184dfa1
Handle Polish in the RCT2-to-Unicode conversion
...
Also removed the misidentified A_MINUSCULE and CENT.
2017-10-10 09:22:38 +02:00
Michael Steenbeek
71686e88b5
Render Polish with the sprite font
...
Fixes the sprite lookup table for the Polish characters.
Switches the font settings for Polish from TTF to sprite.
2017-10-10 09:22:38 +02:00
vector-of-bool
57a8bbac23
Respect POSIX path separators on Windows ( #6356 )
2017-10-08 21:28:38 +02:00
LRFLEW
11cdcea72b
Fix RCTC g1.dat rendering issues
2017-09-30 19:18:31 -05:00
LRFLEW
e177811115
Add RCTC g1.dat support
2017-09-29 10:44:23 +02:00
Michał Janiszewski
5ab9f938a7
Update files missed in the great extern "C" cleanup of 2017
2017-09-28 23:29:16 +02:00
ZehMatt
5187946bc9
Fix #6309 : Lightfx being enabled with incompatible drawing engine.
2017-09-28 08:01:25 +02:00
Michał Janiszewski
00fd18809c
Move extern "C" {} blocks to headers ( #6282 )
2017-09-18 17:05:28 +02:00
Gymnasiast
a28509e24c
Split Ride and rct2_ride
2017-09-12 11:16:57 +02:00
Duncan
04e217a04c
Remove unused global palette pointer ( #6247 )
...
Moved one use of the palette pointer into a parameter
2017-09-03 10:16:51 +01:00
Ted John
f81ee49015
Pass paint session to remaining non-track called functions
2017-09-02 23:41:02 +01:00
Ted John
46c2e52b5c
Pass paint_session to more functions
2017-09-02 20:25:03 +01:00
Ted John
eb7b1e7b7e
Remove global, gPaintMapPosition
2017-09-02 17:11:59 +01:00
Ted John
1d04f334e3
Change more paint globals to use gPaintSession
2017-09-02 17:11:58 +01:00
Ted John
cb09357bba
Create paint_session to replace paint globals
2017-09-02 17:11:58 +01:00
ζeh Matt
1f3ccae8b1
Refactor remaining image flag constants to defined G1_* flags. ( #6217 )
...
Refactor gUnk9DE568 and gUnk9DE56C to be type of rct_xy16 called gPaintSpritePosition
Rename unk_9ABDA4 to gCurrentColourPalette.
Rename gUnkEDF81C to gCurrentImageType.
Rename sub_679236_679662_679B0D_679FF1 to pixel_is_present.
Remove unused variables _unk9ABDAE, _unk9AC149, unk_9E3CE4, only ever assigned but never read.
Remove unreferenced variable unk_9E3CDC.
Clean up some parts in sub_679236_679662_679B0D_679FF1.
Remove function sub_68371D and references, it assigns variables that are never used.
Add assert determine if unused code.
2017-09-02 14:01:08 +01:00
Ted John
3f1991804a
Add debug option to show dirty blocks
2017-08-31 22:36:15 +01:00
Michał Janiszewski
4708af474d
Fix MinGW builds in release mode
2017-08-31 23:24:47 +02:00
Michał Janiszewski
d698ad1100
Convert NULL -> nullptr in C++
2017-08-15 11:51:56 +02:00
duncanspumpkin
18d082053e
Rename cpp files to use TitleCase
2017-08-04 18:12:54 +02:00
wolfreak99
ffc1dc6376
Add OpenRCT2 information and changelog to About window
2017-08-04 08:38:35 +02:00
Ted John
8b2eb8a13e
Move screen variables to OpenRCT2.h
2017-07-29 20:29:29 +01:00
Oliver Freyermuth
d42b9fc6df
X8DrawingEngine: Only disable warnings which the compiler supports.
...
This fixes compilation with gcc 4.9.4.
2017-07-28 09:56:49 +02:00
Gymnasiast
a67b248956
Update references to sub_688217()
2017-07-26 14:40:28 +02:00
Michael Steenbeek
367efa2020
Use remap flags, SPRITE_ID_PALETTE_COLOUR_1 and _2 in many more places
2017-07-20 20:56:29 +02:00
Michał Janiszewski
ee07695cce
Manually hoist consts before the loop
...
It is optimised in release builds, but it will help in debug mode
2017-07-20 19:36:37 +02:00
Michał Janiszewski
8c9da63aa5
Make drawing loop only depend on loop counter ( #5954 )
2017-07-20 18:09:22 +01:00
Gymnasiast
260f342d73
Fix typos in (unused) defines and comment
2017-07-20 16:18:36 +02:00
Ted John
01b0047675
Invert Painter dependency
...
Make painter call into the drawing engine, rather than the drawing engine create and call the painter.
2017-07-16 23:25:11 +01:00
Ted John
ac6da51dbb
Use IPlatformEnvironment for loading g1.dat
2017-07-16 23:25:11 +01:00
Ted John
cb884dad11
Refactor rct2_draw to a new Painter class
...
Right now this is created for each drawing engine, but should eventually be a dependency into them.
2017-07-16 23:25:11 +01:00
William Wallace
ae110a9159
Allow switching between OpenGL and other renderers without restarting
2017-07-13 19:04:37 +01:00
Ted John
09bb7bfd6c
Allocate strings with new instead of malloc
2017-07-02 11:37:01 +01:00
Ted John
e9519d2d8b
Fix #5507 : RCT1 path check is case-sensitive on Linux
...
If the csg path does not exist, find the first file in the directory that matches (case insensitive).
2017-06-30 21:11:35 +01:00
Ted John
e265fa8948
Fix crash when headless server creates money fx ( #5729 )
...
Ensure headless instances of the game, which do not have graphics loaded, do not try to measure the string for new money effect sprites.
2017-06-29 12:30:49 +01:00
Ted John
4f1cfb4631
Don't load graphics for headless
2017-06-25 23:19:24 +01:00
Ted John
f275e5ba9b
Remove all platform.h includes from header files
...
System headers, particularly windows.h polute the namespace too much with macros and unwanted definitions. Do not use them in header files.
2017-06-25 18:59:56 +01:00
Ted John
89d43c1120
Merge pull request #5702 from IntelOrca/refactor/nosdl/freetype2
...
Remove SDL2_ttf dependency, replace with some code form SDL2_ttf without SDL2 dependencies and instead only requiring freetype alone.
2017-06-25 11:35:06 +01:00
Ted John
6368a29d39
Fix NO_TTF builds
2017-06-25 00:18:08 +01:00
Ted John
16d6ddd22b
Remove unused code from SDL_ttf
2017-06-24 23:40:46 +01:00
Ted John
8046cbc707
Replace SDL2 calls
2017-06-24 23:31:40 +01:00
Ted John
b7fd89361b
Use complete SDL_ttf code
2017-06-24 23:13:07 +01:00
camthesaxman
c301e83a64
fix water rendering
2017-06-24 18:53:25 +02:00
Ted John
9ee1bbe4b5
Add some TTF code, poor
2017-06-24 14:50:30 +01:00
Ted John
2c07a55696
Refactor TTF into new source and remove SDL2_ttf
2017-06-24 14:50:30 +01:00
Gymnasiast
631f4d8907
Add a constant for RIDE_ENTRY_INDEX_NULL
2017-06-17 14:32:15 +02:00
Ted John
29f0372da8
Reduce SDL2 in headers
2017-06-12 19:56:32 +01:00
Ted John
7e9f7df7d1
Use standard platform defines
2017-06-12 18:01:51 +01:00
Ted John
b563d26ffe
Fix #5588 : crash in object selection
...
Add more safety guards for -1 image IDs which can happen if images were unsuccessfully allocated during object load.
2017-06-11 11:14:58 +01:00
Ted John
5bb48f3539
Move SDL part of lightfx blend to drawing engine
2017-06-10 22:18:54 +01:00
Ted John
90aad2e2ec
Use rct_palette instead of SDL
2017-06-10 22:18:54 +01:00
Ted John
fc899d15ef
Remove SDL_Window from IDrawingEngine and UiContext
2017-06-10 22:18:54 +01:00
Ted John
a5e4a0965f
Ignore final warnings for X8DrawingEngine
2017-06-10 15:48:05 +01:00
Ted John
97d68957f0
Fix segfault in screenshot command
2017-06-10 15:48:05 +01:00
Ted John
df16e6a4f7
Inherit X8 engine from software engine
2017-06-10 15:48:04 +01:00
Ted John
39b3ff0251
Create new 8bpp drawing engine in openrct2
2017-06-10 15:48:04 +01:00
Ted John
c1ccf2b7a6
Refactor load_palette to call gfx_invalidate_screen
...
Nearly all calls to load_palette were succeeded with a call to gfx_invalidate_screen. So remove these and stick just one call inside load_palette.
2017-06-07 23:24:18 +01:00
Michał Janiszewski
61d38511bc
Expand tabs to spaces
...
This commit expands tabs to spaces (ts=4) in all the files under src/
and test/.
Until now we had two wildly different code styles with C using tabs and
new C++ using spaces. It is painful to maintain as none of the commonly
used tools support this kind of setup and in reality is needless, as we
can simply convert all the sources to spaces and have opened PRs do the
same, where needed.
Additionally, trailing whitespace has been removed.
2017-06-06 23:46:14 +02:00
Michał Janiszewski
79d76759bb
Fix #5516 : Update copyrights for 2017
...
Not all files were necessarily _changed_, but all were touched, see
https://github.com/OpenRCT2/OpenRCT2/pull/4932
2017-06-01 21:55:10 +02:00
Ted John
f998172674
Fix IME text input
2017-05-29 22:38:46 +02:00
Ted John
e2a7189663
Do not use SDL_Colour for gPalette
2017-05-29 22:38:44 +02:00
Ted John
3fcd42fe2b
Move more window code to UiContext
2017-05-29 22:38:43 +02:00
Ted John
bd9839ff50
Get the game working
...
Mostly just needed to resolve screen size which is now retrieved via ui context.
2017-05-29 22:38:43 +02:00
Ted John
7163973bd2
Start moving code from OpenRCT2 to Context
2017-05-29 22:38:42 +02:00
Ted John
10182879da
Invert Context and UiContext dependencies
2017-05-29 22:38:42 +02:00
Ted John
fedb8917c7
Create new CMake project for libopenrct2
2017-05-29 22:38:42 +02:00
Ted John
006a76c099
Refactor registration of drawing engines
2017-05-29 22:38:42 +02:00
Ted John
bf3749833d
Allow drawing engine registration via context interfaces
2017-05-29 22:38:42 +02:00
Ted John
19aafc4e24
Move drawing engine implementation code to openrct2-ui
2017-05-29 22:38:41 +02:00
CraigCraig
26287f5a3e
More readability, grammar, spelling fixes
2017-05-15 09:28:43 +02:00
CraigCraig
58deb3a54a
Grammar, readability, and spelling fixes
...
[ci skip]
2017-05-11 11:45:59 +02:00
Ted John
8bd0c703a7
Revert "fix and refactor DrawRLESprite2 ( #5396 )" as it broke water rendering
...
This reverts commit fde3c8a3ed
.
2017-04-30 20:02:27 +01:00
Ted John
1ab90d86ca
Fix exporting non-RLE sprites
2017-04-30 17:22:27 +01:00
Cameron Hall
fde3c8a3ed
fix and refactor DrawRLESprite2 ( #5396 )
2017-04-30 06:40:25 +02:00
CraigCraig
e0b875398b
Tons of spelling fixes ( #5413 )
...
[ci skip]
2017-04-30 06:39:24 +02:00
Michał Janiszewski
73efe0755d
Validate water image id while loading palette
2017-04-24 22:56:37 +02:00
Michał Janiszewski
0414ba7f6b
Verify access to sprites
2017-04-20 13:20:11 +02:00
Gymnasiast
c8ecd98737
Check for both csg1.1 and csg1.dat when looking for RCT1 graphics
2017-04-12 20:08:31 +02:00
Gymnasiast
99617de70a
Add method to determine if CSG1 is loaded
2017-04-11 22:38:09 +02:00
Martin Müller
3409da9aa1
Only load csg1 if necessary
2017-04-10 14:09:01 +02:00
Ted John
7fb653d1a7
Remove platform include from game.h
2017-03-23 18:34:32 +00:00
Michał Janiszewski
fa65fd1481
Reduce scope of variables in input.c, rect.c
2017-03-18 23:23:23 +01:00
Ted John
bcc0bfa485
Rename climate.h to Climate.h
2017-03-11 22:59:33 +00:00
Ted John
4442b936de
Merge pull request #5256 from chfast/memory-fixes
...
Small memory fixes
2017-02-27 17:24:08 +00:00
Paweł Bylica
7360d06592
Silently fallback to sorfware rendering
...
If accelerated rendered cannot be created by SDL, fallback to software rendering. The config option is not changed.
2017-02-24 20:14:37 +01:00
Ted John
8ba5db0697
Fix build for some configurations
2017-02-20 20:05:59 +00:00
Ted John
fb2c835d52
Include new config header
2017-02-18 15:45:10 +00:00
Ted John
6a2b7b1200
Start moving config definitions over to C++
2017-02-18 10:54:13 +00:00
Ted John
b79e714740
Fix compilation of sprite.cpp
2017-02-09 18:50:30 +00:00
Ted John
6a0f934a5f
Tabs to spaces for sprite.cpp
2017-02-09 17:59:17 +00:00
Ted John
6ea4e4987d
Turn sprite.c into sprite.cpp
2017-02-09 17:59:17 +00:00
Michał Janiszewski
7cb9d10d72
Fix wrong #define checks for DEBUG macro
2017-02-07 21:01:07 +01:00
Michael Steenbeek
94d38b9f7a
Don't remove vehicles when removing all guests, name some interaction fields
2017-01-30 23:51:01 +01:00
Michał Janiszewski
6bd9e3eca8
Make sure various fields are initialised properly
2017-01-27 07:35:48 +01:00
Ted John
efb64603eb
Only create OpenGL window when necessary
...
Currently the game window is always created with an OpenGL context which then means that opengl32.dll and other modules are loaded. The OpenGL window flag will now only be used if the config drawing engine is set to OpenGL. This now means that a restart of the game is required when switching to the OpenGL drawing engine for Windows.
#5104
2017-01-22 21:38:08 +00:00
Ted John
ed940ab41c
Merge pull request #5098 from IntelOrca/enable-lightfx
...
Resolve #5048 : Enable light FX
2017-01-22 01:31:56 +00:00
Ted John
66c2dcaa59
Remove unncessary extern from functions definitions.
2017-01-21 21:57:09 +00:00
Michael Steenbeek
d60b0def60
Fix loading zoomed sprites from RCT1
2017-01-21 21:48:12 +00:00
Ted John
fc66f42c31
Add config option to enable / disable light FX
2017-01-21 12:01:01 +00:00
Ted John
a102a566d2
Allocate image IDs for RCT1 images
2017-01-19 15:00:20 +01:00
Ted John
4bffc4b131
Add ability to import RCT1 graphics
2017-01-19 15:00:18 +01:00
Broxzier
60603ae10a
Use types from common.h
2017-01-14 12:37:31 +01:00
Michał Janiszewski
0a36af19e4
Mark classes as final to help devirtualisation
2017-01-13 12:12:50 +01:00
Michał Janiszewski
411d1fff18
Make GCC suggest final, override keywords
2017-01-13 11:44:14 +01:00
Ted John
13a8eee1b4
More warning fixes, more warnings disabled
2017-01-12 13:12:53 +00:00
Ted John
ca9c3cc5ee
Fix more warnings, disable others
2017-01-12 13:00:12 +00:00
Ted John
4fbecc2f60
Replace magic numbers with constant SPRITE_INDEX_NULL
2017-01-05 12:49:42 +00:00
Ted John
25bc798ff8
Move contents of src into project sub directory
2017-01-04 17:44:12 +00:00