Commit graph

592 commits

Author SHA1 Message Date
Eric S. Raymond
f5470cb75c More code-lifting. 2007-06-24 17:15:00 +00:00
Eric S. Raymond
83e4974ac0 Pull image type computation out of draw_tile(),
...as a step towards lifting it into the map_display class.
2007-06-24 10:27:04 +00:00
Eric S. Raymond
61a02bc875 Reports were cleared twice on redraw_everything,
...once in that function and once in the following draw().  I don't
think this is necessary, and it's in the way of my refactoring
project.

Suspect this commit if we start to have glitches in updates of the
report fields on screen.
2007-06-24 09:27:48 +00:00
Eric S. Raymond
5725da5dc1 Lift portions of the draw logic. 2007-06-24 04:31:59 +00:00
Eric S. Raymond
00e8aae88d More lifting of code from display into map_display. 2007-06-24 03:40:04 +00:00
Eric S. Raymond
c29be324fc Lift the lower end of the terrain-tile drawing code. 2007-06-23 20:58:51 +00:00
Eric S. Raymond
beb9db4c82 Suppress a spurious compiler warning. 2007-06-23 20:00:29 +00:00
Eric S. Raymond
98616b3014 Make fogged() a method of map_display...
...that is overridden by a fogged() method in the display subclass.

If fogging or shrouding stops working, suspect this commit.
2007-06-23 19:46:29 +00:00
Eric S. Raymond
f8aadff796 Move some key data members in preparation for lifting thec drawing logic. 2007-06-23 17:13:22 +00:00
Eric S. Raymond
4a92710834 More display-class refactoring; lift the code for manipulating buttons. 2007-06-23 16:19:45 +00:00
Eric S. Raymond
c906e80464 Lift another bounds-checking function, and some cosmetic fixes. 2007-06-22 12:46:50 +00:00
Eric S. Raymond
928ee74075 Lift some bounds-checking code into display.cpp. 2007-06-22 12:32:43 +00:00
Eric S. Raymond
1960c1e1a7 Lift the sceenshot() and get_zoom_facotor() functions. 2007-06-22 11:59:47 +00:00
Eric S. Raymond
63e81a6a31 Move screen up to the map_display class. 2007-06-22 11:36:30 +00:00
Eric S. Raymond
00d1266ccf Lift map_, theme_, and zoom_ to the new map_display superclass. 2007-06-22 11:06:11 +00:00
Eric S. Raymond
10f391919d Refactoring the display class quickly didn't work.
So now we'll do it the slow step-by-step way, starting by subclassing
display from an empty superclass and moving a little bit of stuff up
before each test.
2007-06-22 10:19:02 +00:00
Eric S. Raymond
946203ac8f Small refactoring step; hide the guts of what the display code uses...
...for announcements.
2007-06-13 08:46:18 +00:00
Mark de Wever
436b421af8 made display::invalidate_animations() private since display::draw()
always calls it unconditionally
2007-06-09 17:13:02 +00:00
Mark de Wever
6c31017094 Added Proof-of-concept of the new background still has some flaws
* upon scrolling the background static (so maps scrolls over wood)

* _off^usr has redraw glitches since background is only updated every
  now and then

* the alpha at the border tends to "build up"

* we impose a huge performance hit

The code still needs a lot of work, but what needs to be done heavily
depends on whether or not the half-hexes are reintroduced so that the
is postponed until that descission has been made.
2007-06-09 11:51:59 +00:00
Ali El Gariani
70922f8419 Experiments with the movement hint, please comment for tuning / removing
- multiline, so the def% is always on center and turns to reach just
  below. Also allow next point

- def% is a little bigger, because it's more important and also for
  helping the darkening in next point

- def% is slighlty level-colored, but it's hard to choose a good color
scale using a constant brightness currently use the formula : color =
{255 - def, 105 + def, 0} but not very differentiable and a bit darker
2007-06-04 11:36:22 +00:00
Ali El Gariani
f45136b7b5 "movement hint" and "number of enemies who can reach" used...
...similar code to draw text in a hex

add a new function to replace this redundancy (+ some cleaning for
drawing the black border).  The function draw_enemies_reach is now
almost empty, so remove it.

No visible change.
2007-06-04 01:43:17 +00:00
Ali El Gariani
a28991f607 clean and add a parameter to the sunset command for tuning the delay
...(in frames) between 2 darkenings

(as suggested by Mordante). You can still use just "sunset" to toogle,
the default is every 5 frames.
2007-06-02 17:54:00 +00:00
Mark de Wever
ff216afd2c removed display::lock_updates() and display::update_locked()
they had a comment which indicated they were scheduled for removal
(over 2 years old) and fixed the callers.
2007-06-02 14:09:11 +00:00
Ali El Gariani
9e7120aa90 Add a debug function "sunset" to see what hexes are refreshed and when
Just a quick hack to help devs to spot useless invalidated hexes (and
there is such ones)

Need cleaning but I am not sure that it will stay on the release

Just type the command "sunset" in debug mode.
2007-06-01 05:06:28 +00:00
Mark de Wever
8906a0ac18 adds 1 row of border hexes to the map, the grid is not shown on them
NOTE not too happy with now it looks at the outer border

NOTE also not too happy with the forced void drawing of the outer hexes
but it's required to avoid old images getting stuck on the outer border.
2007-05-28 21:33:08 +00:00
Mark de Wever
286cbd4a04 maps smaller than the screen are now shown centered on the screen
for test also changed the minimum map size is to 1 in the editor
this feature might be handy for special maps so leave it in.

I'm not too happy with the name of display::map_outside_area()
2007-05-28 12:19:24 +00:00
Mark de Wever
052da3a591 inline display::set_turbo_speed() 2007-05-27 19:21:55 +00:00
Mark de Wever
0182d47712 removed the automatic shroud outside the map,
it reintroduces some bugs but it's the next step to change the
background.
2007-05-27 17:01:50 +00:00
Mark de Wever
fbabe2290b got rid of display::map_w() and now uses the value from the theme code 2007-05-27 10:13:28 +00:00
Mark de Wever
bc4b91d0d1 renamed to following functions
display::x() => display::w()
display::y() => display::h()
display::mapx() => display::map_w()

Also did some small cleanups. 

map_w() is buggy (uses 140 hardcoded instead of theme value) and might
get removed.
2007-05-27 09:54:30 +00:00
Martin Renold
bb054324a3 fixed comment typos 2007-05-27 09:20:37 +00:00
Mark de Wever
509cd5dff1 cleaned up some comment 2007-05-27 09:07:35 +00:00
Mark de Wever
c7351b1885 changed scroll_to_tiles() to use gamemap::location 2007-05-27 08:51:40 +00:00
Mark de Wever
ee6e372c2e changed get_terrain_images() to use gamemap::location 2007-05-27 08:33:06 +00:00
Mark de Wever
277820f09b some cleanups and added some comment 2007-05-27 08:23:22 +00:00
Mark de Wever
d167945df2 changed draw_terrain_on_tile() to use gamemap::location 2007-05-27 08:11:06 +00:00
Mark de Wever
b46b21ec44 converted get_flag() to use gamemap::location 2007-05-26 23:53:57 +00:00
Mark de Wever
b5686b7911 converted scroll_to_tile() to use gamemap::location 2007-05-26 23:39:22 +00:00
Mark de Wever
886df389f0 display has a lot of functions with x and y parameters...
...where it's not clear what these are.

started to change functions which get a map location to use gamemap::location
this commit does fogged() and shrouded(), more will follow
2007-05-26 23:13:07 +00:00
Mark de Wever
dc1ca61775 small header dependency cleanup 2007-05-26 22:21:11 +00:00
Mark de Wever
e06a318932 added some const modifiers,
need them for testing and the functions can be const anyway
2007-05-26 20:39:51 +00:00
Mark de Wever
6e04a003db remove some unused variables and fix a small comment typo in my previous commit 2007-05-26 19:50:48 +00:00
Mark de Wever
755947764e did some cleaning up;
zoom() could change the zoom value and return the factor
now split in 2 functions, also namechange of default_zoom()
2007-05-26 19:38:43 +00:00
Jérémy Rosen
e105dea465 fix compilation error in the editor 2007-05-12 16:18:21 +00:00
Jérémy Rosen
81108055a4 have the halo and ellipsis stay in the hex during fight... this is a try 2007-05-12 12:53:53 +00:00
Jérémy Rosen
e111e5d439 unit drawing logic cleanup,
should fix various acceleration bugs and restore status bars during fight
2007-05-12 10:33:21 +00:00
Martin Renold
feefb2648a Scrolling review:
* fights should now always be fully on-screen (before, only the rectangle
  between the upper left corners was moved on-screen)

* checking map bounds before scrolling now: if the scrolling speed is
  set slow(!) enough, there will be no more direction changes

* center the tile center instead of the tile upper left bbox corner
2007-04-21 07:17:51 +00:00
Ali El Gariani
9ebaff01f1 Add transition for the shroud outsite the map. 2007-04-01 00:03:52 +00:00
Ali El Gariani
f2238dfada Fix other less frequent variant of bug #8768.
Probably better support of theme with no-standard gamemap location.
2007-03-27 04:26:47 +00:00
Mark de Wever
9184ec4ee6 reapply the halo changes,
...boucman found the cause of failure; shouldn't have been 64 bit specific.

added halo::NO_HALO as value for no halo.

src/unit_frame.cpp will need some more cleaning up but will be done
another time.
2007-03-25 13:52:15 +00:00