Blame toonz/sources/common/tvrender/tglcurves.cpp
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#include "tgl.h"
|
|
Toshihiro Shimizu |
890ddd |
//#include "tvectorgl.h"
|
|
Toshihiro Shimizu |
890ddd |
//#include "tstroke.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "tstrokeprop.h"
|
|
Toshihiro Shimizu |
890ddd |
//#include "tpalette.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "tvectorrenderdata.h"
|
|
Toshihiro Shimizu |
890ddd |
//#include "tpalette.h"
|
|
Toshihiro Shimizu |
890ddd |
//#include "tcolorstyles.h"
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//=============================================================================
|
|
Toshihiro Shimizu |
890ddd |
#ifdef SPOSTATOINTGLREGIONS
|
|
Shinya Kitaoka |
120a6e |
void tglDraw(const TVectorRenderData &rd, const TStroke *s) {
|
|
Shinya Kitaoka |
120a6e |
assert(s);
|
|
Shinya Kitaoka |
120a6e |
if (!s) return;
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
const TStroke &stroke = *s;
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
// initialize information for aaliasing
|
|
Shinya Kitaoka |
120a6e |
glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
|
|
Shinya Kitaoka |
120a6e |
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
|
Shinya Kitaoka |
120a6e |
glEnable(GL_BLEND);
|
|
Shinya Kitaoka |
120a6e |
glEnable(GL_LINE_SMOOTH);
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
// it's necessary to do line function of pixel size ?
|
|
Shinya Kitaoka |
120a6e |
glLineWidth((float)1.0);
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
assert(rd.m_palette);
|
|
Shinya Kitaoka |
120a6e |
TStrokeProp *prop = stroke.getProp(/*rd.m_palette*/);
|
|
Shinya Kitaoka |
120a6e |
/////questo codice stava dentro tstroke::getprop/////////
|
|
Shinya Kitaoka |
120a6e |
TColorStyle *style =
|
|
Shinya Kitaoka |
120a6e |
rd.m_palette->getStyle(stroke->getStyle() /*m_imp->m_styleId*/);
|
|
Shinya Kitaoka |
120a6e |
if (!style->isStrokeStyle() || style->isEnabled() == false) {
|
|
Shinya Kitaoka |
120a6e |
prop = 0;
|
|
Shinya Kitaoka |
120a6e |
} else {
|
|
Shinya Kitaoka |
120a6e |
if (!prop || style != prop->getColorStyle()) {
|
|
Shinya Kitaoka |
120a6e |
stroke->setProp(style->makeStrokeProp(stroke));
|
|
Shinya Kitaoka |
120a6e |
prop = stroke->getProp();
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Shinya Kitaoka |
120a6e |
///
|
|
Shinya Kitaoka |
120a6e |
//---------------------
|
|
Shinya Kitaoka |
120a6e |
if (prop) prop->draw(rd);
|
|
Shinya Kitaoka |
120a6e |
//---------------------
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
tglColor(TPixel32::White);
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
glDisable(GL_BLEND);
|
|
Shinya Kitaoka |
120a6e |
glDisable(GL_LINE_SMOOTH);
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
#endif
|
|
Toshihiro Shimizu |
890ddd |
//-----------------------------------------------------------------------------
|