I know R16 is old history by now, but I still want to keep my plugins compatible as much as possible.
I had updated the R20 version of the plugin, and wanted to port back the updates to R19. However, due to compatibility reason, the plugin is being developed with the R16 SDK.
Following is an excerpt of the implementation that was ported to R16.
const COLORMODE colorMode = COLORMODE_ARGB;
MultipassBitmap* multiBitmap = MultipassBitmap::Alloc(mBitmapSize, mBitmapSize, colorMode);
MultipassBitmap* layer = multiBitmap->GetLayerNum(0);
layer->SetParameter(MPBTYPE_NAME, "Background");
layer->SetParameter(MPBTYPE_SAVE, true);
layer->SetParameter(MPBTYPE_SHOW, true);
// draw onto this layer via a ClipMap
AutoAlloc<GeClipMap> clipMap;
if (clipMap && (clipMap->Init(layer) == IMAGERESULT_OK))
{
viewData->mClipmap = clipMap.operator GeClipMap *();
clipMap->BeginDraw();
viewData->DrawBackground();
...
void ViewData::DrawBackground()
{
Vector color(128);
mClipmap->SetColor(SAFEINT32(color.x), SAFEINT32(color.y), SAFEINT32(color.z), 255);
mClipmap->FillRect(0, 0, mClipmap->GetBw() - 1, mClipmap->GetBh() - 1);
...
Building the plugin (with R16 SDK) and running it from Cinema 4D R19 yields no problem.
However, when running in R16.050 it just locks up, or when ran in debug from VisualStudio it crashes when FillRect
, or any other GeClipMap
drawing function is performed.
Now, I understand no support can be given for R16, but I just wanted to make sure it was a problem then (which has been fixed since). Or if I need to do something different in R16 to make it work.
Have not yet tested with R17 or R18 to know where the boundary "works / does not work" actually is.