From 35b1b1f16978017a39e0951c9ee74115567a0407 Mon Sep 17 00:00:00 2001 From: Eugenio Favalli Date: Sun, 17 Jul 2005 22:00:10 +0000 Subject: Fixing linking issues --- The Mana World.dev | 48 +++++++++++++++++++++-- src/engine.cpp | 2 +- src/game.cpp | 22 ++++++++++- src/gui/equipment.cpp | 94 --------------------------------------------- src/gui/equipment.h | 64 ------------------------------ src/gui/equipmentwindow.cpp | 94 +++++++++++++++++++++++++++++++++++++++++++++ src/gui/equipmentwindow.h | 64 ++++++++++++++++++++++++++++++ 7 files changed, 224 insertions(+), 164 deletions(-) delete mode 100644 src/gui/equipment.cpp delete mode 100644 src/gui/equipment.h create mode 100644 src/gui/equipmentwindow.cpp create mode 100644 src/gui/equipmentwindow.h diff --git a/The Mana World.dev b/The Mana World.dev index 653456ad..0f7eb3be 100644 --- a/The Mana World.dev +++ b/The Mana World.dev @@ -1,7 +1,7 @@ [Project] FileName=The Mana World.dev Name=tmw -UnitCount=147 +UnitCount=151 Type=0 Ver=1 ObjFiles= @@ -12,7 +12,7 @@ ResourceIncludes= MakeIncludes= Compiler=-Dmain=SDL_main_@@_ CppCompiler=-funroll-loops_@@_-ffast-math_@@_-fomit-frame-pointer_@@_-pipe_@@_-DUSE_OPENGL_@@_ -Linker=-lguichan_@@_-lguichan_sdl_@@_-lguichan_opengl_@@_-lwsock32_@@_-lSDL_image_@@_-lSDL_mixer_@@_-lmingw32_@@_-lSDLmain_@@_-lSDL_@@_-llibxml2_@@_-lopengl32_@@_-lz_@@_-lphysfs_@@_-lcurl_@@_ +Linker=-lguichan_@@_-lguichan_sdl_@@_-lguichan_opengl_@@_-lwsock32_@@_-lSDL_image_@@_-lSDL_mixer_@@_-lmingw32_@@_-lSDLmain_@@_-lSDL_@@_-llibxml2_@@_-lopengl32_@@_-lz_@@_-lphysfs_@@_-lcurl_@@_-lwinmm_@@_ IsCpp=1 Icon=The Mana World.ico ExeOutput= @@ -228,7 +228,7 @@ OverrideBuildCmd=0 BuildCmd= [Unit49] -FileName=src\gui\equipment.h +FileName=src\gui\equipmentwindow.h CompileCpp=1 Folder=gui Compile=1 @@ -1128,7 +1128,7 @@ OverrideBuildCmd=0 BuildCmd= [Unit48] -FileName=src\gui\equipment.cpp +FileName=src\gui\equipmentwindow.cpp CompileCpp=1 Folder=gui Compile=1 @@ -1527,3 +1527,43 @@ Priority=1000 OverrideBuildCmd=0 BuildCmd= +[Unit148] +FileName=src\item.h +CompileCpp=1 +Folder=tmw +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd= + +[Unit149] +FileName=src\equipment.cpp +CompileCpp=1 +Folder=tmw +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd= + +[Unit150] +FileName=src\equipment.h +CompileCpp=1 +Folder=tmw +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd= + +[Unit151] +FileName=src\item.cpp +CompileCpp=1 +Folder=tmw +Compile=1 +Link=1 +Priority=1000 +OverrideBuildCmd=0 +BuildCmd= + diff --git a/src/engine.cpp b/src/engine.cpp index 8992dfc8..a92805b3 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -43,7 +43,7 @@ #include "gui/npc.h" #include "gui/stats.h" #include "gui/setup.h" -#include "gui/equipment.h" +#include "gui/equipmentwindow.h" #include "gui/popupmenu.h" //#include "gui/buddywindow.h" #include "gui/help.h" diff --git a/src/game.cpp b/src/game.cpp index 0b5411a1..5ab9470f 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -36,7 +36,7 @@ #include "gui/npc.h" #include "gui/stats.h" #include "gui/setup.h" -#include "gui/equipment.h" +#include "gui/equipmentwindow.h" #include "gui/popupmenu.h" #include "gui/npc_text.h" #include "gui/trade.h" @@ -950,6 +950,8 @@ void do_parse() being->direction = get_direction(RFIFOP(46)); being->walk_time = tick_time; being->frame = 0; + + logger->log("0x01d8% i %i", RFIFOW(18), RFIFOW(20)); if (RFIFOB(51) == 2) { @@ -1600,6 +1602,21 @@ void do_parse() break; // Equipment related case 0x01d7: + being = findNode(RFIFOL(2)); + if (being != NULL) { + case 529: + case 1199: + break; + case 521: + case 522: + case 530: + case 536: + case 1200: + case 1201: + being->weapon = 0; + break; + } + logger->log("1d7 %i %i %i %i", RFIFOL(2), RFIFOB(6), RFIFOW(7), RFIFOW(9)); break; // Answer to unequip item @@ -1733,6 +1750,9 @@ void do_parse() if (being) strcpy(being->name, RFIFOP(6)); break; + // Change in players look + case 0x0119: + std::cout << RFIFOL(2) << " " << RFIFOW(6) << " " << RFIFOW(8) << " " << RFIFOW(10) << " " << RFIFOB(12) << std::endl; // Manage non implemented packets default: logger->log("Unhandled packet: %x", id); diff --git a/src/gui/equipment.cpp b/src/gui/equipment.cpp deleted file mode 100644 index dbfc4f8d..00000000 --- a/src/gui/equipment.cpp +++ /dev/null @@ -1,94 +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 - * - * $Id$ - */ - -#include -#include "gui/equipment.h" -#include "../equipment.h" -#include "../log.h" -#include "../resources/resourcemanager.h" -#include "../resources/image.h" - -#include - -EquipmentWindow::EquipmentWindow(): - Window("Equipment") -{ - setContentSize(200, 90); - setPosition(40, 40); - - ResourceManager *resman = ResourceManager::getInstance(); - Image *itemImg = resman->getImage("graphics/sprites/items.png"); - if (!itemImg) logger->error("Unable to load items.png"); - itemset = new Spriteset(itemImg, 32, 32); -} - -EquipmentWindow::~EquipmentWindow() -{ -} - -void EquipmentWindow::draw(gcn::Graphics *graphics) -{ - int x, y; - getAbsolutePosition(x, y); - - // Draw window graphics - Window::draw(graphics); - - Equipment *equipment = Equipment::getInstance(); - Item *item; - Image *image; - - for (int i = 0; i < 8; i++) { - graphics->setColor(gcn::Color(0, 0, 0)); - graphics->drawRectangle(gcn::Rectangle(10 + 36 * (i % 4), - 36 * (i / 4) + 25, 32, 32)); - - if (!(item = equipment->getEquipment(i))) { - continue; - } - - image = itemset->spriteset[item->getInfo()->getImage() - 1]; - dynamic_cast(graphics)->drawImage( - image, x + 36 * (i % 4) + 10, y + 36 * (i / 4) + 25); - } - - graphics->setColor(gcn::Color(0, 0, 0)); - graphics->drawRectangle(gcn::Rectangle(160, 25, 32, 32)); - - if (!(item = equipment->getArrows())) { - return; - } - - image = itemset->spriteset[item->getInfo()->getImage() - 1]; - - dynamic_cast(graphics)->drawImage( - image, x + 160, y + 25); - std::stringstream n; - n << item->getQuantity(); - graphics->drawText(n.str(), 170, 62, - gcn::Graphics::CENTER); -} - -void EquipmentWindow::action(const std::string &eventId) -{ -} diff --git a/src/gui/equipment.h b/src/gui/equipment.h deleted file mode 100644 index 5670d065..00000000 --- a/src/gui/equipment.h +++ /dev/null @@ -1,64 +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 - * - * $Id$ - */ - -#ifndef _TMW_EQUIPMENT_H -#define _TMW_EQUIPMENT_H - -#include "../graphic/spriteset.h" -#include "window.h" - -/** - * Equipment dialog. - * - * \ingroup Interface - */ -class EquipmentWindow : public Window, gcn::ActionListener { - public: - /** - * Constructor. - */ - EquipmentWindow(); - - /** - * Destructor. - */ - ~EquipmentWindow(); - - /** - * Draws the equipment window. - */ - void draw(gcn::Graphics *graphics); - - /** - * Called when receiving actions from the widgets. - */ - void action(const std::string& eventId); - - private: - Spriteset *itemset; - -}; - -extern EquipmentWindow *equipmentWindow; - -#endif diff --git a/src/gui/equipmentwindow.cpp b/src/gui/equipmentwindow.cpp new file mode 100644 index 00000000..8410750c --- /dev/null +++ b/src/gui/equipmentwindow.cpp @@ -0,0 +1,94 @@ +/* + * 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 + * + * $Id$ + */ + +#include +#include "equipmentwindow.h" +#include "../equipment.h" +#include "../log.h" +#include "../resources/resourcemanager.h" +#include "../resources/image.h" + +#include + +EquipmentWindow::EquipmentWindow(): + Window("Equipment") +{ + setContentSize(200, 90); + setPosition(40, 40); + + ResourceManager *resman = ResourceManager::getInstance(); + Image *itemImg = resman->getImage("graphics/sprites/items.png"); + if (!itemImg) logger->error("Unable to load items.png"); + itemset = new Spriteset(itemImg, 32, 32); +} + +EquipmentWindow::~EquipmentWindow() +{ +} + +void EquipmentWindow::draw(gcn::Graphics *graphics) +{ + int x, y; + getAbsolutePosition(x, y); + + // Draw window graphics + Window::draw(graphics); + + Equipment *equipment = Equipment::getInstance(); + Item *item; + Image *image; + + for (int i = 0; i < 8; i++) { + graphics->setColor(gcn::Color(0, 0, 0)); + graphics->drawRectangle(gcn::Rectangle(10 + 36 * (i % 4), + 36 * (i / 4) + 25, 32, 32)); + + if (!(item = equipment->getEquipment(i))) { + continue; + } + + image = itemset->spriteset[item->getInfo()->getImage() - 1]; + dynamic_cast(graphics)->drawImage( + image, x + 36 * (i % 4) + 10, y + 36 * (i / 4) + 25); + } + + graphics->setColor(gcn::Color(0, 0, 0)); + graphics->drawRectangle(gcn::Rectangle(160, 25, 32, 32)); + + if (!(item = equipment->getArrows())) { + return; + } + + image = itemset->spriteset[item->getInfo()->getImage() - 1]; + + dynamic_cast(graphics)->drawImage( + image, x + 160, y + 25); + std::stringstream n; + n << item->getQuantity(); + graphics->drawText(n.str(), 170, 62, + gcn::Graphics::CENTER); +} + +void EquipmentWindow::action(const std::string &eventId) +{ +} diff --git a/src/gui/equipmentwindow.h b/src/gui/equipmentwindow.h new file mode 100644 index 00000000..5670d065 --- /dev/null +++ b/src/gui/equipmentwindow.h @@ -0,0 +1,64 @@ +/* + * 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 + * + * $Id$ + */ + +#ifndef _TMW_EQUIPMENT_H +#define _TMW_EQUIPMENT_H + +#include "../graphic/spriteset.h" +#include "window.h" + +/** + * Equipment dialog. + * + * \ingroup Interface + */ +class EquipmentWindow : public Window, gcn::ActionListener { + public: + /** + * Constructor. + */ + EquipmentWindow(); + + /** + * Destructor. + */ + ~EquipmentWindow(); + + /** + * Draws the equipment window. + */ + void draw(gcn::Graphics *graphics); + + /** + * Called when receiving actions from the widgets. + */ + void action(const std::string& eventId); + + private: + Spriteset *itemset; + +}; + +extern EquipmentWindow *equipmentWindow; + +#endif -- cgit v1.2.3-70-g09d2