Welcome to mirror list, hosted at ThFree Co, Russian Federation.

BlenderTextureManager.cpp « blender_interface « intern « freestyle « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c1eaa1f5928412c91101d195d1c9602da2a81980 (plain)
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/*
 * ***** BEGIN GPL LICENSE BLOCK *****
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 * ***** END GPL LICENSE BLOCK *****
 */

/** \file blender/freestyle/intern/blender_interface/BlenderTextureManager.cpp
 *  \ingroup freestyle
 */

#include "BlenderTextureManager.h"

#include "BKE_global.h"

BlenderTextureManager::BlenderTextureManager()
: TextureManager()
{
	//_brushes_path = Config::getInstance()...
}

BlenderTextureManager::~BlenderTextureManager()
{
}

void BlenderTextureManager::loadStandardBrushes()
{
#if 0
	getBrushTextureIndex(TEXTURES_DIR "/brushes/charcoalAlpha.bmp", Stroke::HUMID_MEDIUM);
	getBrushTextureIndex(TEXTURES_DIR "/brushes/washbrushAlpha.bmp", Stroke::HUMID_MEDIUM);
	getBrushTextureIndex(TEXTURES_DIR "/brushes/oil.bmp", Stroke::HUMID_MEDIUM);
	getBrushTextureIndex(TEXTURES_DIR "/brushes/oilnoblend.bmp", Stroke::HUMID_MEDIUM);
	getBrushTextureIndex(TEXTURES_DIR "/brushes/charcoalAlpha.bmp", Stroke::DRY_MEDIUM);
	getBrushTextureIndex(TEXTURES_DIR "/brushes/washbrushAlpha.bmp", Stroke::DRY_MEDIUM);
	getBrushTextureIndex(TEXTURES_DIR "/brushes/opaqueDryBrushAlpha.bmp", Stroke::OPAQUE_MEDIUM);
	getBrushTextureIndex(TEXTURES_DIR "/brushes/opaqueBrushAlpha.bmp", Stroke::OPAQUE_MEDIUM);
	_defaultTextureId = getBrushTextureIndex("smoothAlpha.bmp", Stroke::OPAQUE_MEDIUM);
#endif
}

unsigned int BlenderTextureManager::loadBrush(string sname, Stroke::MediumType mediumType)
{
#if 0
	GLuint texId;
	glGenTextures(1, &texId);
	bool found = false;
	vector<string> pathnames;
	string path; //soc
	StringUtils::getPathName(TextureManager::Options::getBrushesPath(), sname, pathnames);
	for (vector<string>::const_iterator j = pathnames.begin(); j != pathnames.end(); j++) {
		path = j->c_str();
		//soc if (QFile::exists(path)) {
		if (BLI_exists( const_cast<char *>(path.c_str()))) {
			found = true;
			break;
		}
	}
	if (!found)
		return 0;
	// Brush texture
	if (G.debug & G_DEBUG_FREESTYLE) {
		cout << "Loading brush texture..." << endl;
	}
	switch (mediumType) {
	case Stroke::DRY_MEDIUM:
		//soc prepareTextureLuminance((const char*)path.toAscii(), texId);
		prepareTextureLuminance(StringUtils::toAscii(path), texId);
		break;
	case Stroke::HUMID_MEDIUM:
	case Stroke::OPAQUE_MEDIUM:
	default:
		//soc prepareTextureAlpha((const char*)path.toAscii(), texId);
		prepareTextureAlpha(StringUtils::toAscii(path), texId);
		break;
	}
	if (G.debug & G_DEBUG_FREESTYLE) {
		cout << "Done." << endl << endl;
	}

	return texId;
#else
	return 0;
#endif
}