Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/camera/src/world_entities/blackscreen.cc @ 10236

Last change on this file since 10236 was 10236, checked in by gfilip, 17 years ago

another update :)

File size: 3.0 KB
Line 
1/*
2   orxonox - the future of 3D-vertical-scrollers
3
4   Copyright (C) 2004 orx
5
6   This program is free software; you can redistribute it and/or modify
7   it under the terms of the GNU General Public License as published by
8   the Free Software Foundation; either version 2, or (at your option)
9   any later version.
10
11   ### File Specific
12   main-programmer: Filip Gospodinov
13   co-programmer:
14*/
15#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
16
17
18#include "executor/executor.h"
19#include "util/loading/factory.h"
20#include "util/loading/load_param.h"
21#include "blackscreen.h"
22#include "debug.h"
23#include "material.h"
24#include "state.h"
25#include "class_id_DEPRECATED.h"
26
27ObjectListDefinition(blackscreen);
28CREATE_FACTORY(blackscreen);
29
30
31
32/**
33 *
34 */
35blackscreen::blackscreen ()
36{
37  this->init();
38
39
40}
41
42
43/**
44 *
45 */
46blackscreen::blackscreen(const TiXmlElement* root)
47{
48  this->init();
49
50  if( root != NULL)
51    this->loadParams(root);
52  i=0;
53  state=0;
54}
55
56
57/**
58 *
59 */
60blackscreen::~blackscreen ()
61{}
62
63
64/**
65 *
66 */
67void blackscreen::init()
68{
69  this->registerObject(this, blackscreen::_objectList);
70  this->toList(OM_GROUP_00);
71
72  this->material = new Material();
73  this->material->setIllum(3);
74  this->material->setDiffuse(1.0,1.0,1.0);
75  this->material->setSpecular(0.0,0.0,0.0);
76  this->material->setAmbient(1.0, 1.0, 1.0);
77
78}
79
80
81/**
82 * loads the Settings of a MD2Creature from an XML-element.
83 * @param root the XML-element to load the MD2Creature's properties from
84 */
85void blackscreen::loadParams(const TiXmlElement* root)
86{
87  WorldEntity::loadParams(root);
88}
89
90void blackscreen::draw() const
91{
92//   if(!mediaLoaded)
93//     false;
94
95  glPushAttrib(GL_ENABLE_BIT);
96  glDisable(GL_LIGHTING);
97//   glDisable(GL_BLEND);
98//
99//   glEnable(GL_TEXTURE_2D);
100//   glBindTexture(GL_TEXTURE_2D, media_container->getFrameTexture(counter));
101
102  glPushMatrix();
103 /* glTranslatef (this->getAbsCoor ().x,
104                this->getAbsCoor ().y,
105                this->getAbsCoor ().z);
106  glRotatef(axis, 0.0f, 1.0f, 0.0f);*/
107//PRINTF(0)("axis: %f\n", axis);
108glEnable(GL_BLEND);     // Turn Blending On
109
110//
111//  Coord schould depend on CameraTarget
112//
113//
114//
115
116glColor4f(0, 0, 0, i);
117this->material->select();
118  glBegin(GL_QUADS);
119  glVertex3f(State::getCameraNode()->getAbsCoorX()+3,State::getCameraNode()->getAbsCoorY() -100.0f,
120             State::getCameraNode()->getAbsCoorZ()-100.0f);
121  glVertex3f(State::getCameraNode()->getAbsCoorX()+3, State::getCameraNode()->getAbsCoorY()-100.0f,
122             State::getCameraNode()->getAbsCoorZ()+100.0f);
123  glVertex3f(State::getCameraNode()->getAbsCoorX()+3, State::getCameraNode()->getAbsCoorY() +100.0f,
124             State::getCameraNode()->getAbsCoorZ()+100.0f);
125  glVertex3f(State::getCameraNode()->getAbsCoorX()+3, State::getCameraNode()->getAbsCoorY()+100.0f,
126             State::getCameraNode()->getAbsCoorZ()-100.0f);
127
128
129  glEnd();
130
131  glPopMatrix();
132  glPopAttrib();
133}
134
135/**
136 *
137 */
138void blackscreen::tick (float time)
139{
140  if (state==0 && i==1)
141    i=0;
142  if (state==1 && i<=1)
143    i=i+0.005;
144}
145
146
147void  blackscreen::changeState (bool sta)
148{
149  state=sta;
150}
Note: See TracBrowser for help on using the repository browser.