예제 #1
0
파일: world.cpp 프로젝트: oMystique/IIP
void World::InitWorldObjects() {
	InitTextures();
	InitImages();
	InitSounds();
	InitObjects();
	InitSprites();
}
예제 #2
0
/** ComplxFrame
  *
  * Constructor
  */
ComplxFrame::ComplxFrame(const ComplxFrame::Options& opts) :
    ComplxFrameDecl(NULL, wxID_ANY, opts.title, wxDefaultPosition, wxSize(opts.width, opts.height)), console(NULL), memoryView(NULL), base_title(opts.title)
{
    InitImages();

    menuViewInstructionHighlighting->Check(opts.highlight);
    menuViewBasic->Check(opts.disassemble == 0);
    menuViewNormal->Check(opts.disassemble == 1);
    menuViewHighLevel->Check(opts.disassemble == 2);

    this->stack_size = opts.stack_size;
    this->call_stack_size = opts.call_stack_size;

    DoLoadFile(opts.loading_options);

    memoryView = new MemoryView();
    memory->SetView(memoryView, opts.exact_column_sizing, opts.column_sizes);
    memory->SetDisassembleLevel(opts.disassemble);
    memory->SetUnsignedMode(false);
    memory->SetHighlight(opts.highlight);

    int widths[5] = {-6, -2, -2, -2, -2};
    int styles[5] = {wxSB_NORMAL, wxSB_NORMAL, wxSB_NORMAL, wxSB_NORMAL, wxSB_NORMAL};
    statusBar->SetStatusWidths(5, widths);
    statusBar->SetStatusStyles(5, styles);

    UpdateMemory();
    UpdateStatus();

    Connect(wxID_ANY, wxEVT_COMMAND_RUNTHREAD_COMPLETED, wxThreadEventHandler(ComplxFrame::OnRunComplete));
    Connect(wxID_ANY, wxEVT_COMMAND_RUNTHREAD_IO, wxThreadEventHandler(ComplxFrame::OnIo));
    Connect(wxID_ANY, wxEVT_COMMAND_RUNTHREAD_NOIO, wxThreadEventHandler(ComplxFrame::OnNoIo));
    Connect(wxID_ANY, wxEVT_COMMAND_RUNTHREAD_OUTPUT, wxThreadEventHandler(ComplxFrame::OnOutput));
}
예제 #3
0
void CMainWnd::OnToolOption()
{
	m_pOptions->ShowOptionDlg(m_hWnd, m_hMap);
	MAP_SetScanPeek(m_hMap, m_pOptions->m_fDrawPeek);

	// 再描画する
	DeleteImages();
	InitImages();
	InvalidateRect(m_hWnd, NULL, TRUE);
	UpdateWindow(m_hWnd);
}
예제 #4
0
void CPpcMainWnd::OnSize(UINT nType, int cx, int cy)
{
	DeleteImages();
	InitImages();

	RECT rc;
	MoveWindow(m_hwndLV, PPC_PLAYLIST_LEFT, PPC_PLAYLIST_TOP, PPC_PLAYLIST_WIDTH, PPC_PLAYLIST_HEIGHT, TRUE);
	GetWindowRect(m_hwndLV, &rc);
	SendMessage(m_hwndLV, LVM_SETCOLUMNWIDTH, 0, 
		MAKELPARAM(RECT_WIDTH(&rc) - GetSystemMetrics(SM_CXVSCROLL) - GetSystemMetrics(SM_CXBORDER) * 2, 0));

	InvalidateRect(m_hWnd, NULL, TRUE);
	UpdateWindow(m_hWnd);
}
예제 #5
0
bool CAGEmotionSetup::Create() {
  setUseEmoticons(false);
  cleanup();
  const string l_CurentName = SETTING(EMOTICONS_FILE);
  if (l_CurentName == "Disabled") {
    return true; 
  }
  LoadEmotion(l_CurentName); //[+]PPA
#ifndef _DEBUG
  loadOtherPacks(l_CurentName);
#endif
  InitImages();
  setUseEmoticons(true);
  return true;
}
예제 #6
0
int main(int argc, char **argv)
{	
    // Output usage message
    std::cout << "Osg3DMarkerField example" << std::endl;
	std::cout << "==============" << std::endl;
    std::cout << std::endl;
    std::cout << "Description:" << std::endl;
    std::cout << "  This is an example of how to use the 'MultiMarkerBundle' class " << std::endl;
	std::cout << "  to automatically deduce and optimize 'Multimarker' setups." << std::endl;
    std::cout << "  The program deduces the relative poses and positions of markers that have been" << std::endl;
	std::cout << "  laid in any 3D configuration. Then the program uses the deduced marker" << std::endl;
	std::cout << "  configuration for tracking and overlays an OSG model to the scene." << std::endl;
    std::cout << std::endl;
    std::cout << "Possible command line parameters:" << std::endl;
    std::cout << "  <the number of the capture device to use>" << std::endl;
    std::cout << "  <camera calibration file>" <<  std::endl;
    std::cout << "  <pose marker id (0-11)>" << std::endl;
    std::cout << std::endl;
	std::cout << "Keyboard Shortcuts (these work only when AR window is selected):" << std::endl;
    std::cout << "  q: quit" << std::endl;
    std::cout << "  r: reset" << std::endl;
    std::cout << std::endl;

	size_t use_cap = 0;
	std::string calib_file = "calib.xml";
	if (argc > 1) 
		use_cap = atoi(argv[1]);
	if (argc > 2) 
		calib_file = argv[2];
	if (argc > 3) 
	{
		pose_marker = atoi(argv[3]);
		if( pose_marker<0 || pose_marker>=nof_markers )
			pose_marker = 0;
	}

	if (InitVideoCapture(use_cap) && 
		InitImages(_width, _height, _origin) && 
		InitOSG(_width, _height, true, "axes.osg", calib_file)) 
	{
		Process();
		CleanUp();
		return 0;
	}
	CleanUp();
	return -1;
}
예제 #7
0
/** ComplxFrame
  *
  * Constructor
  */
ComplxFrame::ComplxFrame(long decimal, long disassemble, long stack_size, long true_traps, long interrupts, long highlight,
                         wxString address_str, wxString state_file, wxArrayString files) : ComplxFrameDecl(NULL), console(NULL), memoryView(NULL)
{
    InitImages();

    menuStateTrueTraps->Check(true_traps == 1);
    menuStateInterrupts->Check(interrupts == 1);
    menuViewInstructionHighlighting->Check(highlight != 0);
    menuViewUnsignedDecimal->Check(decimal == 1);

    this->stack_size = stack_size;
    OnInit();

    if (!address_str.IsEmpty())
    {
        int addr;
        lc3_calculate(state, address_str.ToStdString(), addr);
        state.pc = addr;
    }

    if (!state_file.IsEmpty()) DoLoadMachine(wxFileName(state_file));
    if (files.size() > 0) DoLoadFile(wxFileName(files[0]));

    memoryView = new MemoryView();
    memory->SetView(memoryView);
    memory->SetDisassembleLevel(disassemble > 2 ? 2 : disassemble);
    memory->SetUnsignedMode(decimal > 1 ? 0 : decimal);
    memory->SetHighlight(highlight > 1 ? 1 : highlight);

    int widths[3] = {-7, -3, -3};
    int styles[3] = {wxSB_NORMAL, wxSB_NORMAL, wxSB_NORMAL};
    statusBar->SetStatusWidths(3, widths);
    statusBar->SetStatusStyles(3, styles);

    UpdateMemory();
    UpdateStatus();

    Connect(wxID_ANY, wxEVT_COMMAND_RUNTHREAD_COMPLETED, wxThreadEventHandler(ComplxFrame::OnRunComplete));
    Connect(wxID_ANY, wxEVT_COMMAND_RUNTHREAD_UPDATE, wxThreadEventHandler(ComplxFrame::OnRunUpdate));
    Connect(wxID_ANY, wxEVT_COMMAND_RUNTHREAD_IO, wxThreadEventHandler(ComplxFrame::OnIo));
    Connect(wxID_ANY, wxEVT_COMMAND_RUNTHREAD_NOIO, wxThreadEventHandler(ComplxFrame::OnNoIo));
    Connect(wxID_ANY, wxEVT_COMMAND_RUNTHREAD_OUTPUT, wxThreadEventHandler(ComplxFrame::OnOutput));
}
예제 #8
0
파일: life.c 프로젝트: viva-calman/Life
int main (int argc, char *argv[])
{
    Uint8* mouse;
    bool start=false;
    bool exitstate=false;
    int clickx,clicky;

    ClearField();

    if(SDL_Init(SDL_INIT_VIDEO)<0)
    {
        printf("Unable to init SDL: %s\n",SDL_GetError());
        exit(1);
    }
    atexit(SDL_Quit);

    SDL_WM_SetCaption("Life game","life");
    screen=SDL_SetVideoMode(640,480,32,SDL_HWSURFACE|SDL_DOUBLEBUF);

    if(screen==NULL)
    {
        printf("unable to set 640x480 video %s\n",SDL_GetError());
        exit(1);
    }
    InitImages();
    DrawIMG(background,0,0);
    while(exitstate==false)
    {
        SDL_Event event;
        while(SDL_PollEvent(&event))
        {
            if(event.type==SDL_QUIT)
            {
                exitstate=true;
            }
            if(event.type==SDL_KEYDOWN)
            {
                if(event.key.keysym.sym=SDLK_ESCAPE)
                {
                    exitstate=true;
                }
            }
            if(event.type==SDL_MOUSEBUTTONUP)
            {
                clickx=event.button.x;
                clicky=event.button.y;
                if(clicky>450 && clickx<320)
                {
                    if(start==false)
                    {
                        start=true;
                    }
                    else
                    {
                        start=false;
                    }
                }
                if(clicky>450 && clickx>320)
                {
                    ClearField();
                    start=false;
                }
                if(clicky<450 && start==false)
                {
                    SetPoint(clickx,clicky);
                }

            }
        }
        if(start==true)
        {
            SDL_Delay(500);
            NextGen();
        }
        ReDraw();


    }
    return 0;
}
예제 #9
0
파일: main.cpp 프로젝트: alexkam/air-hockey
/* ------------------------------------------- */
int main(int argc, char *argv[]){

 Uint8* keys;
 char mes[100];

 if ( SDL_Init(SDL_INIT_AUDIO|SDL_INIT_VIDEO) < 0 ){
   printf("Unable to init SDL: %s\n", SDL_GetError());
   exit(1);
 }

 atexit(SDL_Quit);

if(Mix_OpenAudio(44100, AUDIO_S16SYS, 2, 2048) < 0)
  {
    printf("Warning: Couldn't set 44100 Hz 16-bit audio\n- Reason: %s\n",
							SDL_GetError());
  }
    music = Mix_LoadMUS("(sblu)moon6.xm");



 SDL_WM_SetCaption("arcanoid","arcanoid");
 SDL_WM_SetIcon(SDL_LoadBMP("icon.bmp"), NULL);


 screen = SDL_SetVideoMode(640, 480, 32, SDL_SWSURFACE);
 if ( screen == NULL ){
   printf("Unable to set 640x480 video: %s\n", SDL_GetError());
   exit(1);
 }

 InitImages();
 InitGame();


CreateThread(NULL, 0, GoBall , (LPVOID)0, NULL, NULL);

DrawScene();
 int done=0;
 while(done == 0)
 {

   SDL_Event event;

   while ( SDL_PollEvent(&event) )
   {
     if ( event.type == SDL_QUIT ){ done = 1; }
     if ( event.type == SDL_KEYDOWN )
     {
       if ( event.key.keysym.sym == SDLK_ESCAPE ){ done = 1; }
     }
   }

    if (NewGame)
    {
        bool t= false;
        if ((Win1!=5)&&(Win2!=5))
        {
            InitGame();
            CreateThread(NULL, 0, GoBall , (LPVOID)0, NULL, NULL);
        }

        if (Win1==5)
        {
            strcpy(mes, "The first one wins!\nDo you want to play again?");
            t= true;
        } else
        if (Win2==5)
        {
            strcpy(mes, "The second one wins!\nDo you want to play again?");
            t=true;
        }
        if (t)
        if (MessageBoxA(NULL, mes, "Game Over", MB_YESNO)==IDYES)
        {
            InitGame();
            CreateThread(NULL, 0, GoBall , (LPVOID)0, NULL, NULL);
        } else
            break;

    }


   keys = SDL_GetKeyState(NULL);

   if(keys[SDLK_UP])
   {
       if (ypos-3>=VG)
        ypos -= 3;
   }
   if(keys[SDLK_DOWN])
   {
       if (ypos+3<=480-85)
        ypos += 3;
   }


   if(keys[SDLK_w])
   {
       if (ypos1-3>=VG)
        ypos1 -= 3;
   }

    if(keys[SDLK_s])
    {
        if (ypos1+3<=480-85)
         ypos1 += 3;
    }


    while (redraw)
    {

    }
    DrawScene();
 }
 CloseThread= true;
SDL_Quit();
 return 0;

}
예제 #10
0
ALERROR CUniverse::InitFromXML (SDesignLoadCtx &Ctx,
								CXMLElement *pElement, 
								CResourceDb &Resources)

//	InitFromXML
//
//	Initializes the universe from an XML database

	{
	ALERROR error;
	int i;
	CIDTable UNIDMap(FALSE, FALSE);

	m_bNoImages = Ctx.bNoResources;

	//	Initialize code chain

	if (error = m_CC.Boot())
		return error;

	if (error = InitCodeChainPrimitives())
		return error;

	//	Create some fonts

	m_MapLabelFont.Create(MAP_LABEL_TYPEFACE, 12);
	m_SignFont.Create(SIGN_TYPEFACE, 11, true);

	//	Make sure we have the right version

	if (!Ctx.bNoVersionCheck)
		{
		DWORD dwVersion;

		//	Make sure we have the latest version of the .XML

		dwVersion = (DWORD)pElement->GetAttributeInteger(VERSION_ATTRIB);
		if (fileGetProductVersion() > dwVersion)
			{
			if (Resources.IsUsingExternalGameFile())
				Ctx.sError = CONSTLIT("External definitions file (Transcendence.xml) is obsolete.\nPlease remove 'Transcendence.xml' file from game folder.");
			else
				Ctx.sError = CONSTLIT("Source definitions file (Transcendence.xml) is obsolete.\nPlease download the latest version at http://www.neurohack.com/transcendence/Downloads.html.");
			return ERR_FAIL;
			}

		//	Make sure we have the latest version of the .EXE

		dwVersion = (DWORD)pElement->GetAttributeInteger(MIN_VERSION_ATTRIB);
		if (fileGetProductVersion() < dwVersion)
			{
			Ctx.sError = CONSTLIT("Source definitions file (Transcendence.xml) requires a newer version of Transcendence.exe.\nPlease download the latest version at http://www.neurohack.com/transcendence/Downloads.html.");
			return ERR_FAIL;
			}
		}

	//	Load the Main XML file

	for (i = 0; i < pElement->GetContentElementCount(); i++)
		{
		CXMLElement *pDesc = pElement->GetContentElement(i);

		if (strEquals(pDesc->GetTag(), IMAGES_TAG))
			error = InitImages(Ctx, pDesc, Resources);
		else if (strEquals(pDesc->GetTag(), SOUNDS_TAG))
			error = InitSounds(Ctx, pDesc, Resources);
		else if (strEquals(pDesc->GetTag(), STATION_TYPE_RESOURCES_TAG))
			error = InitStationTypeResources(Ctx, pDesc);
		else if (strEquals(pDesc->GetTag(), STAR_SYSTEM_TYPES_TAG))
			error = InitStarSystemTypes(Ctx, pDesc);
		else if (strEquals(pDesc->GetTag(), MODULES_TAG))
			error = LoadModules(Ctx, pDesc);
		else
			error = LoadDesignElement(Ctx, pDesc);

		//	Check for error

		if (error)
			return error;
		}

	return NOERROR;
	}
예제 #11
0
//**************************************************************************************************************
//
// Init
//
// connect the object class to the decoration method
//
void nuiDefaultDecoration::Init()
{
  nuiInitDefaultDecorationAtlas();
  
  InitColors();
  InitSelection();
  InitMaps();
  InitIcons();
  InitImages();
    
  nuiWidget::SetDefaultDecoration(nuiObject::GetClassNameIndex(_T("nuiLabel")), &nuiDefaultDecoration::Label);
  nuiWidget::SetDefaultDecoration(nuiObject::GetClassNameIndex(_T("nuiEditText")), &nuiDefaultDecoration::EditText);
  nuiWidget::SetDefaultDecoration(nuiObject::GetClassNameIndex(_T("nuiEditLine")), &nuiDefaultDecoration::EditLine);
  
  nuiWidget::SetDefaultDecoration(nuiObject::GetClassNameIndex(_T("nuiSplitter")), &nuiDefaultDecoration::Splitter);
  
  nuiWidget::SetDefaultDecoration(nuiObject::GetClassNameIndex(_T("nuiTitledPane")), &nuiDefaultDecoration::TitledPane);
  nuiWidget::SetDefaultDecoration(nuiObject::GetClassNameIndex(_T("nuiFolderPane")), &nuiDefaultDecoration::FolderPane);
  
  nuiWidget::SetDefaultDecoration(nuiObject::GetClassNameIndex(_T("nuiButton")), &nuiDefaultDecoration::Button);
  nuiWidget::SetDefaultDecoration(nuiObject::GetClassNameIndex(_T("nuiRadioButton")), &nuiDefaultDecoration::RadioButton);
  nuiWidget::SetDefaultDecoration(nuiObject::GetClassNameIndex(_T("nuiCloseButton")), &nuiDefaultDecoration::CloseButton);
  nuiWidget::SetDefaultDecoration(nuiObject::GetClassNameIndex(_T("nuiToggleButton")), &nuiDefaultDecoration::ToggleButton);
  
  nuiWidget::SetDefaultDecoration(nuiObject::GetClassNameIndex(_T("nuiKnob")), &nuiDefaultDecoration::KnobSequence);

  nuiWidget::SetDefaultDecoration(nuiObject::GetClassNameIndex(_T("nuiComboBox")), &nuiDefaultDecoration::ComboBox);

  // dialogs
  nuiWidget::SetDefaultDecoration(nuiObject::GetClassNameIndex(_T("nuiDialog::Title")), &nuiDefaultDecoration::Dialog_Title);
  
  nuiWidget::SetDefaultDecoration(nuiObject::GetClassNameIndex(_T("nuiDialog::EditLine")), &nuiDefaultDecoration::Dialog_EditLine);
  nuiWidget::SetDefaultDecoration(nuiObject::GetClassNameIndex(_T("nuiMessageBox::Title")), &nuiDefaultDecoration::MessageBox_Title);
  
  
  // FileSelector
  nuiWidget::SetDefaultDecoration(nuiObject::GetClassNameIndex(_T("nuiFileSelector::FolderView")), &nuiDefaultDecoration::FileSelector_FolderView);
  nuiWidget::SetDefaultDecoration(nuiObject::GetClassNameIndex(_T("nuiFileSelector::InfoView")), &nuiDefaultDecoration::FileSelector_InfoView);
  nuiWidget::SetDefaultDecoration(nuiObject::GetClassNameIndex(_T("nuiFileSelector::FolderLabel")), &nuiDefaultDecoration::FileSelector_FolderLabel);
  nuiWidget::SetDefaultDecoration(nuiObject::GetClassNameIndex(_T("nuiFileSelector::VolumeIcon")), &nuiDefaultDecoration::FileSelector_VolumeIcon);
  nuiWidget::SetDefaultDecoration(nuiObject::GetClassNameIndex(_T("nuiFileSelector::FolderIcon")), &nuiDefaultDecoration::FileSelector_FolderIcon);
  nuiWidget::SetDefaultDecoration(nuiObject::GetClassNameIndex(_T("nuiFileSelector::TreeView")), &nuiDefaultDecoration::FileSelector_TreeView);
  nuiWidget::SetDefaultDecoration(nuiObject::GetClassNameIndex(_T("nuiFileSelector::TreeFolderLabel")), &nuiDefaultDecoration::FileSelector_TreeFolderLabel);
  nuiWidget::SetDefaultDecoration(nuiObject::GetClassNameIndex(_T("nuiFileSelector::TreeFileLabel")), &nuiDefaultDecoration::FileSelector_TreeFileLabel);
  nuiWidget::SetDefaultDecoration(nuiObject::GetClassNameIndex(_T("nuiFileSelector::TreeFolderIcon")), &nuiDefaultDecoration::FileSelector_TreeFolderIcon);
  nuiWidget::SetDefaultDecoration(nuiObject::GetClassNameIndex(_T("nuiFileSelector::TreeFileIcon")), &nuiDefaultDecoration::FileSelector_TreeFileIcon);

  // FileTree
  nuiWidget::SetDefaultDecoration(nuiObject::GetClassNameIndex(_T("nuiFileTree")), &nuiDefaultDecoration::FileTree_View);
//  nuiWidget::SetDefaultDecoration(nuiObject::GetClassNameIndex(_T("nuiFileTree::Node")), &nuiDefaultDecoration::FileTree_Node);
  nuiWidget::SetDefaultDecoration(nuiObject::GetClassNameIndex(_T("nuiFileTree::ColumnLabel")), &nuiDefaultDecoration::FileTree_ColumnLabel);
  nuiWidget::SetDefaultDecoration(nuiObject::GetClassNameIndex(_T("nuiFileTree::VolumeLabel")), &nuiDefaultDecoration::FileTree_FolderLabel);
  nuiWidget::SetDefaultDecoration(nuiObject::GetClassNameIndex(_T("nuiFileTree::FolderLabel")), &nuiDefaultDecoration::FileTree_FolderLabel);
  nuiWidget::SetDefaultDecoration(nuiObject::GetClassNameIndex(_T("nuiFileTree::FileLabel")), &nuiDefaultDecoration::FileTree_FileLabel);
  nuiWidget::SetDefaultDecoration(nuiObject::GetClassNameIndex(_T("nuiFileTree::FileInfo")), &nuiDefaultDecoration::FileTree_FileInfo);
  nuiWidget::SetDefaultDecoration(nuiObject::GetClassNameIndex(_T("nuiFileTree::VolumeIcon")), &nuiDefaultDecoration::FileTree_VolumeIcon);
  nuiWidget::SetDefaultDecoration(nuiObject::GetClassNameIndex(_T("nuiFileTree::FolderIcon")), &nuiDefaultDecoration::FileTree_FolderIcon);
  nuiWidget::SetDefaultDecoration(nuiObject::GetClassNameIndex(_T("nuiFileTree::OpenFolderIcon")), &nuiDefaultDecoration::FileTree_OpenFolderIcon);
  nuiWidget::SetDefaultDecoration(nuiObject::GetClassNameIndex(_T("nuiFileTree::ParentFolderIcon")), &nuiDefaultDecoration::FileTree_ParentFolderIcon);
  nuiWidget::SetDefaultDecoration(nuiObject::GetClassNameIndex(_T("nuiFileTree::FileIcon")), &nuiDefaultDecoration::FileTree_FileIcon);

  // NavigationViews
  nuiWidget::SetDefaultDecoration(nuiObject::GetClassNameIndex(_T("nuiNavigationBar")), &nuiDefaultDecoration::NavigationBar);
  
  
  App->AddExit(nuiDefaultDecoration::Exit);
}