matthijs
2752dd7bbe
(svn r25003) -Fix (r24993): [SDL] Keep a flag to remember if a hardware palette was requested.
...
- Previously, the code would query the SDL_HWPALETTE flag, which doesn't always match the requested value.
- This would cause SDL to be restarted on every window resize event, effectively breaking resizing.
12 years ago
matthijs
afd1e49224
(svn r25002) -Doc: [SDL] Fix typo in comment.
12 years ago
matthijs
328ed1cf94
(svn r24993) -Fix: [SDL] Improve 8bpp hardware palette support. Instead of always requesting SDL_HWPALETTE, it is now only done for 8bp blitters in fullscreen mode.
...
- This fixes 32bpp blitters on 8bpp X11, which would only render garbage with SDL_HWPALETTE.
- This prevents the colors of other applications from being messed up when running a 8bpp blitter on a 8bpp system.
- When running a 8bpp blitter on an 8bpp system without SDL_HWPALETTE (e.g., in windowed mode), this uses a new shadow surface with color approximation.
- The use of a hardware palette can be forced on and off using -v sdl:hw_palette=1 or -v sdl:hw_palette=0
12 years ago
matthijs
afcb4a25b2
(svn r24992) -Codechange: [SDL] Make CreateMainSurface and PollEvent private methods instead of static functions.
12 years ago
planetmaker
c24374f99c
(svn r24900) -Fix [FS#5389]: Comments with typos (most fixes supplied by Eagle_rainbow)
12 years ago
rubidium
74785478ec
(svn r23980) -Fix (r23977): crash when starting with the 32bpp anim blitter
13 years ago
rubidium
4db85fcc4d
(svn r23978) -Fix: [SDL] Palette update was done too late making switching from 8bpp -> 32bpp look ugly
13 years ago
matthijs
311413a091
(svn r23910) -Fix: [SDL] Handle the SDL_VIDEOEXPOSE event.
...
- It seems this event is never triggered when using 1.2 (it has some
autorefresh feature which seems to have been removed in 1.3), but in theory
this event could also trigger on 1.2.
- Note that this fixes redraw issues when compiling against SDL 1.3, but it
still uses the "compatibility" rendering API using SDL_SetVideoMode and
SDL_UpdateRects. Eventually (when 1.3 is stable and released as 2.0), this
should probably be rewritting to use the new Windows and Renderers
available in SDL 1.3.
13 years ago
matthijs
cba6390973
(svn r23909) -Fix: [SDL] Fix keyboard-related segfault when compiling against SDL 1.3.
13 years ago
rubidium
af7ea8c525
(svn r23891) -Fix-ish: compile failures with SDL 1.3
13 years ago
rubidium
ccededbf77
(svn r23451) -Codechange: [SDL] Move 32bpp-anim palette animation to the draw thread instead of the single threaded bit of the game loop. This causes a speedup of up to 15% when animation is turned on with the 32bpp-anim blitter
13 years ago
rubidium
61625e53c9
(svn r23448) -Fix: keep a local copy of the palette in the 32bpp animated blitter so changes of the palette data during the game don't influence drawing (with SDL)
13 years ago
rubidium
2ccbd2a6f5
(svn r23446) -Codechange: move _cur_palette and it's related first/count dirty variables into a single structure
13 years ago
rubidium
6e31c2f068
(svn r23241) -Codechange: make the decision when to go to the custom drawn cursor more prominently during the initialisation of OpenTTD
13 years ago
michi_cc
8c4c616cfe
(svn r23003) -Fix (r22999): Missing semicolon.
13 years ago
michi_cc
6dbb050a32
(svn r22999) -Codechange: Allow changing the blitter during the running game.
13 years ago
rubidium
bffa93a4e9
(svn r22910) -Fix [FS#4617]: icon would (almost) never be shown for SDL builds
13 years ago
rubidium
421053a694
(svn r22788) -Codechange: move modal progress related functions and variables to progress.cpp/h
13 years ago
rubidium
37415b9cf7
(svn r22785) -Codechange: rename IsGeneratingWorld to HasModalProgress
13 years ago
rubidium
1d0d7635e0
(svn r22021) -Fix (r22019): ofcourse make doesn't notice files are gone, so it doesn't recompile everything that needs to be recompiled...
14 years ago
rubidium
ab44c91778
(svn r21252) -Codechange: introduce a constant for the number of milliseconds per game tick and use it
14 years ago
rubidium
b8487afe54
(svn r20192) -Cleanup: bye bye variables.h, bye bye VARDEF... you won't be missed :)
14 years ago
peter1138
4b4e97695f
(svn r19965) -Cleanup: Use size of buffer, not magic number.
15 years ago
rubidium
82fc28f77f
(svn r18809) -Codechange/Cleanup: remove unneeded headers from some files, if a header require a header make it include that header
15 years ago
rubidium
7aeccb9bd0
(svn r18796) -Fix [FS#3521]: [SDL] possible deadlock when killing OpenTTD while starting it
15 years ago
peter1138
c3fffe7496
(svn r18790) -Revert (r18001,r18177,FS#3515): Viewport could still jump under high CPU load. Revert as change caused more problems than it fixed.
15 years ago
peter1138
abb147d974
(svn r18709) -Fix (r10227,FS#3464): Animation buffer for 32bpp-anim blitter was only validated during sprite blitting, other drawing operations didn't check it. Initial startup and window resize could therefore lead to crash.
15 years ago
rubidium
c811f3bd21
(svn r18547) -Fix [FS#3388]: missing thread synchronisation when changing the resolution for SDL via the in game menu
15 years ago
frosch
29d6491605
(svn r18545) -Fix [FS#3292]: Assign '_screen.dst_ptr' as soon as it is allocated.
15 years ago
peter1138
3addf58f30
(svn r18390) -Fix (r17776): [SDL] Reinstate pointer update on 'idle' loop.
15 years ago
peter1138
b0049500a6
(svn r18177) -Fix (r18001): [SDL] Viewport could jump when mouse moved and right button pressed at the same time.
15 years ago
rubidium
88a7e23897
(svn r18031) -Codechange: since basically r7157 adding up 'all' mouse movement isn't needed anymore because after each even that movement is handled and the counter is reset. As such simply assigning instead of adding works.
15 years ago
peter1138
723c19571f
(svn r18001) -Codechange: [SDL] When the mouse cursor is locked into position when scrolling a viewport, warp the mouse pointer to the centre of the window. This gives maximum freedom of movement. The pointer position is restored when the lock is removed. Visually the mouse cursor stays where it was.
15 years ago
smatz
da54a01114
(svn r17950) -Fix (r17776): _draw_mutex was never destroyed, _draw_thread was never joined
15 years ago
smatz
dc4b251dbd
(svn r17949) -Fix (r17776): unlock mutex before deleting it when creating drawing thread failed
15 years ago
rubidium
cfcf3159b2
(svn r17815) -Fix [SDL]: asynchronious drawing caused extra unresponsiveness during map generation; disable the threading while generating a map
15 years ago
rubidium
f4f4044859
(svn r17776) -Codechange: [SDL] make "update the video card"-process asynchronious. Profiling with gprof etc. hasn't shown us that DrawSurfaceToScreen takes a significant amount of CPU; only using TIC/TOC it became apparant that it was a heavy CPU-cycle user or that it was waiting for something.
...
The benefit of making this function asynchronious ranges from 2%-25% (real time) during fast forward on dual core/hyperthreading-enabled CPUs; 8bpp improvements are, in my test cases, significantly smaller than 32bpp improvements.
On single core non-hyperthreading-enabled CPUs the extra locking/scheduling costs up to 1% extra realtime in fast forward. You can use -v sdl:no_threads to disable threading and undo this loss.
During normal non-fast-forwarded games the benefit/costs are negligable except when the gameloop takes more than about 90% of the time of a tick.
Note that allegro's performance does not improve with this system, likely due to their way of getting data to the video card. It is not implemented for the OS X/Windows video backends, unless (ofcourse) SDL is used there.
Funny is that the performance of the 32bpp(-anim) blitter is, at least in some test cases, significantly faster (more than 10%) than the 8bpp(-optimized) blitter when looking at real time in fast forward on a dual core CPU; it was slower.
The idea comes from a paper/report by Idar Borlaug and Knut Imar Hagen.
15 years ago
rubidium
7fbc33dae1
(svn r17248) -Fix: add GPL license notice where appropriate
15 years ago
rubidium
791187cd12
(svn r16699) -Fix [FS#3001]: if SDL fails to allocate a surface due to it being too large (and SDL doesn't crash!) fall back to another video driver.
15 years ago
alberth
9b070b5405
(svn r16677) -Codechange: Dimension width and height are unsigned.
15 years ago
rubidium
2664f2a2d9
(svn r16242) -Codechange: rework pausing
...
-Fix [FS#2864]: autopause and manual pausing conflict with eachother
-Fix: new game + pause on new game + autopause make the game not unpause on the first join
16 years ago
smatz
0d3f5e6e74
(svn r15299) -Cleanup: remove many redundant includes
16 years ago
glx
a3dc092ebc
(svn r15233) -Fix (r15231): compilation with SDL broken on win32
16 years ago
rubidium
48125a6d5f
(svn r15232) -Codechange: sprinklin' of coding style
16 years ago
rubidium
4ba90f6887
(svn r15231) -Change: (sdl) check the full screen resolutions to determine what 'valid' resolutions we've got
16 years ago
rubidium
cdec8f6b27
(svn r14641) -Change [Allegro]: when making a debug build revert Allegro's hooks on SIGSEGV/SIGABRT so one can actually use gdb.
...
-Change: make it more clear that Allegro's failing to find a driver.
16 years ago
rubidium
3b7ffcf759
(svn r14260) -Fix [FS#2277]: merge keycode for "normal" 0-9 keys and keypad 0-9 keys so people don't get confused that the keypad doesn't work as expected.
16 years ago
rubidium
d0c1a989a4
(svn r14047) -Codechange: move chatmessage handling to the network directory as that's the only case chat messages are used. Furthermore remove any trace of chatmessages when compiling without network support.
16 years ago
smatz
2299181c4b
(svn r13537) -Fix [FS#2090](r13523): QSortT won't work this way, use Dimension instead of uint16[2] for resolutions
17 years ago
glx
ee256e770a
(svn r13390) -Codechange: introduce usererror() for fatal but not openttd related errors. Now all error() will 'crash' openttd after showing the message in win32 releases (MSVC), creating a crash.log and crash.dmp (like the '!' hack used before). On the other hand, usererror() will just close the game. So use error() only when it can be helpful to debugging, else use usererror().
17 years ago