JNR
laGateway.cpp
1 /*
2 
3 Jump'n'Run Engine
4 http://www.atanaslaskov.com/jnr/
5 
6 BSD LICENSE
7 Copyright (c) 2007-2013, Atanas Laskov
8 All rights reserved.
9 
10 Redistribution and use in source and binary forms, with or without
11 modification, are permitted provided that the following conditions are met:
12 1. Redistributions of source code must retain the above copyright notice,
13 this list of conditions and the following disclaimer.
14 2. Redistributions in binary form must reproduce the above copyright notice,
15 this list of conditions and the following disclaimer in the documentation
16 and/or other materials provided with the distribution.
17 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 DISCLAIMED. IN NO EVENT SHALL ATANAS LASKOV BE LIABLE FOR ANY
21 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 
28 */
29 
30 #include "stdafx.h"
31 #include "Core-Level-JR.h"
32 
33 laGateway::laGateway(void)
34 {
35  _ptPivot.bSimulateGravitation = M_FALSE;
36 }
37 
38 laGateway::~laGateway(void)
39 {
40 }
41 
42 //This method is part of the laLoadableObj interface
43 void laGateway::load(class laFileParser *fp)
44 {
45  laObject::load(fp);
46 }
47 
48 //Respawn
49 void laGateway::respawn()
50 {
51  laObject::respawn();
52 }
53 
54 #include "GL/GL.h"
55 //Draw
56 void laGateway::drawGeometry(laRenderer *r, laPoint3 ptBasePos)
57 {
58  r->modeOutline(M_TRUE);
59  laObject::drawGeometry(r, ptBasePos);
60  r->modeOutline(M_FALSE);
61 
62  /*glPushAttrib( GL_ALL_ATTRIB_BITS );
63 
64  glClearStencil(0);
65  glClear(GL_STENCIL_BUFFER_BIT);
66 
67  //Render the mesh into the stencil buffer.
68  glEnable(GL_STENCIL_TEST);
69  glStencilFunc(GL_ALWAYS, 1, -1);
70  glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);
71 
72  r->modeBlendFilter(0.1);
73  r->transPush();
74  _offset_and_rotation(r, ptBasePos);
75  _pTSObject->drawGeometry(r, laPoint3());
76  r->transPop();
77 
78  // Render the thick wireframe version.
79  glStencilFunc(GL_NOTEQUAL, 1, -1);
80  glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);
81 
82  glLineWidth(10);
83  glDisable(GL_LIGHTING);
84  glDisable(GL_TEXTURE);
85 
86  r->modeBlend(M_TRUE);
87  r->styleSet( laColor(255,255,255, 200) );
88  r->transPush();
89  _offset_and_rotation(r, ptBasePos);
90  r->transScale( laPoint3(1.3, 1.3, 1.3));
91  _pTSObject->drawGeometry(r, laPoint3());
92  r->transPop();
93 
94  // Pop the state changes off the attribute stack
95  // to set things back how they were
96  glPopAttrib();*/
97 }
98 
99 void laGateway::drawFx(laRenderer *r, laPoint3 ptBasePos)
100 {
101  laObject::drawFx(r, ptBasePos);
102 }
103 
104 //Animate
105 void laGateway::animate(laTimer &t)
106 {
107  laObject::animate(t);
108 }
109 
110 //Dynamic create
111 /*void laGateway::create(laPoint3 pos)
112 {
113 }*/
virtual void modeOutline(const laOutline &outline)
Set outline parameters.
Definition: laRenderer.h:174
Virtual interface for the Engine graphics renderer.
Definition: laRenderer.h:98
File Parser.
Definition: laFileParser.h:41