Quote from: TheExDeus on July 25, 2014, 07:00:58 PM
Quotestl::containers is definitely something I need then, since I would need to pass the objects between functions, as I like to keep it clean and not do everything in main
say for example a file reading function, then passing the read large block to an encryption function and so forth, I know that the non dynamic, regular ways of doing things, it gets lost outside the function (scope). Something I definitely do not want at this point for my specific needs 
Yeah, it's useful when passing to functions, because regular arrays don't hold it's size. So if you pass an array to a function, you cannot know how large it was (so you cannot iterate over it). That requires ugly fixes like passing size as a separate argument. With containers, you always have that information. Just remember passing stuff by reference, so you don't create a copy. I had a project to do with computer vision - I passed images to functions to extract data from them.
double awesomeFunction(std::vector<std::vector<unsigned char> > img){
//Calculate something awesome and return
}I had like 20FPS, because I was passing data by value. Then I just had to pass it by reference (add &) and it jumps to 60FPS:
double awesomeFunction(std::vector<std::vector<unsigned char> > &img){
//Calculate something awesome and return
}It's something people learn early, but still something worth reminding. Especially when working with large amount of data.
QuoteI discovered the hard way back when I using GM that file functions were HORRIBLY, RIDICULOUSLY slow, but YYG must have assumed most people would use small files and never notice...... But try reading a larger binary and it's a PAIN....... They read 1 byte at a time, and I believe ENIGMA also, since it is compatible to its GML, also uses the same method.......
Yeah, we need to address that. One suggestion I have is to have an option to load the whole file (file_open function) and then abstract that fact, so you can still use file_text_readln() and so on, but instead of doing that on the HDD, you do that in RAM. So in essence you would have a much larger speed, but still be compatible.
QuoteIN your example you are reading lines of text from a text file. I'm guessing, model information

As the name implies, I loaded data from a CSV file. I saved point clouds in that format (as it's very easy) and used this function to load it in ENIGMA.
QuoteBTW speaking of that, if I were to code a function that uses containers, buckets, vectors, or whatever they are called, and stuff dynamically allocated (heap), in functions, can I use this in my ENIGMA projects. Example, if I use stl containers and vector and store a large 100 MB file into for example ResRead, and do something like return ResRead, can I pass back that 100MB back the function that was called in my enigma project ? If that is the case, then I could easily revamp the file functions and add faster more efficient ones for advanced game developers. 
Well the idea is that you can use C++ in ENIGMA. So you should be able to just call "vector<double> myVector;" straight in ENIGMA. I do make calls like "glEnable(...)" in my ENIGMA projects, so I know it's possible to use stuff that is not just in ENIGMA functions. Problem is that they break GML/EDL compatibility, as you know are using classes instead of ID's. But I personally think we should end using them.
So you are telling me I could use those in ENIGMA, but I thought we could not do that inside ENIGMA, meaning can't use STL containers with this parser... I would much rather make it into a C++ function and call it from my ENIGMA project

More and more I realise how LAZY and UGLY many parts of GM were implemented...... But that idea of yours is a great one, keeping compatibility with file functions in G**Studio but reading the whole file in memory and reading from the buffer instead of the HDD. However, keep in mind this has its pros and cons......
#1) More memory consumption
#2) counter productive, especially if you need to open really small files which most people do, so you won't gain any noticeable speed, and in some cases the opposite.
So in my opinion adding NEW functions would be ideal. People can't have their cake and eat it, there is a hefty price to pay for being compatible to a highly flawed product.

There are times when you DON'T want to load the entire file in memory and read straight from HDD, particularly when you need to read a small chunk of info....... There are times when you would want to read by blocks as opposed to the entire file.......and there are times when you want the entire file in RAM.
So it's nice of YoYoGames to have assumed and DECIDED that 1 byte binary reads was ideal LOL.
