~ubuntu-branches/debian/sid/astromenace/sid

« back to all changes in this revision

Viewing changes to AstroMenaceSource/Object3D/GroundObject/Building/Building.cpp

  • Committer: Package Import Robot
  • Author(s): Boris Pek
  • Date: 2013-04-09 02:04:25 UTC
  • Revision ID: package-import@ubuntu.com-20130409020425-a7fl9xk4diamw6di
Tags: upstream-1.3.1+repack
Import upstream version 1.3.1+repack

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/************************************************************************************
 
2
 
 
3
        AstroMenace (Hardcore 3D space shooter with spaceship upgrade possibilities)
 
4
        Copyright © 2006-2012 Michael Kurinnoy, Viewizard
 
5
 
 
6
 
 
7
        AstroMenace is free software: you can redistribute it and/or modify
 
8
        it under the terms of the GNU General Public License as published by
 
9
        the Free Software Foundation, either version 3 of the License, or
 
10
        (at your option) any later version.
 
11
 
 
12
        AstroMenace is distributed in the hope that it will be useful,
 
13
        but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 
15
        GNU General Public License for more details.
 
16
 
 
17
        You should have received a copy of the GNU General Public License
 
18
        along with AstroMenace. If not, see <http://www.gnu.org/licenses/>.
 
19
 
 
20
 
 
21
        Web Site: http://www.viewizard.com/
 
22
        Project: http://sourceforge.net/projects/openastromenace/
 
23
        E-mail: viewizard@viewizard.com
 
24
 
 
25
*************************************************************************************/
 
26
 
 
27
 
 
28
/// подключаем нужные файлы
 
29
#include "Building.h"
 
30
 
 
31
 
 
32
 
 
33
struct BuildingData
 
34
{
 
35
        float   Strength;
 
36
        const   char *Name;
 
37
};
 
38
 
 
39
const int       PresetBuildingDataCount = 11;
 
40
BuildingData PresetBuildingData[PresetBuildingDataCount] =
 
41
{
 
42
        {150,   "DATA/MODELS/BUILDING/bld-01.VW3D"},
 
43
        {150,   "DATA/MODELS/BUILDING/bld-02.VW3D"},
 
44
        {150,   "DATA/MODELS/BUILDING/bld-03.VW3D"},
 
45
        {150,   "DATA/MODELS/BUILDING/bld-04.VW3D"},
 
46
        {150,   "DATA/MODELS/BUILDING/bld-05.VW3D"},
 
47
        {150,   "DATA/MODELS/BUILDING/bld-06.VW3D"},
 
48
        {150,   "DATA/MODELS/BUILDING/bld-07.VW3D"},
 
49
        {150,   "DATA/MODELS/BUILDING/bld-08.VW3D"},
 
50
        {150,   "DATA/MODELS/BUILDING/bld-09.VW3D"},
 
51
        {150,   "DATA/MODELS/BUILDING/bld-10.VW3D"},
 
52
        {150,   "DATA/MODELS/BUILDING/bld-11.VW3D"}
 
53
};
 
54
 
 
55
 
 
56
 
 
57
//-----------------------------------------------------------------------------
 
58
// Конструктор, инициализация всех переменных
 
59
//-----------------------------------------------------------------------------
 
60
void CBuilding::Create(int      BuildingNum)
 
61
{
 
62
        ObjectType = 12;
 
63
        ObjectCreationType = BuildingNum;
 
64
        // здания неразрушимы, не показываем вообще их жизнь
 
65
        ShowStrength = false;
 
66
        PromptDrawDist2 = 100.0f;
 
67
 
 
68
        LoadObjectData(PresetBuildingData[BuildingNum-1].Name, this, 0, -1.0f, Setup.UseGLSL);
 
69
 
 
70
        for (int i=0; i<DrawObjectQuantity; i++)
 
71
        {
 
72
                Texture[i] = vw_FindTextureByName("DATA/MODELS/BUILDING/bld.VW2D");
 
73
                TextureIllum[i] = vw_FindTextureByName("DATA/MODELS/BUILDING/bld_illum.VW2D");
 
74
                NormalMap[i] = vw_FindTextureByName("DATA/MODELS/NORMALMAP/buildings_nm.tga");
 
75
        }
 
76
 
 
77
        ResistanceHull = 1.0f;
 
78
        ResistanceSystems = 1.0f;
 
79
 
 
80
        Strength = StrengthStart = PresetBuildingData[BuildingNum-1].Strength/GameNPCArmorPenalty;
 
81
 
 
82
 
 
83
        // находим все данные по геометрии
 
84
        ::CObject3D::InitByDrawObjectList();
 
85
}
 
86