Commit Graph

139 Commits (0b2567d882827f3a2c8b9e927c4d7f354e498a58)

Author SHA1 Message Date
rubidium 2618d960e3 (svn r26209) -Codechange: remove some template magic and simplify some code 11 years ago
rubidium 52883db91b (svn r25970) -Fix [FS#5787]: [SDL] Recursive mutex locking when changing blitter 11 years ago
michi_cc 019984a14f (svn r25671) -Codechange: Pass character and key code separately to the keyboard handler. 11 years ago
rubidium 4fbcb73166 (svn r25523) -Fix [FS#5587]: SDL does not give an event when an application gets mouse focus while going to full screen, so manually force the mouse-is-in-window state 11 years ago
matthijs 0d28dc92fc (svn r25318) -Fix: [SDL, FS#5580] Keyboard input stopped working after fullscreen toggle 11 years ago
rubidium dcf3df65d3 (svn r25017) -Fix [FS#5466]: crash after bootstrap download of 32bits base set due to referencing a deleted mutex 12 years ago
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. 14 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
15 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 16 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(). 16 years ago
rubidium 402a1e24ba (svn r12977) -Codechange: remove quite some redundant (duplicate) function declarations. 16 years ago
rubidium d03994098b (svn r12971) -Documentation: add @file in files that missed them and add something more than whitespace as description of files that don't have a description. 16 years ago
smatz 297f99e100 (svn r12944) -Codechange: use rev.h instead of externs at many places 16 years ago
rubidium dde68e922a (svn r12779) -Codechange: remove a few constants from openttd.h. 16 years ago
smatz 8b56e7544e (svn r12167) -Feature(tte): change colour of autorail and autoroad selection when Ctrl is pressed 17 years ago
rubidium fde33b5547 (svn r12003) -Codechange: don't declare InteractiveRandom[Range] in multiple places. 17 years ago
rubidium 04f936c2c6 (svn r11811) -Fix: make compilation without networking work again (and thus move the debugdumpcommand stuff out of the network 'area'). 17 years ago
belugas 3dd61f423a (svn r11734) -Change: Allow ToggleFullScreen to return the result of the operation' attempt. Previously, only visual clues were available.
-Fix[FS#1519]: When you can not use this resolution at full screen, now you'll know that it failed.
As for the reason it did not work, each computer/OS has its reason.
17 years ago
rubidium 429521a7d1 (svn r11692) -Codechange: move some functions from 'functions.h' to a more logical place and remove about 50% of the includes of 'functions.h' 17 years ago
rubidium a773d45885 (svn r11684) -Codechange: split gfx.h in a type and functional header. 17 years ago
rubidium 8f0e68285b (svn r11682) -Codechange: move some 'generic' geometry related types into a single file and do not include gfx.h everywhere to get a Point type. 17 years ago
rubidium 01e20c9140 (svn r11674) -Codechange: refactor some functions out of macros.h into more logical locations. 17 years ago
rubidium 8896bea306 (svn r11667) -Codechange: split window.h into a header that defines some 'global' window related types, on that defined 'global' window functions and one that defines functions and types only used by *_gui.cpps. 17 years ago
skidd13 bf959f926f (svn r11510) -Codechange: merge the IS_*INSIDE* functions and rename them fitting to the naming style 17 years ago
skidd13 8be526e499 (svn r11475) -Codechange: rename clamp and clampu to Clamp and ClampU to fit with the coding style 17 years ago
rubidium 0fed821efb (svn r10932) -Codechange: replace "text" with "chat" for the chat related function and variables. 17 years ago
truelight 155b912ebb (svn r10663) -Fix r10662: bad me, didn't comply with coding style, as penalty I updated the surrounding code to comply with coding style too; I will never do it again (I hope :p) 17 years ago
truelight ef0be0e1dc (svn r10662) -Add: added 'V' as new shortcut for new viewport (bilbo)
-Add: added 'M' as new shortcut for smallmap (bilbo)
-Add: added '+' and '-' as shortcuts to zoom in the mainview (bilbo)
-Add: added support for other keycodes to be possible used in the future (bilbo)
17 years ago
peter1138 68c6add8cc (svn r10444) -Codechange: switch to c++ classes and inheritance for sound/music/video drivers, using self-registration based on the blitter-model. 17 years ago
truelight 60f0610a85 (svn r10278) -Fix r10276: make the _realtime_tick less demanding on the CPU 17 years ago
truelight 2e19d3cf78 (svn r10276) -Codechange: made a counter based on milliseconds and independent of the game-state to base double-click and TGP Generation Process on
-Codechange: renamed _timer_counter to _palette_animation_counter, as that is what it is
17 years ago
truelight af8a234db0 (svn r10255) -Codechange: remove some old debug code nobody was using anymore 17 years ago
truelight a7dd710f06 (svn r10217) -Fix r10216: forgot to declare 'blitter' in win32 and cocoa driver (tnx glx) 17 years ago
truelight 1c4760ee06 (svn r10216) -Fix: palette animation always redid all palette entries, where in fact only a few indexes were needed
-Codechange: allow blitters to handle palette animation internally or even disable it; 8bpp uses video-backend for palette animation
17 years ago
truelight 003375d375 (svn r10190) -Codechange: merged renderer and blitter to one single class API: blitter
-Codechange: introduced a hierachy of blitters to avoid a lot of code duplication
 Note: this allows much easier adding other types of video-drivers, like OpenGL
17 years ago
truelight f3f744d36a (svn r10121) -Codechange: split renderer from rest of code; no longer any code directly accesses the video-buffer
-Add: added NULL blitter and renderer, which are always used for -vnull
-Add: dedicated driver doesn't blit nor render by default. Can be overruled by user. (-D -b 8bpp-optimized)
-Remove: removed CTRL+D from win32, which is incompatible with above
-Add: extended screenshot support for PNG and BMP
-Codechange: remove all hardcoded 8bpp references and replace them with more dynamic ones
-Codechange: minor stuff in blitters
17 years ago
truelight d7b4fb80d0 (svn r9835) -Codechange: use Pixel typedef instead of byte where ever possible 17 years ago
rubidium 24c4d5b06d (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {}; 18 years ago
rubidium 36bb92ae24 (svn r9050) -Codechange: Foo(void) -> Foo() 18 years ago
truelight 43133c766c (svn r9034) -Codechange: renamed _pause to _pause_game, as some targets already have
a symbol called _pause (and therefor our variable conflicts with 
 thatone. We shouldn't be using _ as global indicator.....)
18 years ago
Darkvater 4d4c1e0505 (svn r8691) -Cleanup: Some proper #endif comments for sound/music/video files, and a little elimination of magic numbers in Win32SoundStart 18 years ago
rubidium f35ed4bbc2 (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b. 18 years ago
KUDr e373ea7096 (svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp) 18 years ago