cocos2d::TrianglesCommand* SkeletonBatch::addCommand(cocos2d::Renderer* renderer, float globalOrder, cocos2d::Texture2D* texture, cocos2d::GLProgramState* glProgramState, cocos2d::BlendFunc blendType, const cocos2d::TrianglesCommand::Triangles& triangles, const cocos2d::Mat4& mv, uint32_t flags) { TrianglesCommand* command = allocateCommand(); command->init(globalOrder, texture, glProgramState, blendType, triangles, mv, flags); renderer->addCommand(command); return command; }
// Launch the reception: take and allocate new orders. int Reception::start() { Order *order; size_t name = 0; while (1) { try { order = new Order(_mPizzaSize, _mPizzaType); std::queue<Command *> &commands = order->getOrder(); while (!commands.empty()/* || _kitchens.size()*/) { if (allocateCommand(commands, name)) { delete order; return (0); } if (!commands.empty()) commands.pop(); } delete order; } catch (BadCommandError &e) { std::cerr << e.what() << "." << std::endl; } } return (0); }