| |
Installing ICC, Intel Compiler Collection
Xgoff |
|

<):|
![Super Happy Heart Badge [*]](https://archive.mfgg.net/html/badges/shappyheart.gif) ![Sprite Comp Winner Badge (1) [*]](https://archive.mfgg.net/html/badges/scg1.gif) ![Drawing Comp Winner Badge (1) [*]](https://archive.mfgg.net/html/badges/dcg1.gif) ![Drawing Comp Runner Up Badge (1) [*]](https://archive.mfgg.net/html/badges/dcr1.gif) ![MFGG Awards 2006 Winner [*]](https://archive.mfgg.net/html/badges/award06.gif)
![MFGG Awards 2007 Winner [*]](https://archive.mfgg.net/html/badges/award07.gif) ![Forum Event Badge [*]](https://archive.mfgg.net/html/badges/event.gif)

Group: Members
Posts: 52341
Member No.: 24
Joined: 13-October 03
Status: (0d)
![[--]](style_images/mfgg2_skin/warn_nosuspend.gif)

|
| QUOTE (Retriever II @ Mar 29 2009, 08:42 PM) | | Also Oni, what's the point of a compiler optimized for one platform when your code is going to run on all sorts of platforms? You're focusing on the wrong stuff. If performance is a problem, your code is at fault, not your compiler. |
lol both my laptop and desktop have (old) amd procs
i'm going to see amazing performance enhancements from this
--------------------
 DISCLAIMER: by sending me (xgoff) a private message, you agree to the directives and their terms specified henceforth: DIRECTIVE 1 (APPLE): i may or may not reply promptly or at all; and there are no guarantees to the usefulness of the reply. i may not acknowledge whether i have even received your private message DIRECTIVE 2 (CHILE CON CARNE): as per my view, "private" applies only to the initial transaction, and the material of your message may or may not be made public at my discretion; as this will more than likely be a post in the CCC or IRC, you may not be able to view it DIRECTIVE 3 (FEATHER DUSTER): you must address me (xgoff) as "Sir Master Xgofficus his Highest and Most Awesome the Third"; failure to comply with this term may invoke one or both of the above directives, and i will leave a burning bag of **** on your doorstep DIRECTIVE 4 (BOOTSTRAP): if you have read this disclaimer, please private message me promptly, in compliance with the above terms, so i can ensure you are capable of following directions you idiot this concludes the test of the emergency disclaimer system, your scheduled programming will now continue. satisfaction guaranteed, and 100% cash back available under certain circumstances; restrictions may or may not apply within your place of residence NOTICE: these directives and their terms may change at any time, without notice; as a private message transaction to myself assumes an understanding and full compliance of the above, you should ensure you are fully aware of the above terms at any point before sending a private message; any message received is assumed to have been sent in compliance with the above| QUOTE | (5:25:58 PM) Mikau: xgoff (5:26:00 PM) Mikau: guess what (5:26:04 PM) Xgoff: chicken butt (5:26:09 PM) Mikau: **** you |
|
|
|
OniLink10 |
|

C++ Programmer, Unofficial Physicist, and Unofficial Chemist
![Super Happy Heart Badge [*]](https://archive.mfgg.net/html/badges/shappyheart.gif) ![Secret Santa Badge [*]](https://archive.mfgg.net/html/badges/present.gif)

Group: Members
Posts: 3920
Member No.: 4907
Joined: 19-February 08
Status: (0d)
![[--]](style_images/mfgg2_skin/warn_nosuspend.gif)

|
| QUOTE (Retriever II @ Mar 29 2009, 07:42 PM) | | Also Oni, what's the point of a compiler optimized for one platform when your code is going to run on all sorts of platforms? You're focusing on the wrong stuff. If performance is a problem, your code is at fault, not your compiler. |
I did some research and found that the GNU GCC Compiler actually produces bad code in many occasions. I understand that my code is at fault, and I'm working to fix it, but using the Intel Compiler will help me speed up my Beta Testing. Now, I don't notice any actual Lag when Compiled with GCC, but I do notice that my CPU Usage goes up to 25-50% when running one of my Programs that was compiled under GCC. When I run it when it's compiled under ICC, the CPU Usage doesn't increase at all. Here's my Level Editor Code:
| CODE | #include <SFML/Graphics.hpp> #include <iostream> #include <fstream> #include <string> #include <vector> using namespace std;
sf::RenderWindow App(sf::VideoMode(640, 480, 32), "");
class Object { public: int type, subtype; sf::Image Image; sf::Sprite Sprite;
Object(int t, int st, int a, int b); void Render(); };
Object::Object(int t, int st, int a, int b) { type = t; subtype = st; Image.SetSmooth(false); switch (type) { case 0: Image.LoadFromFile("Res/Mario.png"); break;
case 1: switch(subtype) { case 0: Image.LoadFromFile("Res/Solid.png"); break;
case 1: Image.LoadFromFile("Res/Solidtop.png"); break;
case 3: Sprite.FlipX(true); case 2: Image.LoadFromFile("Res/SSlope.png"); break;
case 5: Sprite.FlipX(true); case 4: Image.LoadFromFile("Res/Slope.png"); break; } break; } Sprite.SetImage(Image); Sprite.SetPosition(a, b); }
void Object::Render() { App.Draw(Sprite); }
vector<b>*> Objects; int room_width = 0, room_height = 0;
void Load(string filename) { fstream file(filename.c_str(), ios::in); int type = 0, x = 0, y = 0, subtype = 0; file >> room_width >> room_height; while (!file.eof()) { file >> type >> x >> y; if (type == 1) file >> subtype; Objects.push_back(new Object(type, subtype, x, y)); } file.close(); }
std::fstream file; sf::View View(sf::FloatRect(0, 0, 640, 480));
int main(int argc, char* argv[]) { //Window Setup App.SetView(View); App.Show(false);
//Variables string roomname;
//Loading... if (argc > 1) { roomname = argv[1]; Load(roomname); file.open(roomname.c_str(), ios::trunc | ios::out); } else { cout << "Enter Room Name: "; cin >> roomname; file.open(roomname.c_str(), ios::trunc | ios::out); cout << "Enter Room Width: "; cin >> room_width; cout << "Enter Room Height: "; cin >> room_height; }
//More Window Setup App.Show(true); bool running = true; App.UseVerticalSync(true); App.SetFramerateLimit(60); sf::Event Event; int curtype = 0; int cursubtype = 0; sf::Image Image; Image.SetSmooth(false); Image.LoadFromFile("Res/Mario.png"); sf::Sprite LevelEdit; LevelEdit.SetImage(Image); sf::View View(sf::FloatRect(0, 0, 640, 480)); App.SetView(View); while (running) { App.Clear(); while (App.GetEvent(Event)) { if (Event.Type == sf::Event::Closed || (Event.Type == sf::Event::KeyPressed && Event.Key.Code == sf::Key::Escape)) running = false; else if (Event.Type == sf::Event::KeyPressed) switch (Event.Key.Code) { case sf::Key::Left: if (LevelEdit.GetPosition().x > 0) LevelEdit.Move(-16, 0); break; case sf::Key::Right: if (LevelEdit.GetPosition().x + LevelEdit.GetSize().x < room_width) LevelEdit.Move(16, 0); break; case sf::Key::Up: if (LevelEdit.GetPosition().y > 0) LevelEdit.Move(0, -16); break; case sf::Key::Down: if (LevelEdit.GetPosition().y + LevelEdit.GetSize().y < room_height) LevelEdit.Move(0, 16); break; case sf::Key::Q: curtype++; if (curtype > 1) curtype = 0; break; case sf::Key::A: curtype--; if (curtype < 0) curtype = 1; break; case sf::Key::W: cursubtype++; break; case sf::Key::S: cursubtype--; break;
case sf::Key::I: View.Move(0, -16); break;
case sf::Key::J: View.Move(-16, 0); break;
case sf::Key::K: View.Move(0, 16); break;
case sf::Key::L: View.Move(16, 0); break; case sf::Key::Return: Objects.push_back(new Object(curtype, cursubtype, LevelEdit.GetPosition().x, LevelEdit.GetPosition().y)); break;
default: break; } } switch (curtype) { case 0: Image.LoadFromFile("Res/Mario.png"); break;
case 1: switch (cursubtype) { case 0: Image.LoadFromFile("Res/Solid.png"); LevelEdit.Resize(16, 16); break;
case 1: Image.LoadFromFile("Res/Solidtop.png"); LevelEdit.Resize(16, 16); break;
case 3: LevelEdit.FlipX(true); case 2: Image.LoadFromFile("Res/SSlope.png"); if (cursubtype == 2) LevelEdit.FlipX(false); LevelEdit.Resize(16, 16); break;
case 5: LevelEdit.FlipX(true); case 4: Image.LoadFromFile("Res/Slope.png"); if (cursubtype == 4) LevelEdit.FlipX(false); LevelEdit.Resize(32, 16); break; } break; } for (int i = 0; i < Objects.size(); i++) Objects.at(i)->Render(); App.Draw(LevelEdit); App.Display(); } file << room_width << ' ' << room_height << '\n'; for (int i = 0; i < Objects.size(); i++) { file << Objects.at(i)->type << ' ' << Objects.at(i)->Sprite.GetPosition().x << ' ' << Objects.at(i)->Sprite.GetPosition().y; if (Objects.at(i)->type == 1) file << ' ' << Objects.at(i)->subtype << '\n'; else file << '\n'; } file.close(); Objects.clear(); return 0; } |
Obviously, I need help with Organization. D: If you can find anything in there that might be causing the drastic CPU Usage Increase, tell me. I have tried looking, but I don't see much that could be causing it. If you don't want to look at my terrible code, fine, but since I'm pretty much the only one who will have the final Level Editor, I think using ICC to compile it should be fine.
This post has been edited by OniLink10 on Mar 29 2009, 10:28 PM
--------------------
| QUOTE (Xgoff @ Sep 10 2009 @ 06:11 PM) | did you try hello's engine
make sure to not ****ing change anything before using it! |
|
|
|
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
Track this topic
Receive email notification when a reply has been made to this topic and you are not active on the board.
Subscribe to this forum
Receive email notification when a new topic is posted in this forum and you are not active on the board.
Download / Print this Topic
Download this topic in different formats or view a printer friendly version.
[ Script Execution time: 0.0861 ] [ 14 queries used ] [ GZIP Enabled ] [ Server Load: 1.01 ]
| |