--- q_a/samples/spincube/paint.c 2018/08/09 18:29:19 1.1.1.1 +++ q_a/samples/spincube/paint.c 2018/08/09 18:29:20 1.1.1.2 @@ -1,4 +1,4 @@ -/************************************************************************\ +/******************************************************************************\ * * MODULE: PAINT.C * @@ -22,7 +22,11 @@ * XformVertices() - transforms normalized polyhedron * vertices using above matrix * -\************************************************************************/ +* +* Microsoft Developer Support +* Copyright (c) 1992 Microsoft Corporation +* +\******************************************************************************/ #include #include @@ -31,7 +35,7 @@ -/************************************************************************\ +/******************************************************************************\ * * FUNCTION: Paint * @@ -45,7 +49,7 @@ * * COMMENTS: Draws a polyhedron in the window. * -\************************************************************************/ +\******************************************************************************/ void Paint (HWND hWnd) { @@ -66,9 +70,9 @@ void Paint (HWND hWnd) ComputeXform (pSCI->xRotAngle, pSCI->yRotAngle, pSCI->zRotAngle); - /**********************************************************************\ - * If inMotion increment the rotation angles and release the memory - \**********************************************************************/ + // + // if inMotion increment the rotation angles and release the memory + // if (pSCI->inMotion) { @@ -83,18 +87,18 @@ void Paint (HWND hWnd) GetWindowRect (hWnd, &rect); - /**********************************************************************\ - * The rectangle we get back is in Desktop coordinates, so we need to - * modify it to reflect coordinates relative to this window. - \**********************************************************************/ + // + // The rectangle we get back is in Desktop coordinates, so we need to + // modify it to reflect coordinates relative to this window. + // rect.right -= rect.left; rect.bottom -= rect.top; rect.left = rect.top = 0; - /**********************************************************************\ - * Determine a "best fit" scale factor for our polyhedron - \**********************************************************************/ + // + // Determine a "best fit" scale factor for our polyhedron + // scale = (rect.right > rect.bottom) ? rect.bottom/4 : rect.right/4; for (i = 0; i < NUMVERTICES; i++) @@ -109,20 +113,20 @@ void Paint (HWND hWnd) BeginPaint (hWnd, &ps); - /**********************************************************************\ - * Draw the window frame & background - \**********************************************************************/ + // + // Draw the window frame & background + // SelectObject (ps.hdc, GetStockObject (GRAY_BRUSH)); Rectangle (ps.hdc, (int)rect.left, (int)rect.top, (int)rect.right, (int)rect.bottom); - /**********************************************************************\ - * Draw the polyhedron. We'll walk through the facets list and compute - * the normal for each facet- if the normal has z > 0, then the facet - * faces us and we'll draw it. Note that this algorithim is ONLY valid - * for scenes with a single, convex polyhedron. - \**********************************************************************/ + // + // Draw the polyhedron. We'll walk through the facets list and compute + // the normal for each facet- if the normal has z > 0, then the facet + // faces us and we'll draw it. Note that this algorithim is ONLY valid + // for scenes with a single, convex polyhedron. + // crColor = 0x00000f; @@ -159,7 +163,7 @@ void Paint (HWND hWnd) -/************************************************************************\ +/******************************************************************************\ * * FUNCTION: ComputeXform * @@ -172,7 +176,7 @@ void Paint (HWND hWnd) * COMMENTS: Computes a 3x2 tranformation matrix which rotates about * the Z axis, the Y axis, and the X axis, respectively. * -\************************************************************************/ +\******************************************************************************/ void ComputeXform (float xRotAngle, float yRotAngle, float zRotAngle) { @@ -195,7 +199,7 @@ void ComputeXform (float xRotAngle, floa -/************************************************************************\ +/******************************************************************************\ * * FUNCTION: XformVertices * @@ -210,7 +214,7 @@ void ComputeXform (float xRotAngle, floa * to translate each point so that it positioned relative to * the center of the window. * -\************************************************************************/ +\******************************************************************************/ void XformVertices (int xCenterWindow, int yCenterWindow) {