]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - plugins/spritemodel/spritemodel.cpp
netradiant: strip 16-bit png to 8-bit, fix #153
[xonotic/netradiant.git] / plugins / spritemodel / spritemodel.cpp
index 286841331241f9b93a7fc62aeed9a65f2e4fd68f..8308416f63707626c0193124c1b3ab401c758a73 100644 (file)
@@ -1,6 +1,5 @@
 /*
-   Copyright (C) 1999-2007 id Software, Inc. and contributors.
-   For a list of contributors, see the accompanying CONTRIBUTORS file.
+   Copyright (C) 2002 Dominic Clifton.
 
    This file is part of GtkRadiant.
 
@@ -36,7 +35,7 @@ void LoadSpriteModel( entity_interfaces_t *interfaces, const char *name ){
 
        if ( !pShader ) {
                Sys_Printf( "ERROR: can't find shader (or image) for: %s\n", name );
-               return;
+               return; // NULL;
        }
 
        CSpriteModel *model = new CSpriteModel();
@@ -136,14 +135,14 @@ void CSpriteModel::Draw( int state, int rflags ) const {
 
        // so draw it using y/z instead.
        g_QglTable.m_pfn_qglBegin( GL_QUADS );
-       g_QglTable.m_pfn_qglTexCoord2f( 0,0 );
-       g_QglTable.m_pfn_qglVertex3f( 0,w,h );
-       g_QglTable.m_pfn_qglTexCoord2f( 1,0 );
-       g_QglTable.m_pfn_qglVertex3f( 0,0 - w,h );
-       g_QglTable.m_pfn_qglTexCoord2f( 1,1 );
-       g_QglTable.m_pfn_qglVertex3f( 0,0 - w,0 - h );
-       g_QglTable.m_pfn_qglTexCoord2f( 0,1 );
-       g_QglTable.m_pfn_qglVertex3f( 0,w,0 - h );
+       g_QglTable.m_pfn_qglTexCoord2f( 0.0f, 0.0f );
+       g_QglTable.m_pfn_qglVertex3f( 0.0f, static_cast<float>( w ), static_cast<float>( h ) );
+       g_QglTable.m_pfn_qglTexCoord2f( 1.0f, 0.0f );
+       g_QglTable.m_pfn_qglVertex3f( 0.0f, 0.0f - static_cast<float>( w ), static_cast<float>( h ) );
+       g_QglTable.m_pfn_qglTexCoord2f( 1.0f, 1.0f );
+       g_QglTable.m_pfn_qglVertex3f( 0.0f, 0.0f - static_cast<float>( w ), 0.0f - static_cast<float>( h ) );
+       g_QglTable.m_pfn_qglTexCoord2f( 0.0f, 0.0f );
+       g_QglTable.m_pfn_qglVertex3f( 0.0f, static_cast<float>( w ), 0.0f - static_cast<float>( h ) );
        g_QglTable.m_pfn_qglEnd();
 #endif