Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 10212 was 10212, checked in by gfilip, 14 years ago

blackscreen troubles

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
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 */
46blackscreen::blackscreen(const TiXmlElement* root)
47{
48  this->init();
49
50  if( root != NULL)
51    this->loadParams(root);
52}
53
54
55/**
56 *
57 */
58blackscreen::~blackscreen ()
59{}
60
61
62/**
63 *
64 */
65void blackscreen::init()
66{
67  this->registerObject(this, blackscreen::_objectList);
68  this->toList(OM_GROUP_00);
69
70  this->material = new Material();
71  this->material->setIllum(3);
72  this->material->setDiffuse(1.0,1.0,1.0);
73  this->material->setSpecular(0.0,0.0,0.0);
74  this->material->setAmbient(1.0, 1.0, 1.0);
75  this->material->setDiffuseMap("maps/TE2.tga");
76}
77
78
79/**
80 * loads the Settings of a MD2Creature from an XML-element.
81 * @param root the XML-element to load the MD2Creature's properties from
82 */
83void blackscreen::loadParams(const TiXmlElement* root)
84{
85  WorldEntity::loadParams(root);
86}
87
88void blackscreen::draw() const
89{
90//   if(!mediaLoaded)
91//     false;
92
93  glPushAttrib(GL_ENABLE_BIT);
94  glDisable(GL_LIGHTING);
95//   glDisable(GL_BLEND);
96//
97//   glEnable(GL_TEXTURE_2D);
98//   glBindTexture(GL_TEXTURE_2D, media_container->getFrameTexture(counter));
99
100  glPushMatrix();
101 /* glTranslatef (this->getAbsCoor ().x,
102                this->getAbsCoor ().y,
103                this->getAbsCoor ().z);
104  glRotatef(axis, 0.0f, 1.0f, 0.0f);*/
105//PRINTF(0)("axis: %f\n", axis);
106glEnable(GL_BLEND);     // Turn Blending On
107
108
109
110glColor4f(0, 0, 0, i);
111
112  glBegin(GL_QUADS);
113    glVertex3f(-1.0f, -100.0f, -100.0f);
114    glVertex3f(-1.0f, -100.0f, 100.0f);
115    glVertex3f(-1.0f, 100.0f, 100.0f);
116    glVertex3f(-1.0f, 100.0f, -100.0f);
117
118
119  glEnd();
120
121  glPopMatrix();
122  glPopAttrib();
123}
124
125/**
126 *
127 */
128void blackscreen::tick (float time)
129{
130  if (state==0 && i==1)
131    i=0;
132  if (state==1 && i<=1)
133    i=i+0.005;
134}
135
136
137void  blackscreen::changeState (bool sta)
138{
139  state=sta;
140}
Note: See TracBrowser for help on using the repository browser.