77 lines
3.4 KiB
C++
Raw Normal View History

2012-08-14 18:00:48 -04:00
//////////////////////////////////////////////////////////////////////////////
// Model: game.qm
2013-10-10 20:01:51 -04:00
// File: ./main.cpp
2012-08-14 18:00:48 -04:00
//
2013-10-10 20:01:51 -04:00
// This code has been generated by QM tool (see state-machine.com/qm).
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
2012-08-14 18:00:48 -04:00
//
2013-10-10 20:01:51 -04:00
// This program is open source software: you can redistribute it and/or
// modify it under the terms of the GNU General Public License as published
// by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
2012-08-14 18:00:48 -04:00
//////////////////////////////////////////////////////////////////////////////
2013-10-10 20:01:51 -04:00
// @(/3/6) ...................................................................
2012-08-14 18:00:48 -04:00
#include "qp_port.h"
#include "bsp.h"
#include "game.h"
namespace GAME {
2013-10-10 20:01:51 -04:00
//............................................................................
extern "C" int_t main() {
static QP::QEvt const * missileQueueSto[2];
static QP::QEvt const * shipQueueSto[3];
static QP::QEvt const * tunnelQueueSto[GAME_MINES_MAX + 5];
2012-08-14 18:00:48 -04:00
2013-10-10 20:01:51 -04:00
static QF_MPOOL_EL(QP::QEvt) smlPoolSto[10];
static QF_MPOOL_EL(ObjectImageEvt) medPoolSto[2*GAME_MINES_MAX + 10];
2012-08-14 18:00:48 -04:00
2013-10-10 20:01:51 -04:00
static QP::QSubscrList subscrSto[MAX_PUB_SIG];
2012-08-14 18:00:48 -04:00
QP::QF::init(); // initialize the framework and the underlying RT kernel
BSP_init(); // initialize the Board Support Package
// initialize the event pools...
2013-10-10 20:01:51 -04:00
QP::QF::poolInit(smlPoolSto, sizeof(smlPoolSto), sizeof(smlPoolSto[0]));
QP::QF::poolInit(medPoolSto, sizeof(medPoolSto), sizeof(medPoolSto[0]));
2012-08-14 18:00:48 -04:00
2013-10-10 20:01:51 -04:00
QP::QF::psInit(subscrSto, Q_DIM(subscrSto)); // init publish-subscribe
2012-08-14 18:00:48 -04:00
// send object dictionaries for event queues...
2013-10-10 20:01:51 -04:00
QS_OBJ_DICTIONARY(missileQueueSto);
QS_OBJ_DICTIONARY(shipQueueSto);
QS_OBJ_DICTIONARY(tunnelQueueSto);
2012-08-14 18:00:48 -04:00
// send object dictionaries for event pools...
2013-10-10 20:01:51 -04:00
QS_OBJ_DICTIONARY(smlPoolSto);
QS_OBJ_DICTIONARY(medPoolSto);
2012-08-14 18:00:48 -04:00
// send signal dictionaries for globally published events...
QS_SIG_DICTIONARY(TIME_TICK_SIG, static_cast<void *>(0));
QS_SIG_DICTIONARY(PLAYER_TRIGGER_SIG, static_cast<void *>(0));
QS_SIG_DICTIONARY(PLAYER_QUIT_SIG, static_cast<void *>(0));
QS_SIG_DICTIONARY(GAME_OVER_SIG, static_cast<void *>(0));
// start the active objects...
2013-10-10 20:01:51 -04:00
AO_Tunnel ->start(1U, // priority
tunnelQueueSto, Q_DIM(tunnelQueueSto), // evt queue
2012-08-14 18:00:48 -04:00
static_cast<void *>(0), 0U); // no per-thread stack
2013-10-10 20:01:51 -04:00
AO_Missile->start(2U, // priority
missileQueueSto, Q_DIM(missileQueueSto), // evt queue
2012-08-14 18:00:48 -04:00
static_cast<void *>(0), 0U); // no per-thread stack
2013-10-10 20:01:51 -04:00
AO_Ship ->start(3U, // priority
shipQueueSto, Q_DIM(shipQueueSto), // evt queue
2012-08-14 18:00:48 -04:00
static_cast<void *>(0), 0U); // no per-thread stack
return QP::QF::run(); // run the QF application
}
} // namespace GAME