diff options
author | Eugenio Favalli <elvenprogrammer@gmail.com> | 2005-07-13 09:50:11 +0000 |
---|---|---|
committer | Eugenio Favalli <elvenprogrammer@gmail.com> | 2005-07-13 09:50:11 +0000 |
commit | 360408fc4c04a72750ecfece7539260129b765ab (patch) | |
tree | d01bdddafa4dd0aa2cab4f3995dda1d0748cccee /src/main.cpp | |
parent | 6eb84fcfaf55c7e4baf13bfdff8f0a16a5b97d76 (diff) | |
download | mana-360408fc4c04a72750ecfece7539260129b765ab.tar.gz mana-360408fc4c04a72750ecfece7539260129b765ab.tar.bz2 mana-360408fc4c04a72750ecfece7539260129b765ab.tar.xz mana-360408fc4c04a72750ecfece7539260129b765ab.zip |
- Adding the wonderful new font by Bjorn to speech and player names
- Way to system cursor (now you can choose the original sdl cursor in config)
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 54 |
1 files changed, 28 insertions, 26 deletions
diff --git a/src/main.cpp b/src/main.cpp index 2009be96..5fb543fc 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -393,33 +393,37 @@ int download(const char *location) std::cout << "Downloading '" << location << "'" << std::endl; // init curl - curl_global_init(CURL_GLOBAL_ALL); + curl_global_init(CURL_GLOBAL_WIN32); // download file CURL *curl = curl_easy_init(); - - curl_easy_setopt(curl, CURLOPT_URL, location); - //curl_easy_setopt(curl, CURLOPT_NOPROGRESS, false); - //curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, progressCallback); - //curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, NULL); - - //curl_easy_setopt(curl, CURLOPT_WRITEDATA, fp); + int ret = 0; + if (curl) + { + curl_easy_setopt(curl, CURLOPT_URL, "curl.haxx.se"); + std::cout << "Debug: setopt" << std::endl; + /*curl_easy_setopt(curl, CURLOPT_NOPROGRESS, false); + curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, progressCallback); + curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, NULL); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, fp);*/ - //int ret = curl_easy_perform(curl); - - curl_easy_cleanup(curl); - - + //ret = curl_easy_perform(curl); + std::cout << "Debug: perform" << std::endl; + curl_easy_cleanup(curl); + std::cout << "Debug: cleanup" << std::endl; + } + else { + ret = 1; + } + // cleanup curl curl_global_cleanup(); - fclose(fp); - - //if (ret != 0) + + if (ret != 0) std::cout << "Failed!" << std::endl; - //std::cout << " (" << ret << ")" << std::endl; + std::cout << " (" << ret << ")" << std::endl; - //return (ret == CURLE_OK) ? true : false; - return true; + return (ret == CURLE_OK) ? true : false; } /** Check to see if a file exists */ @@ -470,10 +474,8 @@ void update() std::cout << "Opening " << fullName << std::endl; - std::ifstream *in; - - in = new std::ifstream(fullName.c_str()); - if (in!=NULL && !in->is_open()) + std::ifstream in(fullName.c_str()); + if (!in.is_open()) { std::cout << "Error opening" << std::endl; delete updaterWindow; @@ -482,9 +484,9 @@ void update() std::string line; - while (!in->eof()) + while (!in.eof()) { - getline(*in, line); + getline(in, line); // check for XML tag (if it is XML tag it is error) if (line[0] == '<') { @@ -510,7 +512,7 @@ void update() PHYSFS_addToSearchPath(fullName.c_str(), 1); } } - in->close(); + in.close(); guiTop->remove(updaterWindow); delete updaterWindow; } |