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
|
|
Toshihiro Shimizu |
890ddd |
void tglDraw(const TVectorRenderData &rd, const TStroke *s)
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
assert(s);
|
|
Toshihiro Shimizu |
890ddd |
if (!s)
|
|
Toshihiro Shimizu |
890ddd |
return;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
const TStroke &stroke = *s;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
// initialize information for aaliasing
|
|
Toshihiro Shimizu |
890ddd |
glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
|
|
Toshihiro Shimizu |
890ddd |
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
|
Toshihiro Shimizu |
890ddd |
glEnable(GL_BLEND);
|
|
Toshihiro Shimizu |
890ddd |
glEnable(GL_LINE_SMOOTH);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
// it's necessary to do line function of pixel size ?
|
|
Toshihiro Shimizu |
890ddd |
glLineWidth((float)1.0);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
assert(rd.m_palette);
|
|
Toshihiro Shimizu |
890ddd |
TStrokeProp *prop = stroke.getProp(/*rd.m_palette*/);
|
|
Toshihiro Shimizu |
890ddd |
/////questo codice stava dentro tstroke::getprop/////////
|
|
Toshihiro Shimizu |
890ddd |
TColorStyle *style = rd.m_palette->getStyle(stroke->getStyle() /*m_imp->m_styleId*/);
|
|
Toshihiro Shimizu |
890ddd |
if (!style->isStrokeStyle() || style->isEnabled() == false) {
|
|
Toshihiro Shimizu |
890ddd |
prop = 0;
|
|
Toshihiro Shimizu |
890ddd |
} else {
|
|
Toshihiro Shimizu |
890ddd |
if (!prop || style != prop->getColorStyle()) {
|
|
Toshihiro Shimizu |
890ddd |
stroke->setProp(style->makeStrokeProp(stroke));
|
|
Toshihiro Shimizu |
890ddd |
prop = stroke->getProp();
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
///
|
|
Toshihiro Shimizu |
890ddd |
//---------------------
|
|
Toshihiro Shimizu |
890ddd |
if (prop)
|
|
Toshihiro Shimizu |
890ddd |
prop->draw(rd);
|
|
Toshihiro Shimizu |
890ddd |
//---------------------
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
tglColor(TPixel32::White);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
glDisable(GL_BLEND);
|
|
Toshihiro Shimizu |
890ddd |
glDisable(GL_LINE_SMOOTH);
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
#endif
|
|
Toshihiro Shimizu |
890ddd |
//-----------------------------------------------------------------------------
|