Exemplo n.º 1
0
GLWidget::GLWidget(QWidget *parent)
    : QGLWidget(parent), _camera(20), _character(0), _planarChain(0), _humanHand(0), _walkingBug(0),
      _currentIKMethod(IKSolver::DAMPED_LEAST_SQUARES), _animationEnabled(false), _selectedJoint(0),
      _enableUserControl(true), _isRecording(false), _frameExporter(0)
{
    // Create update timer
    _animationTimer = new QTimer(this);
    connect(_animationTimer , SIGNAL(timeout()), this, SLOT(animate()));
    _animationTimer->start();
}
Exemplo n.º 2
0
//! OnAnimate() is called just before rendering the whole scene.
//! nodes may calculate or store animations here, and may do other useful things,
//! dependent on what they are.
void CCameraMayaSceneNode::OnAnimate(u32 timeMs)
{
	animate();

	ISceneNode::setPosition(Pos);
	updateAbsolutePosition();

	// This scene node cannot be animated by scene node animators, so
	// don't invoke them.
}
Exemplo n.º 3
0
Ripple::Ripple(const QPoint &center, RippleOverlay *overlay, QObject *parent)
    : QObject(parent),
      _overlay(overlay),
      _radiusAnimation(animate("radius")),
      _opacityAnimation(animate("opacity")),
      _radius(0),
      _opacity(0),
      _center(center)
{
    connect(&_group, SIGNAL(finished()), this, SIGNAL(finished()));

    setOpacityStartValue(0.5);
    setOpacityEndValue(0);
    setRadiusStartValue(0);
    setRadiusEndValue(300);

    _brush.setColor(Qt::black);
    _brush.setStyle(Qt::SolidPattern);
}
Exemplo n.º 4
0
void
visibility(int state)
{
  if (state == GLUT_VISIBLE) {
    visible = 1;
    animate(0);
  } else {
    visible = 0;
  }
}
Exemplo n.º 5
0
void KstDebugNotifier::animate() {
  if (_animationStage > TIMER_ITERATIONS) {
    setPixmap(_pm[0]);
    return;
  }

  setPixmap(_pm[_animationStage % IMAGE_STAGES]);
  QTimer::singleShot(TIMER_TICK, this, SLOT(animate()));
  ++_animationStage;
}
SpikeViewerWidget::SpikeViewerWidget(QWidget *parent) : QGLWidget(parent) {
    setMouseTracking(true);
	s = new SpikeViewer(4, 4, 800, 600, NULL);
	s->initPlots();
	firstDraw = true;

	animationTimer.setSingleShot(false);
    connect(&animationTimer, SIGNAL(timeout()), this, SLOT(animate()));
    animationTimer.start(1e3/60);
}
Exemplo n.º 7
0
/* program entry */
int main(int argc, char *argv[])
{
    GLFWwindow* window;
    int width, height;

    if( !glfwInit() )
    {
        fprintf( stderr, "Failed to initialize GLFW\n" );
        exit( EXIT_FAILURE );
    }

    glfwWindowHint(GLFW_DEPTH_BITS, 16);

    window = glfwCreateWindow( 300, 300, "Gears", NULL, NULL );
    if (!window)
    {
        fprintf( stderr, "Failed to open GLFW window\n" );
        glfwTerminate();
        exit( EXIT_FAILURE );
    }

    // Set callback functions
    glfwSetFramebufferSizeCallback(window, reshape);
    glfwSetKeyCallback(window, key);

    glfwMakeContextCurrent(window);
    gladLoadGLLoader((GLADloadproc) glfwGetProcAddress);
    glfwSwapInterval( 1 );

    glfwGetFramebufferSize(window, &width, &height);
    reshape(window, width, height);

    // Parse command-line options
    init();

    // Main loop
    while( !glfwWindowShouldClose(window) )
    {
        // Draw gears
        draw();

        // Update animation
        animate();

        // Swap buffers
        glfwSwapBuffers(window);
        glfwPollEvents();
    }

    // Terminate GLFW
    glfwTerminate();

    // Exit program
    exit( EXIT_SUCCESS );
}
Exemplo n.º 8
0
void AGOSEngine_Feeble::printInteractText(uint16 num, const char *string) {
	char convertedString[320];
	char *convertedString2 = convertedString;
	const char *string2 = string;
	uint16 height = 15;
	uint16 w = 0xFFFF;
	uint16 b, pixels, x;

	// It doesn't really matter what 'w' is to begin with, as long as it's
	// something that cannot be generated by getPixelLength(). The original
	// used 620, which was a potential problem.

	while (1) {
		string2 = getPixelLength(string, 620, pixels);
		if (*string2 == 0x00) {
			if (w == 0xFFFF)
				w = pixels;
			Common::strlcpy(convertedString2, string, 320);
			break;
		}
		while (*string2 != ' ') {
			byte chr = *string2;
			pixels -= (_language == Common::PL_POL) ? polish_charWidth[chr] : charWidth[chr];
			string2--;
		}
		if (w == 0xFFFF)
			w = pixels;
		b = string2 - string;
		strncpy(convertedString2, string, b);
		convertedString2 += b;
		*convertedString2++ = '\n';
		height += 15;
		string = string2;
	}

	// ScrollX
	x = _variableArray[251];
	x += 20;

	if (num == 1)
		_interactY = 385;

	// Returned values for box definition
	_variableArray[51] = x;
	_variableArray[52] = _interactY;
	_variableArray[53] = w;
	_variableArray[54] = height;

	stopAnimateSimon2(2, num + 6);
	renderString(num, 0, w, height, convertedString);
	animate(4, 2, num + 6, x, _interactY, 12);

	_interactY += height;
}
Exemplo n.º 9
0
void animate_player_ships(void)
{

	if ( (current_proc->pa8=player_1_ship)!=NULL )
	{
		if ( (current_proc->pa8)->oimg==&ship1 )
			animate(SINGLE_ANI,&ship2,(current_proc->pa8)->oflags);
		else animate(SINGLE_ANI,&ship1,(current_proc->pa8)->oflags);
	}

	/* aps_2 */
	if ( (current_proc->pa8=player_2_ship)!=NULL )
	{
		if ( (current_proc->pa8)->oimg==&ship3 )
			animate(SINGLE_ANI,&ship4,(current_proc->pa8)->oflags);
		else animate(SINGLE_ANI,&ship3,(current_proc->pa8)->oflags);
	}

	return;
}
Exemplo n.º 10
0
void RTSCamera::OnAnimate(u32 timeMs)
{
	//subtract new time from old time to get elapsed time :)
	u32 elapsed = timeMs - oldTimeMs;
	oldTimeMs = timeMs;
	//if (elapsed == 0) elapsed = 1;
	animate(elapsed);

   setPosition(Pos);
   updateAbsolutePosition();
}
Exemplo n.º 11
0
void CountdownObject::dispatch() {
	int frameNum = _frame;
	SceneObject::dispatch();

	if ((frameNum != _frame) && (_countDown > 0)) {
		if (--_countDown == 0) {
			animate(ANIM_MODE_NONE, 0);
			_frame = 1;
		}
	}
}
Exemplo n.º 12
0
AboutDialog::AboutDialog(QWidget *parent)
	: QDialog(parent),
	ui(new Ui::AboutDialog)
{
	ui->setupUi(this);

#ifdef Q_OS_WIN
	QString os = tr("Windows");
#endif
#ifdef Q_OS_LINUX
	QString os = tr("GNU/Linux");
#endif
#ifdef Q_OS_MAC
	QString os = tr("Mac");
#endif

    QString buildName = ACT_BUILD_NAME;

    if(buildName.isEmpty())
        buildName.clear();
    else
        buildName = " - " ACT_BUILD_NAME;

    QString message = tr("<img src=':/icons/logo.png'><h2>Actiona %1%2</h2>").arg(Global::ACTIONA_VERSION.toString()).arg(buildName);
    message += " 2005-2016 Jonathan \"Jmgr\" Mercier-Ganady <a href='mailto:[email protected]'>[email protected]</a><br/><br/>";
    message += tr("<i>Emulates clics, key presses and other actions</i><br/><br/>Using Qt %1 (runtime %2) under %3 (%4 bit)")
			   .arg(QT_VERSION_STR)
			   .arg(qVersion())
			   .arg(os)
               .arg(QSysInfo::WordSize);
#ifdef ACT_ENABLE_BUILD_DATE
    message += tr("<br/>Build date: %1 %2")
            .arg(__DATE__)
            .arg(__TIME__);
#endif
    message += "</center><br/>";

	ui->titleLabel->setText(message);

	mComboBoxes.append(ui->act3Prog);
	mComboBoxes.append(ui->act3Ideas);
	mComboBoxes.append(ui->act3Donators);
	mComboBoxes.append(ui->act3Art);
	mComboBoxes.append(ui->act3Pack);
	mComboBoxes.append(ui->act3Documentation);
	mComboBoxes.append(ui->act2Prog);
	mComboBoxes.append(ui->act2Ideas);
	mComboBoxes.append(ui->act2Donators);
	mComboBoxes.append(ui->act2Art);

	QTimer *timer = new QTimer(this);
	connect(timer, SIGNAL(timeout()), this, SLOT(animate()));
	timer->start(1500);
}
ViewSphereRender::ViewSphereRender(QWidget *parent)
: QGLCanvas(parent), m_nside(32), m_currentPos(NULL), m_startPos(NULL), m_targetPos(NULL)
{
	resize(250, 250);
	m_recorder = new ViewPointRecorder;
	m_recorderArc = new ViewPointRecorder;
	m_timer = new QTimer(this);
	connect(m_timer, SIGNAL(timeout()), this, SLOT(animate()));

	//m_tf = new unsigned char[256];
}
Exemplo n.º 14
0
void Bomb::update()
{
	if (animClock.getElapsedTime().asSeconds() >= 1.f && sprite.getTextureRect().left < spriteRects[3].left)
	{
		animate();
		animClock.restart().asSeconds();
	}
	else if (animClock.getElapsedTime().asSeconds() >= 0.03f &&
			(sprite.getTextureRect().top > spriteRects[0].top || sprite.getTextureRect().left >= spriteRects[3].left))
	{
		animate();
		animClock.restart().asSeconds();
	}

	// Explosion
	if (sprite.getTextureRect() == spriteRects[4])
	{
		//explode();
	}
}
Exemplo n.º 15
0
WindowPreview::WindowPreview(
		TaskManager::TaskItem *task,
		int index,
		SmoothToolTip *toolTip)
	: QWidget(),
	  m_background(new Plasma::FrameSvg(this)),
	  m_iconSpace(NULL),
	  m_previewSpace(NULL),
	  m_highlite(),
	  m_task(new Task(task, this)),
	  m_toolTip(toolTip),
	  m_previewSize(0, 0),
	  m_hover(false),
	  m_index(index),
	  m_activateTimer(NULL),
	  m_didPress(false),
	  m_dragStartPosition() {
	setMouseTracking(true);
	setAcceptDrops(true);

//	m_background->setImagePath("widgets/button");
	m_background->setImagePath("widgets/tasks");
	m_background->setElementPrefix(NORMAL);
	m_background->setCacheAllRenderedFrames(true);

	setPreviewSize();

	// placeholder for preview:
	if (toolTip->previewsAvailable()) {
		m_previewSpace = new QSpacerItem(
			0, 0,
			QSizePolicy::Minimum,
			QSizePolicy::Minimum);
	}

	switch (m_toolTip->applet()->previewLayout()) {
	case Applet::NewPreviewLayout:
		setNewLayout();
		break;
	case Applet::ClassicPreviewLayout:
	default:
		setClassicLayout();
	}
	
	setMaximumWidth(260);
	updateTheme();
	
	connect(m_background, SIGNAL(repaintNeeded()), this, SLOT(updateTheme()));
	connect(
		task, SIGNAL(changed(::TaskManager::TaskChanges)),
		this, SLOT(updateTask(::TaskManager::TaskChanges)));

	connect(&m_highlite, SIGNAL(animate(qreal)), this, SLOT(repaint()));
}
Exemplo n.º 16
0
SCViewModePreviewPageEffect::SCViewModePreviewPageEffect(KoPAView * view, KoPACanvas * canvas)
: KoPAViewMode(view, canvas)
, m_savedViewMode(0)
, m_pageEffect(0)
, m_pageEffectRunner(0)
, m_page(0)
, m_prevpage(0)
{
    connect(&m_timeLine, SIGNAL(valueChanged(qreal)), this, SLOT(animate()));
    connect(&m_timeLine, SIGNAL(finished()), this, SLOT(activateSavedViewMode()));
}
Exemplo n.º 17
0
int main() {
	/*
	IOCON_PIO1_5 = 0x000000d0;
	GPIO1DIR |= 1 << 5;
	GPIO1MASKED[1 << 5] = 0;
	for (int i = 0;; i++) {
		GPIO1MASKED[1 << 5] = i;
	}
	*/
	matrixled_init();
	ux_init();
	
#if ENEBLE_WDT == 1
	slowClock();
#endif
	
#if SYSTICK_WAIT == 1
#if ENEBLE_WDT == 1
	InitSysTick(120000);
#else
	InitSysTick(12000);	// 12,000,000Hz 12,000 -> 10 = 1ms
#endif
#endif
	
#if ENEBLE_WDT == 0
	initUART();
#endif
	
	/*
	for (;;) {
		playMML("C");
		println("TEST\n");
		toggleSounder();
		wait(10000);
	}
//	uart();
	*/
	
//	bitman();
	//	bitman2();
	for (;;) {
		if (!ux_state()) {
			break;
		}
		WAIT(10);
	}
	for (;;) {
		animate(DATA_ANIM, LEN_DATA_ANIM);
		app_mikuji();
//		app_keytest();
		app_renda();
	}
	return 0;
}
Exemplo n.º 18
0
void View::load(BitRep &br) {
    Widget *wid = new Widget(&helper, this,br);
    my_widget = wid;
    QGridLayout *layout = new QGridLayout;
    layout->addWidget(wid, 0, 0);
    setLayout(layout);
    QTimer *timer = new QTimer(this);
    connect(timer, SIGNAL(timeout()), wid, SLOT(animate()));
    timer->start(my_time);
    setWindowTitle(tr("Bitrep in action"));
}
Exemplo n.º 19
0
	void flash(bool alarm, ws2811::rgb color, ws2811::rgb (&leds)[led_count], uint8_t channel)
	{
		int count = 18;
		ws2811::rgb strobe = ws2811::rgb( 255, 255, 255);
		if(alarm)
		{
			strobe = ws2811::rgb( 255, 0, 0);
		}
		
		animate(strobe, leds, channel);
		for (uint8_t idx = 0; idx != count; ++idx)
		{
			animate(color, leds, channel);		
		}
		
		animate(strobe, leds, channel);
		for (uint8_t idx = count; idx != 0; --idx)
		{
			animate(color, leds, channel);		
		}
	}
Exemplo n.º 20
0
Window::Window() : QWidget()
{
    BoxWidget *widget = new BoxWidget(this);
    setWindowTitle(tr("So Boxy"));
    QGridLayout *layout = new QGridLayout;
    layout->addWidget(widget, 0, 0);
    setLayout(layout);

    QTimer *timer = new QTimer(this);
    connect(timer, SIGNAL(timeout()), widget, SLOT(animate()));
    timer->start(1);
}
void KPrViewModePreviewShapeAnimations::deactivate()
{
    if ( m_timeLine.state() == QTimeLine::Running ) { // there are still shape animations running
            m_timeLine.stop();
    }
    m_savedViewMode = 0;
    m_shapeAnimation->deactivate();
    m_canvas->shapeManager()->setPaintingStrategy(new KoShapeManagerPaintingStrategy(m_canvas->shapeManager()));
    delete (m_animationCache);
    m_animationCache = 0;
    disconnect(&m_timeLine, SIGNAL(valueChanged(qreal)), this, SLOT(animate()));
}
Exemplo n.º 22
0
void water_ani(OIMGTBL *frame,OBJECT *obj) 
{
	short x,y;

	x=obj->oxpos.u.intpos;
	y=obj->oypos.u.intpos;
	current_proc->pa8=obj;
	animate(SINGLE_ANI,frame,obj->oflags);
	obj->oxpos.u.intpos=x;
	obj->oypos.u.intpos=y;
	return;
}
Exemplo n.º 23
0
ModelBall::ModelBall(QObject *parent) :
    Model3D(parent), _animationTimer(new QTimer(this)), _frame(0)
{
    const float defaultScale = 2.0;
    const int interval = 10;
    _scale = defaultScale;
    createScene();
    _animationTimer->setInterval(interval);
    _animationTimer->setSingleShot(true);
    connect(_animationTimer, SIGNAL(timeout()),
            this, SLOT(animate()));
}
Exemplo n.º 24
0
void ImageSequenceDialog::animateNextStep()
{
    if (sliderAnimateSequence->value() < m_images.count() - 1)
    {
        sliderAnimateSequence->setValue(sliderAnimateSequence->value() + 1);
        animateSequence(sliderAnimateSequence->value());
    }
    else
    {
        animate();
    }
}
Exemplo n.º 25
0
void ce4s(void)
{
	OBJECT *obj;
	XYTYPE temp;

	gso_dmawnz(obj,(ADDRESS)&expld6,hidden_anims,0);
	alloc_cache(&expld1,&hidden_anims,obj);
	temp.yx=(LONG)current_proc->pa9;
	set_xy_coordinates(obj,temp.u.xpos,temp.u.ypos);
	insert_object(obj,&objlst);
	process_sleep(2);

 	animate(SINGLE_ANI,&expld7,obj->oflags);
	process_sleep(2);

 	animate(SINGLE_ANI,&expld8,obj->oflags);
	process_sleep(2);

	delobj(obj);
	process_suicide();
}
Exemplo n.º 26
0
void SpotView::initializeGL(QGLPainter *painter)
{
    painter->setStandardEffect(QGL::LitMaterial);
    //painter->setStandardEffect(QGL::FlatColor);
    painter->setClearColor(QColor(32, 32, 128));
    painter->setDepthTestingEnabled(true);

    painter->setLightModel(model);

    connect(timer, SIGNAL(timeout()), this, SLOT(animate()));
    timer->start(25);
}
Exemplo n.º 27
0
void TImageButton::setup()
{
    setFlat(true);
    setAutoDefault(false);
    setIconSize(QSize(m_imageSize, m_imageSize));
    setMaximumSize(m_imageSize, m_imageSize);
    setMinimumSize(m_imageSize, m_imageSize);
    m_animator = new Animation(m_imageSize);
    connect(m_animator->aTimer, SIGNAL(timeout()), this, SLOT(animate()));
    
    setFocusPolicy(Qt::NoFocus);
}
Exemplo n.º 28
0
void Quiddiards::initializeGL(){
	glClearColor(0.0, 0.0, 0.0, 0.0);
	glClearDepth(1.0);
	glEnable(GL_AUTO_NORMAL);
	glShadeModel(GL_SMOOTH);
	glEnable(GL_DEPTH_TEST);
	glDepthFunc(GL_LEQUAL);
	glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);

	glEnable(GL_CULL_FACE);
	glCullFace(GL_BACK);

	//glDisable(GL_BLEND);
	//glBlendFunc(GL_ONE, GL_ZERO);
	glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
	//glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
	//glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);

	/* camera */
	camera = FOLLOW;
	theta = 45;
	phi = 45;
	radius = MAXRANGE / 2;

	initObjects();	// init objects first, since others may base on them
	loadResources();
	initLights();


	ambLight = true;
	sunLight = true;
	spotLight = true;
	pause = false;

	/* flag nurbs object */
	nurbs = gluNewNurbsRenderer();
	gluNurbsProperty(nurbs, GLU_SAMPLING_TOLERANCE, 25.0);
	gluNurbsProperty(nurbs, GLU_DISPLAY_MODE, GLU_FILL);
	/* quadric object */
	quad = gluNewQuadric();
	gluQuadricDrawStyle(quad, GLU_FILL);
	gluQuadricNormals(quad, GLU_SMOOTH);
	gluQuadricTexture(quad, true);

	timer = new QTimer;
	connect(timer, SIGNAL(timeout()), SLOT(animate()));
	timer->start(interval);
	msec = clock();

	/* particle system */
	ps = new ParticleSystem(200, -10.0f);
}
Exemplo n.º 29
0
void AGOSEngine_Simon2::os2_animate() {
	// 98: start vga
	uint16 zoneNum = getVarOrWord();
	uint16 vgaSpriteId = getVarOrWord();
	uint16 windowNum = getVarOrByte();
	int16 x = getVarOrWord();
	int16 y = getVarOrWord();
	uint16 palette = (getVarOrWord() & 15);

	_videoLockOut |= 0x40;
	animate(windowNum, zoneNum, vgaSpriteId, x, y, palette);
	_videoLockOut &= ~0x40;
}
Exemplo n.º 30
0
void AGOSEngine_PN::opn_opcode57() {
	uint16 windowNum = varval();
	uint16 vgaSpriteId = varval();
	int16 x = varval();
	int16 y = varval();
	uint16 palette = varval();

	_videoLockOut |= 0x40;
	animate(windowNum, 0, vgaSpriteId, x, y, palette);
	_videoLockOut &= ~0x40;

	setScriptReturn(true);
}