From ea1fb986053dc3c99476b190e16975f58f7846d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Timbert?= Date: Fri, 10 Mar 2006 22:17:19 +0000 Subject: [PATCH] Moved the hero icon from EI & TSG into the main directories --- changelog | 1 + .../The_South_Guard/images/misc/hero-icon.png | Bin 446 -> 0 bytes .../images => images}/misc/hero-icon.png | Bin src/game.cpp | 39 ++++++++++++++++++ 4 files changed, 40 insertions(+) delete mode 100644 data/campaigns/The_South_Guard/images/misc/hero-icon.png rename {data/campaigns/Eastern_Invasion/images => images}/misc/hero-icon.png (100%) diff --git a/changelog b/changelog index ad68ff0aa39..7d8d30dc588 100644 --- a/changelog +++ b/changelog @@ -63,6 +63,7 @@ SVN trunk (1.1.1+svn): * increased cost of the Draug from 40 to 50 * decreased melee damage of the Blood Bat from 6-3 to 5-3 * graphics + * moved hero icon from the South Guard into main directories * new attack icons: animal fangs, axe, baneblade, battle axe, beak, claws-animal, claw-undead, entangle, faery touch, fireball, fist-troll, fist-skeletal, hammer, hatchet, human-greatsword diff --git a/data/campaigns/The_South_Guard/images/misc/hero-icon.png b/data/campaigns/The_South_Guard/images/misc/hero-icon.png deleted file mode 100644 index da7ce410b1378c106a5294e3ec6b2c1cf77375be..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 446 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY1|&n@ZgvM!oCO|{#S9GG!XV7ZFl&wkP>{XE z)7O>#Dw8;itims)|3yF{wj^(N7l!{JxM1({$qWpP-kvUwAr-gYUe_%;Y#`8_BJ;TT1Og5A3}2Kg_yad>aMc;llD`F5|>Sr`~TxF~%} zTKwATXa1Ls)0Z)?a@^B9f0BLL$zM9BwVu9?{&w59=kNU-2g7uJwbGOBcJoRjEW|?I zNaqISPG}Wb7VC5~HOlq*?DNi1whPjtMJAiBsEF=jOMbXy$=i$HUw_>FlWnP|{l>+P zg(r%3zEirb5ZOFyTD8Mjy=!t8EPgLf;q7w%)S##O9Pe+b#H5K6`t^tGu-HOSmg8GrqL^aMgL$!-(!v-#Avz zYi)X$)dvtqceDfvSISc&r*3|o5EfwGc1|%k!_m=(1 WI*AACy%t%5Bt2dIT-G@yGywomTC?8( diff --git a/data/campaigns/Eastern_Invasion/images/misc/hero-icon.png b/images/misc/hero-icon.png similarity index 100% rename from data/campaigns/Eastern_Invasion/images/misc/hero-icon.png rename to images/misc/hero-icon.png diff --git a/src/game.cpp b/src/game.cpp index b6d3235e0d7..bc50e563c8f 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -1501,6 +1501,38 @@ void game_controller::play_replay() } } +void display_progress(display &dsply, int percentage) +{ + CVideo &video = dsply.video(); + /* Saturate percentage. */ + if (percentage < 0) { + percentage = 0; + } + else if (percentage > 100) { + percentage = 100; + } + int bcr = 255, bcg = 255, bcb = 255; /* Border color. */ + int dcr = 0, dcg = 0, dcb = 255; /* Done color. */ + int lcr = 0, lcg = 0, lcb = 15; /* Leftover color. */ + int bw = 5; /* Border width in pixels. */ + int scrx = video.getx() - 2*bw; /* Available width. */ + int scry = video.gety() - 2*bw; /* Available height. */ + int pbx = scrx/2; /* Used width. */ + int pby = scry/16; /* Used heigth. */ + /* Draw border. */ + draw_solid_tinted_rectangle ((scrx-pbx)/2-bw, (scry-pby)/2-bw, pbx + 2*bw, bw, bcr, bcg, bcb, 1.0, video.getSurface()); + draw_solid_tinted_rectangle ((scrx-pbx)/2-bw, (scry-pby)/2-bw, bw, pby + 2*bw, bcr, bcg, bcb, 1.0, video.getSurface()); + draw_solid_tinted_rectangle ((scrx-pbx)/2-bw, (scry-pby)/2+pby+bw, pbx + 2*bw, bw, bcr, bcg, bcb, 1.0, video.getSurface()); + draw_solid_tinted_rectangle ((scrx-pbx)/2+pbx+bw, (scry-pby)/2-bw, bw, pby + 2*bw, bcr, bcg, bcb, 1.0, video.getSurface()); + /* Draw done piece. */ + draw_solid_tinted_rectangle ((scrx-pbx)/2, (scry-pby)/2, percentage * pbx / 100, pby, dcr, dcg, dcb, 1.0, video.getSurface()); + /* Draw leftover piece. */ + draw_solid_tinted_rectangle ((scrx-pbx)/2 + percentage * pbx / 100, (scry-pby)/2, (100 - percentage) * pbx / 100, pby, lcr, lcg, lcb, 1.0, video.getSurface()); + /* Update the screen. */ + update_whole_screen(); + dsply.flip(); +} + int play_game(int argc, char** argv) { const int start_ticks = SDL_GetTicks(); @@ -1646,6 +1678,7 @@ int play_game(int argc, char** argv) std::cerr << "could not initialize display\n"; return 0; } + display_progress (game.disp(), 10); #ifdef WIN32 res = game.init_config(); @@ -1654,18 +1687,21 @@ int play_game(int argc, char** argv) return 0; } #endif + display_progress (game.disp(), 25); res = game.init_language(); if(res == false) { std::cerr << "could not initialize the language\n"; return 0; } + display_progress (game.disp(), 40); res = font::load_font_config(); if(res == false) { std::cerr << "could not re-initialize fonts for the current language\n"; return 0; } + display_progress (game.disp(), 55); #ifndef WIN32 // it is better for gettext-native platforms to read the config @@ -1676,6 +1712,7 @@ int play_game(int argc, char** argv) return 0; } #endif + display_progress (game.disp(), 70); const cursor::manager cursor_manager; #if defined(_X11) && !defined(__APPLE__) @@ -1685,6 +1722,8 @@ int play_game(int argc, char** argv) int ntip = -1; config tips_of_day; + display_progress (game.disp(), 85); + for(;;) { //make sure the game config is always set to how it should be at the title screen game.reset_game_cfg();