Exemple #1
0
int CTaskDialog::AppendFooterIcon(int& x, int y)
{
	int cx = ::GetSystemMetrics(SM_CXSMICON);
	int cy = ::GetSystemMetrics(SM_CYSMICON);
	AddStatic(L"", IDC_FOOTER_ICON, SS_ICON | SS_CENTERIMAGE, 0, x, y, cx, cy);
	x += cx;
	return cy;
}
Exemple #2
0
int CTaskDialog::AppendMainIcon(int& x, int y)
{
	int cx = ::GetSystemMetrics(SM_CXICON);
	int cy = ::GetSystemMetrics(SM_CYICON);
	AddStatic(L"", IDC_MAIN_ICON, SS_ICON | SS_CENTERIMAGE, 0, x, y, cx, cy);
	x += cx;
	return cy;
}
Exemple #3
0
void SpawnInertStatic (int x, int y, int z, int mtype)
{statobj_t * temp;




 if (!firstemptystat)
	{temp = (statobj_t*)Z_LevelMalloc(sizeof(statobj_t),PU_LEVELSTRUCT,NULL);
	 //SoftError("\nMalloc-ing actor");
	 //if (insetupgame)
	  //	SoftError("in setup");
	}

 else
	{temp = lastemptystat;
	 //SoftError("\nfree actor available");
	 RemoveFromFreeStaticList(lastemptystat);
	}

 if (temp)
  {  memset(temp,0,sizeof(*temp));
	  temp->shapenum = stats[mtype].picnum;

	  temp->whichstat = statcount ++;
	  temp->tilex = x>>16;
	  temp->tiley = y>>16;
	  temp->x = x;
	  temp->y = y;
	  temp->areanumber = MAPSPOT(temp->tilex,temp->tiley,0)-AREATILE;
	  temp->linked_to = -1;
	  if ((temp->areanumber<=0) || (temp->areanumber>NUMAREAS))
		  {
		  int tilex=temp->tilex;
		  int tiley=temp->tiley;

		  FindEmptyTile(&tilex,&tiley);
		  temp->areanumber = MAPSPOT(tilex,tiley,0)-AREATILE;
		  }
	  temp->z=z;
	  temp->visspot = &spotvis[temp->tilex][temp->tiley];
	  temp->which = SPRITE;
	  temp->ticcount = stats[mtype].tictime;
	  temp->hitpoints = stats[mtype].hitpoints;
	  temp->itemnumber = stats[mtype].type;
	  temp->flags = (stats[mtype].flags|FL_ABP|FL_NONMARK);
     if (fog)
       {temp->shapenum++;
        temp->flags &= ~FL_TRANSLUCENT;
       }

     temp->ammo = stats[mtype].ammo;
	  temp->numanims = stats[mtype].numanims;
	  AddStatic(temp);
	  MakeStatActive(temp);
  }
 else
Exemple #4
0
int CTaskDialog::AppendMainInstruction(int x, int y, int cx, int cy)
{
	ATLASSERT(hFontInstruction_ != 0);

	HeapResString szStaticText(Instance(), config_.pszMainInstruction);
	CSize extent = GetTextExtent(hFontInstruction_, szStaticText, cx);
	extent.cy = max(extent.cy, cy);
	AddStatic(szStaticText, IDC_MAIN_INSTRUCTION, SS_LEFT | SS_CENTERIMAGE, 0, x, y, cx, extent.cy);

	return extent.cy;
}
bool CRenderableObjectsLayersManager::LoadRenderableObject( const std::string& l_FilePath, const std::string& l_Name, const std::string& l_RoomName )
{
    bool lOk = true;
    CXMLTreeNode l_Node, l_Root;

    if (!l_Root.LoadAndFindNode(l_FilePath.c_str(), "RenderableObjects", l_Node))
    {
        return false;
    }

    CRenderableObjectsManager *lRenderableObjectManager = new CRenderableObjectsManager();
    uint32 l_NumChilds = l_Node.GetNumChildren();
    m_ResourcesVector.reserve( l_NumChilds );

    for (uint32 i = 0; i < l_NumChilds; ++i)
    {
        const CXMLTreeNode& lNode = l_Node( i );
        const std::string& lTagName = lNode.GetName();
        const std::string& lName = lNode.GetAttribute<std::string>( "name", "" );

        CRenderableObject* p_object = NULL;
        if ( lTagName == "MeshInstance" )
        {
            const std::string& lType = lNode.GetAttribute<std::string>( "type", "static" );
            p_object = ( lType == "static" ) ? AddStatic( lNode ) : AddDynamic( lNode );
        }
        else if ( lTagName == "AnimatedInstance" )
        {
            p_object = new CAnimatedInstanceModel( lNode );
        }

        if( p_object )
        {
            p_object->SetRoomName( l_RoomName );
            if (!lRenderableObjectManager->AddResource(lName, p_object))
            {
                LOG_ERROR_APPLICATION( "Error adding renderable object %s!", lName.c_str() );
                CHECKED_DELETE( p_object );
            }
        }
    }

     if(!AddResource(l_Name, lRenderableObjectManager))
     {
         CHECKED_DELETE(lRenderableObjectManager);
         ASSERT(false, "The layer %s could not be added", l_Name.c_str());

         return false;
     }

     return true;
}
Exemple #6
0
int CTaskDialog::AppendFooter(int x, int y, int cx, int cy)
{
	HeapResString szStaticText(Instance(), config_.pszFooter);
	CSize extent = GetTextExtent(hFont_, szStaticText, cx);
	extent.cy = max(extent.cy, cy);

	if (HasFlag(TDF_ENABLE_HYPERLINKS))
		AddHyperLink(szStaticText, IDC_FOOTER, WS_TABSTOP, 0, x, y, cx, extent.cy);
	else
		AddStatic(szStaticText, IDC_FOOTER, SS_LEFT, 0, x, y, cx, extent.cy);

	return extent.cy;
}
Exemple #7
0
int CTaskDialog::AddContent(int x, int y, int cx)
{
	ATLASSERT(hFontContent_ != 0);

	HeapResString szStaticText(Instance(), config_.pszContent);
	CSize extent = GetTextExtent(hFontContent_, szStaticText, cx);

	if (HasFlag(TDF_ENABLE_HYPERLINKS))
		AddHyperLink(szStaticText, IDC_CONTENT, WS_TABSTOP, 0, x, y, extent.cx, extent.cy);
	else
		AddStatic(szStaticText, IDC_CONTENT, SS_LEFT, 0, x, y, extent.cx, extent.cy);

	return extent.cy;
}
Exemple #8
0
void SpawnStatic (int tilex, int tiley, int mtype, int zoffset)
{statobj_t * temp;
 boolean onetimer;



#if (SHAREWARE == 1)
   switch(mtype)
      {
      case stat_rlight:
      case stat_glight:
      case stat_ylight:
      case stat_chandelier:
         mtype = stat_blight;
         break;

      case stat_garb1:
      case stat_garb2:
      case stat_garb3:
      case stat_shit:
         mtype = stat_metalshards;
         break;

      case stat_lamp:
         mtype = stat_altbrazier2;
         break;

      }
#endif



   if ( BATTLEMODE )
      {
      if ( !gamestate.BattleOptions.SpawnWeapons )
         {
         if ( stats[ mtype ].flags & FL_WEAPON )
            {
            return;
            }
         }

      if (mtype == stat_pit)
         return;

      // Change lifeitems and extra lives to health
      switch( mtype )
         {
         case stat_lifeitem1 :
         case stat_lifeitem2 :
            mtype = stat_monkcrystal1;
            break;

         case stat_lifeitem3 :
         case stat_lifeitem4 :
         case stat_oneup :
         case stat_threeup :
            mtype = stat_monkcrystal2;
            break;
         }

      switch( mtype )
         {
         case stat_monkmeal :
         case stat_priestporridge :
         case stat_monkcrystal1 :
         case stat_monkcrystal2 :
         case stat_healingbasin :
            if ( ( gamestate.Product != ROTT_SHAREWARE ) &&
               ( gamestate.BattleOptions.SpawnMines ) &&
               ( !IsPlatform( tilex, tiley ) &&
               ( ( zoffset & 0xff00 ) != 0xb000 ) ) &&
               ( zoffset == -1 ) )
               {
               mtype = stat_mine;
               }
            else if ( !gamestate.BattleOptions.SpawnHealth )
               {
               return;
               }
            break;
         }
      }

 if (!firstemptystat)
	{temp = (statobj_t*)Z_LevelMalloc(sizeof(statobj_t),PU_LEVELSTRUCT,NULL);
	 //SoftError("\nMalloc-ing actor");
	 //if (insetupgame)
	  //	SoftError("in setup");
	}

 else
	{temp = lastemptystat;
	 //SoftError("\nfree actor available");
	 RemoveFromFreeStaticList(lastemptystat);
	}

 // Standard pole hack

 if ((zoffset>=14) && (zoffset<=17))
	 zoffset=-1;

 if (temp)
  {  memset(temp,0,sizeof(*temp));
	  temp->shapenum = stats[mtype].picnum;
	  temp->whichstat = statcount ++;
	  temp->tilex = tilex;
	  temp->tiley = tiley;
	  temp->x = ((long)tilex << TILESHIFT) + 0x8000;
	  temp->y = ((long)tiley << TILESHIFT) + 0x8000;
	  temp->areanumber = MAPSPOT(tilex,tiley,0)-AREATILE;
	  temp->linked_to = -1;
	  if ((temp->areanumber<=0) || (temp->areanumber>NUMAREAS))
		  Error ("Sprite at x=%d y=%d type=%d has an illegal areanumber\n",tilex,tiley,mtype);
     if ( mtype == stat_mine )
        {
        temp->z = nominalheight;
        }
     else if (zoffset!=-1)
		  {
		  if ((zoffset&0xff00)==0xb000)
           Set_NewZ_to_MapValue(&(temp->z),zoffset,"static",tilex,tiley);
		  else if (IsPlatform(tilex,tiley))
			  temp->z = PlatformHeight(tilex,tiley);
		  else if (zoffset==11)
			  temp->z=-65;
		  else if (zoffset==12)
			  temp->z=-66;
		  else
			  temp->z = nominalheight;
			 // Error ("You didn't specify a valid height over the sprite at tilex=%ld tiley=%ld\n",tilex,tiley);
		  }
	  else if (mtype>stat_chandelier)
		  temp->z = nominalheight;

	  temp->visspot = &spotvis[tilex][tiley];
	  temp->which = SPRITE;
	  temp->ticcount = stats[mtype].tictime;
	  temp->hitpoints = stats[mtype].hitpoints;
	  temp->itemnumber = stats[mtype].type;
     temp->flags = stats[mtype].flags;
	  temp->ammo = stats[mtype].ammo;
	  temp->numanims = stats[mtype].numanims;




     if (temp->flags & FL_BONUS)
		switch  (stats[mtype].type)
		  {case stat_lifeitem1:
			case stat_lifeitem2:
			case stat_lifeitem3:
			case stat_lifeitem4:
			 gamestate.treasuretotal++;
			 break;
		  default:
		      ;
		  }




      AddStatic(temp);

     onetimer = ((mtype == stat_rubble) || (mtype == stat_woodfrag) ||
                 (mtype == stat_metalfrag) || (mtype == stat_missmoke)
                );

     if (DoPanicMapping())
        {
        if (temp->numanims && (!onetimer))
           {
           temp->flags &= ~FL_ACTIVE;
           temp->numanims = 0;
           GameRandomNumber("SpawnStatic",mtype);
           }
        }

     else
        {
        if (temp->numanims)
           {
           if (!onetimer)
              temp->count = (int)(((int)GameRandomNumber("SpawnStatic",mtype) % stats[mtype].numanims) + 1);
           else
              temp->count = 0;
           }
        else if (temp->itemnumber == stat_standardpole)
           {
           if (MAPSPOT(temp->tilex,temp->tiley,2))
              temp->count = 2*(MAPSPOT(temp->tilex,temp->tiley,2)-14);
           else
              temp->count = 0;
           }

        if ((temp->itemnumber == stat_knifestatue) ||
            (temp->itemnumber == stat_emptystatue) ||
            (temp->itemnumber == stat_standardpole))
           temp->flags|=FL_ROTATING;
        }




     if (mtype != stat_missmoke)
		  sprites[tilex][tiley] = temp;
	  else
		  temp->flags |= FL_NONMARK;


//================ check special junk ==================================//

	  if (temp->itemnumber == stat_dariantouch)
		 {_2Dpoint *tdptr;

		  tdptr = &(MISCVARS->ETOUCH[MISCVARS->nexttouch]);

		  tdptr->x = tilex;
		  tdptr->y = tiley;
		  sprites[tilex][tiley]->linked_to = MISCVARS->nexttouch;
		  MISCVARS->nexttouch ++;
		 }
	  else if ((temp->itemnumber >= stat_touch1) &&
				  (temp->itemnumber <= stat_touch4))
		 {touchindices[tilex][tiley] = lasttouch + 1;
		  SD_PreCacheSoundGroup(SD_TOUCHPLATESND,SD_BADTOUCHSND);
		  lasttouch ++;
		 }

//=====================================================================//
	//bna added
	// BaseMarkerZ used to adjust height in s_basemarker1
	// in SpawnNewObj(i,j,&s_basemarker1,inertobj); 
	BaseMarkerZ=temp->z;//bna++	BaseMarkerZ = spawnz;

     PreCacheStaticFrames(temp);

     PreCacheStaticSounds(temp->itemnumber);

	  if (temp->flags & FL_WEAPON)
		 MISCVARS->NUMWEAPONS ++;
  }
 else
	Error("Z_LevelMalloc failed in SpawnStatic!");

}
Exemple #9
0
void LoadStatics( byte * buffer, int size)
{saved_stat_type dummy;
 int stcount,i;
 statobj_t*temp;

 stcount = size/sizeof(saved_stat_type);
 InitStaticList();

 for(i=0;i<stcount;i++)
	{
	temp = (statobj_t*)Z_LevelMalloc(sizeof(statobj_t),PU_LEVELSTRUCT,NULL);
	if (!temp)
		Error("LoadStatics: Failed on allocation of static %d of %d",i,stcount);
	memset(temp,0,sizeof(*temp));
	memcpy(&(dummy.x),buffer,sizeof(saved_stat_type));
	temp->whichstat = statcount++;
	temp->x = dummy.x;
	temp->y = dummy.y;
	temp->z = dummy.z;
	temp->flags = dummy.flags;
	temp->ticcount = dummy.ticcount;
	temp->hitpoints = dummy.hitpoints;
	temp->shapenum = dummy.shapenum;
	temp->ammo = dummy.ammo;
	temp->count = dummy.count;
	temp->numanims = dummy.numanims;
	temp->itemnumber = dummy.itemnumber;
	temp->areanumber = dummy.areanumber;
	temp->linked_to = dummy.linked_to;

	temp->which = SPRITE;
	temp->tilex = temp->x >> TILESHIFT;
	temp->tiley = temp->y >> TILESHIFT;
	temp->flags &= ~FL_ABP;
	temp->visspot = &spotvis[temp->tilex][temp->tiley];

	if ((temp->itemnumber >= stat_touch1) &&
		 (temp->itemnumber <= stat_touch4))
	  {touchindices[temp->tilex][temp->tiley] = lasttouch + 1;
		lasttouch ++;
		SD_PreCacheSoundGroup(SD_TOUCHPLATESND,SD_BADTOUCHSND);
	  }

	AddStatic(temp);
	if (temp->shapenum != -1)
	  {
     if (temp->itemnumber == stat_bullethole)
		  {
		  SetupBulletHoleLink(temp->linked_to,temp);
		  }

	  else if (temp->flags & FL_DEADBODY)
		  {
        if ( actorat[temp->tilex][temp->tiley] == NULL )
           actorat[temp->tilex][temp->tiley] = temp;
		  }

	  else if (!(temp->flags & FL_NONMARK))
		  {
		  sprites[temp->tilex][temp->tiley] = temp;
		  }

     PreCacheStaticFrames(temp);


	  }
	PreCacheStaticSounds(temp->itemnumber);

	buffer += sizeof(saved_stat_type);
  }
}
void wxZEditNode::BuildInterface(wxGraphNode *pNode)
{
	mEditingNode = pNode;


	BeginPanel();
	if (mEditingNode)
	{
		mNodeName = mEditingNode->GetFunctionName();
		AddFolder(_("Node"));
		AddTextEdit(_("Name"), &mNodeName, 200);
#if 0
		AddStatic("Comments");
		AddScriptEdit(pNode->GetComment(), 2);

		if (pNode->GetType() == GNT_STATE)
		{
			AddFolder("Properties");
		}
#endif
		if (pNode->GetType() == GNT_MESSAGE)
		{
			AddFolder(_("Source code"));
			AddScriptEdit(pNode->GetCode(pNode->GetSubItem()), 2);
		}

		if (mEditingNode->GetType() == GNT_STATE)
		{
			wxString info;
			info = mNodeName+_(" > ");
			info += ((wxGraphNodeState*)mEditingNode)->mCurSelectedButton;
			SetScriptToEdit(info, pNode->GetCode(pNode->GetSubItem()));
		}
	}
	else
	{
		// editing tab

		extern wxNotebook * myNotebook;

		mNodeName = myNotebook->GetPageText(myNotebook->GetSelection());
		AddFolder(_("FSM"));
		AddTextEdit(_("Name"), &mNodeName, 199);
		AddCheckBox(_("Add Raknet packet support"), &mScrollV->mbRaknetMessage);
		AddCheckBox(_("Tick has time parameter"), &mScrollV->mbTickHasTime);
		AddTextEdit(_("State base"), &mScrollV->mStateEnumBase);
		AddTextEdit(_("Message base"), &mScrollV->mMessageEnumBase);
		AddTextEdit(_("Output"), &mScrollV->mOutputFileName);


		std::vector<wxString> mStateList;
		mScrollV->FillNodeList(mStateList, GNT_STATE);
		if (!mStateList.empty())
		{
			wxString mInitialStatesList;
			for (unsigned int i=0;i<mStateList.size()-1;i++)
			{
				mInitialStatesList += mStateList[i]+_("|");
			}
			mInitialStatesList += mStateList[mStateList.size()-1];

			if (mScrollV->mInitialState > (mStateList.size()-1) )
				mScrollV->mInitialState = 0;

			AddCombo(_("Initial State"), mInitialStatesList.c_str(), &mScrollV->mInitialState);
		}
		AddFolder(_("Code"));
		AddStatic(_("Includes"));
		AddScriptEdit(mScrollV->GetIncludes(), 14);
		AddStatic(_("Member Variables"));
		AddScriptEdit(mScrollV->GetMemberVariables(), 14);
		AddStatic(_("Members Init"));
		AddScriptEdit(mScrollV->GetMembersInit(), 14);

		extern wxScriptEditPanel *mEditScriptPanel;
		mEditScriptPanel->SetScriptToEdit(wxT(""), NULL);
	}
	EndPanel();
}
Exemple #11
0
int CTaskDialog::AddFooterDividingLine(int x, int y, int cx)
{
	int cy = ::GetSystemMetrics(SM_CYEDGE);
	AddStatic(L"", IDC_FOOTER_DIVIDER, SS_ETCHEDHORZ, 0, x, y, cx, cy);
	return cy;
}
Exemple #12
0
int CTaskDialog::AddFrame(int x, int y, int cx, int cy)
{
	AddStatic(L"", IDC_FRAME, SS_WHITERECT, 0, x, y, cx, cy);
	return cy;
}