예제 #1
0
파일: init.c 프로젝트: kawatea/cedit
void init_window(void)
{
    load_setting();
    
    //メインウィンドウの外観の設定
    main_window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
    gtk_window_set_title(GTK_WINDOW(main_window), "cedit");
    gtk_window_set_icon(GTK_WINDOW(main_window), get_icon("icon.png"));
    gtk_window_move(GTK_WINDOW(main_window), window_x, window_y);
    gtk_window_set_default_size(GTK_WINDOW(main_window), window_width, window_height);
    
    //ウィンドウの内部の設定
    GtkWidget *main_vbox = gtk_vbox_new(FALSE, 3);
    gtk_container_add(GTK_CONTAINER(main_window), main_vbox);
    init_bar(main_vbox);
    init_editor(main_vbox);
    
    //全体の動作の設定
    init_tag();
    init_library();
    set_action("New", FALSE);
    set_action("Save", FALSE);
    set_action("Undo", FALSE);
    set_action("Redo", FALSE);
    set_action("Cut", FALSE);
    set_action("Copy", FALSE);
    set_action("Delete", FALSE);
    static GtkTargetEntry target[] = {{"text/uri-list",  0, 10}};
    gtk_drag_dest_set(view, GTK_DEST_DEFAULT_ALL, target, 1, GDK_ACTION_COPY);
    gtk_drag_dest_set(main_window, GTK_DEST_DEFAULT_ALL, target, 1, GDK_ACTION_COPY);
    set_signal();
}
예제 #2
0
파일: particleed.cpp 프로젝트: kvakvs/hge
int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) {
    hge = hgeCreate(HGE_VERSION);

    hge->System_SetState(HGE_INIFILE, "particleed.ini");
    hge->System_SetState(HGE_LOGFILE, "particleed.log");
    hge->System_SetState(HGE_FRAMEFUNC, frame_func);
    hge->System_SetState(HGE_RENDERFUNC, render_func);
    hge->System_SetState(HGE_TITLE, "HGE Particle Systems Editor");
    hge->System_SetState(HGE_SCREENWIDTH, 800);
    hge->System_SetState(HGE_SCREENHEIGHT, 600);
    hge->System_SetState(HGE_SCREENBPP, 32);
    hge->System_SetState(HGE_USESOUND, false);

    if (hge->Ini_GetInt("HGE", "FullScreen", 0)) {
        hge->System_SetState(HGE_WINDOWED, false);
    }
    else {
        hge->System_SetState(HGE_WINDOWED, true);
    }

    if (hge->System_Initiate()) {
        init_editor();
        hge->System_Start();
        done_editor();
    }
    else {
        MessageBox(nullptr, hge->System_GetErrorMessage(), "Error",
                   MB_OK | MB_ICONERROR | MB_SYSTEMMODAL);
    }

    hge->System_Shutdown();
    hge->Release();
    return 0;
}
예제 #3
0
파일: mutation.c 프로젝트: recep59/wine
static void parse_complete(HTMLDocumentObj *doc)
{
    TRACE("(%p)\n", doc);

    if(doc->usermode == EDITMODE)
        init_editor(&doc->basedoc);

    call_explorer_69(doc);
    if(doc->view_sink)
        IAdviseSink_OnViewChange(doc->view_sink, DVASPECT_CONTENT, -1);
    call_property_onchanged(&doc->basedoc.cp_container, 1005);
    call_explorer_69(doc);

    if(doc->webbrowser && doc->usermode != EDITMODE && !(doc->basedoc.window->load_flags & BINDING_REFRESH))
        IDocObjectService_FireNavigateComplete2(doc->doc_object_service, &doc->basedoc.window->base.IHTMLWindow2_iface, 0);

    /* FIXME: IE7 calls EnableModelless(TRUE), EnableModelless(FALSE) and sets interactive state here */
}
예제 #4
0
파일: med.c 프로젝트: paud/d2x-xl
// ---------------------------------------------------------------------------------------------------
//this function is the editor. called when editor mode selected.  runs until
//game mode or exit selected
void editor(void)
{
	int w,h;
	grsBitmap * savedbitmap;
	editorView *new_cv;
        static int padnum=0;
	vmsMatrix	MouseRotMat,tempm;
	//@@short camera_objnum;			//a camera for viewing

	init_editor();

	InitCurve();

	RestoreEffectBitmapIcons();

	if (!SetScreenMode(SCREEN_EDITOR))	{
		SetScreenMode(SCREEN_GAME);
		gameStates.app.nFunctionMode=FMODE_GAME;			//force back into game
		return;
	}

	GrSetCurrentCanvas( NULL );
	GrSetCurFont(editor_font);

	//Editor renders into full (320x200) game screen 

	SetWarnFunc(med_show_warning);

	gameStates.input.keys.bRepeat = 1;		// Allow repeat in editor

//	_MARK_("start of editor");//Nuked to compile -KRB

	ui_mouse_hide();
	ui_reset_idleSeconds();
	gameData.objs.viewer = gameData.objs.console;
	slew_init(gameData.objs.console);
	UpdateFlags = UF_ALL;
	medlisp_update_screen();

	//set the wire-frame window to be the current view
	currentView = &LargeView;

	if (faded_in==0)
	{
		faded_in = 1;
		//gr_pal_fade_in( grdCurScreen->pal );
	}

	w = GameViewBox->canvas->cvBitmap.bmProps.w;
	h = GameViewBox->canvas->cvBitmap.bmProps.h;

	savedbitmap = GrCreateBitmap(w, h );

	GrBmUBitBlt( w, h, 0, 0, 0, 0, &GameViewBox->canvas->cvBitmap, savedbitmap );

	GrSetCurrentCanvas( GameViewBox->canvas );
	GrSetCurFont(editor_font);
	//GrSetColor( CBLACK );
	//gr_deaccent_canvas();
	//gr_grey_canvas();

	ui_mouse_show();

	GrSetCurFont(editor_font);
	ui_pad_goto(padnum);

	gamestate_restore_check();

	while (gameStates.app.nFunctionMode == FMODE_EDITOR) {

		GrSetCurFont(editor_font);
		info_display_all(EditorWindow);

		ModeFlag = 0;

		// Update the windows

		// Only update if there is no key waiting and we're not in
		// fast play mode.
		if (!KeyPeekKey()) //-- && (MacroStatus != UI_STATUS_FASTPLAY))
			medlisp_update_screen();

		//do editor stuff
		GrSetCurFont(editor_font);
		ui_mega_process();
		last_keypress &= ~KEYDBGGED;		//	mask off delete key bit which has no function in editor.
		ui_window_do_gadgets(EditorWindow);
		doRobot_window();
		doObject_window();
		do_wall_window();
		do_trigger_window();
		do_hostage_window();
		do_centers_window();
		check_wall_validity();
		Assert(gameData.walls.nWalls>=0);

		if (Gameview_lockstep) {
			static tSegment *old_cursegp=NULL;
			static int old_curside=-1;

			if (old_cursegp!=Cursegp || old_curside!=Curside) {
				SetPlayerFromCursegMinusOne();
				old_cursegp = Cursegp;
				old_curside = Curside;
			}
		}

		if ( ui_get_idleSeconds() > COMPRESS_INTERVAL ) 
			{
			med_compress_mine();
			ui_reset_idleSeconds();
			}
  
//	Commented out because it occupies about 25% of time in twirling the mine.
// Removes some Asserts....
//		med_check_all_vertices();
		clear_editor_status();		// if enough time elapsed, clear editor status message
		TimedAutosave(mine_filename);
		set_editorTime_of_day();
		GrSetCurrentCanvas( GameViewBox->canvas );
	
		// Remove keys used for slew
		switch(last_keypress)
		{
		case KEY_PAD9:
		case KEY_PAD7:
		case KEY_PADPLUS:
		case KEY_PADMINUS:
		case KEY_PAD8:
		case KEY_PAD2:
		case KEY_LBRACKET:
		case KEY_RBRACKET:
		case KEY_PAD1:
		case KEY_PAD3:
		case KEY_PAD6:
		case KEY_PAD4:
			last_keypress = 0;
		}
		if ((last_keypress&0xff)==KEY_LSHIFT) last_keypress=0;
		if ((last_keypress&0xff)==KEY_RSHIFT) last_keypress=0;
		if ((last_keypress&0xff)==KEY_LCTRL) last_keypress=0;
		if ((last_keypress&0xff)==KEY_RCTRL) last_keypress=0;
//		if ((last_keypress&0xff)==KEY_LALT) last_keypress=0;
//		if ((last_keypress&0xff)==KEY_RALT) last_keypress=0;

		GrSetCurFont(editor_font);
		menubar_do( last_keypress );

		//=================== DO FUNCTIONS ====================

		if ( KeyFunction[ last_keypress ] != NULL )	{
			KeyFunction[last_keypress]();
			last_keypress = 0;
		}
		switch (last_keypress)
		{
		case 0:
		case KEY_Z:
		case KEY_G:
		case KEY_LALT:
		case KEY_RALT:
		case KEY_LCTRL:
		case KEY_RCTRL:
		case KEY_LSHIFT:
		case KEY_RSHIFT:
		case KEY_LAPOSTRO:
			break;
		case KEY_SHIFTED + KEY_L:
			ToggleLighting();
			break;
		case KEY_F1:
			render_3d_in_big_window = !render_3d_in_big_window;
			UpdateFlags |= UF_ALL;
			break;		
		default:
			{
			char kdesc[100];
			GetKeyDescription( kdesc, last_keypress );
			editor_status("Error: %s isn't bound to anything.", kdesc  );
			}
		}

		//================================================================

		if (ModeFlag==1)
		{
			close_editor_screen();
			gameStates.app.nFunctionMode=FMODE_EXIT;
				GrFreeBitmap( savedbitmap );
			break;
		}

		if (ModeFlag==2) //-- && MacroStatus==UI_STATUS_NORMAL )
		{
			ui_mouse_hide();
			gameStates.app.nFunctionMode = FMODE_GAME;
			GrBmUBitBlt( w, h, 0, 0, 0, 0, savedbitmap, &GameViewBox->canvas->cvBitmap);
			GrFreeBitmap( savedbitmap );
			break;
		}

		if (ModeFlag==3) //-- && MacroStatus==UI_STATUS_NORMAL )
		{
//			med_compress_mine();						//will be called anyways before game.
			close_editor_screen();
			gameStates.app.nFunctionMode=FMODE_GAME;			//force back into game
			SetScreenMode(SCREEN_GAME);		//put up game screen
			GrFreeBitmap( savedbitmap );
			break;
		}

//		if (CurWindow->keyboard_focus_gadget == (UI_GADGET *)GameViewBox) currentView=NULL;
//		if (CurWindow->keyboard_focus_gadget == (UI_GADGET *)GroupViewBox) currentView=NULL;

		new_cv = currentView ;

#if ORTHO_VIEWS
		if (CurWindow->keyboard_focus_gadget == (UI_GADGET *)LargeViewBox) new_cv=&LargeView;
		if (CurWindow->keyboard_focus_gadget == (UI_GADGET *)TopViewBox)	new_cv=&TopView;
		if (CurWindow->keyboard_focus_gadget == (UI_GADGET *)FrontViewBox) new_cv=&FrontView;
		if (CurWindow->keyboard_focus_gadget == (UI_GADGET *)RightViewBox) new_cv=&RightView;
#endif
		if (new_cv != currentView ) {
			currentView->ev_changed = 1;
			new_cv->ev_changed = 1;
			currentView = new_cv;
		}

		CalcFrameTime();
		if (slew_frame(0)) {		//do movement and check keys
			UpdateFlags |= UF_GAME_VIEW_CHANGED;
			if (Gameview_lockstep) {
				Cursegp = &gameData.segs.segments[gameData.objs.console->nSegment];
				med_create_new_segment_from_cursegp();
				UpdateFlags |= UF_ED_STATE_CHANGED;
			}
		}

		// DO TEXTURE STUFF
		texpage_do();
		objpage_do();


		// Process selection of Cursegp using mouse.
		if (LargeViewBox->mouse_onme && LargeViewBox->b1_clicked && !render_3d_in_big_window) 
		{
			int	xcrd,ycrd;
			xcrd = LargeViewBox->b1_drag_x1;
			ycrd = LargeViewBox->b1_drag_y1;

			find_segments(xcrd,ycrd,LargeViewBox->canvas,&LargeView,Cursegp,Big_depth);	// Sets globals N_found_segs, Found_segs

			// If shift is down, then add tSegment to found list
			if (gameStates.input.keys.pressed[ KEY_LSHIFT ] || gameStates.input.keys.pressed[ KEY_RSHIFT ])
				subtract_found_segments_from_selected_list();
			else
				add_found_segments_to_selected_list();

  			Found_seg_index = 0;
	
			if (N_found_segs > 0) {
				sort_seg_list(N_found_segs,Found_segs,&gameData.objs.console->position.vPos);
				Cursegp = &gameData.segs.segments[Found_segs[0]];
				med_create_new_segment_from_cursegp();
				if (LockView_to_cursegp)
					setView_target_from_segment(Cursegp);
			}

			UpdateFlags |= UF_ED_STATE_CHANGED | UF_VIEWPOINT_MOVED;
		}

		if (GameViewBox->mouse_onme && GameViewBox->b1_dragging) {
			int	x, y;
			x = GameViewBox->b1_drag_x2;
			y = GameViewBox->b1_drag_y2;

			ui_mouse_hide();
			GrSetCurrentCanvas( GameViewBox->canvas );
			GrSetColor( 15 );
			GrRect( x-1, y-1, x+1, y+1 );
			ui_mouse_show();

		}
	
		// Set current tSegment and tSide by clicking on a polygon in game window.
		//	If ctrl pressed, also assign current texture map to that tSide.
		//if (GameViewBox->mouse_onme && (GameViewBox->b1_done_dragging || GameViewBox->b1_clicked)) {
		if ((GameViewBox->mouse_onme && GameViewBox->b1_clicked && !render_3d_in_big_window) ||
			(LargeViewBox->mouse_onme && LargeViewBox->b1_clicked && render_3d_in_big_window)) {

			int	xcrd,ycrd;
			int seg,tSide,face,poly,tmap;

			if (render_3d_in_big_window) {
				xcrd = LargeViewBox->b1_drag_x1;
				ycrd = LargeViewBox->b1_drag_y1;
			}
			else {
				xcrd = GameViewBox->b1_drag_x1;
				ycrd = GameViewBox->b1_drag_y1;
			}

			//Int3();

			if (FindSegSideFace(xcrd,ycrd,&seg,&tSide,&face,&poly)) {


				if (seg<0) {							//found an tObject

					CurObject_index = -seg-1;
					editor_status("Object %d selected.",CurObject_index);

					UpdateFlags |= UF_ED_STATE_CHANGED;
				}
				else {

					//	See if either shift key is down and, if so, assign texture map
					if (gameStates.input.keys.pressed[KEY_LSHIFT] || gameStates.input.keys.pressed[KEY_RSHIFT]) {
						Cursegp = &gameData.segs.segments[seg];
						Curside = tSide;
						AssignTexture();
						med_create_new_segment_from_cursegp();
						editor_status("Texture assigned");
					} else if (gameStates.input.keys.pressed[KEY_G])	{
						tmap = gameData.segs.segments[seg].sides[tSide].nBaseTex;
						texpage_grab_current(tmap);
						editor_status( "Texture grabbed." );
					} else if (gameStates.input.keys.pressed[ KEY_LAPOSTRO] ) {
						ui_mouse_hide();
						moveObject_to_mouse_click();
					} else {
						Cursegp = &gameData.segs.segments[seg];
						Curside = tSide;
						med_create_new_segment_from_cursegp();
						editor_status("Curseg and curside selected");
					}
				}

				UpdateFlags |= UF_ED_STATE_CHANGED;
			}
			else 
				editor_status("Click on non-texture ingored");

		}

		// Allow specification of LargeView using mouse
		if (gameStates.input.keys.pressed[ KEY_LCTRL ] || gameStates.input.keys.pressed[ KEY_RCTRL ]) {
			ui_mouse_hide();
			if ( (Mouse.dx!=0) && (Mouse.dy!=0) ) {
				GetMouseRotation( Mouse.dx, Mouse.dy, &MouseRotMat );
				VmMatMul(&tempm,&LargeView.ev_matrix,&MouseRotMat);
				LargeView.ev_matrix = tempm;
				LargeView.ev_changed = 1;
				LargeView_index = -1;			// say not one of the orthogonal views
			}
		} else  {
			ui_mouse_show();
		}

		if ( gameStates.input.keys.pressed[ KEY_Z ] ) {
			ui_mouse_hide();
			if ( Mouse.dy!=0 ) {
				currentView->evDist += Mouse.dy*10000;
				currentView->ev_changed = 1;
			}
		} else {
			ui_mouse_show();
		}

	}

//	_MARK_("end of editor");//Nuked to compile -KRB

	ClearWarnFunc(med_show_warning);

	//kill our camera tObject

	gameData.objs.viewer = gameData.objs.console;					//reset viewer
	//@@ReleaseObject(camera_objnum);

	padnum = ui_pad_get_current();

	close_editor();
	ui_close();


}
예제 #5
0
파일: gamecntl.c 프로젝트: Mako88/DXX-Retro
int HandleTestKey(int key)
{
	switch (key)
	{

#ifdef SHOW_EXIT_PATH
		case KEY_DEBUGGED+KEY_1:	create_special_path();	break;
#endif

		case KEY_DEBUGGED+KEY_Y:
			do_controlcen_destroyed_stuff(NULL);
			break;
		case KEY_BACKSP:
		case KEY_CTRLED+KEY_BACKSP:
		case KEY_ALTED+KEY_BACKSP:
		case KEY_SHIFTED+KEY_BACKSP:
		case KEY_SHIFTED+KEY_ALTED+KEY_BACKSP:
		case KEY_CTRLED+KEY_ALTED+KEY_BACKSP:
		case KEY_SHIFTED+KEY_CTRLED+KEY_BACKSP:
		case KEY_SHIFTED+KEY_CTRLED+KEY_ALTED+KEY_BACKSP:

			Int3(); break;

		case KEY_DEBUGGED+KEY_S:				digi_reset(); break;

		case KEY_DEBUGGED+KEY_P:
			if (Game_suspended & SUSP_ROBOTS)
				Game_suspended &= ~SUSP_ROBOTS;		//robots move
			else
				Game_suspended |= SUSP_ROBOTS;		//robots don't move
			break;



		case KEY_DEBUGGED+KEY_K:	Players[Player_num].shields = 1;	break;							//	a virtual kill
		case KEY_DEBUGGED+KEY_SHIFTED + KEY_K:  Players[Player_num].shields = -1;	 break;  //	an actual kill
		case KEY_DEBUGGED+KEY_X: Players[Player_num].lives++; break; // Extra life cheat key.
		case KEY_DEBUGGED+KEY_H:
			if (Player_is_dead)
				return 0;

			Players[Player_num].flags ^= PLAYER_FLAGS_CLOAKED;
			if (Players[Player_num].flags & PLAYER_FLAGS_CLOAKED) {
#ifdef NETWORK
				if (Game_mode & GM_MULTI)
					multi_send_cloak();
#endif
				ai_do_cloak_stuff();
				Players[Player_num].cloak_time = GameTime64;
			}
			break;


		case KEY_DEBUGGED+KEY_R:
			cheats.robotfiringsuspended = !cheats.robotfiringsuspended;
			break;

#ifdef EDITOR		//editor-specific functions

		case KEY_E + KEY_DEBUGGED:
			window_set_visible(Game_wind, 0);	// don't let the game do anything while we set the editor up
			init_editor();
			window_close(Game_wind);
			break;
		case KEY_C + KEY_SHIFTED + KEY_DEBUGGED:
			if (!Player_is_dead && !( Game_mode & GM_MULTI ))
				move_player_2_segment(Cursegp,Curside);
			break;   //move eye to curseg


		case KEY_DEBUGGED+KEY_W:	draw_world_from_game(); break;

		#endif  //#ifdef EDITOR

		case KEY_DEBUGGED+KEY_LAPOSTRO: Show_view_text_timer = 0x30000; object_goto_next_viewer(); break;
		case KEY_DEBUGGED+KEY_SHIFTED+KEY_LAPOSTRO: Viewer=ConsoleObject; break;
		case KEY_DEBUGGED+KEY_O: toggle_outline_mode(); break;
		case KEY_DEBUGGED+KEY_T:
			*Toggle_var = !*Toggle_var;
			break;
		case KEY_DEBUGGED + KEY_L:
			if (++Lighting_on >= 2) Lighting_on = 0; break;
		case KEY_DEBUGGED + KEY_SHIFTED + KEY_L:
			Beam_brightness=0x38000-Beam_brightness; break;
		case KEY_PAD5: slew_stop(); break;

#ifndef NDEBUG
		case KEY_DEBUGGED + KEY_F11: play_test_sound(); break;
		case KEY_DEBUGGED + KEY_SHIFTED+KEY_F11: advance_sound(); play_test_sound(); break;
#endif

		case KEY_DEBUGGED + KEY_M:
			Debug_spew = !Debug_spew;
			if (Debug_spew) {
				HUD_init_message_literal(HM_DEFAULT,  "Debug Spew: ON" );
			} else {
				HUD_init_message_literal(HM_DEFAULT,  "Debug Spew: OFF" );
			}
			break;

		case KEY_DEBUGGED + KEY_C:
			do_cheat_menu();
			break;
		case KEY_DEBUGGED + KEY_SHIFTED + KEY_A:
			do_megawow_powerup(10);
			break;
		case KEY_DEBUGGED + KEY_A:	{
			do_megawow_powerup(200);
				break;
		}

		case KEY_DEBUGGED+KEY_SPACEBAR:		//KEY_F7:				// Toggle physics flying
			slew_stop();
		
			game_flush_inputs();
			if ( ConsoleObject->control_type != CT_FLYING ) {
				fly_init(ConsoleObject);
				Game_suspended &= ~SUSP_ROBOTS;	//robots move
			} else {
				slew_init(ConsoleObject);			//start player slewing
				Game_suspended |= SUSP_ROBOTS;	//robots don't move
			}
			break;

		case KEY_DEBUGGED+KEY_COMMA: Render_zoom = fixmul(Render_zoom,62259); break;
		case KEY_DEBUGGED+KEY_PERIOD: Render_zoom = fixmul(Render_zoom,68985); break;

		#ifndef NDEBUG
		case KEY_DEBUGGED+KEY_D:
			if ((GameArg.DbgUseDoubleBuffer = !GameArg.DbgUseDoubleBuffer)!=0)
				init_cockpit();
			break;
		#endif

#ifdef EDITOR
		case KEY_DEBUGGED+KEY_Q:
			stop_time();
			dump_used_textures_all();
			start_time();
			break;
#endif

		case KEY_DEBUGGED+KEY_B: {
			newmenu_item m;
			char text[FILENAME_LEN]="";
			int item;
			m.type=NM_TYPE_INPUT; m.text_len = FILENAME_LEN; m.text = text;
			item = newmenu_do( NULL, "Briefing to play?", 1, &m, NULL, NULL );
			if (item != -1) {
				do_briefing_screens(text,1);
			}
			break;
		}

		case KEY_DEBUGGED+KEY_SHIFTED+KEY_B:
			if (Player_is_dead)
				return 0;

			kill_and_so_forth();
			break;
		case KEY_DEBUGGED+KEY_G:
			GameTime64 = (0x7fffffffffffffffLL) - (F1_0*10);
			HUD_init_message(HM_DEFAULT, "GameTime %li - Reset in 10 seconds!", GameTime64);
			break;
		default:
			return 0;
			break;
	}

	return 1;
}
예제 #6
0
void editor(world * gameWorld)
{
    int quit = 0;
    int pre_property = 0;
    int object_data = 1;
    int left_ctrl=0;
    int moving = 0;
    int old_mouse_x;
    int old_mouse_y;

    init_editor(gameWorld);

    object_data = mapLoad(gameWorld, MAP_FILE);
    //fps
    struct timer_t2 fps;

    //wait for user to continue or exit
    while( quit != 1 )
    {
        //Start the frame timer
        timer_start(&fps);
        //While there are events to handle
        while( SDL_PollEvent( &event ) )
        {

            if( event.type == SDL_QUIT )
            {
                mapSave(gameWorld, MAP_FILE);
                //exit
                clean_up();
                exit(0);
            }

            if(event.type == SDL_KEYDOWN)
            {
                switch(event.key.keysym.sym)
                {
                    case SDLK_LCTRL://is left ctrl being pressed?
                        left_ctrl = 1; break;
                    default:
                        break;
                }
            }
            //set property, handle keyevents
            if(event.type == SDL_KEYUP)
            {
                switch(event.key.keysym.sym)
                {
                    case SDLK_1:
                        pre_property = 1; break;

                    case SDLK_2:
                        pre_property = 2; break;

                    case SDLK_3:
                        pre_property = 3; break;

                    case SDLK_4:
                        pre_property = 4; break;

                    case SDLK_5:
                        pre_property = 5; break;

                    case SDLK_6:
                        pre_property = 6; break;

                    case SDLK_7:
                        pre_property = 7; break;

                    case SDLK_8:
                        pre_property = 8; break;

                    case SDLK_s:
                        pre_property = 's'; break;

                    case SDLK_e:
                        pre_property = 'e'; break;

                    case SDLK_LCTRL:
                        left_ctrl = 0; break;
                    case SDLK_z:
                        if(left_ctrl == 1)
                        {
                            if(object_data>=2)
                            {
                                editor_undo(object_data,gameWorld);
                                object_data--;
                            }
                            break;
                        }
                        else
                        {
                            break;
                        }
                    //save the map before quiting
                    case SDLK_ESCAPE:
                        mapSave(gameWorld, MAP_FILE);
                        quit = 1; break;
                    default:
                        break;
                }
                break;
            }
            if(moving == 1)
            {
                editor_update_move_object(event.button.x, event.button.y, &old_mouse_x, &old_mouse_y,gameWorld);
            }
            if( event.type == SDL_MOUSEBUTTONDOWN)
            {
                switch(event.button.button)
                {
                    case SDL_BUTTON_RIGHT:
                        moving = 1;
                        editor_start_move_object(event.button.x, event.button.y, &old_mouse_x, &old_mouse_y);
                        break;
                }
            }
            if( event.type == SDL_MOUSEBUTTONUP)
            {
                switch(event.button.button)
                {
                    case SDL_BUTTON_LEFT:
                        editor_create_object(event.button.x, event.button.y, pre_property, &object_data,gameWorld);
                        break;
                    case SDL_BUTTON_RIGHT:
                        moving = 0;
                        break;
                }
            }
        }
        //draw editor
        editor_show(SCREEN_WIDTH, SCREEN_HEIGHT,gameWorld);

        if( timer_get_ticks(&fps) < 1000 / FRAMES_PER_SECOND )
        {
            //delay the as much time as we need to get desired frames per second
            SDL_Delay( ( 1000 / FRAMES_PER_SECOND ) - timer_get_ticks(&fps) );
        }
    }
}