Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 28, 2005, 12:05:46 PM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: now Textures are maped as they should
before this textures where switched upside-down, now this is done in the corresponding model's textureCoordinate

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/graphics/importer/texture.cc

    r3966 r4357  
    1818#include "texture.h"
    1919
     20#include "debug.h"
    2021#include "graphics_engine.h"
     22
     23#include <SDL_image.h>
    2124
    2225/**
     
    167170
    168171          GLubyte* pixels = (GLubyte*)tmpSurf->pixels;
    169          
    170           /* this swaps the Mapping so lowel left will be upper left */
    171           for( int i = 0 ; i < (tmpSurf->h / 2) ; ++i )
    172             for( int j = 0 ; j < tmpSurf->w * tmpSurf->format->BytesPerPixel; j += tmpSurf->format->BytesPerPixel )
    173               for(int k = 0; k < tmpSurf->format->BytesPerPixel; ++k)
    174                 swap( pixels[(i * tmpSurf->w * tmpSurf->format->BytesPerPixel) + j + k],
    175                       pixels[ ( (tmpSurf->h - i - 1) * tmpSurf->w *  tmpSurf->format->BytesPerPixel) + j + k]);
    176172
    177173          PRINTF(3)("loading Image %s\n", imageName);
Note: See TracChangeset for help on using the changeset viewer.