Skip to content

Commit

Permalink
Update to mapview rendering.
Browse files Browse the repository at this point in the history
  • Loading branch information
freecivnet committed Jun 13, 2011
1 parent c76ce3d commit 471c768
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 27 deletions.
Binary file modified freeciv-web/src/main/webapp/images/freeciv-screenshot-fp3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 7 additions & 6 deletions freeciv-web/src/main/webapp/javascript-compressed/webclient.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions freeciv-web/src/main/webapp/javascript/civclient.js
Expand Up @@ -72,10 +72,7 @@ function civclient_init()
};
})();

(function animloop(){
update_map_canvas_check();
requestAnimFrame(animloop, mapview_canvas);
})();
requestAnimFrame(update_map_canvas_check, mapview_canvas);


/*
Expand Down
6 changes: 6 additions & 0 deletions freeciv-web/src/main/webapp/javascript/control.js
Expand Up @@ -47,6 +47,12 @@ function control_init()
$("#canvas").mousedown(mapview_mouse_down);

$("#city_canvas").click(city_mapview_mouse_click);

$("#turn_done_button").click(send_end_turn);
$("#freeciv_logo").click(function(event) {
window.open('http://www.freeciv.net/', '_new');
});


$("#game_text_input").keydown(function(event) {
return check_text_input(event, $("#game_text_input"));
Expand Down
10 changes: 6 additions & 4 deletions freeciv-web/src/main/webapp/javascript/mapview_common.js
Expand Up @@ -554,6 +554,7 @@ function update_map_canvas_check()
if (time > MAPVIEW_REFRESH_INTERVAL || mapview_slide['active']) {
update_map_canvas_full();
}
requestAnimFrame(update_map_canvas_check, mapview_canvas);

}

Expand Down Expand Up @@ -602,11 +603,14 @@ function enable_mapview_slide(ptile)
var gui_x = r['gui_dx'];
var gui_y = r['gui_dy'];

gui_x -= (mapview['width'] - tileset_tile_width) >> 1 ;
gui_x -= (mapview['width'] - tileset_tile_width) >> 1;
gui_y -= (mapview['height'] - tileset_tile_height) >> 1;

var dx = gui_x - mapview['gui_x0'];
var dy = gui_y - mapview['gui_y0'];
mapview_slide['dx'] = dx;
mapview_slide['dy'] = dy;
mapview_slide['i'] = mapview_slide['max'];

if (Math.abs(dx) > mapview['width'] || Math.abs(dy) > mapview['height']) {
// sliding across map edge.
Expand Down Expand Up @@ -665,9 +669,6 @@ function enable_mapview_slide(ptile)
mapview['width'] = old_width;
mapview['height'] = old_height;

mapview_slide['dx'] = dx;
mapview_slide['dy'] = dy;
mapview_slide['i'] = mapview_slide['max'];
mapview_slide['start'] = new Date().getTime();

}
Expand All @@ -682,6 +683,7 @@ function update_map_slide()
mapview_slide['active'] = false;
return;
}

dx = mapview_slide['dx'];
dy = mapview_slide['dy'];
var sx = 0;
Expand Down
5 changes: 2 additions & 3 deletions freeciv-web/src/main/webapp/webclient/game.jsp
Expand Up @@ -4,7 +4,7 @@
<div id="tabs">

<ul id="tabs_menu">
<div id="freeciv_logo" style="cursor:pointer;cursor:hand" onclick="window.open('http://www.freeciv.net/', '_new');"></div>
<div id="freeciv_logo" style="cursor:pointer;cursor:hand"></div>
<li id="map_tab"><a href="#tabs-map" onclick="set_default_mapview_active();">Map</a></li>
<li id="civ_tab"><a href="#tabs-civ" onclick="set_default_mapview_inactive(); update_rates_dialog(); update_govt_dialog();">Government</a></li>
<li><a id="tech_tab_item" href="#tabs-tec" onclick="set_default_mapview_inactive(); update_tech_screen();">Research</a></li>
Expand All @@ -13,9 +13,8 @@
<li id="opt_tab"><a href="#tabs-opt" onclick="init_options_dialog(); set_default_mapview_inactive();">Options</a></li>
<li id="hel_tab"><a href="#tabs-hel" onclick="set_default_mapview_inactive(); show_help();">Manual</a></li>
<div id="turn_done_button_div">
<%--<button id="turn_done_button" type="button" onClick="send_end_turn();" >Turn Done</button>--%>

<button id="turn_done_button" type="button" class="button" onClick="send_end_turn();">Turn Done</button>
<button id="turn_done_button" type="button" class="button">Turn Done</button>


</div>
Expand Down
10 changes: 0 additions & 10 deletions freeciv-web/src/main/webapp/webclient/pregame.jsp
Expand Up @@ -12,16 +12,6 @@
<button type="button" class="button" onClick="pregame_settings();" >Settings</button>
</div>

<div id="share_icons">
<a href="http://www.facebook.com/sharer.php?u=http://www.freeciv.net/&t=Join me in a Freeciv.net multiplayer game at http://www.freeciv.net/" target="_new">
<img src="/images/facebook-share.png" border="0" title="Invite friends on Facebook!">
</a>
<a href="http://twitter.com/home?status=Join me in a Freeciv.net multiplayer game at http://www.freeciv.net/" target="_new">
<img src="/images/twitter-share.png" border="0" title="Invite friends on Twitter!">
</a>

</div>

</div>


Expand Down

0 comments on commit 471c768

Please sign in to comment.