INLINE void ISprite::Reset() { sRelease(pFrameImage); sRelease(pSprite); pAnimation = NULL; pFrame = NULL; pAnimationFrames = NULL; bInitialized = FALSE; bChanged = FALSE; bAnimation = FALSE; bLoop = FALSE; bVisible = TRUE; bPlaying = FALSE; iCurrentFrame = 0; iFrames = 0; fCurrentFrameRate = 1.0f / SPRITE_GLOBAL_FRAME_TIME; fFrameTime = 0.0f; iWidth = 0; iHeight = 0; iHalfWidth = 0; iHalfHeight = 0; fTexS0 = 0; fTexS1 = 0; fTexT0 = 0; fTexT1 = 0; this->SetPriority(0); }
ViewBitmapWin_::~ViewBitmapWin_() { sRelease(MtrlTex); sRelease(MtrlTexAlpha); sRelease(MtrlNormalLight); sRelease(MtrlNormal); }
void sClearSoundInHandler() { sLockSound(); if(DXSIBuffer) DXSIBuffer->Stop(); sRelease(DXSIBuffer); sRelease(DXSI); sUnlockSound(); }
void Exit() { sDelete(Thread); sRelease(Buffer); sRelease(PrimBuffer); sRelease(DS); sDeleteArray(RenderBuffer); Renderers.Reset(); }
void sClearSoundHandler() { sLockSound(); if(DXSOBuffer) DXSOBuffer->Stop(); sRelease(DXSOBuffer); sRelease(DXSOPrimary); sRelease(DXSO); sUnlockSound(); }
INLINE BOOL ISprite::Unload() { sRelease(pFrameImage); sRelease(pSprite); pAnimation = NULL; pFrame = NULL; pAnimationFrames = NULL; bInitialized = FALSE; return TRUE; }
sBool sSetSoundInHandler(sInt freq,sSoundHandler handler,sInt latency) { HRESULT hr; DSCBUFFERDESC desc; IDirectSoundCaptureBuffer *cbuf; static WAVEFORMATEX wfx = { WAVE_FORMAT_PCM,2,freq,freq*4,4,16,0}; // los gehts sClearSoundInHandler(); sLockSound(); cbuf = 0; DXSIRate = freq; DXSISamples = latency; DXSIHandler = handler; // create device hr = DirectSoundCaptureCreate8(0,&DXSI,0); if(FAILED(hr)) goto error; // create buffer sSetMem(&desc,0,sizeof(desc)); desc.dwSize = sizeof(desc); desc.dwBufferBytes = latency*4; desc.lpwfxFormat = &wfx; hr = DXSI->CreateCaptureBuffer(&desc,&cbuf,0); if(FAILED(hr)) goto error; hr = cbuf->QueryInterface(IID_IDirectSoundCaptureBuffer8, (LPVOID*)&DXSIBuffer); sRelease(cbuf); if(FAILED(hr)) goto error; // kick it! hr = DXSIBuffer->Start(DSCBSTART_LOOPING); if(FAILED(hr)) goto error; sUnlockSound(); return 1; error: sRelease(DXSIBuffer); sRelease(DXSI); sUnlockSound(); return 0; }
static sBool sCompileDX9(sCompileResult &result, sInt stype, sInt dtype, sInt flags, const sChar8 *src, sInt len, const sChar8 *name) { #if sCOMP_DX9_ENABLE ID3DXBuffer *bytecode; sRelease(result.D3D9.CTable); sRelease(result.D3D9.Errors); sU32 d3dflags = 0; if(flags&sSCF_DEBUG) d3dflags |= D3DXSHADER_DEBUG; //if (sGetShellSwitch(L"n")) // flags |= D3DXSHADER_SKIPOPTIMIZATION; // only use in case of emergency const sChar8 *profile8 = GetProfile(dtype); sChar profile[16]; sCopyString(profile,profile8,16); // use old compiler for generating shader model 1_* code #ifdef D3DXSHADER_USE_LEGACY_D3DX9_31_DLL if(sMatchWildcard(L"ps_1_*",profile)) d3dflags |= D3DXSHADER_USE_LEGACY_D3DX9_31_DLL; #endif if(D3DXCompileShader(src,len,0,0,name,profile8,d3dflags,&bytecode,&result.D3D9.Errors,&result.D3D9.CTable)!=D3D_OK) result.Valid = sFALSE; else result.Valid = sTRUE; // print errors and warnings if(result.D3D9.Errors) { ID3DXBuffer *buffer = result.D3D9.Errors; //sInt size = buffer->GetBufferSize(); sCopyString(result.Errors,(sChar8*)buffer->GetBufferPointer(),result.Errors.Size()); } if(!result.Valid) { sRelease(bytecode); return sFALSE; } // get source code sAddShaderBlob(result.ShaderBlobs,dtype,bytecode->GetBufferSize(),(const sU8*)bytecode->GetBufferPointer()); return result.Valid; #else return sFALSE; #endif // sCOMP_DX9_ENABLE }
void sCompileResult::Reset() { #if sCOMP_DX9_ENABLE sRelease(D3D9.CTable); sRelease(D3D9.Errors); #endif // sCOMP_DX9_ENABLE #if sCOMP_CG_ENABLE if(Cg.Program) cgDestroyProgram(Cg.Program); #endif // sCOMP_CG_ENABLE ShaderBlobs.Reset(); Valid = sFALSE; Errors = L""; }
postPurchaseOrdersByAgent::postPurchaseOrdersByAgent(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_release, SIGNAL(clicked()), this, SLOT(sRelease())); _agent->setText(omfgThis->username()); }
postPurchaseOrder::postPurchaseOrder(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_po, SIGNAL(valid(bool)), _release, SLOT(setEnabled(bool))); connect(_release, SIGNAL(clicked()), this, SLOT(sRelease())); _captive = false; }
INLINE void SoundSource::Unload() { if (Private::bInitialized) pSoundSystem->Remove(this); if (iSource) alDeleteSources(1, &iSource); sRelease(pSound); stFile.Close(); }
releaseWorkOrdersByPlannerCode::releaseWorkOrdersByPlannerCode(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); QButtonGroup* _dateGroupInt = new QButtonGroup(this); _dateGroupInt->addButton(_startDate); _dateGroupInt->addButton(_dueDate); connect(_release, SIGNAL(clicked()), this, SLOT(sRelease())); _plannerCode->setType(PlannerCode); }
void dspPurchaseReqsByItem::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *, int) { QAction *menuItem; menuItem = pMenu->addAction(tr("Running Availability..."), this, SLOT(sDspRunningAvailability())); menuItem->setEnabled(_privileges->check("ViewInventoryAvailability")); pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Release P/R..."), this, SLOT(sRelease())); menuItem->setEnabled(_privileges->check("MaintainPurchaseOrders")); menuItem = pMenu->addAction(tr("Delete P/R..."), this, SLOT(sDelete())); menuItem->setEnabled(_privileges->check("MaintainPurchaseRequests")); }
/* * Constructs a releasePlannedOrdersByPlannerCode as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * * The dialog will by default be modeless, unless you set 'modal' to * true to construct a modal dialog. */ releasePlannedOrdersByPlannerCode::releasePlannedOrdersByPlannerCode(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_release, SIGNAL(clicked()), this, SLOT(sRelease())); connect(_submit, SIGNAL(clicked()), this, SLOT(sSubmit())); if (!_metrics->boolean("EnableBatchManager")) _submit->hide(); _plannerCode->setType(ParameterGroup::PlannerCode); }
releasePlannedOrdersByPlannerCode::releasePlannedOrdersByPlannerCode(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_release, SIGNAL(clicked()), this, SLOT(sRelease())); connect(_submit, SIGNAL(clicked()), this, SLOT(sSubmit())); if (!_metrics->boolean("EnableBatchManager")) _submit->hide(); _plannerCode->setType(ParameterGroup::PlannerCode); // TODO Always append to existing unreleased Transfer Orders _appendTransferOrder->hide(); _appendTransferOrder->setChecked(TRUE); }
INLINE void ISprite::ReconfigureAnimation() { iFrames = pAnimation->iFrames; bLoop = ((pAnimation->iFlags & Seed::FlagLooped) == Seed::FlagLooped); bAnimation = ((pAnimation->iFlags & Seed::FlagAnimated) == Seed::FlagAnimated); fFrameTime = 0.0f; pFrame = &pAnimationFrames[iCurrentFrame]; sRelease(pFrameImage); pFrameImage = static_cast<ITexture *>(pRes->Get(_F(pFrame->iFileId), Seed::ObjectTexture, pPool)); this->ReconfigureFrame(); if (this->bAnimation) this->Play(); }
void dspPurchaseReqsByItem::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *) { int menuItem; menuItem = pMenu->insertItem(tr("Running Availability..."), this, SLOT(sDspRunningAvailability()), 0); if (!_privileges->check("ViewInventoryAvailability")) pMenu->setItemEnabled(menuItem, FALSE); pMenu->insertSeparator(); menuItem = pMenu->insertItem(tr("Release P/R..."), this, SLOT(sRelease()), 0); if (!_privileges->check("MaintainPurchaseOrders")) pMenu->setItemEnabled(menuItem, FALSE); menuItem = pMenu->insertItem(tr("Delete P/R..."), this, SLOT(sDelete()), 0); if (!_privileges->check("MaintainPurchaseRequests")) pMenu->setItemEnabled(menuItem, FALSE); }
void ISprite::Update(f32 delta) { //IBasicMesh::Update(delta); if (bPlaying && bAnimation) { fFrameTime += delta; if (fFrameTime > fCurrentFrameRate) { fFrameTime -= fCurrentFrameRate; if (iCurrentFrame + 1 == iFrames) { if (bLoop) { iCurrentFrame = 0; } else { bChanged = FALSE; } } else iCurrentFrame++; u32 oldId = pFrame->iFileId; pFrame = &pAnimationFrames[iCurrentFrame]; if (oldId != pFrame->iFileId) { sRelease(pFrameImage); pFrameImage = static_cast<ITexture *>(pRes->Get(_F(pFrame->iFileId), Seed::ObjectTexture, pPool)); } this->ReconfigureFrame(); } } if (!bChanged && !this->IsChanged()) return; uPixel p = iColor; p.rgba.r = iColor.argb.r; p.rgba.g = iColor.argb.g; p.rgba.b = iColor.argb.b; p.rgba.a = iColor.argb.a; if (!arCustomVertexData) { arCurrentVertexData = &vert[0]; vert[0].cVertex = Vector3f(-fAspectHalfWidth, -fAspectHalfHeight, (f32)iPriority); vert[0].iColor = p; vert[0].cCoords = Point2f(fTexS0, fTexT0); vert[1].cVertex = Vector3f(+fAspectHalfWidth, -fAspectHalfHeight, (f32)iPriority); vert[1].iColor = p; vert[1].cCoords = Point2f(fTexS1, fTexT0); vert[2].cVertex = Vector3f(-fAspectHalfWidth, +fAspectHalfHeight, (f32)iPriority); vert[2].iColor = p; vert[2].cCoords = Point2f(fTexS0, fTexT1); vert[3].cVertex = Vector3f(+fAspectHalfWidth, +fAspectHalfHeight, (f32)iPriority); vert[3].iColor = p; vert[3].cCoords = Point2f(fTexS1, fTexT1); } else { arCurrentVertexData = arCustomVertexData; } f32 ratio = pScreen->GetAspectRatio(); f32 x = fAspectHalfWidth + ISprite::GetX(); f32 y = fAspectHalfHeight + ISprite::GetY() * ratio; f32 lx = ISprite::GetLocalX(); f32 ly = ISprite::GetLocalY() * ratio; Matrix4x4f t1, t2, r, s; t1 = TranslationMatrix(lx + x, ly + y, 0.0f); r = RotationMatrix(AxisZ, DegToRad(ISprite::GetRotation())); s = ScaleMatrix(ISprite::GetScaleX(), ISprite::GetScaleY(), 1.0f); t2 = TranslationMatrix(-lx, -ly, 0.0f); Matrix4x4f transform = ((t1 * r) * s) * t2; if (bTransformationChanged || !arCustomVertexData) { for (u32 i = 0; i < iNumVertices; i++) { transform.Transform(arCurrentVertexData[i].cVertex); } } bChanged = FALSE; bTransformationChanged = FALSE; }
GenSplineMeta::~GenSplineMeta() { for(sInt i=0;i<sCOUNTOF(Splines);i++) sRelease(Splines[i]); }
GenSplineShaker::~GenSplineShaker() { sRelease(Parent); }
void plannedSchedules::sPopulateMenu(QMenu* pMenu) { int menuItem; menuItem = pMenu->insertItem(tr("Release"), this, SLOT(sRelease()), 0); }
~sAutoPtr() { sRelease(ptr); }
sAutoPtr& operator= (const sAutoPtr &p) { sRelease(ptr); sAddRef(ptr=p.ptr); return *this; }