summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2005-02-15 13:29:16 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2005-02-15 13:29:16 +0000
commitf06b86893e610276d1deac4c2dd3c0247d62b44d (patch)
treef4d24df364c33e437c4979d5ddea812129a40300
parent192f17745eb2c3bba18b066f2d01ca771b3cd4d8 (diff)
downloadmana-client-f06b86893e610276d1deac4c2dd3c0247d62b44d.tar.gz
mana-client-f06b86893e610276d1deac4c2dd3c0247d62b44d.tar.bz2
mana-client-f06b86893e610276d1deac4c2dd3c0247d62b44d.tar.xz
mana-client-f06b86893e610276d1deac4c2dd3c0247d62b44d.zip
Updated layout and contents of FAQ a bit, fixed debug path and mouse rendering
in OpenGL mode, and some general cleanups.
-rw-r--r--docs/FAQ.txt74
-rw-r--r--src/graphic/graphic.cpp75
-rw-r--r--src/gui/char_select.cpp2
-rw-r--r--src/gui/char_server.cpp4
-rw-r--r--src/gui/gui.cpp12
-rw-r--r--src/gui/gui.h5
-rw-r--r--src/gui/login.cpp2
-rw-r--r--src/main.cpp15
8 files changed, 104 insertions, 85 deletions
diff --git a/docs/FAQ.txt b/docs/FAQ.txt
index 8f974abf..c532c79e 100644
--- a/docs/FAQ.txt
+++ b/docs/FAQ.txt
@@ -1,38 +1,76 @@
F.A.Q.
------
-- Help
+HELP
+
Q: How to get help?
-A: The fastest way is to come on our IRC channel. There you can find a lot of nice people that will help you until you solve your problem. Server: irc.freenode.net Channel: manaworld.
-If you don't like IRC just come to our forum: http://themanaworld.sourceforge.net/phpBB2. It is not needed to register since guest posting is active, but you're welcome if you want to subscribe, it will help to get more players. Ok you think forums are evil? Don't worry, send me an e-mail at umperio@users.sourceforge.net and you're done. That's not enough? No, I won't give you my phone number! ;P
-- CVS
+A: The fastest way is to come on our IRC channel. There you can find a lot of
+ nice people that will help you until you solve your problem. Server:
+ irc.freenode.net Channel: manaworld.
+
+ If you don't like IRC just come to our forum:
+ http://themanaworld.sourceforge.net/phpBB2. It is not needed to register
+ since guest posting is active, but you're welcome if you want to subscribe,
+ it will help to get more players. Ok you think forums are evil? Don't worry,
+ send me an e-mail at umperio@users.sourceforge.net and you're done. That's
+ not enough? No, I won't give you my phone number! ;P
+
+
+CVS
Q: What's CVS?
-A: It's a system where is stored the latest development version. It's not assured that it's stable, but surely it has the latest updates. (CVS version is updated quite frequently). If you want to check it out, read this guide http://themanaworld.sourceforge.net/cvs-tutorial.txt
-- Windows
+A: It's a system where is stored the latest development version. It's not
+ assured that it's stable, but surely it has the latest updates. (CVS version
+ is updated quite frequently). If you want to check it out, read this guide
+ http://themanaworld.sourceforge.net/cvs-tutorial.txt
-Q: The client crashes frequently in Windows, how can I correctly terminate it?
-A: Due to the Allegro library we're using, the application - if not closed correctly - remains running, so you should open up your task-manager (Alt+Ctrl+Canc) and terminate the "The Mana World.exe" process. This will probably be fixed soon.
-- Game
+GAME
Q: I always get "Unregistered ID" error message, why?
-A: First of all check that your username is at least 4 characters long. Is the first time you login? Then add _M at the end of the username you chose the first time you login. (You don't need to add _M the following times). If you already succesfully connected, but now getting this message, please send an e-mail to umperio@users.sourceforge.net.
+
+A: First of all check that your username is at least 4 characters long. Is the
+ first time you login? Then add _M at the end of the username you chose the
+ first time you login. (You don't need to add _M the following times). If you
+ already succesfully connected, but now getting this message, please send an
+ e-mail to umperio@users.sourceforge.net.
+
Q: I always get "Wrong password" but I'm sure I typed it right, why?
-A: If is the first time you login be sure you're not adding _M at the end of your username. Else please send an e-mail to umperio@users.sourceforge.net.
-- Development
+A: If is the first time you login be sure you're not adding _M at the end of
+ your username. Else please send an e-mail to umperio@users.sourceforge.net.
+
+
+DEVELOPMENT
Q: When will the next version be released?
-A: Really don't know. Usually a newer version comes out in a month, but that's not for sure. You can try asking the devs on IRC for further infos, you can try the latest CVS version or the latest CVS daily snaphost. These are no stable releases but are updated freuqently or even on a daily basis.
+
+A: Really don't know. Usually a newer version comes out in a month, but that's
+ not for sure. You can try asking the devs on IRC for further infos, you can
+ try the latest CVS version or the latest CVS daily snaphost. These are no
+ stable releases but are updated freuqently or even on a daily basis.
+
Q: How can I contribute?
+
A: There are a lot of ways:
-- If you're a programer or an artist you can be part of the development team. Send an e-mail to umperio@users.sourceforge.net explaining what you want to do.
-- You want to work on the server: server customization, scripts, maps. Send an e-mail to umperio@users.sourceforge.net explaining what you want to do.
-- You can donate money. Follow the link in the main web page http://themanaworld.souceforge.net.
-- You can be a beta tester. Just play with The Mana World and report every error to the tracker. Read for more infos on the main page http://themanaworld.sourceforge.net.
-- Play with The Mana World: more players, more fun! Simple as that! ;-) \ No newline at end of file
+
+ - If you're a programer or an artist you can be part of the development
+ team. Send an e-mail to umperio@users.sourceforge.net explaining what you
+ want to do.
+
+ - You want to work on the server: server customization, scripts, maps. Send
+ an e-mail to umperio@users.sourceforge.net explaining what you want to do.
+
+ - You can donate money. Follow the link in the main web page
+ http://themanaworld.souceforge.net.
+
+ - You can be a beta tester. Just play with The Mana World and report every
+ error to the tracker. Read for more infos on the main page
+ http://themanaworld.sourceforge.net.
+
+ - Play with The Mana World: more players, more fun! Simple as that! ;-)
+
diff --git a/src/graphic/graphic.cpp b/src/graphic/graphic.cpp
index 29bf3596..2e681fb0 100644
--- a/src/graphic/graphic.cpp
+++ b/src/graphic/graphic.cpp
@@ -162,7 +162,9 @@ Graphics::Graphics():
setTarget(SDL_GetVideoSurface());
#endif
-#ifndef USE_OPENGL
+ // Hide the system mouse cursor
+ SDL_ShowCursor(SDL_DISABLE);
+
// Load the mouse cursor
ResourceManager *resman = ResourceManager::getInstance();
mouseCursor = resman->getImage("core/graphics/gui/mouse.png", IMG_ALPHA);
@@ -170,12 +172,14 @@ Graphics::Graphics():
error("Unable to load mouse cursor.");
}
- // Hide the system mouse cursor
- SDL_ShowCursor(SDL_DISABLE);
-#endif
+ // Initialize for drawing
+ _beginDraw();
}
-Graphics::~Graphics() {
+Graphics::~Graphics()
+{
+ // Deinitialize for drawing
+ _endDraw();
}
void Graphics::drawImageRect(
@@ -230,17 +234,17 @@ void Graphics::drawImageRect(
void Graphics::updateScreen()
{
+ // Draw mouse before flipping
+ int mouseX, mouseY;
+ SDL_GetMouseState(&mouseX, &mouseY);
+ mouseCursor->draw(screen, mouseX - 5, mouseY - 2);
+
#ifdef USE_OPENGL
glFlush();
glFinish();
SDL_GL_SwapBuffers();
glClear(GL_COLOR_BUFFER_BIT);
#else
- // Draw mouse before flipping
- int mouseX, mouseY;
- SDL_GetMouseState(&mouseX, &mouseY);
- mouseCursor->draw(screen, mouseX - 5, mouseY - 2);
-
SDL_Flip(screen);
#endif
}
@@ -251,7 +255,8 @@ Engine::Engine()
// Initializes GUI
chatInput = new TextField();
chatInput->setPosition(chatInput->getBorderSize(),
- screen->h - chatInput->getHeight() - chatInput->getBorderSize() -1);
+ screen->h - chatInput->getHeight() -
+ chatInput->getBorderSize());
chatInput->setWidth(592 - 2 * chatInput->getBorderSize());
ChatListener *chatListener = new ChatListener();
@@ -285,7 +290,8 @@ Engine::Engine()
inventoryWindow = new InventoryWindow();
inventoryWindow->setVisible(false);
- inventoryWindow->setPosition(screen->w - statusWindow->getWidth() - inventoryWindow->getWidth() - 10, 5);
+ inventoryWindow->setPosition(screen->w - statusWindow->getWidth() -
+ inventoryWindow->getWidth() - 10, 5);
npcTextDialog = new NpcTextDialog();
npcTextDialog->setVisible(false);
@@ -298,7 +304,9 @@ Engine::Engine()
statsWindow = new StatsWindow();
statsWindow->setVisible(false);
- statsWindow->setPosition(screen->w - 5 - statsWindow->getWidth(), statusWindow->getHeight() + 20);
+ statsWindow->setPosition(
+ screen->w - 5 - statsWindow->getWidth(),
+ statusWindow->getHeight() + 20);
setupWindow = new Setup();
setupWindow->setVisible(false);
@@ -356,8 +364,6 @@ Engine::~Engine()
void Engine::draw()
{
- guiGraphics->_beginDraw();
-
// Get the current mouse position
int mouseX, mouseY;
SDL_GetMouseState(&mouseX, &mouseY);
@@ -395,7 +401,8 @@ void Engine::draw()
// Draw nodes
std::list<Being*>::iterator beingIterator = beings.begin();
- while (beingIterator != beings.end()) {
+ while (beingIterator != beings.end())
+ {
Being *being = (*beingIterator);
unsigned short x = being->x;
@@ -403,11 +410,12 @@ void Engine::draw()
unsigned char dir = being->direction / 2;
int sx = x - camera_x;
int sy = y - camera_y;
-
+
#ifdef DEBUG
- //rect(screen, sx*32, sy*32, sx*32+32, sy*32+32, makecol(0,0,255));
+ guiGraphics->setColor(gcn::Color(0, 0, 255));
+ guiGraphics->drawRectangle(gcn::Rectangle(sx * 32, sy * 32, 32, 32));
#endif
-
+
if ((being->job >= 100) && (being->job <= 110)) { // Draw a NPC
npcset->spriteset[4 * (being->job - 100) + dir]->draw(screen,
sx * 32 - 8 - offset_x,
@@ -514,37 +522,36 @@ void Engine::draw()
if (tile > 0 && tile < (int)tileset->spriteset.size()) {
tileset->spriteset[tile]->draw(
screen, i * 32 - offset_x, j * 32 - offset_y);
- }
-#ifdef DEBUG
- //rect(screen, i * 32 - offset_x, j * 32 - offset_y,
- // i * 32 - offset_x + 32, j * 32 - offset_y + 32,
- // makecol(0,0,0));
+
+#ifdef DEBUG
+ guiGraphics->setColor(gcn::Color(0, 0, 0));
+ guiGraphics->drawRectangle(gcn::Rectangle(
+ i * 32 - offset_x, j * 32 - offset_y, 32, 32));
#endif
+ }
}
}
+ // Find a path from the player to the mouse, and draw it. This is for debug
+ // purposes.
if (displayPathToMouse)
{
- // Draw a debug path
PATH_NODE *debugPath = tiledMap.findPath(
player_node->x, player_node->y,
mouseX / 32 + camera_x, mouseY / 32 + camera_y);
while (debugPath)
{
- SDL_Rect destRect;
- destRect.x = (debugPath->x - camera_x) * 32 - offset_x + 12;
- destRect.y = (debugPath->y - camera_y) * 32 - offset_y + 12;
- destRect.w = 8;
- destRect.h = 8;
- SDL_FillRect(screen, &destRect,
- SDL_MapRGB(screen->format, 255, 0, 0));
+ int squareX = (debugPath->x - camera_x) * 32 - offset_x + 12;
+ int squareY = (debugPath->y - camera_y) * 32 - offset_y + 12;
+ guiGraphics->setColor(gcn::Color(255, 0, 0));
+ guiGraphics->fillRectangle(gcn::Rectangle(squareX, squareY, 8, 8));
Tile *tile = tiledMap.getTile(debugPath->x, debugPath->y);
std::stringstream cost;
cost << tile->Gcost;
- guiGraphics->drawText(cost.str(), destRect.x + 4, destRect.y + 12,
+ guiGraphics->drawText(cost.str(), squareX + 4, squareY + 12,
gcn::Graphics::CENTER);
// Move to the next node
@@ -595,6 +602,4 @@ void Engine::draw()
(mouseX / 32 + camera_x) << ", " << (mouseY / 32 + camera_y);
debugInfo->setCaption(debugStream.str());
debugInfo->adjustSize();
-
- guiGraphics->_endDraw();
}
diff --git a/src/gui/char_select.cpp b/src/gui/char_select.cpp
index 24fa9c86..ba18a93d 100644
--- a/src/gui/char_select.cpp
+++ b/src/gui/char_select.cpp
@@ -452,10 +452,8 @@ void charSelect()
gui->logic();
- guiGraphics->_beginDraw();
login_wallpaper->draw(screen, 0, 0);
gui->draw();
- guiGraphics->_endDraw();
guiGraphics->updateScreen();
}
diff --git a/src/gui/char_server.cpp b/src/gui/char_server.cpp
index 6cc45f3d..035f18fd 100644
--- a/src/gui/char_server.cpp
+++ b/src/gui/char_server.cpp
@@ -140,10 +140,8 @@ void char_server() {
gui->logic();
- guiGraphics->_beginDraw();
login_wallpaper->draw(screen, 0, 0);
gui->draw();
- guiGraphics->_endDraw();
guiGraphics->updateScreen();
}
@@ -205,7 +203,7 @@ void server_char_server(int serverIndex) {
}
state = CHAR_SELECT;
- log("CharServer: Player: %s (Packet ID: %x, Length: %d",
+ log("CharServer: Player: %s (Packet ID: %x, Length: %d)",
char_info->name, RFIFOW(0), RFIFOW(2));
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp
index 6cc05910..cf4c5b36 100644
--- a/src/gui/gui.cpp
+++ b/src/gui/gui.cpp
@@ -156,24 +156,12 @@ void Gui::logic()
void Gui::draw()
{
- //guiGraphics->_beginDraw();
-
guiGraphics->pushClipArea(guiTop->getDimension());
guiTop->draw(guiGraphics);
guiGraphics->popClipArea();
-
- //guiGraphics->_endDraw();
}
void Gui::focusNone()
{
focusHandler->focusNone();
}
-
-void init_gui(Graphics *graphics) {
- gui = new Gui(graphics);
-}
-
-void gui_exit() {
- delete gui;
-}
diff --git a/src/gui/gui.h b/src/gui/gui.h
index 597cdb5c..6b678396 100644
--- a/src/gui/gui.h
+++ b/src/gui/gui.h
@@ -91,9 +91,4 @@ extern WindowContainer *guiTop; // The top container
extern Graphics *guiGraphics; // Graphics driver
extern gcn::SDLInput *guiInput; // GUI input
-/** Initialize gui system */
-void init_gui(Graphics *graphics);
-
-void gui_exit();
-
#endif
diff --git a/src/gui/login.cpp b/src/gui/login.cpp
index 5621f5b2..e5861a9b 100644
--- a/src/gui/login.cpp
+++ b/src/gui/login.cpp
@@ -154,10 +154,8 @@ void login() {
gui->logic();
- guiGraphics->_beginDraw();
login_wallpaper->draw(screen, 0, 0);
gui->draw();
- guiGraphics->_endDraw();
guiGraphics->updateScreen();
}
diff --git a/src/main.cpp b/src/main.cpp
index 043be40d..0c79affe 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -95,10 +95,6 @@ class InitWarningListener : public gcn::ActionListener {
}
} initWarningListener;
-void request_exit() {
- state = EXIT;
-}
-
/**
* Do all initialization stuff
*/
@@ -277,7 +273,7 @@ void init_engine()
playerset = new Spriteset(playerImg, 160, 120);
hairset = new Spriteset(hairImg, 40, 40);
- init_gui(graphics);
+ gui = new Gui(graphics);
state = LOGIN;
// initialize sound-engine and start playing intro-theme /-kth5
@@ -302,15 +298,18 @@ void init_engine()
}
/** Clear the engine */
-void exit_engine() {
+void exit_engine()
+{
config.write(dir);
delete[] dir;
- gui_exit();
+ delete gui;
+ delete graphics;
ResourceManager::deleteInstance();
}
/** Main */
-int main(int argc, char *argv[]) {
+int main(int argc, char *argv[])
+{
init_engine();
SDL_Event event;