summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEugenio Favalli <elvenprogrammer@gmail.com>2004-09-26 15:50:07 +0000
committerEugenio Favalli <elvenprogrammer@gmail.com>2004-09-26 15:50:07 +0000
commit624370950b22fc9c5806f0da0d2984c629ecc33d (patch)
treea044ca196b4fb84db09705ac6fa5df8fa90a2fd8 /src
parentfd2e46bffbc5b4f17ab413dc339e5864db1dbb48 (diff)
downloadmana-624370950b22fc9c5806f0da0d2984c629ecc33d.tar.gz
mana-624370950b22fc9c5806f0da0d2984c629ecc33d.tar.bz2
mana-624370950b22fc9c5806f0da0d2984c629ecc33d.tar.xz
mana-624370950b22fc9c5806f0da0d2984c629ecc33d.zip
*** empty log message ***
Diffstat (limited to 'src')
-rw-r--r--src/game.cpp4
-rw-r--r--src/graphic/graphic.cpp12
2 files changed, 5 insertions, 11 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 5f4aced4..d73bfebb 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -473,9 +473,7 @@ void do_parse() {
player_node->type = ACTION_NODE;
player_node->speed = 150;
player_node->id = account_ID;
- x = RFIFOW(18);
- y = RFIFOW(20);
- set_coordinates(player_node->coordinates, x, y, 0);
+ set_coordinates(player_node->coordinates, RFIFOW(18), RFIFOW(20), 0);
add_node(player_node);
walk_status = 0;
// Send "map loaded"
diff --git a/src/graphic/graphic.cpp b/src/graphic/graphic.cpp
index 7aca9189..c104b0d2 100644
--- a/src/graphic/graphic.cpp
+++ b/src/graphic/graphic.cpp
@@ -137,8 +137,8 @@ void do_graphic(void) {
for(int j=0;j<20;j++)
for(int i=0;i<26;i++) {
- draw_rle_sprite(buffer, (RLE_SPRITE *)tileset[get_tile(i+camera_x, j+camera_y, 0)].dat, i*16-offset_x, j*16-offset_y);
- if(get_tile(i+camera_x, j+camera_y, 1)!=0)draw_rle_sprite(buffer, (RLE_SPRITE *)tileset[get_tile(i+camera_x, j+camera_y, 1)].dat, i*16-offset_x, j*16-offset_y);
+ if(get_tile(i+camera_x, j+camera_y, 0)>=0 && get_tile(i+camera_x, j+camera_y, 0)<600)draw_rle_sprite(buffer, (RLE_SPRITE *)tileset[get_tile(i+camera_x, j+camera_y, 0)].dat, i*16-offset_x, j*16-offset_y);
+ if(get_tile(i+camera_x, j+camera_y, 1)>0 && get_tile(i+camera_x, j+camera_y, 1)<600)draw_rle_sprite(buffer, (RLE_SPRITE *)tileset[get_tile(i+camera_x, j+camera_y, 1)].dat, i*16-offset_x, j*16-offset_y);
}
NODE *node = get_head();
@@ -204,15 +204,11 @@ void do_graphic(void) {
for(int j=0;j<20;j++)
for(int i=0;i<26;i++) {
- if(get_tile(i+camera_x, j+camera_y, 2)!=0)draw_rle_sprite(buffer, (RLE_SPRITE *)tileset[get_tile(i+camera_x, j+camera_y, 2)].dat, i*16-offset_x, j*16-offset_y);
+ if(get_tile(i+camera_x, j+camera_y, 2)>0 && get_tile(i+camera_x, j+camera_y, 2)<600)draw_rle_sprite(buffer, (RLE_SPRITE *)tileset[get_tile(i+camera_x, j+camera_y, 2)].dat, i*16-offset_x, j*16-offset_y);
}
-
-
stretch_blit(buffer, double_buffer, 0, 0, 400, 300, 0, 0, 800, 600);
-
-
// Draw player speech
node = get_head();
while(node) {
@@ -247,7 +243,7 @@ void do_graphic(void) {
}
- alfont_textprintf_aa(double_buffer, gui_font, 0, 0, MAKECOL_WHITE, "FPS:%i", fps);
+ alfont_textprintf_aa(double_buffer, gui_font, 0, 0, MAKECOL_WHITE, "FPS:%i %i %i", fps,get_x(player_node->coordinates),get_y(player_node->coordinates));
blit(double_buffer, screen, 0, 0, 0, 0, 800, 600);