Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

blackscreen

File size: 2.5 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#include <iostream.h>
27ObjectListDefinition(blackscreen);
28CREATE_FACTORY(blackscreen);
29
30
31
32/**
33 *
34 */
35blackscreen::blackscreen ()
36{
37  this->init();
38  i=0;
39  state=1;
40
41}
42
43
44/**
45 *
46 */
47blackscreen::blackscreen(const TiXmlElement* root)
48{
49  this->init();
50
51  if( root != NULL)
52    this->loadParams(root);
53  cout << "JUHU";
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  this->material->setDiffuseMap("maps/TE2.tga");
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
112glColor4f(0, 0, 0, i);
113
114  glBegin(GL_QUADS);
115    glVertex3f(-1.0f, -100.0f, -100.0f);
116    glVertex3f(-1.0f, -100.0f, 100.0f);
117    glVertex3f(-1.0f, 100.0f, 100.0f);
118    glVertex3f(-1.0f, 100.0f, -100.0f);
119
120
121  glEnd();
122
123 // glPopMatrix();
124 // glPopAttrib();
125}
126
127/**
128 *
129 */
130void blackscreen::tick (float time)
131{
132  if (state==0 && i==1)
133    i=0;
134  if (state==1 && i<=1)
135    i=i+0.005;
136}
137
138
139void  blackscreen::changeState (bool sta)
140{
141  state=sta;
142}
Note: See TracBrowser for help on using the repository browser.