summaryrefslogtreecommitdiff
path: root/src/graphic
diff options
context:
space:
mode:
authorEugenio Favalli <elvenprogrammer@gmail.com>2004-10-08 14:01:51 +0000
committerEugenio Favalli <elvenprogrammer@gmail.com>2004-10-08 14:01:51 +0000
commit1e1e15dd3ab111383b27f09f70eb590878254e00 (patch)
tree9f47098a3c1758d6d49b40e3b02442e2cae8fe85 /src/graphic
parent75da526f11f74b9bffb9580c2daf63108c294ca8 (diff)
downloadmana-client-1e1e15dd3ab111383b27f09f70eb590878254e00.tar.gz
mana-client-1e1e15dd3ab111383b27f09f70eb590878254e00.tar.bz2
mana-client-1e1e15dd3ab111383b27f09f70eb590878254e00.tar.xz
mana-client-1e1e15dd3ab111383b27f09f70eb590878254e00.zip
*** empty log message ***
Diffstat (limited to 'src/graphic')
-rw-r--r--src/graphic/2xsai.cpp (renamed from src/graphic/super_eagle.cpp)294
-rw-r--r--src/graphic/2xsai.h25
-rw-r--r--src/graphic/graphic.cpp108
-rw-r--r--src/graphic/graphic.h3
-rw-r--r--src/graphic/super_eagle.h44
5 files changed, 377 insertions, 97 deletions
diff --git a/src/graphic/super_eagle.cpp b/src/graphic/2xsai.cpp
index e48723d9..59e824b9 100644
--- a/src/graphic/super_eagle.cpp
+++ b/src/graphic/2xsai.cpp
@@ -1,27 +1,8 @@
-/**
+#include "2xsai.h"
- The Mana World
- Copyright 2004 The Mana World Development Team
-
- This file is part of The Mana World.
-
- The Mana World is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- any later version.
-
- The Mana World is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with The Mana World; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-*/
-
-#include "super_eagle.h"
+#define uint32 unsigned long
+#define uint16 unsigned short
+#define uint8 unsigned char
static uint32 colorMask = 0xF7DEF7DE;
static uint32 lowPixelMask = 0x08210821;
@@ -32,7 +13,8 @@ static uint32 greenMask = 0x7E0;
static int PixelsPerMask = 2;
static int xsai_depth = 0;
-int Init_SuperEagle(int d) {
+int Init_2xSaI(int d) {
+
int minr = 0, ming = 0, minb = 0;
int i;
@@ -75,8 +57,9 @@ int Init_SuperEagle(int d) {
return 0;
}
-/** unused /- kth5
-static int GetResult1(uint32 A, uint32 B, uint32 C, uint32 D) {
+
+static int GetResult1(uint32 A, uint32 B, uint32 C, uint32 D)
+{
int x = 0;
int y = 0;
int r = 0;
@@ -95,7 +78,8 @@ static int GetResult1(uint32 A, uint32 B, uint32 C, uint32 D) {
return r;
}
-static int GetResult2(uint32 A, uint32 B, uint32 C, uint32 D, uint32 E) {
+static int GetResult2(uint32 A, uint32 B, uint32 C, uint32 D, uint32 E)
+{
int x = 0;
int y = 0;
int r = 0;
@@ -112,7 +96,7 @@ static int GetResult2(uint32 A, uint32 B, uint32 C, uint32 D, uint32 E) {
if (y <= 1)
r += 1;
return r;
-}*/
+}
#define GET_RESULT(A, B, C, D) ((A != C || A != D) - (B != C || B != D))
@@ -192,8 +176,260 @@ static unsigned char *src_line[4];
static unsigned char *dst_line[2];
+void Super2xSaI(BITMAP * src, BITMAP * dest, int s_x, int s_y, int d_x, int d_y, int w, int h)
+{
+ int sbpp, dbpp;
+
+ BITMAP *dst2 = NULL;
+
+ if (!src || !dest)
+ return;
+
+ sbpp = bitmap_color_depth(src);
+ dbpp = bitmap_color_depth(dest);
+
+ if ((sbpp != xsai_depth) || (sbpp != dbpp)) /* Must be same color depth */
+ return;
+
+ BLIT_CLIP2(src, dest, s_x, s_y, d_x, d_y, w, h, 2, 2);
+
+ if (w < 4 || h < 4) { /* Image is too small to be 2xSaI'ed. */
+ stretch_blit(src, dest, s_x, s_y, w, h, d_x, d_y, w * 2, h * 2);
+ return;
+ }
+
+ sbpp = BYTES_PER_PIXEL(sbpp);
+ if (d_x || d_y)
+ dst2 = create_sub_bitmap(dest, d_x, d_y, w * 2, h * 2);
+
+ Super2xSaI_ex(src->line[s_y] + s_x * sbpp, (unsigned int)(src->line[1] - src->line[0]), NULL, dst2 ? dst2 : dest, w, h);
+
+ if (dst2)
+ destroy_bitmap(dst2);
+
+ return;
+}
+
+void Super2xSaI_ex(uint8 *src, uint32 src_pitch, uint8 *unused, BITMAP *dest, uint32 width, uint32 height) {
+
+ int j, v;
+ unsigned int x, y;
+ int sbpp = BYTES_PER_PIXEL(bitmap_color_depth(dest));
+ unsigned long color[16];
+
+ /* Point to the first 3 lines. */
+ src_line[0] = src;
+ src_line[1] = src;
+ src_line[2] = src + src_pitch;
+ src_line[3] = src + src_pitch * 2;
+
+ /* Can we write the results directly? */
+ if (is_video_bitmap(dest) || is_planar_bitmap(dest)) {
+ dst_line[0] = (unsigned char *)malloc(sizeof(char) * sbpp * width);
+ dst_line[1] = (unsigned char *)malloc(sizeof(char) * sbpp * width);
+ v = 1;
+ }
+ else {
+ dst_line[0] = dest->line[0];
+ dst_line[1] = dest->line[1];
+ v = 0;
+ }
+
+ /* Set destination */
+ bmp_select(dest);
+
+ x = 0, y = 0;
+
+ if (PixelsPerMask == 2) {
+ unsigned short *sbp;
+ sbp = (unsigned short*)src_line[0];
+ color[0] = *sbp; color[1] = color[0]; color[2] = color[0]; color[3] = color[0];
+ color[4] = color[0]; color[5] = color[0]; color[6] = *(sbp + 1); color[7] = *(sbp + 2);
+ sbp = (unsigned short*)src_line[2];
+ color[8] = *sbp; color[9] = color[8]; color[10] = *(sbp + 1); color[11] = *(sbp + 2);
+ sbp = (unsigned short*)src_line[3];
+ color[12] = *sbp; color[13] = color[12]; color[14] = *(sbp + 1); color[15] = *(sbp + 2);
+ }
+ else {
+ unsigned long *lbp;
+ lbp = (unsigned long*)src_line[0];
+ color[0] = *lbp; color[1] = color[0]; color[2] = color[0]; color[3] = color[0];
+ color[4] = color[0]; color[5] = color[0]; color[6] = *(lbp + 1); color[7] = *(lbp + 2);
+ lbp = (unsigned long*)src_line[2];
+ color[8] = *lbp; color[9] = color[8]; color[10] = *(lbp + 1); color[11] = *(lbp + 2);
+ lbp = (unsigned long*)src_line[3];
+ color[12] = *lbp; color[13] = color[12]; color[14] = *(lbp + 1); color[15] = *(lbp + 2);
+ }
+
+ for (y = 0; y < height; y++) {
+
+ /* Todo: x = width - 2, x = width - 1 */
+
+ for (x = 0; x < width; x++) {
+ unsigned long product1a, product1b, product2a, product2b;
+
+//--------------------------------------- B0 B1 B2 B3 0 1 2 3
+// 4 5* 6 S2 -> 4 5* 6 7
+// 1 2 3 S1 8 9 10 11
+// A0 A1 A2 A3 12 13 14 15
+//--------------------------------------
+ if (color[9] == color[6] && color[5] != color[10]) {
+ product2b = color[9];
+ product1b = product2b;
+ }
+ else if (color[5] == color[10] && color[9] != color[6]) {
+ product2b = color[5];
+ product1b = product2b;
+ }
+ else if (color[5] == color[10] && color[9] == color[6]) {
+ int r = 0;
+
+ r += GET_RESULT(color[6], color[5], color[8], color[13]);
+ r += GET_RESULT(color[6], color[5], color[4], color[1]);
+ r += GET_RESULT(color[6], color[5], color[14], color[11]);
+ r += GET_RESULT(color[6], color[5], color[2], color[7]);
+
+ if (r > 0)
+ product1b = color[6];
+ else if (r < 0)
+ product1b = color[5];
+ else
+ product1b = INTERPOLATE(color[5], color[6]);
+
+ product2b = product1b;
+
+ }
+ else {
+ if (color[6] == color[10] && color[10] == color[13] && color[9] != color[14] && color[10] != color[12])
+ product2b = Q_INTERPOLATE(color[10], color[10], color[10], color[9]);
+ else if (color[5] == color[9] && color[9] == color[14] && color[13] != color[10] && color[9] != color[15])
+ product2b = Q_INTERPOLATE(color[9], color[9], color[9], color[10]);
+ else
+ product2b = INTERPOLATE(color[9], color[10]);
+
+ if (color[6] == color[10] && color[6] == color[1] && color[5] != color[2] && color[6] != color[0])
+ product1b = Q_INTERPOLATE(color[6], color[6], color[6], color[5]);
+ else if (color[5] == color[9] && color[5] == color[2] && color[1] != color[6] && color[5] != color[3])
+ product1b = Q_INTERPOLATE(color[6], color[5], color[5], color[5]);
+ else
+ product1b = INTERPOLATE(color[5], color[6]);
+ }
+
+ if (color[5] == color[10] && color[9] != color[6] && color[4] == color[5] && color[5] != color[14])
+ product2a = INTERPOLATE(color[9], color[5]);
+ else if (color[5] == color[8] && color[6] == color[5] && color[4] != color[9] && color[5] != color[12])
+ product2a = INTERPOLATE(color[9], color[5]);
+ else
+ product2a = color[9];
+
+ if (color[9] == color[6] && color[5] != color[10] && color[8] == color[9] && color[9] != color[2])
+ product1a = INTERPOLATE(color[9], color[5]);
+ else if (color[4] == color[9] && color[10] == color[9] && color[8] != color[5] && color[9] != color[0])
+ product1a = INTERPOLATE(color[9], color[5]);
+ else
+ product1a = color[5];
+
+ if (PixelsPerMask == 2) {
+ *((unsigned long *) (&dst_line[0][x * 4])) = product1a | (product1b << 16);
+ *((unsigned long *) (&dst_line[1][x * 4])) = product2a | (product2b << 16);
+ }
+ else {
+ *((unsigned long *) (&dst_line[0][x * 8])) = product1a;
+ *((unsigned long *) (&dst_line[0][x * 8 + 4])) = product1b;
+ *((unsigned long *) (&dst_line[1][x * 8])) = product2a;
+ *((unsigned long *) (&dst_line[1][x * 8 + 4])) = product2b;
+ }
+
+ /* Move color matrix forward */
+ color[0] = color[1]; color[4] = color[5]; color[8] = color[9]; color[12] = color[13];
+ color[1] = color[2]; color[5] = color[6]; color[9] = color[10]; color[13] = color[14];
+ color[2] = color[3]; color[6] = color[7]; color[10] = color[11]; color[14] = color[15];
+
+ if (x < width - 3) {
+ x += 3;
+ if (PixelsPerMask == 2) {
+ color[3] = *(((unsigned short*)src_line[0]) + x);
+ color[7] = *(((unsigned short*)src_line[1]) + x);
+ color[11] = *(((unsigned short*)src_line[2]) + x);
+ color[15] = *(((unsigned short*)src_line[3]) + x);
+ }
+ else {
+ color[3] = *(((unsigned long*)src_line[0]) + x);
+ color[7] = *(((unsigned long*)src_line[1]) + x);
+ color[11] = *(((unsigned long*)src_line[2]) + x);
+ color[15] = *(((unsigned long*)src_line[3]) + x);
+ }
+ x -= 3;
+ }
+ }
+
+ /* We're done with one line, so we shift the source lines up */
+ src_line[0] = src_line[1];
+ src_line[1] = src_line[2];
+ src_line[2] = src_line[3];
+
+ /* Read next line */
+ if (y + 3 >= height)
+ src_line[3] = src_line[2];
+ else
+ src_line[3] = src_line[2] + src_pitch;
+
+ /* Then shift the color matrix up */
+ if (PixelsPerMask == 2) {
+ unsigned short *sbp;
+ sbp = (unsigned short*)src_line[0];
+ color[0] = *sbp; color[1] = color[0]; color[2] = *(sbp + 1); color[3] = *(sbp + 2);
+ sbp = (unsigned short*)src_line[1];
+ color[4] = *sbp; color[5] = color[4]; color[6] = *(sbp + 1); color[7] = *(sbp + 2);
+ sbp = (unsigned short*)src_line[2];
+ color[8] = *sbp; color[9] = color[9]; color[10] = *(sbp + 1); color[11] = *(sbp + 2);
+ sbp = (unsigned short*)src_line[3];
+ color[12] = *sbp; color[13] = color[12]; color[14] = *(sbp + 1); color[15] = *(sbp + 2);
+ }
+ else {
+ unsigned long *lbp;
+ lbp = (unsigned long*)src_line[0];
+ color[0] = *lbp; color[1] = color[0]; color[2] = *(lbp + 1); color[3] = *(lbp + 2);
+ lbp = (unsigned long*)src_line[1];
+ color[4] = *lbp; color[5] = color[4]; color[6] = *(lbp + 1); color[7] = *(lbp + 2);
+ lbp = (unsigned long*)src_line[2];
+ color[8] = *lbp; color[9] = color[9]; color[10] = *(lbp + 1); color[11] = *(lbp + 2);
+ lbp = (unsigned long*)src_line[3];
+ color[12] = *lbp; color[13] = color[12]; color[14] = *(lbp + 1); color[15] = *(lbp + 2);
+ }
+
+
+ /* Write the 2 lines, if not already done so */
+ if (v) {
+ unsigned long dst_addr;
+
+ dst_addr = bmp_write_line(dest, y * 2);
+ for (j = 0; j < dest->w * sbpp; j += sizeof(long))
+ bmp_write32(dst_addr + j, *((unsigned long *) (dst_line[0] + j)));
+
+ dst_addr = bmp_write_line(dest, y * 2 + 1);
+ for (j = 0; j < dest->w * sbpp; j += sizeof(long))
+ bmp_write32(dst_addr + j, *((unsigned long *) (dst_line[1] + j)));
+ }
+ else {
+ if (y < height - 1) {
+ dst_line[0] = dest->line[y * 2 + 2];
+ dst_line[1] = dest->line[y * 2 + 3];
+ }
+ }
+ }
+ bmp_unwrite_line(dest);
+
+ if (v) {
+ free(dst_line[0]);
+ free(dst_line[1]);
+ }
+}
+
+
-void SuperEagle(BITMAP * src, BITMAP * dest, int s_x, int s_y, int d_x, int d_y, int w, int h) {
+void SuperEagle(BITMAP * src, BITMAP * dest, int s_x, int s_y, int d_x, int d_y, int w, int h)
+{
int sbpp, dbpp;
BITMAP *dst2 = NULL;
diff --git a/src/graphic/2xsai.h b/src/graphic/2xsai.h
new file mode 100644
index 00000000..7a9128bf
--- /dev/null
+++ b/src/graphic/2xsai.h
@@ -0,0 +1,25 @@
+#ifdef WIN32
+#pragma warning(disable:4312)
+#endif
+
+#ifndef _2XSAI_H
+#define _2XSAI_H
+
+#include <allegro.h>
+#include <allegro/internal/aintern.h>
+//#include <string.h>
+
+
+
+#define uint32 unsigned long
+#define uint16 unsigned short
+#define uint8 unsigned char
+
+int Init_2xSaI(int depth);
+void Super2xSaI(BITMAP * src, BITMAP * dest, int s_x, int s_y, int d_x, int d_y, int w, int h);
+void Super2xSaI_ex(uint8 *src, uint32 src_pitch, uint8 *unused, BITMAP *dest, uint32 width, uint32 height);
+
+void SuperEagle(BITMAP * src, BITMAP * dest, int s_x, int s_y, int d_x, int d_y, int w, int h);
+void SuperEagle_ex(uint8 *src, uint32 src_pitch, uint8 *unused, BITMAP *dest, uint32 width, uint32 height);
+
+#endif
diff --git a/src/graphic/graphic.cpp b/src/graphic/graphic.cpp
index 86aa62d4..3e07e9d0 100644
--- a/src/graphic/graphic.cpp
+++ b/src/graphic/graphic.cpp
@@ -24,6 +24,7 @@
*/
#include "graphic.h"
+#include "2xsai.h"
#define TILESET_W 480
#define TILESET_H 320
@@ -38,14 +39,16 @@ DATAFILE *tileset;
char itemCurrenyQ[10] = "0";
char page_num;
int map_x, map_y, camera_x, camera_y;
-DIALOG_PLAYER *chat_player, *npc_player, *skill_player, *buy_sell_player, *buy_player, *sell_player, *stats_player;
+DIALOG_PLAYER *chat_player, *npc_player, *skill_player, *buy_sell_player, *buy_player, *sell_player, *stats_player, *skill_list_player;
char speech[255] = "";
char npc_text[1000] = "";
char statsString2[255] = "n/a";
+char skill_points[10] = "";
TmwInventory inventory;
Chat chatlog("./docs/chatlog.txt", 20);
int show_npc_dialog = 0;
bool show_skill_dialog = false;
+bool show_skill_list_dialog = false;
DIALOG npc_dialog[] = {
/* (dialog proc) (x) (y) (w) (h) (fg) (bg) (key) (flags) (d1) (d2) (dp) (dp2) (dp3) */
@@ -88,6 +91,16 @@ DIALOG sell_dialog[] = {
{ NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL }
};
+DIALOG skill_list_dialog[] = {
+ /* (dialog proc) (x) (y) (w) (h) (fg) (bg) (key) (flags) (d1) (d2) (dp) (dp2) (dp3) */
+ { tmw_dialog_proc, 300, 200, 260, 200, 0, 0, 0, 0, 0, 0, (char *)"Skills", NULL, NULL },
+ { tmw_button_proc, 450, 376, 50, 20, 255, 0, 'u', D_EXIT, 0, 0, (char *)"&Up", NULL, NULL },
+ { tmw_button_proc, 508, 376, 50, 20, 255, 0, 'c', D_EXIT, 0, 0, (char *)"&Close", NULL, NULL },
+ { tmw_list_proc, 304, 224, 252, 100, 0, 0, 0, 0, 0, 0, (char *)skill_list, NULL, NULL },
+ { tmw_text_proc, 304, 326, 40, 20, 0, 0, 0, 0, 0, 0, (char *)skill_points, NULL, NULL },
+ { NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL }
+};
+
DIALOG chat_dialog[] = {
/* (dialog proc) (x) (y) (w) (h) (fg) (bg) (key) (flags) (d1) (d2) (dp) (dp2) (dp3) */
{ tmw_edit_proc, 0, 574, 592, 25, 0, 0, 'c', 0, 90, 0, speech, NULL, NULL },
@@ -149,6 +162,7 @@ void init_graphic() {
buy_sell_player = init_dialog(buy_sell_dialog, -1);
buy_player = init_dialog(buy_dialog, -1);
sell_player = init_dialog(sell_dialog, -1);
+ skill_list_player = init_dialog(skill_list_dialog, -1);
gui_bitmap = double_buffer;
alfont_text_mode(-1);
inventory.create(100, 100);
@@ -210,18 +224,28 @@ void do_graphic(void) {
//node->speed = 10000;
- //set_coordinates(node->coordinates, get_x(node->coordinates), get_y(node->coordinates), direction);*/
+ if(node->frame>=4) {
+ //alert("","","","","",0,0);
+ node->frame = 3;
+ }
+
+ //set_coordinates(node->coordinates, get_x(node->coordinates), get_y(node->coordinates), direction);*/
- node->text_x = (get_x(node->coordinates)-camera_x)*16-20+get_x_offset(node)-offset_x;
+ node->text_x = (get_x(node->coordinates)-camera_x)*16-22+get_x_offset(node)-offset_x;
node->text_y = (get_y(node->coordinates)-camera_y)*16-25+get_y_offset(node)-offset_y;
int r_x = node->text_x-get_x_offset(node);
int r_y = node->text_y-get_y_offset(node);
- if(node->action==MONSTER_DEAD)node->frame = 0;
- masked_blit((BITMAP *)graphic[MOBSET_BMP].dat, buffer, (get_direction(node->coordinates)/2)*60+240*(node->job-1002), 60*(node->frame+node->action), node->text_x, node->text_y, 60, 60);
- //rectfill(buffer, r_x, r_y, r_x+16, r_y+16, makecol(0,0,255));
- //alfont_textprintf(buffer, gui_font, node->text_x, node->text_y, MAKECOL_WHITE, "%i", node->frame);
+ //rectfill(buffer, node->text_x+22, node->text_y+25, node->text_x+16+22, node->text_y+16+25, makecol(0,0,255));
+
+ //if(node->action==MONSTER_DEAD)node->frame = 0;
+ if(node->action==MONSTER_DEAD)
+ masked_blit((BITMAP *)graphic[MOBSET_BMP].dat, buffer, (get_direction(node->coordinates)/2)*60+240*(node->job-1002), 60*MONSTER_DEAD, node->text_x, node->text_y, 60, 60);
+ else
+ masked_blit((BITMAP *)graphic[MOBSET_BMP].dat, buffer, (get_direction(node->coordinates)/2)*60+240*(node->job-1002), 60*(node->frame+node->action), node->text_x, node->text_y, 60, 60);
+
+ //alfont_textprintf(buffer, gui_font, node->text_x, node->text_y, MAKECOL_WHITE, "%i", node->id);
if(node->action!=STAND) {
node->frame = (get_elapsed_time(node->tick_time)*4)/(node->speed);
@@ -232,39 +256,59 @@ void do_graphic(void) {
node->path = node->path->next;
direction = 0;
//if(node->path->next) {
- if(node->path->x>old->x && node->path->y>old->y)direction = SE;
- else if(node->path->x<old->x && node->path->y>old->y)direction = SW;
- else if(node->path->x>old->x && node->path->y<old->y)direction = NE;
- else if(node->path->x<old->x && node->path->y<old->y)direction = NW;
- else if(node->path->x>old->x)direction = EAST;
- else if(node->path->x<old->x)direction = WEST;
- else if(node->path->y>old->y)direction = SOUTH;
- else if(node->path->y<old->y)direction = NORTH;
+ if(node->path->x>old->x && node->path->y>old->y)direction = SE;
+ else if(node->path->x<old->x && node->path->y>old->y)direction = SW;
+ else if(node->path->x>old->x && node->path->y<old->y)direction = NE;
+ else if(node->path->x<old->x && node->path->y<old->y)direction = NW;
+ else if(node->path->x>old->x)direction = EAST;
+ else if(node->path->x<old->x)direction = WEST;
+ else if(node->path->y>old->y)direction = SOUTH;
+ else if(node->path->y<old->y)direction = NORTH;
//}
set_coordinates(node->coordinates, node->path->x, node->path->y, direction);
+
+ //node->tick_time = tick_time;
- if(old!=NULL)
- free(old);
- } else node->action = STAND;
+ /*if(old!=NULL)
+ free(old);*/
+ } else {
+ node->action = STAND;
+ }
if(node->action!=MONSTER_DEAD)node->frame = 0;
node->tick_time = tick_time;
+ //node->frame = 0;
}
}
}
}
- old_node = node;
- node = node->next;
- if(old_node->action==MONSTER_DEAD && old_node->frame>=4)
- remove_node(old_node->id);
+
+ //old_node = node;
+ if(node->action==MONSTER_DEAD && node->frame>=20) {
+ NODE *temp = node;
+ node = node->next;
+ remove_node(temp->id);
+ } else node = node->next;
+ /*if(old_node->action==MONSTER_DEAD && old_node->frame>=4)
+ remove_node(old_node->id);*/
+
+ // nodes are ordered so if the next node y is > then the
+ // last drawed for fringe layer, draw the missing lines
}
+ // complete drawing fringe layer
+
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 && 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);
+ if(stretch_mode==0)
+ stretch_blit(buffer, double_buffer, 0, 0, 400, 300, 0, 0, 800, 600);
+ else if(stretch_mode==1)
+ Super2xSaI(buffer, double_buffer, 0, 0, 0, 0, 400, 300);
+ else if(stretch_mode==2)
+ SuperEagle(buffer, double_buffer, 0, 0, 0, 0, 400, 300);
// Draw player speech
node = get_head();
@@ -366,6 +410,24 @@ void do_graphic(void) {
if(gui_update(skill_player)==0)show_skill_dialog = false;
}
+ if(show_skill_list_dialog) {
+ /*if(char_info->skill_point>0)skill_list_dialog[1].flags = 0;
+ else skill_list_dialog[1].flags |= D_DISABLED;*/
+ if(gui_update(skill_list_player)==0) {
+ int ret = shutdown_dialog(skill_list_player);
+ if(ret==1) {
+ if(char_info->skill_point>0) {
+ WFIFOW(0) = net_w_value(0x0112);
+ WFIFOW(2) = net_w_value(get_skill_id(skill_list_dialog[3].d1));
+ WFIFOSET(4);
+ }
+ } else if(ret==2) {
+ show_skill_list_dialog = false;
+ }
+ skill_list_player = init_dialog(skill_list_dialog, -1);
+ }
+ }
+
// character status display
update_stats_dialog();
gui_update(stats_player);
diff --git a/src/graphic/graphic.h b/src/graphic/graphic.h
index 2ba3cc74..bfbb106f 100644
--- a/src/graphic/graphic.h
+++ b/src/graphic/graphic.h
@@ -44,8 +44,9 @@
extern BITMAP *buffer, *double_buffer;
extern char speech[255];
extern char npc_text[1000];
+extern char skill_points[10];
extern Chat chatlog;
-extern bool show_skill_dialog;
+extern bool show_skill_dialog, show_skill_list_dialog;
extern int show_npc_dialog;
extern TmwInventory inventory;
extern int map_x, map_y, camera_x, camera_y;
diff --git a/src/graphic/super_eagle.h b/src/graphic/super_eagle.h
deleted file mode 100644
index 64c763db..00000000
--- a/src/graphic/super_eagle.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
-
- The Mana World
- Copyright 2004 The Mana World Development Team
-
- This file is part of The Mana World.
-
- The Mana World is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- any later version.
-
- The Mana World is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with The Mana World; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-*/
-
-#ifdef WIN32
- #pragma warning (disable:4312)
-#endif
-
-#ifndef _SUPER_EAGLE_H
-#define _SUPER_EAGLE_H
-
-#include <string.h>
-#include <allegro.h>
-#include <allegro/internal/aintern.h>
-
-#define uint32 unsigned long
-#define uint16 unsigned short
-#define uint8 unsigned char
-
-void SuperEagle(BITMAP * src, BITMAP * dest, int s_x, int s_y, int d_x, int d_y, int w, int h);
-void SuperEagle_ex(uint8 *src, uint32 src_pitch, uint8 *unused, BITMAP *dest, uint32 width, uint32 height);
-
-int Init_SuperEagle(int d);
-
-#endif