Example #1
0
void DrawPreOverlayEffects(room_type* room, Draw3DParams* params)
{
	PDIB pdibCeiling = NULL;

	// Only drawn in room, before overlays are drawn.

	pdibCeiling = GetPointCeilingTexture(params->viewer_x, params->viewer_y);

	// sand
	if (effects.sand)
	{
		SandDib(gBits, MAXX, MAXY, 200/*drops*/);
		RedrawAll();
		if (!config.animate)
			effects.sand = 0;
	}

	// rain
	if (effects.raining && config.weather && !pdibCeiling)
	{
		RainDib(gBits, MAXX, MAXY, 60/*drops*/, params->viewer_angle/*myheading*/, 0/*windheading*/, 10/*windstrength*/, TRUE/*torch*/);
		RedrawAll();
		if (!config.animate)
			effects.raining = 0;
	}

	// snow
	if (effects.snowing && config.weather && !pdibCeiling)
	{
		SnowDib(gBits, MAXX, MAXY, 20/*drops*/, params->viewer_angle/*myheading*/, 0/*windheading*/, 10/*windstrength*/, TRUE/*torch*/);
		RedrawAll();
		if (!config.animate)
			effects.snowing = 0;
	}
}
/////////////////////////////////////////////////////////////////////////////
//	OnTH_LClicked
//		Sent whenever the user clicks the left mouse button within the top heading
//		this message is sent when the button goes down then again when the button goes up
//	Params:
//		col, row	- coordinates of a cell that received mouse click event
//		updn		- is TRUE if mouse button is 'down' and FALSE if button is 'up'
//		processed	- indicates if current event was processed by other control in the grid.
//		rect		- represents the CDC rectangle of cell in question
//		point		- represents the screen point where the mouse event was detected
//	Return:
//		<none>
void CDDBaseGrid::OnTH_LClicked(int col,long row,int updn,RECT *rect,POINT *point,BOOL processed)
{
	//UNREFERENCED_PARAMETER(col);
	UNREFERENCED_PARAMETER(row);
	UNREFERENCED_PARAMETER(updn);
	UNREFERENCED_PARAMETER(*rect);
	UNREFERENCED_PARAMETER(*point);
	UNREFERENCED_PARAMETER(processed);

   // Sort by selected column when user clicks in column heading and
   // did not do a column swap.
   // If the button-up col does not match the button-down col, then a col swap occurred.
   // Column sort can be turned on/off by sbuclass grids. Sort only if on.

   if (m_sortEnabled)
   {
      if (updn == TRUE) // Button Down
      {
         m_THButtonDownCol = col;
      }
      else if (col == m_THButtonDownCol) // Button Up, down & up cols match?
      {
         SortBy(col);
         RedrawAll();
      }
   }
}
Example #3
0
void CLayerTypeGrid::OnDClicked(int col,long row, RECT *rect,POINT *point,BOOL processed)
{
   int lastColIndx = GetNumberCols() - 1;
   CString cellText(QuickGetText(lastColIndx, row));
   int layerType = atoi(cellText);

   // Edit color if a layerType row (not a group name row)
   // and double click was not in the layer type column.
   if (layerType > -1 && col > 0)
   {
      CUGCell cell;
      GetCell(col, row, &cell); 

      COLORREF color = cell.GetBackColor(); // current color

	   CPersistantColorDialog dialog(color);
	   if (dialog.DoModal() == IDOK)
      {
	      color = dialog.GetColor();
         cell.SetBackColor(color);
         SetCell(col, row, &cell);
         RedrawAll();
      }
   }
}
Example #4
0
void TERMWINDOWMEMBER cls(int whatToDo)
	{
#ifdef WINCIT
	scroll(conRows, conRows + 1, (uchar) cfg.attr);
	position(0, 0);
#else
	if (whatToDo == SCROLL_SAVE && cfg.scrollSize)
		{
		SaveToScrollBackBuffer(logiRow);
		}

	if (cfg.bios && !ScreenSaver.IsOn() && !StatusLine.IsFullScreen() &&
			!allWindows)
		{
		scroll_bios(conRows, 0, cfg.attr);
		}
	else
		{
		cls_fast(ScreenSaver.IsOn() ? 0 : cfg.attr);
		}

	setborder(cfg.battr);
	position(0, 0);

	if (allWindows && !oPhys)
		{
		RedrawAll();
		}
#endif
	}
Example #5
0
void WindowInfo::ChangePresentationMode(PresentationMode mode)
{
    presentation = mode;
    if (PM_BLACK_SCREEN == mode || PM_WHITE_SCREEN == mode) {
        DeleteInfotip();
    }
    RedrawAll();
}
Example #6
0
/*
 * GraphicsToggleMap:  Toggle map display on and off.
 */
void GraphicsToggleMap(void)
{
   map = !map;
   if (map)
      SetUserTargetID(INVALID_ID);

   RedrawAll();
}
Example #7
0
void CComit_e::OnClickedCalphaallowed() 
{
	if(dir_ctrl.alphastrikesallowed)
		dir_ctrl.alphastrikesallowed = false;
	else
		dir_ctrl.alphastrikesallowed = true;
	RedrawAll();

}
Example #8
0
void AnimationTimerProc(HWND hwnd, UINT timer)
{
   Bool need_redraw = False;
   static DWORD last_animate_time = 0;
   DWORD dt, now;

   PingTimerProc(hwnd, 0, 0, 0);

   if (!(GameGetState() == GAME_PLAY || GameGetState() == GAME_SELECT))
      return;

   if (last_animate_time == 0)
   {
      last_animate_time = timeGetTime();
      return;
   }

   config.quickstart = FALSE;
   now = timeGetTime();
   dt = now - last_animate_time;
   last_animate_time = now;
   timeLastFrame = dt;

   /* Send event to modules */
   ModuleEvent(EVENT_ANIMATE, dt);

   /* Send event to non-module child windows */
   if (config.animate)
   {
      Lagbox_Animate(dt);
   }

   /* Animate the first-person view elements */
   if (config.animate && GetGameDataValid())
   {
      // Avoid short-circuiting OR
      need_redraw |= ObjectsMove(dt);
      need_redraw |= ProjectilesMove(dt);
      need_redraw |= AnimateObjects(dt);
      need_redraw |= AnimateRoom(&current_room, dt);
      need_redraw |= AnimateProjectiles(dt);
      need_redraw |= AnimatePlayerOverlays(dt);
      need_redraw |= AnimateBackgroundOverlays(dt);

      AnimateDescription(dt);

      need_redraw |= AnimateEffects(dt);
      if (need_redraw)
    RedrawAll();
   }

   if (GetGameDataValid())
      RedrawForce();

   return;
}
Example #9
0
void CRealTimeView::OnDraw(CDC* pDC)
{
	CStaticDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	// TODO: add draw code for native data here

	CRect	rectClient;
	GetClientRect( &rectClient );

	RedrawAll( pDC, rectClient );
}
Example #10
0
/////////////////////////////////////////////////////////////////////////////
//	OnMenuCommand
//		This notification is called when the user has selected a menu item
//		in the pop-up menu.
//	Params:
//		col, row - the cell coordinates of where the menu originated from
//		setcion - identify for which portion of the gird the menu is for.
//				  possible sections:
//						UG_TOPHEADING, UG_SIDEHEADING,UG_GRID
//						UG_HSCROLL  UG_VSCROLL  UG_CORNERBUTTON
//		item - ID of the menu item selected
//	Return:
//		<none>
void CDropDayCug::OnMenuCommand(int col,long row,int section,int item)
{
	UNREFERENCED_PARAMETER(col);
	UNREFERENCED_PARAMETER(section);

	if ( item == 1000 )
	{
		DeleteRow( row );
		RedrawAll();
		m_bIsUpdated = TRUE;
	}
}
Example #11
0
void CLayerTypeGrid::OnLClicked(int col,long row, int updn, RECT *rect, POINT *point, int processed) 
{
   // A click will get two event calls here, one for button down (updn = true) and one
   // for button up. We don't want to do this twice for a single click.
   // So react only to the button up, that is the end of the click event.
   if (updn)
      return;  // Ignore the button down.

   int lastColIndx = GetNumberCols() - 1;
   CString cellText(QuickGetText(lastColIndx, row));
   int layerType = atoi(cellText);

   // Toggle expand/collapse if layer type indicates this is a layer group row.
   // React only if cell was first column cell.
   if (layerType < 0 && col == 0)
   {
      int rowCnt = GetNumberRows();

      CUGCell cell;
      GetCell(col, row, &cell);

      // We use the "+" and "-" in name to track expanded/collapsed state.
      // The char shows the current state.
      CString groupNameText( cell.GetText() );
      bool isExpanded = (groupNameText.Left(1).Compare("-") == 0);

      if (isExpanded)
      {
         // Is expanded, perform collapse.
         CollapseLayerGroup(row);
         RedrawAll();
      }
      else
      {
         // Is collapsed, perform expand.
         ExpandLayerGroup(row);
         RedrawAll();
      }
   }
}
Example #12
0
void CRealTimeView::OnPrint(CDC* pDC, CPrintInfo* pInfo)
{
	// TODO: add customized printing code here
	pDC->SetMapMode( MM_ISOTROPIC );
	CRect	rectClient( 0, 0, 1020, 586 );
	// GetClientRect( &rectClient );
	pDC->SetWindowOrg( rectClient.left, rectClient.top );
	pDC->SetWindowExt( rectClient.Width(), rectClient.Height() );
	pDC->SetViewportOrg( pInfo->m_rectDraw.left, pInfo->m_rectDraw.top );
	pDC->SetViewportExt( pInfo->m_rectDraw.Width(), pInfo->m_rectDraw.Height() );
	
	RedrawAll( pDC, rectClient );
	// CView::OnPrint(pDC,pInfo);
}
Example #13
0
void xCanvas::Undo()
{
	int sz = m_strokes.size();
	if (sz > 0)
	{
		m_strokes.pop_back();
		sz = m_strokes.size();
		if (sz > 0)
		{
			//m_strokes[sz-1].selection -= 1;
			m_stroke = m_strokes[sz-1];
		}
		else
		{
			m_stroke.clear();
		}
	}

	RedrawAll();
}
Example #14
0
/////////////////////////////////////////////////////////////////////////////
//	OnTH_LClicked
//		Sent whenever the user clicks the left mouse button within the top heading
//		this message is sent when the button goes down then again when the button goes up
//	
//		'col' is negative if the area clicked in is not valid
//		'updn'  TRUE if the button is down FALSE if the button just when up
void MyCug::OnTH_LClicked(int col,long row,int updn,RECT *rect,POINT *point,BOOL processed)
{
	if ( !updn )
	{
		if ( m_nSortCol != GetColTranslation( col ))
		{
			m_nSortDir = UG_SORT_ASCENDING;
		}
		else if ( m_nSortDir == UG_SORT_DESCENDING )
		{
			m_nSortDir = UG_SORT_ASCENDING;
		}
		else if ( m_nSortDir = UG_SORT_ASCENDING )
		{
			m_nSortDir = UG_SORT_DESCENDING;
		}

		//m_nSortCol = col;
		m_nSortCol = GetColTranslation( col );
		SortBy( col, m_nSortDir );
		RedrawAll();
	}
}
Example #15
0
/*
 * CommandHideMap:  "hidemap" command.
 */
void CommandHideMap(char *args)
{
  MapShowAllWalls(cinfo->current_room, False);
  RedrawAll();
}
Example #16
0
BOOL CALLBACK PreferencesDialogProc(HWND hDlg, UINT message, UINT wParam, LONG lParam)
{
   static HWND hBrowser;
   static Bool browser_changed;
   Bool toolbar_changed, lagbox_changed, temp;
   CommSettings *comm = &config.comm;
   OPENFILENAME ofn;
   static char *dir;   // Working directory before dialog (OpenFile may change it)
   int new_val;

   switch (message)
   {
   case WM_INITDIALOG:
      CenterWindow(hDlg, GetParent(hDlg));
      if (hPreferencesDialog != NULL)
      {
         EndDialog(hDlg, IDCANCEL);
         return FALSE;
      }
      hPreferencesDialog = hDlg;
      
      hBrowser = GetDlgItem(hDlg, IDC_BROWSER);
      
      Edit_LimitText(hBrowser, MAX_PATH);

      SetWindowFont(hBrowser, GetFont(FONT_INPUT), FALSE);

      SetWindowText(hBrowser, config.browser);

      CheckDlgButton(hDlg, IDC_SCROLLLOCK, config.scroll_lock);
      CheckDlgButton(hDlg, IDC_DRAWNAMES, config.draw_names);
      CheckDlgButton(hDlg, IDC_TOOLTIPS, config.tooltips);
      CheckDlgButton(hDlg, IDC_PAIN, config.pain);
      CheckDlgButton(hDlg, IDC_INVNUM, config.inventory_num);
      CheckDlgButton(hDlg, IDC_SAFETY, config.aggressive);
      CheckDlgButton(hDlg, IDC_BOUNCE, config.bounce);
      CheckDlgButton(hDlg, IDC_TOOLBAR, config.toolbar);
      CheckDlgButton(hDlg, IDS_LATENCY0, config.lagbox);
      CheckDlgButton(hDlg, IDC_PROFANE, config.antiprofane);
      CheckDlgButton(hDlg, IDC_DRAWMAP, config.drawmap);
      CheckDlgButton(hDlg, IDC_MAP_ANNOTATIONS, config.map_annotations);

      CheckDlgButton(hDlg, IDC_MUSIC, config.play_music);
      CheckDlgButton(hDlg, IDC_SOUNDFX, config.play_sound);
      CheckDlgButton(hDlg, IDC_LOOPSOUNDS, config.play_loop_sounds);
      CheckDlgButton(hDlg, IDC_RANDSOUNDS, config.play_random_sounds);

      EnableWindow(GetDlgItem(hDlg, IDC_LOOPSOUNDS), IsDlgButtonChecked(hDlg, IDC_SOUNDFX));
      EnableWindow(GetDlgItem(hDlg, IDC_RANDSOUNDS), IsDlgButtonChecked(hDlg, IDC_SOUNDFX));

      CheckRadioButton(hDlg, IDC_TARGETHALO1, IDC_TARGETHALO3, config.halocolor + IDC_TARGETHALO1);

      CheckDlgButton(hDlg, IDC_COLORCODES, config.colorcodes);

      Trackbar_SetRange(GetDlgItem(hDlg, IDC_SOUND_VOLUME), 0, CONFIG_MAX_VOLUME, FALSE);
      Trackbar_SetRange(GetDlgItem(hDlg, IDC_MUSIC_VOLUME), 0, CONFIG_MAX_VOLUME, FALSE);
      Trackbar_SetPos(GetDlgItem(hDlg, IDC_SOUND_VOLUME), config.sound_volume);
      Trackbar_SetPos(GetDlgItem(hDlg, IDC_MUSIC_VOLUME), config.music_volume);
      
      dir = (char *) SafeMalloc(MAX_PATH + 1);
      GetWorkingDirectory(dir, MAX_PATH);

      browser_changed = False;
      return TRUE;

   case WM_COMMAND:
      switch(GET_WM_COMMAND_ID(wParam, lParam))
      {
      case IDC_BROWSER:
         if (GET_WM_COMMAND_CMD(wParam, lParam) != EN_CHANGE)
            break;
         
         browser_changed = True;
         return TRUE;
         
      case IDC_FIND:
         memset(&ofn, 0, sizeof(OPENFILENAME));
         ofn.lStructSize = sizeof(OPENFILENAME);
         ofn.hwndOwner = hDlg;
         ofn.lpstrFilter = EXE_filter;
         ofn.lpstrFile = config.browser;
         ofn.nMaxFile = MAX_PATH;
         ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
         if (GetOpenFileName(&ofn))
         {
            SetWindowText(hBrowser, config.browser);
            browser_changed = True;
         }
         else debug(("GetOpenFileName failed, error = %d\n", CommDlgExtendedError()));
         return TRUE;
         
      case IDCANCEL:
         EndDialog(hDlg, IDCANCEL);
         return TRUE;
         
      case IDC_SOUNDFX:
         EnableWindow(GetDlgItem(hDlg, IDC_LOOPSOUNDS), IsDlgButtonChecked(hDlg, IDC_SOUNDFX));
         EnableWindow(GetDlgItem(hDlg, IDC_RANDSOUNDS), IsDlgButtonChecked(hDlg, IDC_SOUNDFX));
         return TRUE;
         
      case IDC_PROFANESETTINGS:
         if (IDOK == DialogBox(hInst, MAKEINTRESOURCE(IDC_PROFANESETTINGS), hDlg, ProfanityDialogProc))
            CheckDlgButton(hDlg, IDC_PROFANE, TRUE);
         return TRUE;
         
      case IDOK:
         Edit_GetText(hBrowser, config.browser, MAX_PATH);
         
         if (browser_changed)
            config.default_browser = False;
         
         config.scroll_lock   = IsDlgButtonChecked(hDlg, IDC_SCROLLLOCK);
         config.draw_names    = IsDlgButtonChecked(hDlg, IDC_DRAWNAMES);
         config.tooltips      = IsDlgButtonChecked(hDlg, IDC_TOOLTIPS);
         config.pain          = IsDlgButtonChecked(hDlg, IDC_PAIN);
         config.inventory_num = IsDlgButtonChecked(hDlg, IDC_INVNUM);
         config.aggressive    = IsDlgButtonChecked(hDlg, IDC_SAFETY);
         config.bounce        = IsDlgButtonChecked(hDlg, IDC_BOUNCE);
         config.antiprofane   = IsDlgButtonChecked(hDlg, IDC_PROFANE);
         config.drawmap	      = IsDlgButtonChecked(hDlg, IDC_DRAWMAP);
         config.map_annotations = IsDlgButtonChecked(hDlg, IDC_MAP_ANNOTATIONS);
         temp                 = IsDlgButtonChecked(hDlg, IDC_TOOLBAR);
         toolbar_changed = (temp != config.toolbar);
         config.toolbar = temp;
         temp                 = IsDlgButtonChecked(hDlg, IDS_LATENCY0);
         lagbox_changed = (temp != config.lagbox);
         config.lagbox = temp;
         
         if (IsDlgButtonChecked(hDlg, IDC_MUSIC) != config.play_music)
            UserToggleMusic(config.play_music);
         config.play_music = IsDlgButtonChecked(hDlg, IDC_MUSIC);
         
         config.play_sound = IsDlgButtonChecked(hDlg, IDC_SOUNDFX);
         config.play_loop_sounds = IsDlgButtonChecked(hDlg, IDC_LOOPSOUNDS);
         config.play_random_sounds = IsDlgButtonChecked(hDlg, IDC_RANDSOUNDS);
         if (!config.play_sound)
            SoundAbort();

         new_val = Trackbar_GetPos(GetDlgItem(hDlg, IDC_MUSIC_VOLUME));
         if (new_val != config.music_volume)
         {
            config.music_volume = new_val;
            ResetMusicVolume();
         }

         // Don't need to dynamically update sound volume, because
         // looping sounds are updated as player moves around.
         config.sound_volume = Trackbar_GetPos(GetDlgItem(hDlg, IDC_SOUND_VOLUME));

         if( IsDlgButtonChecked( hDlg, IDC_TARGETHALO1 ) == BST_CHECKED )
            config.halocolor = 0;
         else if( IsDlgButtonChecked( hDlg, IDC_TARGETHALO2 ) == BST_CHECKED )
            config.halocolor = 1;
         else
            config.halocolor = 2;
         
         config.colorcodes = IsDlgButtonChecked(hDlg, IDC_COLORCODES);
         
         // Redraw main window to reflect new settings
         if (toolbar_changed || lagbox_changed)
         {
            ResizeAll();
         }
         else
         {
            InvalidateRect(hMain, NULL, TRUE);
            RedrawAll();
         }
         
         EditBoxSetNormalFormat();
         
         EndDialog(hDlg, IDOK);
         return TRUE;
      }
      break;
      
   case WM_DESTROY:
      // Restore working drive and directory
      if (chdir(dir) != 0)
         debug(("chdir failed to %s\n", dir));
      SafeFree(dir);
      
      hPreferencesDialog = NULL;
      return TRUE;
   }
   return FALSE;
}
Example #17
0
void xCanvas::EraseAll()
{
	ClearStrokes();
	RedrawAll();
}
Example #18
0
/*
 * GraphicsAreaResize:  Set view variable to reflect size of window.
 *   Use when window is resized, and on startup.
 */
void GraphicsAreaResize(int xsize, int ysize)
{
   int new_xsize, new_ysize;  /* Need signed #s */
   Bool must_redraw = False;

   int max_width, max_height;
   int stretchfactor = config.large_area ? 2 : 1;

   int iHeightAvailableForMapAndStats;

   max_width  = stretchfactor * MAXX;
   max_height = stretchfactor * MAXY;

   new_xsize = min(xsize - INVENTORY_MIN_WIDTH, max_width);

   new_ysize = ysize - TEXT_AREA_MIN_HEIGHT - BOTTOM_BORDER - GetTextInputHeight() - TOP_BORDER - EDGETREAT_HEIGHT * 2;
   if (config.toolbar)
     new_ysize -= TOOLBAR_BUTTON_HEIGHT - MIN_TOP_TOOLBAR;
   else new_ysize -= MIN_TOP_NOTOOLBAR;
   new_ysize = min(new_ysize, max_height);   

   /* Make sizes divisible by 4.  Must be even for draw3d, and when 
    * stretchfactor = 2, need divisible by 4 so that room fits exactly in view */
   new_xsize &= ~3;
   new_ysize &= ~3;

   if (new_xsize < 0)
      new_xsize = 0;
   if (new_ysize < 0)
      new_ysize = 0;

   /* Move grid area to appropriate place */
   view.x = LEFT_BORDER + HIGHLIGHT_THICKNESS + EDGETREAT_WIDTH;
   view.y = HIGHLIGHT_THICKNESS;
   if (config.toolbar)
     view.y += TOOLBAR_Y + TOOLBAR_BUTTON_HEIGHT + MIN_TOP_TOOLBAR;
   else view.y += TOP_BORDER + MIN_TOP_NOTOOLBAR + EDGETREAT_HEIGHT;
   
   if (new_xsize != view.cx || new_ysize != view.cy)
      must_redraw = True;

   view.cx = new_xsize;
   view.cy = new_ysize;

   D3DRenderResizeDisplay(view.x, view.y, view.cx, view.cy);

   //	areaMiniMap added by ajw.
   areaMiniMap.x	= view.x + view.cx + LEFT_BORDER + 2 * HIGHLIGHT_THICKNESS + MAPTREAT_WIDTH;
   areaMiniMap.cx	= min( xsize - areaMiniMap.x - 2 * HIGHLIGHT_THICKNESS - EDGETREAT_WIDTH - MAPTREAT_WIDTH, MINIMAP_MAX_WIDTH );

   areaMiniMap.y	= 2 * TOP_BORDER + USERAREA_HEIGHT + EDGETREAT_HEIGHT + (MAPTREAT_HEIGHT * 2) - 1;

   iHeightAvailableForMapAndStats = ysize - areaMiniMap.y - 2 * HIGHLIGHT_THICKNESS - EDGETREAT_HEIGHT;

   areaMiniMap.cy	= (int)( iHeightAvailableForMapAndStats * PROPORTION_MINIMAP ) - HIGHLIGHT_THICKNESS - MAPTREAT_HEIGHT;
   areaMiniMap.cy	= min( areaMiniMap.cy, MINIMAP_MAX_HEIGHT );

   areaMiniMap.cy -= (TOOLBAR_BUTTON_HEIGHT + TOOLBAR_SEPARATOR_WIDTH) * 2;
   areaMiniMap.y += (TOOLBAR_BUTTON_HEIGHT + TOOLBAR_SEPARATOR_WIDTH) * 2;

   MapMiniSizeChanged(&areaMiniMap);

   //	Tell view edge treatment elements to reposition themselves.
   ViewElementsReposition( &view );

   if (must_redraw)
   {
      RedrawAll();
      RedrawForce();
   }
}
Example #19
0
void DrawPostOverlayEffects(room_type* room, Draw3DParams* params)
{
   static DWORD timeLastFrame = 0;
   DWORD timeCurrent, timeDelta;
   int amount;

   timeCurrent = timeGetTime();
   timeDelta = timeCurrent - timeLastFrame;
   timeLastFrame = timeCurrent;

   // May be drawn over room or map.

   // Blurred Vision.
   if (effects.blur)
   {
      // Blur by 1-EFFECT_BLUR_AMPLITUDE pixels
      amount = (effects.blur / EFFECT_BLUR_RATE) % (2 * EFFECT_BLUR_AMPLITUDE);
      if (amount > EFFECT_BLUR_AMPLITUDE)
	 amount = 2 * EFFECT_BLUR_AMPLITUDE - amount;
      amount++;

      BlurDib(gBits, MAXX, MAXY, amount);
      RedrawAll();
      if (!config.animate)
	 effects.blur = 0;
   }

   // Wavering Vision.
   if (effects.waver)
   {
      static int offset = 0;
      offset++;
      WaverDib(gBits, MAXX, MAXY, offset);
      RedrawAll();
      if (!config.animate)
	 effects.waver = 0;
   }

   // Flash of XLAT.  Could be color, blindness, whatever.
   if (effects.flashxlat != XLAT_IDENTITY)
   {
      XlatDib(gBits, MAXX, MAXY, FindStandardXlat(effects.flashxlat));
      effects.duration -= (int)timeDelta;
      if (effects.duration <= 0)
      {
	 effects.flashxlat = XLAT_IDENTITY;
	 effects.duration = 0;
      }
   }

   if (effects.xlatOverride > 0)
   {
      XlatDib(gBits, MAXX, MAXY, FindStandardXlat(effects.xlatOverride));
      RedrawAll();
      return;
   }

   // Whiteout
   if (effects.whiteout > 500)
      XlatDib(gBits, MAXX, MAXY, FindStandardXlat(XLAT_BLEND100WHITE));
   else if (effects.whiteout > 250)
      XlatDib(gBits, MAXX, MAXY, FindStandardXlat(XLAT_BLEND90WHITE));
   else if (effects.whiteout > 0)
      XlatDib(gBits, MAXX, MAXY, FindStandardXlat(XLAT_BLEND80WHITE));
   if (!config.animate && effects.whiteout)
   {
      // Whiteout always shows up, but if not animating, it doesn't fade out, it blinks.
      effects.whiteout = 0;
      RedrawAll();
   }
   
   // Pain (always drawn last).
   if (!config.pain)
      return;
   if (effects.pain > 2000)
      XlatDib(gBits, MAXX, MAXY, FindStandardXlat(XLAT_BLEND80RED));
   else if (effects.pain > 1000)
      XlatDib(gBits, MAXX, MAXY, FindStandardXlat(XLAT_BLEND70RED));
   else if (effects.pain > 500)
      XlatDib(gBits, MAXX, MAXY, FindStandardXlat(XLAT_BLEND60RED));
   else if (effects.pain > 400)
      XlatDib(gBits, MAXX, MAXY, FindStandardXlat(XLAT_BLEND50RED));
   else if (effects.pain > 300)
      XlatDib(gBits, MAXX, MAXY, FindStandardXlat(XLAT_BLEND40RED));
   else if (effects.pain > 200)
      XlatDib(gBits, MAXX, MAXY, FindStandardXlat(XLAT_BLEND30RED));
   else if (effects.pain > 100)
      XlatDib(gBits, MAXX, MAXY, FindStandardXlat(XLAT_BLEND20RED));
   else if (effects.pain)
      XlatDib(gBits, MAXX, MAXY, FindStandardXlat(XLAT_BLEND10RED));
   
   if (!config.animate && effects.pain)
   {
      // Pain always shows up, but if not animating, it doesn't fade out, it blinks.
      effects.pain = 0;
      RedrawAll();
   }
}
Example #20
0
/*
 * GraphicsToggleMap:  Toggle map display on and off.
 */
void GraphicsToggleMap(void)
{
   map = !map;

   RedrawAll();
}
Example #21
0
/*
 * CommandShowMap:  "showmap" command.
 */
void CommandShowMap(char *args)
{
  MapShowAllWalls(cinfo->current_room, True);
  RedrawAll();
}