• Advertisement

adam4813

Member
  • Content count

    197
  • Joined

  • Last visited

Community Reputation

729 Good

About adam4813

  • Rank
    Member

Personal Information

  • Interests
    Programming
  1. Multiply right by look instead of doing a cross? I am not looking at how I did it just suggesting this from memory.
  2. I would put forth my own framework, Sigma, that is still very WIP (the read me is very out-of-date). It has most bullet points you went (graphics is still shaping up, so no animations, particles, etc yet) and the sound is to be added (this weekend). It is pure C++ and takes advantage of some C++11. It works on Linux and Win32 (Mac testing is in the works). It uses GLFW for the OS abstraction layer (user input via mouse/keyboard works but it can also do controllers). OpenGL 3+ using a custom rendering engine. Bullet Physics. and of course HTML based UI using chrome (CEF in the works, but currently has Awesomium. It is being used for the Trillek engine (and is what is powering the milestone 1 release). You can contribute if you would like as well since we are a small sparse team of developers that are open to work from others. And let's not forgot the link Sigma.
  3. Grounded Pointers

    imoogiBG what if ptr is a base class pointer to a derived class to? Then sizeof the base class pointer would have predictable results (clearing the portion of pointed-to memory for the size of base class) but it would have undesirable results for the portion of pointed-to memory that is the derived class.
  4. Model–view–controller pattern

    You can get my take on it, in my article MVC and CBES as it Relates to Game Programming
  5. Maybe that is the logic then. If you aren't in a "section" or room then you left it via a non-portal, so kill.
  6. Wade Not in Unknown Waters: Part Four

    I believe by mix-in you are referring to a pure abstract interface. As far as my understanding goes, a mix-in is a class that provides a certain set of methods or properties to a given object. So in a sense all mix-ins are interfaces, but not all interfaces are mix-ins.
  7. The brackets are need around the ternary operator since it's in a macro. #include <iostream> #define a(i) << " bottle" << (i-1?"s":"") << " of beer" << #define w " on the wall" << int main() { for(int i=100;i-->1;) std::cout << i a(i) w ", " << i a(i) ".\nTake one down and pass it around, " << i-1 a(i-1) w ".\n\n"; std::cout << "No more" a() w ", no more" a() ".\nGo to the store and buy some more, 99" a() w "."; } After some tweaking 273 now
  8. Last one, had an issue with 1 bottle #include <iostream> #define a(i) << " bottle" << (i!=1?"s":"") << " of beer" << #define w " on the wall" << int main() {        for(int i=100;i-->1;)       std::cout << i a(i) w ", " << i a(i) ".\nTake one down and pass it around, " << i-1 a(i-1) w ".\n\n";     std::cout << "No more" a(0) w ", no more" a(0) ".\nGo to the store and buy some more, 99" a(9) w "."; } Characters w/o spaces: 277 Characters: 366
  9. After some more tweaking I brought it down to 274 could be 272 if you aren't required to have to line breaks after each round. #include <iostream> #define a(i) << " bottle" << (i!=1?"s":"") << " of beer" << (i>-1?" on the wall":".\n") << int main() {        for(int i=100;i-->1;)       std::cout << i a(i) ", " << i a(-1) "Take one down and pass it around, " << i-1 a(i-1) ".\n\n";     std::cout << "No more" a(0) ", no more" a(-1) "Go to the store and buy some more, 99" a(9) "."; }
  10. Here's my C++ attempt #include <iostream> #define a(i) <<" bottle" << (i!=1?"s":"") << " of beer"<< #define n(i) <<i a(i) " on the wall" << int main() {        for(int i=100;i-->1;)       std::cout n(i) ", "<< i a(i) ".\nTake one down and pass it around, " n(i-1) ".\n\n";     std::cout << "No more" a(0) " on the wall, no more" a(0) "\nGo to the store and buy some more, " n(99) "."; } Characters w/o spaces: 282 Characters: 366   Edit another tweak #include <iostream> #define n(i) << " bottle" << (i!=1?"s":"") << " of beer on the wall" << #define b << " bottles of beer.\n" << int main() {        for(int i=100;i-->1;)       std::cout << i n(i) ", " << i b "Take one down and pass it around, " << i-1 n(i-1) ".\n\n";     std::cout << "No more" n(0) ", no more" b "Go to the store and buy some more, 99" n(99) "."; } Characters w/o spaces: 280 Characters: 369
  11. Wade Not In Unknown Waters: Part One

    The article is referring to calling alternative constructors within the same class.   An example would be calling Car() with a Truck object as an argument. The Car constructors might be Car(year, make, model, speed, tank_size) and Car(year, make, model, style). However it may have one that would take a Truck Car(Truck*) and make a similar car using the Trucks data (year, speed, tank_size). So you would call Car(Truck*, make, model) and that constructor would then call Car(truck.year, make, model, truck.speed, truck.tank_size)
  12. Wade Not In Unknown Waters: Part One

    new () is the placement new operator. It is the same as calling the new operator, but you provide the placement (or address) at which to create it. Hence calling it with the this pointer tells the new operator to place the created object at the same location as the current.   However that could be bad if you use placement new on the this pointer when you use a base class constructor, The base class isn't as large as the derived type in memory and thus you will leak memory and have some odd/undefined behavior.
  13. The Total Beginner’s Guide to Better 2D Game Art

    Wow, I want to go make my own awesome art now...Thanks for the education.
  • Advertisement