Results 1 to 13 of 13
  1. #1
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty

    Proof of Concept!

    Well I have been working on this menu for a while now and so far I have had nothing to show for it, but finally I can present a little proof that I have in fact been doing something. xD

    Check it out: Right arrow to increment and left to decrement

    It's still really buggy, but Im smoothing out the edges as I post this. hopefully tommorrow I will be able to get out all the bugs. Next I will render an entire Catergory o_O! And finally an entire menu. Once I get all the bugs out I will go about converting it to DirectX once I get my detour down.

    It doesn't look like much, but this took well over 200 lines of code and its still very incomplete. Why so much for such a small effect? well the MenuItem is meant to basic building block of the menu. All other classes simply control these items. And this is filled with a lot of extra stuff meant to play a part when menu is in full effect.

    EDIT: just fixed bug where it would delete item name.
    Last edited by why06; 03-12-2010 at 10:02 PM.

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  2. The Following 3 Users Say Thank You to why06 For This Useful Post:

    ac1d_buRn (03-12-2010),KABLE (03-12-2010),Void (03-12-2010)

  3. #2
    Arhk's Avatar
    Join Date
    Dec 2008
    Gender
    male
    Location
    Engineering
    Posts
    3,618
    Reputation
    35
    Thanks
    217
    My Mood
    Amused
    What do you guys keep packing your stuff with to get these weird Trojan warnings (Virustotal.com).
    ~
    "If the world hates you, keep in mind that it hated me first." John 15:18

  4. #3
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    Quote Originally Posted by Arhk View Post
    What do you guys keep packing your stuff with to get these weird Trojan warnings (Virustotal.com).
    ~
    Lol. I never pack my stuff. If you don't believe me open it up and view the disassembly in Olly or something. Should see some calls to print statements, GetAsyncKeyState, etc. But I only log left, right, up, and down arrow. So you should only see the hexcodes for those numbers passed to the stack. I don't know why it's saying its a trojan... didnt even Virus scan. Maybe it's because it's so small. idk... =/

    EDIT: https://www.virustotal.com/analisis/4...640-1268486166
    Lol. I guess your right. Guess my programs got AIDS o_O. Sorry guys now all ur computers got AIDS too.
    Last edited by why06; 03-13-2010 at 07:31 AM.

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  5. #4
    Arhk's Avatar
    Join Date
    Dec 2008
    Gender
    male
    Location
    Engineering
    Posts
    3,618
    Reputation
    35
    Thanks
    217
    My Mood
    Amused
    Doesn't matter to me I was just saying that to get you digress from whatever weird stuff that could ward of newbies from downloading your content.
    ~
    As a rule I run all small forum programs in a sandbox (Sandboxie - Sandbox software for application isolation and secure Web browsing)
    "If the world hates you, keep in mind that it hated me first." John 15:18

  6. #5
    I got ants in my butt, and I needs to strut.
    Premium Seller
    Former Staff
    Premium Member
    Trusted
    Wyo's Avatar
    Join Date
    Feb 2010
    Gender
    male
    Location
    Guadalajara
    Posts
    24,113
    Reputation
    4354
    Thanks
    4,203
    My Mood
    Lurking
    Nice work Why06 keep doing your great job

  7. #6
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    Thanks. Actually I could use a bit of help with one little problem. Ill post some of the source.
    Code:
    #include <iostream>
    #include <sstream>
    #include <stdio.h>
    #include <windows.h>
    using namespace std;
    
    const static int MAX_OPTIONS = 10;
    
    struct Option
    {
    	bool selected; // for multi option items
    	int optmax;
    	int optmin;
    	char type;
    	int optcount;
    	string str;
    	string strArray[10];
    	int i; //0
    	float f; //0.0
    
    	Option(char t, int initval = 0, int min = 0, int max = 1)
    	{
    		optmax = max;
    		optmin = min;
    		i = initval;
    		f = initval;
    		optcount = initval;
    		type = t;
    	}
    
    	void inc()	//opt++;
    	{
    		switch(type)
    		{
    		case 'i':	//is int?
    			if(i == optmax)break;	//will not increment if option is at lowest value
    			i++;
    			break;
    		case 'f':	//is float?
    			if(f == optmax)break;	//will not increment if option is at lowest value
    			f++;
    			break;
    		case 's':	//is string?
    			if(optcount == optmax - 1)break;	//will not increment if option is at lowest value
    			str = strArray[++optcount];
    			break;
    		default:
    			break;
    		}
    	}
    
    	void dec()	//opt--;
    	{
    		switch(type)
    		{
    		case 'i':	//is int?
    			if(i == optmin)break;	//will not decrement if option is at lowest value.
    			i--;
    			break; 
    		case 'f':	//is float?
    			if(f == optmin)break;	//will not decrement if option is at lowest value.
    			f--;
    			break;
    		case 's':	//is string?
    			if(optcount == optmin)break; //will not decrement if option is at lowest value.
    			str = strArray[--optcount];
    			break;
    		default:
                    break;
    		}
    	}
    	string print()
    	{
    		string s;
    		stringstream out(stringstream::in | stringstream::out);
    		switch(type)
    		{
    		case 'i':
                 char buf[50];
    			 s = itoa(i, buf, 10);
    			 break;
    
    		case 'f':
    			out << f;
    			s = out.str();
    			break;
    
    		case 's':
                 str = strArray[optcount].c_str();
    			return str;
    			break;
    			
    		default:
    			return s;
    		}
    		return s;//redundant? no. ;)
    	}
    
    };
    
    int main()
    {
        Option** opt;
        opt = new Option*[MAX_OPTIONS];
        for(int i=0; opt[i]; i++)cout<<"element: " <<i << " exists."<<endl;
        system("pause");
        return 0;
    }
    Compile this and you will see that there are two element is the array named opt, and I have no clue why that is. I'm using Dev-C++ to compile, but I'll try in VS and see if I get the same thing.

    Result From Visual Studios:
    Code:
    element: 0 exists.
    element: 1 exists.
    element: 2 exists.
    element: 3 exists.
    element: 4 exists.
    element: 5 exists.
    element: 6 exists.
    element: 7 exists.
    element: 8 exists.
    element: 9 exists.
    element: 10 exists.
    element: 11 exists.
    element: 12 exists.
    element: 13 exists.
    Press any key to continue . . .
    Result From Dev-C++:
    Code:
    element: 0 exists.
    element: 1 exists.
    Press any key to continue . . .
    With the same exact code.... Oh lord. Is it to much to as for consistency between different compilers. those elements should be null... >_>. why does it seem like there is something there?

    Any ideas? Your guess is as good as mine. =/
    Last edited by why06; 03-13-2010 at 07:21 PM.

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  8. #7
    nubs's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    My room, duh.
    Posts
    44
    Reputation
    10
    Thanks
    2
    My Mood
    Amused
    What is this suposto be exactly?

  9. #8
    Arhk's Avatar
    Join Date
    Dec 2008
    Gender
    male
    Location
    Engineering
    Posts
    3,618
    Reputation
    35
    Thanks
    217
    My Mood
    Amused
    Use wxDev-C++ btw. It's an updated project with wxWidgets support (something like that) suppose to allow for GUI code portability across platforms.
    ~
    "If the world hates you, keep in mind that it hated me first." John 15:18

  10. #9
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    Quote Originally Posted by nubs View Post
    What is this suposto be exactly?
    Doesn't really matter. It's just a structure. the main method is all that's important... and the results.
    Code:
    int main()
    {
        Option** opt;
        opt = new Option*[MAX_OPTIONS];
        for(int i=0; opt[i]; i++)cout<<"element: " <<i << " exists."<<endl;
        system("pause");
        return 0;
    }
    @Arhk: didn't know about. thanks 4 the tip.

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  11. #10
    Arhk's Avatar
    Join Date
    Dec 2008
    Gender
    male
    Location
    Engineering
    Posts
    3,618
    Reputation
    35
    Thanks
    217
    My Mood
    Amused
    Quote Originally Posted by why06 View Post

    @Arhk: didn't know about. thanks 4 the tip.
    *Note: Arhk requests a pat on the head for a job well done
    ~
    ^_^
    "If the world hates you, keep in mind that it hated me first." John 15:18

  12. The Following User Says Thank You to Arhk For This Useful Post:

    why06 (03-14-2010)

  13. #11
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    o___O... goodboy.

    Anyway figured out the problem was that under C++ ISO new does not zero the memory region being used for your array... kind of makes me wonder what
    's the point of allocating an array of a specific size, but whatever. Anyway my first idea was to use a for loop and zero it all, but I decided to use memset instead. I've been at this for a while now, but more and more I start figuring out how I depended on the compiler in Java to handle bounds checking and garbage collecting. Still not use to specifying so much. Anyway:
    Code:
    int main()
    {
        Option** opt;
    	cout<<&opt<<endl;
        opt =(Option**) new Option*[MAX_OPTIONS];
    	memset(opt+1, 0, sizeof(Option*)*(MAX_OPTIONS-1));
    	cout<<strlen((const char*) opt)/4;
        //NULL all elements. Guess I have to handle this myself. screw u compliler >:|
        for(int i=0; opt[i]; i++)cout<<"element: " <<opt[i] << " exists."<<endl;
        system("pause");
        return 0;
    }
    that's the fix.

    Also found out this neat trick to find the size of any array using strlen(). So pretty neat trick I guess.

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  14. #12
    Arhk's Avatar
    Join Date
    Dec 2008
    Gender
    male
    Location
    Engineering
    Posts
    3,618
    Reputation
    35
    Thanks
    217
    My Mood
    Amused
    I'm pretty sure that you null the array memory in its declaration
    int array[n] = 0;
    ~
    but I got that style of instruction from an 80's C book.
    Last edited by Arhk; 03-14-2010 at 02:29 PM.
    "If the world hates you, keep in mind that it hated me first." John 15:18

  15. #13
    Retoxified's Avatar
    Join Date
    Feb 2010
    Gender
    male
    Posts
    148
    Reputation
    8
    Thanks
    171
    ZeroMemory anyone?

Similar Threads

  1. Proof of Concept.
    By Zen in forum General
    Replies: 17
    Last Post: 01-27-2011, 01:30 AM
  2. [Proof of Concept]Iron Sights
    By TrollerCoaster in forum CrossFire Discussions
    Replies: 37
    Last Post: 01-24-2011, 10:16 AM
  3. CS 1.6 VAC2 proof hacks AND cheat death hacks
    By Brunogol in forum General Game Hacking
    Replies: 28
    Last Post: 12-18-2006, 08:26 PM
  4. Concept Mustang.
    By Dave84311 in forum General
    Replies: 1
    Last Post: 12-13-2006, 06:44 PM
  5. Proof that Dr.Seuss is a genius
    By Jackal in forum Entertainment
    Replies: 14
    Last Post: 06-24-2006, 04:07 AM