Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

SIC Games

Member Since 22 Jun 2012
Offline Last Active Oct 23 2012 09:18 PM
-----

#4989129 string::size_type

Posted by SIC Games on 11 October 2012 - 09:27 AM

I have been wrong too; it is all about how you handle it.
http://www.gamedev.n...67#entry4965067

People don’t lose respect for you for being wrong.  They lose respect for you for handling it poorly.


L. Spiro


True. I probably woke up on the wrong side of the bed today. You're right bro, if a game critic gave me poor game review - probably would aggravate me. So, yeah - I agree I have to react more proactive and professional about. I also have to realize critizism comes in a helping manner and less of a attack. I was being defensive and that's not good demonstration for others to see on this forum. Professionalism is the way to lead people in the right direction. Which, again I have to work upon if I am ever going to be taken seriously. So, yeah I agree with the quote above.


#4989123 string::size_type

Posted by SIC Games on 11 October 2012 - 09:13 AM


sizeof returns the length in bytes of a char. - whether it be a array or what not. Whatever - I was trying to help out; screw that idea.

You are, unfortunately, blatantly wrong on this count.

sizeof() returns the correct size for the given type, or the correct length of a statically allocated array. std::string uses dynamically allocated memory to store the string contents, so sizeof() will not see that memory.

#include <string>
#include <cassert>
int main() {
	std::string A = "Hello, World!";
	std::string B = "Hi";

	assert( sizeof(A) == sizeof(B) );
}


Yeah you too have a good day, keep on warning people; bro! Cause you're cool like that.


#4989122 string::size_type

Posted by SIC Games on 11 October 2012 - 09:12 AM


there is size_t; and plus sizeof() returns bytes of characters. Rather it be a sturct, a class or whatever.

“string” is a structure, so sizeof() returns the size of that structure, not the size of the string it manages.
If it was instead:
const char szString[] = "Hello fellow citizens.";
Then sizeof() would return the number of characters, including the terminating NULL.


screw that idea.

I supported you on SIZE_T but I feel less sorry for you after you posted this.


L. Spiro


Watever, dude. Seriously, all I hear is "IM WRONG" "I AM WRONG" from all you people on here. So, whatever. Have a good day; dude.


#4989106 string::size_type

Posted by SIC Games on 11 October 2012 - 08:12 AM


SIZE_T just returns a integar or length of bytes for the string. SIZE_T is the same function of sizeof(). SIZE_T just stores the integar length of a string or what not.


SIZE_T StringLength;
string Greeting = "Hello, I'm George!";
StringLength = sizeof(Greeting);
cout << StringLength;


As you see the SIZE_T is a typdef that stores the integer of length. Where as sizeof function returns the length of the string Greeting.


std::string varString = "Hello World";
unsigned int size = sizeof(varString);
sizeof DOES NOT RETURN THE SIZE OF THE STRING INSIDE THE STD::STRING

It returns the size of the string class.  The string class uses dynamic memory to store cstrings.  So only the pointer is counted as well as any other members.  If you want the size of an std::string you use .size();


sizeof returns the length in bytes of a char. - whether it be a array or what not. Whatever - I was trying to help out; screw that idea.


#4988961 string::size_type

Posted by SIC Games on 10 October 2012 - 10:51 PM

SIZE_T just returns a integar or length of bytes for the string. SIZE_T is the same function of sizeof(). SIZE_T just stores the integar length of a string or what not.


SIZE_T StringLength;
string Greeting = "Hello, I'm George!";
StringLength = sizeof(Greeting);
cout << StringLength;


As you see the SIZE_T is a typdef that stores the integer of length. Where as sizeof function returns the length of the string Greeting.


#4988953 Double to Float

Posted by SIC Games on 10 October 2012 - 10:28 PM

frob is right! Doubles have longer range than floats which takes up more memory. However, conversion from float to double isn't that hard to say at least just impacts the performance. If you wanted to convert a float to a double just put the:


float PI = 3.14;
float ConvertFloat = (double)PI;

-- or --

double AnotherPie = PI;

However, floats are used in most 3D Applications instead of doubles. But if you insist - go ahead and try and see what your results are. If you feel the performance is getting a punch then this would be the reason behind using floats instead of doubles. I forgot how many bytes doubles use but they're way different than floats.


#4977842 What improves better memory performance?

Posted by SIC Games on 07 September 2012 - 04:59 PM

"INTERIOR DEBATE ROOM - NIGHT TIME"

AS THE SMOKE CLEARS, A BIT OF HAZE STILL DRIFTS JUST LINGERING ON THE FLOOR.

Is everyone finished? Cool, Group Hug Everyone! Com'on!


#4973800 Does this sound like the right ideal for PAK?

Posted by SIC Games on 27 August 2012 - 09:18 AM

Thanks bud! I kinda felt I was thinking in the right approach for this. I can also agree with you on writting the offset because logically, to me it's like a sql database, in order for google or whatever to pull up results - the entries are queried. So, this makes a lot more sense Hodgman. I know you didn't say actually sql database but I interpret it a PAK is like a book. Table of Contents with the filenames and the offsets, then the rest of the pages are the binary file.

Also, what you said at run time makes a lot sense because it'll have more performance.  I was fooling around last night with the code and just work up - perhaps maybe later tonight I'll get a managed assembly class working.  I'll report soon! I need more coffee just woke up lol

-Paul


#4973193 which IDE should i use for opengl?

Posted by SIC Games on 24 August 2012 - 10:57 PM

Visual Studio Express is best. Finally microsoft put in intellisense for C++ language in  Visal Studio 2012.


#4971565 c++ file reading

Posted by SIC Games on 20 August 2012 - 12:29 PM

If this could help some then cool! However, since you're working in text files - let's say for instance you have:

Level TItle: The Doom Room
Models: 25
Textures: 1000
....

if you're using fstream you can do:

char input;
fin = file.open("map1.txt");

fin.get(input);
while(input != ":") {
fin.get(input);
}
 
fin >> MapName;

fin.get(input);
while(input !=":") {
...
}


This is just a suggestion what I used previously for my model file until I converted the file to binary. Just throwing it out there. My example is pretty straightforward and easy. I'm sure others may have preffered ways of reading a text file.


#4967817 If there's more indices loaded - does the shader need to have more bytes?

Posted by SIC Games on 09 August 2012 - 09:33 AM

Inside where it gathers the SGM values - I temporary stored the Normals X Y Z as a Integer! ROFL! Talk about up all night programming tireness. Now it draws a sphere! Additionally, Ripiz I have to move the camera back some to actually see it! :) Thanks everyone!


#4967753 If there's more indices loaded - does the shader need to have more bytes?

Posted by SIC Games on 09 August 2012 - 06:31 AM

So, I get a minus rep point because I showed what the world I was talking about? Dat's messed up. As you can see in the freaking video the GD Cross loads. Nothing wrong with the Custom Mesh importer. It just doesn't like Hearts and cones. FIne, I'll look over the code AGAIN and see what I can come up with. Wow, showing a video - minus rep point! F'ing gay! Ripits said how about show what's happening. So, I did.


#4967744 If there's more indices loaded - does the shader need to have more bytes?

Posted by SIC Games on 09 August 2012 - 06:13 AM

Made a quick video of what's going on. I show in this video comparison of the demo cross loaded fully and just a simple cone import which failed. I

http://www.youtube.com/watch?v=2flX9yNlzoc&feature=youtu.be


#4965713 Direct X 11 compiling issues

Posted by SIC Games on 02 August 2012 - 07:51 PM

as Ripiz said, SIZE_T returns a unsigned interger. It like sizeof() operatator. So, if you're trying to return a size of a string then you'll need a length. Maybe you've already got it but I just threw it out there to help out a bit.


#4965275 Imported OBJ Looks Funky... :(

Posted by SIC Games on 01 August 2012 - 01:25 PM

Alright, I'm gotta study more about setting up Index Buffers a bit more. If I look back now, it doesn't really make sense in Index Buffer's mind because it's like, "You want me to draw what again? Okay cool, I'll draw this but you'll not like it!" So, this reminds me to do more studing before tackling the fun stuff.




PARTNERS