diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/floor_item.cpp | 82 | ||||
-rwxr-xr-x | src/floor_item.h | 66 | ||||
-rw-r--r-- | src/net/win2mac.cpp | 43 | ||||
-rw-r--r-- | src/net/win2mac.h | 1 |
4 files changed, 18 insertions, 174 deletions
diff --git a/src/floor_item.cpp b/src/floor_item.cpp deleted file mode 100755 index fb974356..00000000 --- a/src/floor_item.cpp +++ /dev/null @@ -1,82 +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 "floor_item.h" -#include "game.h" - -std::list<FloorItem*> floorItems; - -void empty_floor_items() { - std::list<FloorItem *>::iterator i; - for (i = floorItems.begin(); i != floorItems.end(); i++) { - delete (*i); - } - floorItems.clear(); -} - -void add_floor_item(FloorItem *floorItem) { - floorItems.push_back(floorItem); -} - -void remove_floor_item(unsigned int int_id) { - std::list<FloorItem *>::iterator i; - for (i = floorItems.begin(); i != floorItems.end(); i++) { - if ((*i)->int_id == int_id) { - delete (*i); - floorItems.erase(i); - return; - } - } -} - -unsigned int find_floor_item_by_cor(unsigned short x, unsigned short y) { - std::list<FloorItem *>::iterator i; - for (i = floorItems.begin(); i != floorItems.end(); i++) { - FloorItem *floorItem = (*i); - if (floorItem->x == x && floorItem->y == y) - { - return floorItem->int_id; - } - } - return 0; -} - -FloorItem *find_floor_item_by_id(unsigned int int_id) { - std::list<FloorItem*>::iterator i; - for (i = floorItems.begin(); i != floorItems.end(); i++) { - FloorItem *floorItem = (*i); - if (floorItem->int_id == int_id) { - return floorItem; - } - } - return NULL; -} - -FloorItem::FloorItem() { - id = 0; int_id = 0; - x = 0; y = 0; - subx = 0; suby = 0; -} - -FloorItem::~FloorItem() { -} diff --git a/src/floor_item.h b/src/floor_item.h deleted file mode 100755 index 61a62804..00000000 --- a/src/floor_item.h +++ /dev/null @@ -1,66 +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_FLOORITEM_H -#define _TMW_FLOORITEM_H - -#include "net/protocol.h" -#include <list> - -class FloorItem { - private: - public: - unsigned int id; - unsigned int int_id; - unsigned short x, y; - unsigned short subx, suby; - - /** - * Constructor. - */ - FloorItem(); - - /** - * Destructor. - */ - ~FloorItem(); -}; - -/** Removes all items from the list */ -void empty_floor_items(); - -/** Add an Item to the list */ -void add_floor_item(FloorItem *floorItem); - -/** Return a specific id FloorItem */ -FloorItem *find_floor_item_by_id(unsigned int int_id); - -/** Remove a FloorItem */ -void remove_floor_item(unsigned int int_id); - -/** Find a Item id based on its coordinates */ -unsigned int find_floor_item_by_cor(unsigned short x, unsigned short y); - -extern std::list<FloorItem*> floorItems; - -#endif diff --git a/src/net/win2mac.cpp b/src/net/win2mac.cpp index be4bad1d..6ddc59cc 100644 --- a/src/net/win2mac.cpp +++ b/src/net/win2mac.cpp @@ -1,42 +1,35 @@ #include "win2mac.h" - -void dummy() -{ - -printf("hej\n"); -} - UInt32 DR_SwapFourBytes(UInt32 dw) { -UInt32 tmp; -tmp = (dw & 0x000000FF); -tmp = ((dw & 0x0000FF00) >> 0x08) | (tmp << 0x08); -tmp = ((dw & 0x00FF0000) >> 0x10) | (tmp << 0x08); -tmp = ((dw & 0xFF000000) >> 0x18) | (tmp << 0x08); -return (tmp); + UInt32 tmp; + tmp = (dw & 0x000000FF); + tmp = ((dw & 0x0000FF00) >> 0x08) | (tmp << 0x08); + tmp = ((dw & 0x00FF0000) >> 0x10) | (tmp << 0x08); + tmp = ((dw & 0xFF000000) >> 0x18) | (tmp << 0x08); + return (tmp); } UInt16 DR_SwapTwoBytes(UInt16 w) { -UInt16 tmp; -tmp = (w & 0x00FF); -tmp = ((w & 0xFF00) >> 0x08) | (tmp << 0x08); -return(tmp); + UInt16 tmp; + tmp = (w & 0x00FF); + tmp = ((w & 0xFF00) >> 0x08) | (tmp << 0x08); + return(tmp); } - + char* SwapChar(char charlist[]) { -for(int i =0; i< 24/2; i++) - SWAP(charlist[i],charlist[24-i]); -return charlist; + for (int i = 0; i < 24 / 2; i++) + SWAP(charlist[i],charlist[24 - i]); + return charlist; } /* char* SwapChar(char charlist[]) { -for(int i =0; i< sizeof(charlist)*4/2; i++) - SWAP(charlist[i],charlist[sizeof(charlist)*4-i]); -return charlist; + for (int i = 0; i < sizeof(charlist) * 4 / 2; i++) + SWAP(charlist[i],charlist[sizeof(charlist) * 4 - i]); + return charlist; } -*/
\ No newline at end of file +*/ diff --git a/src/net/win2mac.h b/src/net/win2mac.h index 72ae9fd9..851a328a 100644 --- a/src/net/win2mac.h +++ b/src/net/win2mac.h @@ -8,7 +8,6 @@ #ifndef _MAC_H #define _MAC_H -void dummy(); UInt32 DR_SwapFourBytes(UInt32 dw); UInt16 DR_SwapTwoBytes(UInt16 w); char* SwapChar(char charlist[]); |