1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//
//=============================================================================//
#include "render_pch.h"
#include "draw.h"
#include "decal.h"
#include "gl_cvars.h"
#include "view.h"
#include "screen.h"
#include "gl_matsysiface.h"
#include "cdll_int.h"
#include "materialsystem/imesh.h"
#include "materialsystem/imaterial.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
Vector g_CurrentViewOrigin(0, 0, 0), g_CurrentViewForward(1, 0, 0), g_CurrentViewRight(0, -1, 0), g_CurrentViewUp(0, 0, 1);
Vector g_MainViewOrigin(0, 0, 0), g_MainViewForward(1, 0, 0), g_MainViewRight(0, -1, 0), g_MainViewUp(0, 0, 1);
//-----------------------------------------------------------------------------
// Purpose:
// Input : *pMaterial -
//-----------------------------------------------------------------------------
void GL_UnloadMaterial( IMaterial *pMaterial )
{
if ( pMaterial )
{
pMaterial->DecrementReferenceCount();
}
}
//-----------------------------------------------------------------------------
// Purpose:
// Input : *pName -
// Output : IMaterial
//-----------------------------------------------------------------------------
static IMaterial *GL_LoadMaterialNoRef( const char *pName, const char *pTextureGroupName )
{
IMaterial *material = NULL;
if( mat_loadtextures.GetInt() )
{
material = materials->FindMaterial( pName, pTextureGroupName );
}
else
{
material = g_materialEmpty;
}
return material;
}
//-----------------------------------------------------------------------------
// Purpose:
// Input : *pName -
// Output : IMaterial
//-----------------------------------------------------------------------------
IMaterial *GL_LoadMaterial( const char *pName, const char *pTextureGroupName )
{
IMaterial *material;
material = GL_LoadMaterialNoRef( pName, pTextureGroupName );
if( material )
{
material->IncrementReferenceCount();
}
return material;
}
|