1
1
Fork 0
mirror of https://github.com/QB64Official/qb64.git synced 2024-07-05 07:40:24 +00:00

Remove teapot, decrease executable by 18K

This commit is contained in:
Luke Ceddia 2017-08-18 20:20:14 +10:00
parent 8238feba75
commit 995f563d0c
6 changed files with 5 additions and 2647 deletions

View file

@ -20,11 +20,10 @@ gcc -s -O2 -c ../../src/freeglut_state.c -o temp/freeglut_state.o
gcc -s -O2 -c ../../src/freeglut_stroke_mono_roman.c -o temp/freeglut_stroke_mono_roman.o
gcc -s -O2 -c ../../src/freeglut_stroke_roman.c -o temp/freeglut_stroke_roman.o
gcc -s -O2 -c ../../src/freeglut_structure.c -o temp/freeglut_structure.o
gcc -s -O2 -c ../../src/freeglut_teapot.c -o temp/freeglut_teapot.o
gcc -s -O2 -c ../../src/freeglut_videoresize.c -o temp/freeglut_videoresize.o
gcc -s -O2 -c ../../src/freeglut_window.c -o temp/freeglut_window.o
gcc -s -O2 -c ../../src/freeglut_xinput.c -o temp/freeglut_xinput.o
ar rcs src.a temp/freeglut_callbacks.o temp/freeglut_cursor.o temp/freeglut_display.o temp/freeglut_ext.o temp/freeglut_font.o temp/freeglut_font_data.o temp/freeglut_gamemode.o temp/freeglut_geometry.o temp/freeglut_glutfont_definitions.o temp/freeglut_init.o temp/freeglut_input_devices.o temp/freeglut_joystick.o temp/freeglut_main.o temp/freeglut_menu.o temp/freeglut_misc.o temp/freeglut_overlay.o temp/freeglut_spaceball.o temp/freeglut_state.o temp/freeglut_stroke_mono_roman.o temp/freeglut_stroke_roman.o temp/freeglut_structure.o temp/freeglut_teapot.o temp/freeglut_videoresize.o temp/freeglut_window.o temp/freeglut_xinput.o
ar rcs src.a temp/freeglut_callbacks.o temp/freeglut_cursor.o temp/freeglut_display.o temp/freeglut_ext.o temp/freeglut_font.o temp/freeglut_font_data.o temp/freeglut_gamemode.o temp/freeglut_geometry.o temp/freeglut_glutfont_definitions.o temp/freeglut_init.o temp/freeglut_input_devices.o temp/freeglut_joystick.o temp/freeglut_main.o temp/freeglut_menu.o temp/freeglut_misc.o temp/freeglut_overlay.o temp/freeglut_spaceball.o temp/freeglut_state.o temp/freeglut_stroke_mono_roman.o temp/freeglut_stroke_roman.o temp/freeglut_structure.o temp/freeglut_videoresize.o temp/freeglut_window.o temp/freeglut_xinput.o
echo "Press any key to continue..."
Pause()
{

View file

@ -19,9 +19,8 @@
..\..\..\..\c_compiler\bin\gcc -s -O2 -c ..\..\src\freeglut_stroke_mono_roman.c -o temp\freeglut_stroke_mono_roman.o
..\..\..\..\c_compiler\bin\gcc -s -O2 -c ..\..\src\freeglut_stroke_roman.c -o temp\freeglut_stroke_roman.o
..\..\..\..\c_compiler\bin\gcc -s -O2 -c ..\..\src\freeglut_structure.c -o temp\freeglut_structure.o
..\..\..\..\c_compiler\bin\gcc -s -O2 -c ..\..\src\freeglut_teapot.c -o temp\freeglut_teapot.o
..\..\..\..\c_compiler\bin\gcc -s -O2 -c ..\..\src\freeglut_videoresize.c -o temp\freeglut_videoresize.o
..\..\..\..\c_compiler\bin\gcc -s -O2 -c ..\..\src\freeglut_window.c -o temp\freeglut_window.o
..\..\..\..\c_compiler\bin\gcc -s -O2 -c ..\..\src\freeglut_xinput.c -o temp\freeglut_xinput.o
..\..\..\..\c_compiler\bin\ar rcs src.a temp\freeglut_callbacks.o temp\freeglut_cursor.o temp\freeglut_display.o temp\freeglut_ext.o temp\freeglut_font.o temp\freeglut_font_data.o temp\freeglut_gamemode.o temp\freeglut_geometry.o temp\freeglut_glutfont_definitions.o temp\freeglut_init.o temp\freeglut_input_devices.o temp\freeglut_joystick.o temp\freeglut_main.o temp\freeglut_menu.o temp\freeglut_misc.o temp\freeglut_overlay.o temp\freeglut_spaceball.o temp\freeglut_state.o temp\freeglut_stroke_mono_roman.o temp\freeglut_stroke_roman.o temp\freeglut_structure.o temp\freeglut_teapot.o temp\freeglut_videoresize.o temp\freeglut_window.o temp\freeglut_xinput.o
..\..\..\..\c_compiler\bin\ar rcs src.a temp\freeglut_callbacks.o temp\freeglut_cursor.o temp\freeglut_display.o temp\freeglut_ext.o temp\freeglut_font.o temp\freeglut_font_data.o temp\freeglut_gamemode.o temp\freeglut_geometry.o temp\freeglut_glutfont_definitions.o temp\freeglut_init.o temp\freeglut_input_devices.o temp\freeglut_joystick.o temp\freeglut_main.o temp\freeglut_menu.o temp\freeglut_misc.o temp\freeglut_overlay.o temp\freeglut_spaceball.o temp\freeglut_state.o temp\freeglut_stroke_mono_roman.o temp\freeglut_stroke_roman.o temp\freeglut_structure.o temp\freeglut_videoresize.o temp\freeglut_window.o temp\freeglut_xinput.o
pause

View file

@ -1,6 +1,6 @@
#ifndef FREEGLUT_STATIC
#define FREEGLUT_STATIC
#endif
#ifndef FREEGLUT_STATIC
#define FREEGLUT_STATIC
#endif
/*
* freeglut_ext.c
*
@ -139,8 +139,6 @@ static GLUTproc fghGetGLUTProcAddress( const char* procName )
CHECK_NAME(glutSolidTorus);
CHECK_NAME(glutWireDodecahedron);
CHECK_NAME(glutSolidDodecahedron);
CHECK_NAME(glutWireTeapot);
CHECK_NAME(glutSolidTeapot);
CHECK_NAME(glutWireOctahedron);
CHECK_NAME(glutSolidOctahedron);
CHECK_NAME(glutWireTetrahedron);

View file

@ -531,12 +531,6 @@ FGAPI void FGAPIENTRY glutSolidTetrahedron( void );
FGAPI void FGAPIENTRY glutWireIcosahedron( void );
FGAPI void FGAPIENTRY glutSolidIcosahedron( void );
/*
* Teapot rendering functions, found in freeglut_teapot.c
*/
FGAPI void FGAPIENTRY glutWireTeapot( GLdouble size );
FGAPI void FGAPIENTRY glutSolidTeapot( GLdouble size );
/*
* Game mode functions, see freeglut_gamemode.c
*/

View file

@ -1,203 +0,0 @@
#ifndef FREEGLUT_STATIC
#define FREEGLUT_STATIC
#endif
/*
* freeglut_teapot.c
*
* Teapot(tm) rendering code.
*
* Copyright (c) 1999-2000 Pawel W. Olszta. All Rights Reserved.
* Written by Pawel W. Olszta, <olszta@sourceforge.net>
* Creation date: Fri Dec 24 1999
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/*
* Original teapot code copyright follows:
*/
/*
* (c) Copyright 1993, Silicon Graphics, Inc.
*
* ALL RIGHTS RESERVED
*
* Permission to use, copy, modify, and distribute this software
* for any purpose and without fee is hereby granted, provided
* that the above copyright notice appear in all copies and that
* both the copyright notice and this permission notice appear in
* supporting documentation, and that the name of Silicon
* Graphics, Inc. not be used in advertising or publicity
* pertaining to distribution of the software without specific,
* written prior permission.
*
* THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU
* "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR
* OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN NO
* EVENT SHALL SILICON GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE
* ELSE FOR ANY DIRECT, SPECIAL, INCIDENTAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER,
* INCLUDING WITHOUT LIMITATION, LOSS OF PROFIT, LOSS OF USE,
* SAVINGS OR REVENUE, OR THE CLAIMS OF THIRD PARTIES, WHETHER OR
* NOT SILICON GRAPHICS, INC. HAS BEEN ADVISED OF THE POSSIBILITY
* OF SUCH LOSS, HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* ARISING OUT OF OR IN CONNECTION WITH THE POSSESSION, USE OR
* PERFORMANCE OF THIS SOFTWARE.
*
* US Government Users Restricted Rights
*
* Use, duplication, or disclosure by the Government is subject to
* restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
* (c)(1)(ii) of the Rights in Technical Data and Computer
* Software clause at DFARS 252.227-7013 and/or in similar or
* successor clauses in the FAR or the DOD or NASA FAR
* Supplement. Unpublished-- rights reserved under the copyright
* laws of the United States. Contractor/manufacturer is Silicon
* Graphics, Inc., 2011 N. Shoreline Blvd., Mountain View, CA
* 94039-7311.
*
* OpenGL(TM) is a trademark of Silicon Graphics, Inc.
*/
#include "freeglut.h"
#include "freeglut_internal.h"
#include "freeglut_teapot_data.h"
/* -- PRIVATE FUNCTIONS ---------------------------------------------------- */
static void fghTeapot( GLint grid, GLdouble scale, GLenum type )
{
#if defined(_WIN32_WCE)
int i, numV=sizeof(strip_vertices)/4, numI=sizeof(strip_normals)/4;
#else
double p[4][4][3], q[4][4][3], r[4][4][3], s[4][4][3];
long i, j, k, l;
#endif
glPushAttrib( GL_ENABLE_BIT | GL_EVAL_BIT );
glEnable( GL_AUTO_NORMAL );
glEnable( GL_NORMALIZE );
glEnable( GL_MAP2_VERTEX_3 );
glEnable( GL_MAP2_TEXTURE_COORD_2 );
glPushMatrix();
glRotated( 270.0, 1.0, 0.0, 0.0 );
glScaled( 0.5 * scale, 0.5 * scale, 0.5 * scale );
glTranslated( 0.0, 0.0, -1.5 );
#if defined(_WIN32_WCE)
glRotated( 90.0, 1.0, 0.0, 0.0 );
glBegin( GL_TRIANGLE_STRIP );
for( i = 0; i < numV-1; i++ )
{
int vidx = strip_vertices[i],
nidx = strip_normals[i];
if( vidx != -1 )
{
glNormal3fv( normals[nidx] );
glVertex3fv( vertices[vidx] );
}
else
{
glEnd();
glBegin( GL_TRIANGLE_STRIP );
}
}
glEnd();
#else
for (i = 0; i < 10; i++) {
for (j = 0; j < 4; j++) {
for (k = 0; k < 4; k++) {
for (l = 0; l < 3; l++) {
p[j][k][l] = cpdata[patchdata[i][j * 4 + k]][l];
q[j][k][l] = cpdata[patchdata[i][j * 4 + (3 - k)]][l];
if (l == 1)
q[j][k][l] *= -1.0;
if (i < 6) {
r[j][k][l] =
cpdata[patchdata[i][j * 4 + (3 - k)]][l];
if (l == 0)
r[j][k][l] *= -1.0;
s[j][k][l] = cpdata[patchdata[i][j * 4 + k]][l];
if (l == 0)
s[j][k][l] *= -1.0;
if (l == 1)
s[j][k][l] *= -1.0;
}
}
}
}
glMap2d(GL_MAP2_TEXTURE_COORD_2, 0.0, 1.0, 2, 2, 0.0, 1.0, 4, 2,
&tex[0][0][0]);
glMap2d(GL_MAP2_VERTEX_3, 0.0, 1.0, 3, 4, 0.0, 1.0, 12, 4,
&p[0][0][0]);
glMapGrid2d(grid, 0.0, 1.0, grid, 0.0, 1.0);
glEvalMesh2(type, 0, grid, 0, grid);
glMap2d(GL_MAP2_VERTEX_3, 0.0, 1.0, 3, 4, 0.0, 1.0, 12, 4,
&q[0][0][0]);
glEvalMesh2(type, 0, grid, 0, grid);
if (i < 6) {
glMap2d(GL_MAP2_VERTEX_3, 0.0, 1.0, 3, 4, 0.0, 1.0, 12, 4,
&r[0][0][0]);
glEvalMesh2(type, 0, grid, 0, grid);
glMap2d(GL_MAP2_VERTEX_3, 0.0, 1.0, 3, 4, 0.0, 1.0, 12, 4,
&s[0][0][0]);
glEvalMesh2(type, 0, grid, 0, grid);
}
}
#endif /* defined(_WIN32_WCE) */
glPopMatrix();
glPopAttrib();
}
/* -- INTERFACE FUNCTIONS -------------------------------------------------- */
/*
* Renders a beautiful wired teapot...
*/
void FGAPIENTRY glutWireTeapot( GLdouble size )
{
FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutWireTeapot" );
/* We will use the general teapot rendering code */
fghTeapot( 10, size, GL_LINE );
}
/*
* Renders a beautiful filled teapot...
*/
void FGAPIENTRY glutSolidTeapot( GLdouble size )
{
FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutSolidTeapot" );
/* We will use the general teapot rendering code */
fghTeapot( 7, size, GL_FILL );
}
/*** END OF FILE ***/

File diff suppressed because it is too large Load diff