diff --git a/alienblaster/Application.mk b/alienblaster/Application.mk new file mode 100644 index 000000000..8617f67fc --- /dev/null +++ b/alienblaster/Application.mk @@ -0,0 +1,2 @@ +APP_PROJECT_PATH := $(call my-dir)/project +APP_MODULES := stlport sdl alienblaster sdl_mixer tremor diff --git a/alienblaster/project/AndroidManifest.xml b/alienblaster/project/AndroidManifest.xml new file mode 100644 index 000000000..fad854a7f --- /dev/null +++ b/alienblaster/project/AndroidManifest.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + diff --git a/alienblaster/project/build.xml b/alienblaster/project/build.xml new file mode 100644 index 000000000..d8aab5df5 --- /dev/null +++ b/alienblaster/project/build.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/alienblaster/project/default.properties b/alienblaster/project/default.properties new file mode 100644 index 000000000..9d6f70d65 --- /dev/null +++ b/alienblaster/project/default.properties @@ -0,0 +1,13 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system use, +# "build.properties", and override values to adapt the script to your +# project structure. + +# Project target. +target=android-4 +# Indicates whether an apk should be generated for each density. +split.density=false diff --git a/alienblaster/project/jni/Android.mk b/alienblaster/project/jni/Android.mk new file mode 100644 index 000000000..ddeffd00a --- /dev/null +++ b/alienblaster/project/jni/Android.mk @@ -0,0 +1,12 @@ + +# The namespace in Java file, with dots replaced with underscores +SDL_JAVA_PACKAGE_PATH := de_schwardtnet_alienblaster + +# Path to files with application data - they should be downloaded from Internet on first app run inside +# Java sources, or unpacked from resources (TODO) +# Typically /sdcard/alienblaster +# Or /data/data/de.schwardtnet.alienblaster/files if you're planning to unpack data in application private folder +# Your application will just set current directory there +SDL_CURDIR_PATH := /sdcard/alienblaster + +include $(call all-subdir-makefiles) diff --git a/alienblaster/project/jni/alienblaster/Android.mk b/alienblaster/project/jni/alienblaster/Android.mk new file mode 100644 index 000000000..239c1d814 --- /dev/null +++ b/alienblaster/project/jni/alienblaster/Android.mk @@ -0,0 +1,29 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := alienblaster + +CG_SUBDIRS := \ +src \ + +# Add more subdirs here, like src/subdir1 src/subdir2 + +LOCAL_CFLAGS := $(foreach D, $(CG_SUBDIRS), -I$(CG_SRCDIR)/$(D)) \ + -I$(LOCAL_PATH)/../sdl/include \ + -I$(LOCAL_PATH)/../sdl_mixer \ + -I$(LOCAL_PATH)/../stlport/stlport \ + +#Change C++ file extension as appropriate +LOCAL_CPP_EXTENSION := .cpp + +LOCAL_SRC_FILES := $(foreach F, $(CG_SUBDIRS), $(addprefix $(F)/,$(notdir $(wildcard $(LOCAL_PATH)/$(F)/*.cpp)))) +# Uncomment to also add C sources +LOCAL_SRC_FILES += $(foreach F, $(CG_SUBDIRS), $(addprefix $(F)/,$(notdir $(wildcard $(LOCAL_PATH)/$(F)/*.c)))) + +LOCAL_STATIC_LIBRARIES := sdl_mixer sdl tremor stlport + +LOCAL_LDLIBS := -lGLESv1_CM -ldl -llog + +include $(BUILD_SHARED_LIBRARY) + diff --git a/alienblaster/project/jni/alienblaster/src/Makefile b/alienblaster/project/jni/alienblaster/src/Makefile new file mode 100644 index 000000000..d878306ee --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/Makefile @@ -0,0 +1,66 @@ +# game name +GAME_NAME=alienBlaster + +# the compiler to use +COMPILER=g++ + +# include path +INCLUDE_PATH=-I. + +#OPTIMIZATION=-g -pg -fprofile-arcs +#OPTIMIZATION=-O3 +OPTIMIZATION=-g +#OPTIMIZATION= + +# SDL library +SDL_LIBS=$(shell sdl-config --libs) +SDL_FLAGS=$(shell sdl-config --cflags) + +# game flags +GAME_FLAGS=-D_GNU_SOURCE -Wall -Winline -finline-functions $(SDL_FLAGS) $(OPTIMIZATION) +GAME_LIBS=-lSDL_mixer $(SDL_LIBS) $(OPTIMIZATION) + +# all objectfiles +OBJECT_FILES=main.o surfaceDB.o soundDB.o options.o geometry.o video.o game.o \ + racer.o racers.o shots.o shot.o boundingBox.o items.o item.o font.o \ + explosion.o explosions.o mixer.o enemys.o enemy.o wrecks.o wreck.o \ + settings.o intro.o setDifficulty.o global.o formation.o infoscreen.o \ + menuArcadeMode.o sonic.o banners.o banner.o smokePuff.o smokePuffs.o \ + shieldGlow.o background.o input.o + +.PHONY: all game clean realclean rebuild tgz + +all: depend $(GAME_NAME) + +clean: + rm -f *.o *.da + +realclean: + rm -f *.o *.da *~ Makefile.dep + +rebuild: realclean game + +.SUFFIXES: .cc + +# How to compile a c++ programm +$(GAME_NAME): $(OBJECT_FILES) + @echo "" + @echo "" + @echo "Linking $@" + @$(COMPILER) $(GAME_LIBS) -o $(GAME_NAME) $(OBJECT_FILES) + mv $(GAME_NAME) ../ + +%.o: %.cc + @echo "" + @echo "" + @echo "Compiling $<" + @$(COMPILER) $(GAME_FLAGS) $(INCLUDE_PATH) -c $< -o $@ + +depend: dep + +dep: + -touch Makefile.dep + -makedepend $(INCLUDE_PATH) -Y -f Makefile.dep *.cc 2> /dev/null + -rm -f Makefile.dep.bak + +-include Makefile.dep diff --git a/alienblaster/project/jni/alienblaster/src/Makefile.dep b/alienblaster/project/jni/alienblaster/src/Makefile.dep new file mode 100644 index 000000000..e69de29bb diff --git a/alienblaster/project/jni/alienblaster/src/asstring.h b/alienblaster/project/jni/alienblaster/src/asstring.h new file mode 100644 index 000000000..a80f0ac99 --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/asstring.h @@ -0,0 +1,32 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +#ifndef _AS_STRING_H_ +#define _AS_STRING_H_ + +#include + +template std::string asString(const T& obj) { + std::ostringstream t; + t << obj; + std::string res(t.str()); + return res; +} + +#endif diff --git a/alienblaster/project/jni/alienblaster/src/background.cc b/alienblaster/project/jni/alienblaster/src/background.cc new file mode 100644 index 000000000..884719ee9 --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/background.cc @@ -0,0 +1,138 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +#include "background.h" +#include "global.h" +#include "surfaceDB.h" +#include "SDL.h" +#include + +using namespace std; + +Background::Background() { + minTileWidth = 9999999; + minTileHeight = 9999999; + tilesPerLine = 0; + tilesPerColumn = 0; + step = 0; +} + + +void Background::clearTileList() { + tileNames.clear(); + tilesPerLine = 0; + tilesPerColumn = 0; +} + + +void Background::addTile( string tilename ) { + tileNames.push_back( tilename ); +} + + +void Background::generateBackground( int length ) { + tileSurfaces.clear(); + minTileWidth = 9999999; + minTileHeight = 9999999; + + // load all tiles + vector< SDL_Surface* > tmpTiles; + for(int i=tileNames.size()-1; i>=0; i--) { + + SDL_Surface *tile = surfaceDB.loadSurface( tileNames[i] ); + + if (tile != NULL) { + tmpTiles.push_back( tile ); + if (tile->w < minTileWidth) { + minTileWidth = tile->w; + } + if (tile->h < minTileHeight) { + minTileHeight = tile->h; + } + } + } + + // calculate tiles per line and tiles per row + tilesPerLine = SCREEN_WIDTH / minTileWidth; + if (SCREEN_WIDTH % minTileWidth) { + tilesPerLine++; + } + tilesPerColumn = SCREEN_HEIGHT / minTileHeight; + if (SCREEN_HEIGHT % minTileHeight) { + tilesPerColumn++; + } + + int rows = length / minTileHeight; + if (length % minTileHeight) { + rows++; + } + + // cout << "Background: minTileWidth=" << minTileWidth << " minTileHeight=" << minTileHeight << " rows=" << rows << endl; + + // generate random background + for(int i=rows*tilesPerLine; i; i--) { + tileSurfaces.push_back( tmpTiles[ rand() % tmpTiles.size() ] ); + } +} + + +void Background::draw( SDL_Surface* screen ) { + step = (step+1) % (tilesPerColumn*minTileHeight); + draw( screen, step ); +} + + +void Background::draw( SDL_Surface* screen, int step ) { + if (step < 0) { + step *= -1; + } + int startLine = (step / minTileHeight); + int offset = (step % minTileHeight); + + SDL_Rect srcRect; + srcRect.x = 0; + srcRect.y = 0; + + SDL_Rect dstRect; + + for(int y = 0; y < tilesPerColumn+1; y++) { + for(int x = 0; x < tilesPerLine; x++) { + + int diffX = SCREEN_WIDTH - x * minTileWidth; + if ( diffX >= minTileWidth ) { + srcRect.w = minTileWidth; + } else { + srcRect.w = diffX; + } + dstRect.w = srcRect.w; + + if (y==0) { + int diffY = -(offset - minTileHeight); + srcRect.h = diffY; + } else { + srcRect.h = minTileHeight; + } + dstRect.h = srcRect.h; + + dstRect.x = x * minTileWidth; + dstRect.y = SCREEN_HEIGHT + offset - (y+1) * minTileHeight; + SDL_BlitSurface( tileSurfaces[ ((y+startLine)*tilesPerLine+x) % tileSurfaces.size()] , &srcRect, screen, &dstRect ); + } + } +} diff --git a/alienblaster/project/jni/alienblaster/src/background.h b/alienblaster/project/jni/alienblaster/src/background.h new file mode 100644 index 000000000..f2967a367 --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/background.h @@ -0,0 +1,51 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +#ifndef _BACKGROUND_H_ +#define _BACKGROUND_H_ + +#include +#include + +class SDL_Surface; + +class Background { + public: + Background(); + + void clearTileList(); + void addTile( std::string tilename ); + void generateBackground( int length ); + void draw( SDL_Surface* screen ); + void draw( SDL_Surface* screen, int step ); + + private: + + int minTileWidth; + int minTileHeight; + int tilesPerLine; + int tilesPerColumn; + int step; + + std::vector< std::string > tileNames; + std::vector< SDL_Surface* > tileSurfaces; +}; + + +#endif diff --git a/alienblaster/project/jni/alienblaster/src/banner.cc b/alienblaster/project/jni/alienblaster/src/banner.cc new file mode 100644 index 000000000..547d7ee00 --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/banner.cc @@ -0,0 +1,122 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +#include "banner.h" +#include "surfaceDB.h" +#include + +Banner::Banner( BannerTexts text, BannerModes mode, BannerBoni bonus ) { + sprite = surfaceDB.loadSurface( FN_BANNER_TEXTS[ text ], true ); + this->mode = mode; + if ( this->mode == BANNER_MODE_RANDOM ) { + this->mode = (BannerModes)(rand() % NR_BANNER_MODES); + } + this->bonus = bonus; + if ( this->bonus != BANNER_BONUS_NONE ) { + spriteBonus = surfaceDB.loadSurface( FN_BANNER_BONUS[ bonus ], true ); + } + + pos = Vector2D( -1000, -1000 ); + + if ( mode == BANNER_MODE_ITEM_COLLECTED_SINGLE_PLAYER ) { + pos = Vector2D( 10, SCREEN_HEIGHT - 20 - sprite->h ); + } else if ( mode == BANNER_MODE_ITEM_COLLECTED_PLAYER_ONE ) { + pos = Vector2D( 10, SCREEN_HEIGHT - 20 - sprite->h ); + } else if ( mode == BANNER_MODE_ITEM_COLLECTED_PLAYER_TWO ) { + pos = Vector2D( SCREEN_WIDTH - sprite->w - 10, + SCREEN_HEIGHT - 20 - sprite->h ); + } + timeLived = 0; +} + + +Banner::~Banner() {} + +bool Banner::isExpired() { + return timeLived > BANNER_MODE_LIFETIME[ mode ]; +} + + +void Banner::update( int dT ) { + timeLived += dT; + + switch ( mode ) { + case BANNER_MODE_FLY_FROM_LEFT: + { + if ( timeLived < 1000 ) { + pos = Vector2D( -(sprite->w) + ((SCREEN_WIDTH + sprite->w)/ 2) * (timeLived / 1000.0), + 200 - sprite->h / 2 ); + } else if ( 1000 < timeLived && timeLived < 3000 ) { + pos = Vector2D( ( SCREEN_WIDTH - sprite->w ) / 2, + 200 - sprite->h / 2 ); + } else { + pos = Vector2D( ((SCREEN_WIDTH - sprite->w)/2) + + ((SCREEN_WIDTH + sprite->w)/2)*((timeLived-3000)/2000.0), + 200 - sprite->h / 2 ); + } + break; + } + case BANNER_MODE_FROM_TOP: + { + if ( timeLived < 1000 ) { + pos = Vector2D( (SCREEN_WIDTH - sprite->w)/2, + -(sprite->h) + (200 + sprite->h/2) * (timeLived / 1000.0) ); + } else if ( 1000 < timeLived && timeLived < 3000 ) { + pos = Vector2D( (SCREEN_WIDTH - sprite->w)/2, + 200 - (sprite->h / 2 ) ); + } else { + pos = Vector2D( (SCREEN_WIDTH - sprite->w)/2, + 200 - (sprite->h / 2) + + (200 + (sprite->h / 2))*((timeLived-3000)/2000.0) ); + } + break; + } + case BANNER_MODE_ITEM_COLLECTED_SINGLE_PLAYER: + case BANNER_MODE_ITEM_COLLECTED_PLAYER_ONE: + case BANNER_MODE_ITEM_COLLECTED_PLAYER_TWO: + { + break; + } + default: + { + break; + } + } +} + +bool Banner::movingAway() { + return ( 3000 <= timeLived ); +} + +void Banner::draw(SDL_Surface *screen) { + SDL_Rect r; + r.x = lroundf(pos.getX()); + r.y = lroundf(pos.getY()); + r.w = sprite->w; + r.h = sprite->h; + SDL_BlitSurface( sprite, 0, screen, &r ); + if ( bonus != BANNER_BONUS_NONE && + 1000 < timeLived && timeLived < 3000 ) { + r.x = SCREEN_WIDTH / 2 - spriteBonus->w / 2; + r.y = 250; + r.w = spriteBonus->w; + r.h = spriteBonus->h; + SDL_BlitSurface( spriteBonus, 0, screen, &r ); + } +} diff --git a/alienblaster/project/jni/alienblaster/src/banner.h b/alienblaster/project/jni/alienblaster/src/banner.h new file mode 100644 index 000000000..35667e11b --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/banner.h @@ -0,0 +1,50 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +#ifndef BANNER_H +#define BANNER_H + +#include "SDL.h" +#include +#include "geometry.h" +#include "global.h" + +class Banner { + SDL_Surface *sprite; + SDL_Surface *spriteBonus; + + int sound; + + Vector2D pos; + int timeLived; + + BannerModes mode; + BannerBoni bonus; + + public: + Banner( BannerTexts text, BannerModes mode, BannerBoni bonus ); + ~Banner(); + + void update( int dT ); + void draw( SDL_Surface *screen ); + bool isExpired(); + bool movingAway(); +}; + +#endif diff --git a/alienblaster/project/jni/alienblaster/src/banners.cc b/alienblaster/project/jni/alienblaster/src/banners.cc new file mode 100644 index 000000000..21d872f95 --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/banners.cc @@ -0,0 +1,90 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +#include "banners.h" +#include "banner.h" + +using namespace std; + +Banners::Banners() {} + +Banners::~Banners() { + vector::iterator i; + for (i = banners.begin(); i != banners.end(); ++i) { + delete *i; + } +} + +void Banners::addBanner( BannerTexts bannerText, BannerModes mode, + BannerBoni bonus ) { + Banner *newBanner = new Banner( bannerText, mode, bonus ); + banners.push_back( newBanner ); +} + +void Banners::expireBanners() { + unsigned int i = 0; + while ( i < banners.size() ) { + if ( banners[i]->isExpired() ) { + delete banners[i]; + banners.erase(banners.begin() + i); + } else { + i++; + } + } +} + +void Banners::deleteAllBanners() { + unsigned int i = 0; + while ( i < banners.size() ) { + delete banners[i]; + i++; + } + banners.clear(); +} + +void Banners::update( int dT ) { + switch ( banners.size() ) { + case 0: break; + case 1: banners[0]->update( dT ); break; + default: + { + banners[0]->update( dT ); + if ( banners[0]->movingAway() ) { + banners[1]->update( dT ); + } + break; + } + } +} + +void Banners::draw(SDL_Surface *screen) { + switch ( banners.size() ) { + case 0: break; + case 1: banners[0]->draw( screen ); break; + default: + { + banners[0]->draw( screen ); + if ( banners[0]->movingAway() ) { + banners[1]->draw( screen ); + } + break; + } + } +} + diff --git a/alienblaster/project/jni/alienblaster/src/banners.h b/alienblaster/project/jni/alienblaster/src/banners.h new file mode 100644 index 000000000..ea08a1275 --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/banners.h @@ -0,0 +1,46 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +#ifndef BANNERS_H +#define BANNERS_H + +#include "SDL.h" +#include "global.h" +#include +#include + +class Banner; + +class Banners { + std::vector banners; + + public: + Banners(); + ~Banners(); + + void addBanner( BannerTexts bannerText, BannerModes mode=BANNER_MODE_RANDOM, + BannerBoni bonus=ARCADE_BONUS_FOR_FORMATION_DESTRUCTION ); + void expireBanners(); + void deleteAllBanners(); + void update( int dT ); + void draw(SDL_Surface *screen); +}; + + +#endif diff --git a/alienblaster/project/jni/alienblaster/src/boundingBox.cc b/alienblaster/project/jni/alienblaster/src/boundingBox.cc new file mode 100644 index 000000000..8877baf8e --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/boundingBox.cc @@ -0,0 +1,123 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +#include "boundingBox.h" +/* + void setX(Uint16 newX) {box.x = newX;} + void setY(Uint16 newY) {box.y = newY;} + void setWidth(Uint16 newWidth) {box.w = newWidth;} + void setHeight(Uint16 newHeight) {box.h = newHeight;} +*/ + +BoundingBox::BoundingBox(int x, int y, int width, int height) { + box.x = x; + box.y = y; + box.w = width; + box.h = height; +} + +int BoundingBox::getUpperBound() { + return box.y; +} + +int BoundingBox::getLowerBound() { + return box.y + box.h; +} + +int BoundingBox::getLeftBound() { + return box.x; +} + +int BoundingBox::getRightBound() { + return box.x + box.w; +} + +bool BoundingBox::overlaps(BoundingBox *other) { + return ( !(getUpperBound() > other->getLowerBound()) && + !(getLowerBound() < other-> getUpperBound()) && + !(getLeftBound() > other->getRightBound()) && + !(getRightBound() < other->getLeftBound()) ); +} + +bool BoundingBox::overlaps(const Vector2D &startOfLine, const Vector2D &endOfLine) { + + // FIXME: optimize me! + RectangleGeo rect( Vector2D( box.x, box.y ), + Vector2D( box.x + box.w, box.y + box.h ) ); + // FIXME: optimize me! + + bool overlaps = false; + + overlaps = rect.isInside( endOfLine ); + if ( overlaps ) return true; + overlaps = rect.isInside( startOfLine ); + if ( overlaps ) return true; + + // check some points between the two end points + Vector2D delta((endOfLine.getX() - startOfLine.getX()) / 4.0, + (endOfLine.getY() - startOfLine.getY()) / 4.0); + Vector2D actPoint = startOfLine + delta; + int i = 1; + while (!overlaps && i <= 3 ) { + overlaps = rect.isInside(actPoint); + actPoint += delta; + i++; + } + return overlaps; +} + +bool BoundingBox::overlaps(const Circle &circle) { + RectangleGeo rect( Vector2D( box.x, box.y ), + Vector2D( box.x + box.w, box.y + box.h ) ); + return (rect.isInside(circle.getCenter()) || + circle.isInside(rect.getPosLeftTop()) || + circle.isInside(rect.getPosRightBottom()) || + circle.isInside(Vector2D( box.x, box.y + box.h )) || + circle.isInside(Vector2D( box.x + box.w, box.y ))); +} + +void BoundingBox::modifyX(int value) { + box.x += value; +} + +void BoundingBox::modifyY(int value) { + box.y += value; +} + +void BoundingBox::moveUpperBound(int upperBound) { + box.y = upperBound; +} + +void BoundingBox::moveLowerBound(int lowerBound) { + box.y = lowerBound - box.h; +} + +void BoundingBox::moveLeftBound(int leftBound) { + box.x = leftBound; +} + +void BoundingBox::moveRightBound(int rightBound) { + box.x = rightBound - box.w; +} + +/* +SDL_Rect *BoundingBox::getRect() { + return &box; +} +*/ diff --git a/alienblaster/project/jni/alienblaster/src/boundingBox.h b/alienblaster/project/jni/alienblaster/src/boundingBox.h new file mode 100644 index 000000000..7510af6f2 --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/boundingBox.h @@ -0,0 +1,54 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +#ifndef BOUNDING_BOX_H +#define BOUNDING_BOX_H + +#include "SDL.h" +#include "geometry.h" + +struct MyRect { + int x, y, w, h; +}; + +class BoundingBox { + +private: + //SDL_Rect box; + MyRect box; + +public: + BoundingBox(int x, int y, int width, int height); + int getUpperBound(); + int getLowerBound(); + int getLeftBound(); + int getRightBound(); + bool overlaps(BoundingBox *other); + bool overlaps(const Vector2D &startOfLine, const Vector2D &endOfLine); + bool overlaps(const Circle &circle); + void modifyX(int value); + void modifyY(int value); + void moveUpperBound(int upperBound); + void moveLowerBound(int lowerBound); + void moveLeftBound(int leftBound); + void moveRightBound(int rightBound); + // SDL_Rect *getRect(); +}; + +#endif diff --git a/alienblaster/project/jni/alienblaster/src/enemy.cc b/alienblaster/project/jni/alienblaster/src/enemy.cc new file mode 100644 index 000000000..7a75a819f --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/enemy.cc @@ -0,0 +1,537 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +#include "enemy.h" +#include "SDL.h" +#include "surfaceDB.h" +#include "boundingBox.h" +#include "mixer.h" +#include "shots.h" +#include "shot.h" +#include "racers.h" +#include "racer.h" +#include "items.h" +#include "item.h" +#include "wrecks.h" +#include "wreck.h" +#include "global.h" +#include "explosions.h" +#include "explosion.h" +#include "options.h" + +Enemy::Enemy( Vector2D pos, Vector2D vel, EnemyTypes whichEnemyType, + bool isInFormation, bool fireByFormation ) { + + this->isInFormation = isInFormation; + this->fireByFormation = fireByFormation; + enemyType = whichEnemyType; + hitpoints = ENEMY_HITPOINTS[ enemyType ]; + + this->pos = pos; + this->vel = vel; + relTargetPos = Vector2D(0,0); + + switch ( enemyType ) { + case FIGHTER: + { + string fn = LVL_ENEMY_FIGHTER; + levelConf->getStr( LVL_ENEMY_FIGHTER, fn ); + spriteEnemy = surfaceDB.loadSurface( fn ); + + fn = LVL_ENEMY_FIGHTER_SHADOW; + levelConf->getStr( LVL_ENEMY_FIGHTER_SHADOW, fn ); + spriteShadow = surfaceDB.loadSurface( fn, true ); + break; + } + case BOMBER: + { + string fn = LVL_ENEMY_BOMBER; + levelConf->getStr( LVL_ENEMY_BOMBER, fn ); + spriteEnemy = surfaceDB.loadSurface( fn ); + + fn = LVL_ENEMY_BOMBER_SHADOW; + levelConf->getStr( LVL_ENEMY_BOMBER_SHADOW, fn ); + spriteShadow = surfaceDB.loadSurface( fn, true ); + break; + } + case TANK: + { + string fn = LVL_ENEMY_TANK; + levelConf->getStr( LVL_ENEMY_TANK, fn ); + spriteEnemy = surfaceDB.loadSurface( fn ); + break; + } + + case BOSS_1_MAIN_GUN: + { + string fn = LVL_ENEMY_BOSS_1_MAIN_GUN; + levelConf->getStr( LVL_ENEMY_BOSS_1_MAIN_GUN, fn ); + spriteEnemy = surfaceDB.loadSurface( fn ); + break; + } + case BOSS_1_ROCKET_LAUNCHER: + { + string fn = LVL_ENEMY_BOSS_1_ROCKET_LAUNCHER; + levelConf->getStr( LVL_ENEMY_BOSS_1_ROCKET_LAUNCHER, fn ); + spriteEnemy = surfaceDB.loadSurface( fn ); + break; + } + case BOSS_1_SHOT_BATTERY_LEFT: + { + string fn = LVL_ENEMY_BOSS_1_SHOT_BATTERY_LEFT; + levelConf->getStr( LVL_ENEMY_BOSS_1_SHOT_BATTERY_LEFT, fn ); + spriteEnemy = surfaceDB.loadSurface( fn ); + break; + } + case BOSS_1_SHOT_BATTERY_RIGHT: + { + string fn = LVL_ENEMY_BOSS_1_SHOT_BATTERY_RIGHT; + levelConf->getStr( LVL_ENEMY_BOSS_1_SHOT_BATTERY_RIGHT, fn ); + spriteEnemy = surfaceDB.loadSurface( fn ); + break; + } + case BOSS_2: + { + spriteEnemy = surfaceDB.loadSurface( FN_ENEMY_BOSS_2 ); + spriteShadow = surfaceDB.loadSurface( FN_ENEMY_BOSS_2_SHADOW, true ); + boss2PointReached = false; + boss2TargetPos = Vector2D(SCREEN_WIDTH / 2, 100); + break; + } + + default: + { + string fn = LVL_ENEMY_FIGHTER; + levelConf->getStr( LVL_ENEMY_FIGHTER, fn ); + spriteEnemy = surfaceDB.loadSurface( fn ); + break; + } + } + + boundingBox = new BoundingBox( lroundf(pos.getX() - spriteEnemy->w * 0.45), + lroundf(pos.getY() - spriteEnemy->h * 0.45), + lroundf(spriteEnemy->w * 0.9), + lroundf(spriteEnemy->h * 0.9) ); + nextShotPrimary = rand() % (ENEMY_RAND_WAIT_PRIMARY[ enemyType ]+1); + nextShotSecondary = rand() % (ENEMY_RAND_WAIT_SECONDARY[ enemyType ]+1); + + sndShotPrimary = mixer.loadSample( FN_SOUND_SHOT_PRIMARY ); + sndShotSecondary = mixer.loadSample( FN_SOUND_SHOT_SECONDARY ); +} + +Enemy::~Enemy() { + delete boundingBox; +} + + +bool Enemy::isExpired() { + return ( hitpoints <= 0 || + pos.getY() < -500 || + pos.getY() > SCREEN_HEIGHT + 500 || + pos.getX() < -500 || + pos.getX() > SCREEN_WIDTH + 500 ); +} + + +void Enemy::expire() { + hitpoints = -1; +} + +Circle Enemy::getBoundingCircle() { + return Circle( pos, min(spriteEnemy->w / 2, spriteEnemy->h / 2) ); +} + +BoundingBox *Enemy::getBoundingBox() { + return boundingBox; +} + +bool Enemy::collidesWith( const Vector2D &shotPosOld, const Vector2D &shotPosNew ) { + return boundingBox->overlaps(shotPosOld, shotPosNew); +} + +bool Enemy::collidesWith( BoundingBox *box ) { + return boundingBox->overlaps( box ); +} + +bool Enemy::collidesWith( const Circle &circle ) { + return boundingBox->overlaps( circle ); +} + +bool Enemy::collidesWithAsCircle( const Circle &circle ) { + return ( circle.getRadius() + spriteEnemy->w / 2 > circle.getCenter().distanceTo( pos ) ); +} + +bool Enemy::collidesWithAsCircle( BoundingBox *box ) { + return ( box->overlaps( Circle( pos, min( spriteEnemy->h / 2, spriteEnemy->w / 2 ) ) ) ); +} + + +void Enemy::update( int dT ) { + move( dT ); + if ( !fireByFormation ) { + shootPrimary( dT ); + shootSecondary( dT ); + } +} + +void Enemy::move( int dT ) { + switch ( enemyType ) { + case FIGHTER: + case BOMBER: + { + if ( scrollingOn ) pos += vel * dT / 1000.0; + else pos += (vel - SCROLL_SPEED) * dT / 1000.0; + if ( isInFormation && relTargetPos != Vector2D(0,0) ) { + Vector2D addMovement = + Vector2D( 40, relTargetPos.getDirection(), POLAR ) * dT / 1000.0; + if ( addMovement.getLength() > relTargetPos.getLength() ) { + addMovement.setLength( relTargetPos.getLength() ); + } + pos += addMovement; + relTargetPos -= addMovement; + } + updateBoundingBox(); + break; + } + case TANK: { + if ( scrollingOn ) pos += vel * dT / 1000.0; + updateBoundingBox(); + break; + } + case BOSS_1_MAIN_GUN: + case BOSS_1_ROCKET_LAUNCHER: + case BOSS_1_SHOT_BATTERY_LEFT: + case BOSS_1_SHOT_BATTERY_RIGHT: { + if ( scrollingOn ) { + pos += Vector2D( 0, SCROLL_SPEED * dT / 1000.0 ); + updateBoundingBox(); + if ( pos.getY() >= BOSS_1_END_Y ) { + scrollingOn = false; + pos.setY( BOSS_1_END_Y ); + } + } + break; + } + case BOSS_2: { + if ( boss2PointReached ) { + boss2TargetPos = Vector2D( (rand() % (SCREEN_WIDTH - spriteEnemy->w)) + spriteEnemy->w / 2, rand() % 100 + spriteEnemy->h ); + boss2PointReached = false; + } else { + pos += (boss2TargetPos - pos) / 50; + } + if ( pos.distanceTo(boss2TargetPos) < 15.0 ) boss2PointReached = true; + updateBoundingBox(); + break; + } + default: cout << "enemys.cc::move(): unknown enemyType" << endl; break; + } +} + +void Enemy::updateBoundingBox() { + boundingBox->moveUpperBound( lroundf(pos.getY() - spriteEnemy->h * 0.45) ); + boundingBox->moveLeftBound( lroundf(pos.getX() - spriteEnemy->w * 0.45) ); +} + + +void Enemy::firePrimary() { + switch (enemyType) { + case FIGHTER: + { + Shot *shot = + new Shot( ENEMY_SHOT_NORMAL, 666, + pos + Vector2D( 0, spriteEnemy->h / 2 ), + 90 ); + shots->addShot( shot ); + mixer.playSample( sndShotPrimary, 0 ); + break; + } + case BOMBER: + { + Shot *shot = + new Shot( ENEMY_SHOT_NORMAL, 666, + pos + Vector2D( -7, spriteEnemy->h / 2 ), + 100 ); + shots->addShot( shot ); + shot = + new Shot( ENEMY_SHOT_NORMAL, 666, + pos + Vector2D( +7, spriteEnemy->h / 2 ), + 80 ); + shots->addShot( shot ); + mixer.playSample( sndShotPrimary, 0 ); + break; + } + case TANK: + { + Shot *shot = + new Shot( ENEMY_SHOT_NORMAL, 666, + pos, + (rand() % 360) - 180 ); + shots->addShot( shot ); + mixer.playSample( sndShotPrimary, 0 ); + break; + } + case BOSS_1_MAIN_GUN: + { + Shot *shot = + new Shot( ENEMY_SHOT_NORMAL, 666, + pos, + (rand() % 20) + 80 ); + shots->addShot( shot ); + mixer.playSample( sndShotPrimary, 0 ); + break; + } + case BOSS_1_SHOT_BATTERY_LEFT: + { + Shot *shot = + new Shot( ENEMY_SHOT_NORMAL, 666, + pos, + (rand() % 120) + 30 ); + shots->addShot( shot ); + mixer.playSample( sndShotPrimary, 0 ); + break; + } + case BOSS_1_SHOT_BATTERY_RIGHT: + { + Shot *shot = + new Shot( ENEMY_SHOT_NORMAL, 666, + pos, + (rand() % 120) + 30 ); + shots->addShot( shot ); + mixer.playSample( sndShotPrimary, 0 ); + break; + } + case BOSS_1_ROCKET_LAUNCHER: + { + unsigned int racerIdx = rand() % racers->getNrRacers(); + float angle = (racers->getRacer( racerIdx )->getPos() - pos).getDirection(); + Shot *shot = + new Shot( ENEMY_SHOT_TANK_ROCKET, 666, pos, angle ); + shots->addShot( shot ); + mixer.playSample( sndShotSecondary, 0 ); + break; + } + case BOSS_2: + { + unsigned int racerIdx = rand() % racers->getNrRacers(); + float angle = (racers->getRacer( racerIdx )->getPos() - pos).getDirection(); + Shot *shot = new Shot( ENEMY_SHOT_NORMAL, 666, pos, angle ); + shots->addShot( shot ); + mixer.playSample( sndShotPrimary, 0 ); + break; + } + default: + { + break; + } + } +} + + +void Enemy::shootPrimary( int dT ) { + nextShotPrimary -= dT; + if ( nextShotPrimary < 0 ) { + firePrimary(); + nextShotPrimary = + (rand() % (ENEMY_RAND_WAIT_PRIMARY[ enemyType ]+1)) + ENEMY_COOLDOWN_PRIMARY[ enemyType ]; + } +} + + +void Enemy::fireSecondary() { + switch (enemyType) { + case TANK: + { + unsigned int racerIdx = rand() % racers->getNrRacers(); + float angle = (racers->getRacer( racerIdx )->getPos() - pos).getDirection(); + + Shot *shot = + new Shot( ENEMY_SHOT_TANK_ROCKET, 666, pos, angle ); + shots->addShot( shot ); + mixer.playSample( sndShotSecondary, 0 ); + break; + } + case BOSS_2: + { + unsigned int racerIdx = rand() % racers->getNrRacers(); + float angle = (racers->getRacer( racerIdx )->getPos() - pos).getDirection(); + Shot *shot = new Shot( ENEMY_SHOT_TANK_ROCKET, 666, pos - Vector2D(-80,0), angle ); + shots->addShot( shot ); + shot = new Shot( ENEMY_SHOT_TANK_ROCKET, 666, pos - Vector2D(+80,0), angle ); + shots->addShot( shot ); + mixer.playSample( sndShotSecondary, 0 ); + break; + } + default: + { + break; + } + } +} + +void Enemy::shootSecondary( int dT ) { + nextShotSecondary -= dT; + if ( nextShotSecondary < 0 ) { + fireSecondary(); + nextShotSecondary = + (rand() % (ENEMY_RAND_WAIT_SECONDARY[ enemyType ]+1)) + + ENEMY_COOLDOWN_SECONDARY[ enemyType ]; + } +} + + +void Enemy::doDamage( ShotTypes shotType, int fromWhichPlayer ) { + bool allreadyDead = isExpired(); + + switch (shotType) { + case SHOT_NORMAL: hitpoints -= DAMAGE_SHOT_NORMAL; break; + case SHOT_NORMAL_HEAVY: hitpoints -= DAMAGE_SHOT_NORMAL_HEAVY; break; + case SHOT_DOUBLE: hitpoints -= DAMAGE_SHOT_DOUBLE; break; + case SHOT_DOUBLE_HEAVY: hitpoints -= DAMAGE_SHOT_DOUBLE_HEAVY; break; + case SHOT_TRIPLE: hitpoints -= DAMAGE_SHOT_TRIPLE; break; + + case SHOT_HF_NORMAL: hitpoints -= DAMAGE_SHOT_HF_NORMAL; break; + case SHOT_HF_DOUBLE: hitpoints -= DAMAGE_SHOT_HF_DOUBLE; break; + case SHOT_HF_TRIPLE: hitpoints -= DAMAGE_SHOT_HF_TRIPLE; break; + case SHOT_HF_QUATTRO: hitpoints -= DAMAGE_SHOT_HF_QUATTRO; break; + case SHOT_HF_QUINTO: hitpoints -= DAMAGE_SHOT_HF_QUINTO; break; + + case SHOT_DUMBFIRE: hitpoints -= DAMAGE_SHOT_DUMBFIRE; break; + case SHOT_DUMBFIRE_DOUBLE: hitpoints -= DAMAGE_SHOT_DUMBFIRE_DOUBLE; break; + case SHOT_KICK_ASS_ROCKET: hitpoints -= DAMAGE_SHOT_KICK_ASS_ROCKET; break; + case SHOT_HELLFIRE: hitpoints -= DAMAGE_SHOT_HELLFIRE; break; + case SHOT_MACHINE_GUN: hitpoints -= DAMAGE_SHOT_MACHINE_GUN; break; + case SHOT_ENERGY_BEAM: hitpoints -= DAMAGE_SHOT_ENERGY_BEAM; break; + + case SHOT_HF_DUMBFIRE: hitpoints -= DAMAGE_SHOT_HF_DUMBFIRE; break; + case SHOT_HF_DUMBFIRE_DOUBLE: hitpoints -= DAMAGE_SHOT_HF_DUMBFIRE_DOUBLE; break; + case SHOT_HF_KICK_ASS_ROCKET: hitpoints -= DAMAGE_SHOT_HF_KICK_ASS_ROCKET; break; + case SHOT_HF_LASER: hitpoints -= DAMAGE_SHOT_HF_LASER; break; + + case SPECIAL_SHOT_HEATSEEKER: hitpoints -= DAMAGE_SPECIAL_SHOT_HEATSEEKER; break; + case SPECIAL_SHOT_NUKE: hitpoints -= DAMAGE_SPECIAL_SHOT_NUKE; break; + default: + { + cout << "Enemy::doDamage: unexpected shotType: " << shotType << endl; + break; + } + } + + if ( enemyType < NR_ENEMY_TYPES_NORMAL ) { + // the enemy just died -> explode, generate item, + if ( (!allreadyDead) && isExpired() ) { + // the player gets points, who did the final shot + if ( 0 <= fromWhichPlayer && fromWhichPlayer < (int)racers->getNrRacers() ) { + racers->getRacer( fromWhichPlayer )->receivePoints( ENEMY_POINTS_FOR_DEST[ enemyType ]); + } + // explode + Explosion *newExplosion = + new Explosion( FN_EXPLOSION_ENEMY, pos, vel, EXPLOSION_NORMAL_AIR ); + explosions->addExplosion( newExplosion ); + // generate wreck + Wreck *newWreck = new Wreck( pos, WRECK_FOR_ENEMYTYPE[ enemyType ]); + wrecks->addWreck( newWreck ); + // generate item + if ( rand() % ENEMY_DIES_ITEM_APPEAR_CHANCE[ enemyType ] == 0 ) { + items->generateItemNow( pos, vel / 10.0 ); + } + } + } + // it's a boss!!! + else { + if ( (!allreadyDead) && isExpired() ) { + // explode + Explosion *newExplosion; + for(int i = 0; i < 10; i++){ + newExplosion = new Explosion( + FN_EXPLOSION_ENEMY, + pos + Vector2D(rand() % spriteEnemy->w - spriteEnemy->w / 2, rand() % spriteEnemy->h - spriteEnemy->h / 2), + vel + Vector2D(rand() % 100 - 50, rand() % 100 - 50) / 5.0, + EXPLOSION_NORMAL_GROUND ); + explosions->addExplosion( newExplosion ); + } + + // generate wreck + Wreck *newWreck = new Wreck( pos, WRECK_FOR_ENEMYTYPE[ enemyType ]); + wrecks->addWreck( newWreck ); + } + } +} + + +void Enemy::drawGroundEnemy( SDL_Surface *screen ) { + if ( ENEMY_FLYING[ enemyType ] ) return; + + SDL_Rect destR; + + destR.x = lroundf(pos.getX()) - spriteEnemy->w / 2; + destR.y = lroundf(pos.getY()) - spriteEnemy->h / 2; + destR.w = spriteEnemy->w; + destR.h = spriteEnemy->h; + + SDL_BlitSurface( spriteEnemy, 0, screen, &destR ); +} + +void Enemy::drawAirEnemy( SDL_Surface *screen ) { + if ( !ENEMY_FLYING[ enemyType ] ) return; + + SDL_Rect destR; + + destR.x = lroundf(pos.getX()) - spriteEnemy->w / 2; + destR.y = lroundf(pos.getY()) - spriteEnemy->h / 2; + destR.w = spriteEnemy->w; + destR.h = spriteEnemy->h; + + SDL_BlitSurface( spriteEnemy, 0, screen, &destR ); +} + +void Enemy::drawShadow( SDL_Surface *screen ) { + if ( !ENEMY_FLYING[ enemyType ] ) return; + + SDL_Rect destR; + + destR.x = lroundf(pos.getX()) - spriteShadow->w / 2 - ENEMY_FLYING_HEIGHT[ enemyType ]; + destR.y = lroundf(pos.getY()) - spriteShadow->h / 2 + ENEMY_FLYING_HEIGHT[ enemyType ]; + destR.w = spriteShadow->w; + destR.h = spriteShadow->h; + + SDL_BlitSurface( spriteShadow, 0, screen, &destR ); +} + + +void Enemy::drawStats( SDL_Surface *screen ) { + // draw status of the bosses + float pixPerHP = spriteEnemy->w / (float)(ENEMY_HITPOINTS[ enemyType ]); + SDL_Rect destR; + // draw damage + destR.x = lroundf(pos.getX()) - spriteEnemy->w / 2; + destR.y = lroundf(pos.getY()) - spriteEnemy->h / 2 - 4; + float damageToDraw = min( (float)ENEMY_HITPOINTS[ enemyType ] / 2, hitpoints ); + destR.w = lroundf(pixPerHP * damageToDraw); + destR.h = 3; + SDL_FillRect( screen, &destR, SDL_MapRGB(screen->format, 255, 0, 0) ); + // draw shields + destR.x = lroundf(pos.getX()); + destR.y = lroundf(pos.getY()) - spriteEnemy->h / 2 - 4; + float shieldToDraw = min( (float)ENEMY_HITPOINTS[ enemyType ] / 2, + hitpoints - ENEMY_HITPOINTS[ enemyType ] / 2 ); + if ( shieldToDraw < 1 ) destR.w = 0; + else destR.w = lroundf(pixPerHP * shieldToDraw); + destR.h = 3; + SDL_FillRect(screen, &destR, SDL_MapRGB(screen->format, 0, 255, 0) ); +} diff --git a/alienblaster/project/jni/alienblaster/src/enemy.h b/alienblaster/project/jni/alienblaster/src/enemy.h new file mode 100644 index 000000000..3cd0faa7d --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/enemy.h @@ -0,0 +1,124 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +#ifndef ENEMY_HH +#define ENEMY_HH + +#include "SDL.h" +#include "geometry.h" +#include +#include "shot.h" +#include "global.h" + +class Shot; +class Shots; +class BoundingBox; + +class Enemy { + private: + SDL_Surface *spriteEnemy; + SDL_Surface *spriteShadow; + // for collision with racers or shots. + // A rectangle with racersize * 0.9 is used. + BoundingBox *boundingBox; + + // Movement-System + Vector2D pos; // absolute position + Vector2D vel; // the velocity vector + + Vector2D relTargetPos; + + // needed for cooldown + int nextShotPrimary; + int nextShotSecondary; + + int sndShotPrimary; + int sndShotSecondary; + + float hitpoints; + + EnemyTypes enemyType; + + bool isInFormation; + bool fireByFormation; + bool boss2PointReached; + Vector2D boss2TargetPos; + + public: + Enemy( Vector2D pos, Vector2D vel, EnemyTypes whichEnemyType, bool isInFormation=false, + bool fireByFormation=false ); + ~Enemy(); + + bool isExpired(); + void expire(); + bool isDead() { return ( hitpoints <= 0 ); } + + EnemyTypes getType() { return enemyType; } + + void update( int dT ); + + void firePrimary(); + void fireSecondary(); + + // The enemy will make an additional movement of newRelTargetPos. + // This is used, when the enemy is part of a formation and should move + // to another position in the formation. + void setNewRelTargetPos( Vector2D newRelTargetPos ) { relTargetPos = newRelTargetPos; } + + void setPos(Vector2D newPos); + Vector2D getPos() { return pos; } + Vector2D getVel() { return vel; } + Vector2D setVel(Vector2D newVel); // returns old vel + + + private: + // fire the Guns! + void shootPrimary( int dT ); + void shootSecondary( int dT ); + // moves the enemy according to his velocity + void move( int dT ); + // move the boundingBox accordingly to the movement + void updateBoundingBox(); + + public: + void drawGroundEnemy( SDL_Surface *screen ); + void drawAirEnemy( SDL_Surface *screen ); + void drawShadow( SDL_Surface *screen ); + void drawStats( SDL_Surface *screen ); + + // collision system + // return if the line between the two points collides with the boundingBox + bool collidesWith( const Vector2D &shotPosOld, const Vector2D &shotPosNew ); + // return if the racers boundingBox overlaps with box + bool collidesWith( BoundingBox *box ); + // return if the racers boundingBox overlaps with circle + bool collidesWith( const Circle &circle ); + // returns if a inner circle around the racer overlaps with circle + bool collidesWithAsCircle( const Circle &circle ); + // returns if a inner circle around the racer overlaps with circle + bool collidesWithAsCircle( BoundingBox *box ); + // returns the boundingBox of the racer + BoundingBox *getBoundingBox(); + Circle getBoundingCircle(); + + // the enemy got hit -> do the damage according to the shotType + void doDamage( ShotTypes shotType, int fromWhichPlayer ); +}; + +#endif diff --git a/alienblaster/project/jni/alienblaster/src/enemys.cc b/alienblaster/project/jni/alienblaster/src/enemys.cc new file mode 100644 index 000000000..e85483537 --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/enemys.cc @@ -0,0 +1,374 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +using namespace std; + +#include +#include +#include "global.h" +#include "enemys.h" +#include "enemy.h" +#include "racers.h" +#include "racer.h" +#include "wrecks.h" +#include "wreck.h" +#include "surfaceDB.h" +#include "formation.h" +#include "banners.h" +#include "options.h" + +Enemys::Enemys() { + timeToNextEnemy = GENERATE_ENEMY_DELAY + (rand() % (GENERATE_ENEMY_RAND_DELAY+1)); + timeToNextFormation = + GENERATE_FORMATION_DELAY + (rand() % (GENERATE_FORMATION_RAND_DELAY + 1)); + bossActive = 0; + enemysKilled = 0; + enemysGenerated = 0; +} + +Enemys::~Enemys() { + vector::iterator i; + for (i = enemys.begin(); i != enemys.end(); ++i) { + delete *i; + } + vector::iterator f; + for (f = formations.begin(); f != formations.end(); ++f) { + delete *f; + } +} + +void Enemys::addEnemy( Enemy *newEnemy ) { + if ( newEnemy ) { + enemys.push_back( newEnemy ); + enemysGenerated++; + } +} + +bool Enemys::minibossDead(){ + for ( unsigned int i = 0; i < enemys.size(); i++ ) { + if ( enemys[ i ]->getType() == BOSS_2 ) return false; + } + return true; +} + +bool Enemys::bossDead() { + bool dead = true; + for ( unsigned int i = 0; i < enemys.size(); i++ ) { + if ( enemys[ i ]->getType() >= NR_ENEMY_TYPES_NORMAL ) { + dead = false; + break; + } + } + if (dead) bossActive = 0; + return dead; +} + + +void Enemys::bossTime( int bossNr ) { + bossActive = bossNr; + Enemy *boss; + Wreck *wreck; + switch (bossNr) { + // Final boss + case 1: + { + wreck = new Wreck( Vector2D( SCREEN_WIDTH / 2 , -120 ), WRECK_BOSS_1_BACKGROUND ); + wrecks->addWreck( wreck ); + + boss = new Enemy( Vector2D( 321, -102 ), Vector2D( 0, SCROLL_SPEED ), BOSS_1_MAIN_GUN ); + addEnemy( boss ); + boss = new Enemy( Vector2D( 248, -73 ), Vector2D( 0, SCROLL_SPEED ), + BOSS_1_SHOT_BATTERY_LEFT ); + addEnemy( boss ); + boss = new Enemy( Vector2D( 393, -73 ), Vector2D( 0, SCROLL_SPEED ), + BOSS_1_SHOT_BATTERY_RIGHT ); + addEnemy( boss ); + boss = new Enemy( Vector2D( 50, -85 ), Vector2D( 0, SCROLL_SPEED ), + BOSS_1_ROCKET_LAUNCHER ); + addEnemy( boss ); + boss = new Enemy( Vector2D( 590, -85 ), Vector2D( 0, SCROLL_SPEED ), + BOSS_1_ROCKET_LAUNCHER ); + addEnemy( boss ); + break; + } + // Miniboss + case 2: + { + boss = new Enemy( Vector2D( SCREEN_WIDTH / 2 , -100 ), + Vector2D( 0, SCROLL_SPEED ), BOSS_2 ); + addEnemy( boss ); + break; + } + default: + { + cout << "Enemys::bossTime: unexpected bossNr: " << bossNr << endl; + break; + } + } +} + + +void Enemys::generateEnemys( int dT ) { + if ( bossActive != 0 ) return; + + + timeToNextFormation -= dT; + if ( timeToNextFormation < 0 ) { + FormationTypes whichFormation = (FormationTypes)(rand() % NR_FORMATION_TYPES); + int flags = 0; + if ( rand() % 2 == 0 ) flags = flags | FORMATION_CHANGE_ON_KILL; + if ( rand() % 2 == 0 ) { + flags = flags | FORMATION_CHANGE_SPONTANEOUS; + if ( rand() % 2 == 0 ) flags = flags | FORMATION_CHANGE_OFTEN; + else flags = flags | FORMATION_CHANGE_SELDOM; + } + FormationShotPatterns shotPattern = + (FormationShotPatterns)getRandValue( FORMATION_SP_CHANCES, NR_FORMATION_SP ); + + Formation *newV = + new Formation( whichFormation, + Vector2D( 80 + (rand() % (SCREEN_WIDTH - 160)), -100 ), + Vector2D( 0, 40 ), + FORMATION_MAX_NR_ENEMYS[ whichFormation ] - (rand() % 3), + (FormationEnemySets)(rand() % NR_FORMATION_ENEMY_SETS), + flags, shotPattern ); + formations.push_back( newV ); + + timeToNextFormation = + GENERATE_FORMATION_DELAY + (rand() % (GENERATE_FORMATION_RAND_DELAY + 1)); + } + + + timeToNextEnemy -= dT; + if ( timeToNextEnemy < 0 ) { + int enemyType = getRandValue( ENEMY_APPEAR_CHANCES, NR_ENEMY_TYPES_NORMAL ); + Enemy *newOne = 0; + switch ((EnemyTypes)enemyType) { + case FIGHTER: + { + bool collides; + float xpos; + for ( int i = 0; i < 10; i++ ) { + collides = false; + xpos = 20 + rand() % (SCREEN_WIDTH - 40); + // check if collides with a formation + for ( unsigned int f = 0; f < formations.size(); f++ ) { + Vector2D formationCenter = formations[ f ]->getCenter(); + collides = + formationCenter.getY() < 150 && + fabs(xpos - formationCenter.getX()) < 150; + if (collides) break; + } + } + if ( !collides ) { + newOne = new Enemy( Vector2D( xpos, -20 ), // position + Vector2D( (rand() % 5) - 2, rand() % 7 + 3 ) * 10, // velocity + FIGHTER ); + } + break; + } + case BOMBER: + { + bool collides; + float xpos; + for ( int i = 0; i < 10; i++ ) { + collides = false; + xpos = 20 + rand() % (SCREEN_WIDTH - 40); + // check if collides with a formation + for ( unsigned int f = 0; f < formations.size(); f++ ) { + Vector2D formationCenter = formations[ f ]->getCenter(); + collides = + formationCenter.getY() < 150 && + fabs(xpos - formationCenter.getX()) < 150; + if (collides) break; + } + } + if ( !collides ) { + newOne = new Enemy( Vector2D( xpos, -20 ), // position + Vector2D( (rand() % 5) - 2, rand() % 3 + 3 ) * 10, // velocity + BOMBER ); + } + break; + } + case TANK: + { +// SDL_Surface *spriteTank = surfaceDB.loadSurface( FN_ENEMY_TANK ); +// SDL_Surface *spriteTankWreck = surfaceDB.loadSurface( FN_WRECK_TANK ); + string fn1, fn2; + levelConf->getStr( LVL_ENEMY_TANK, fn1 ); + levelConf->getStr( LVL_WRECK_TANK, fn2 ); + SDL_Surface *spriteTank = surfaceDB.loadSurface( fn1 ); + SDL_Surface *spriteTankWreck = surfaceDB.loadSurface( fn2 ); + int halfWidthTank = spriteTank->w / 2; + int halfHeightTank = spriteTank->h / 2; + int halfWidthTankWreck = spriteTankWreck->w / 2; + int halfHeightTankWreck = spriteTankWreck->h / 2; + + int xPos; + + for ( int i = 0; i < 10; i++ ) { + bool collides = false; + xPos = halfWidthTank + rand() % (SCREEN_WIDTH - spriteTank->w); + // check if collides with another tank + for ( unsigned int t = 0; t < enemys.size(); t++ ) { + if ( enemys[ t ]->getType() == TANK ) { + Vector2D enemyTankPos = enemys[ t ]->getPos(); + collides = + !(enemyTankPos.getX() - halfWidthTank > xPos + halfWidthTank) && + !(enemyTankPos.getX() + halfWidthTank < xPos - halfWidthTank) && + !(enemyTankPos.getY() - halfHeightTank > 0); + if (collides) break; + } + } + if (!collides) { + // check if collides with an old wreck + for ( unsigned int w = 0; w < wrecks->getNrWrecks(); w++ ) { + if ( wrecks->getWreck( w )->getType() == WRECK_TANK ) { + Vector2D wreckPos = wrecks->getWreck(w)->getPos(); + collides = + !(wreckPos.getX() - halfWidthTankWreck > xPos + halfWidthTank) && + !(wreckPos.getX() + halfWidthTankWreck < xPos - halfWidthTank) && + !(wreckPos.getY() - halfHeightTankWreck > 0); + if (collides) break; + } + } + } + + // no collision -> generate this enemy + if ( !collides ) { + // the tank and the background have to be at the same pixel-fraction + // to avoid a waggle-effect + float correlateToBackground = actBackgroundPos - truncf(actBackgroundPos); + newOne = new Enemy( Vector2D( xPos, -halfHeightTank - correlateToBackground ), + Vector2D (0, SCROLL_SPEED), // tanks are not moving + TANK ); + break; + } + } + + break; + } + default: + { + cout << "generateEnemys(): unexpected enemyType: " << enemyType << endl; + break; + } + } + addEnemy( newOne ); + // +1 for security + timeToNextEnemy = GENERATE_ENEMY_DELAY + (rand() % (GENERATE_ENEMY_RAND_DELAY+1)); + } +} + +void Enemys::updateEnemys( int dT ) { + vector::iterator f; + for (f = formations.begin(); f != formations.end(); ++f) { + (*f)->update( dT ); + } + vector::iterator i; + for (i = enemys.begin(); i != enemys.end(); ++i) { + (*i)->update( dT ); + } +} + +void Enemys::doNukeDamage() { + vector::iterator i; + for (i = enemys.begin(); i != enemys.end(); ++i) { + (*i)->doDamage( SPECIAL_SHOT_NUKE, -1 ); + } +} + + +void Enemys::deleteExpiredEnemys() { + unsigned int i = 0; + while ( i < enemys.size() ) { + if ( enemys[i]->isExpired() ) { + if ( enemys[i]->isDead() ) { + enemysKilled++; + if ( arcadeGame ) { + if ( enemysKilled % 50 == 0 ) { + banners->addBanner( BANNER_ENEMYS_KILLED, + BANNER_MODE_RANDOM, + ARCADE_BONUS_FOR_ENEMYS_KILLED ); + racers->receivePointsArcade( ARCADE_POINTS_FOR_ENEMYS_KILLED ); + } + } + } + for ( unsigned int f = 0; f < formations.size(); f++ ) { + formations[f]->enemyKilled( enemys[i] ); + } + delete enemys[i]; + enemys.erase(enemys.begin() + i); + } else { + i++; + } + } + unsigned int f = 0; + while ( f < formations.size() ) { + if ( formations[f]->isExpired() ) { + // assert, that the formation is not deleted, because all + // enemys in the formation flew out of the screen + if ( arcadeGame && formations[f]->getCenter().getY() < SCREEN_HEIGHT + 400 ) { + banners->addBanner( (BannerTexts)(rand() % NR_BANNER_TEXTS), + BANNER_MODE_RANDOM, + ARCADE_BONUS_FOR_FORMATION_DESTRUCTION ); + racers->receivePointsArcade( ARCADE_POINTS_FOR_FORMATION_DESTRUCTION ); + } + delete formations[f]; + formations.erase(formations.begin() + f); + } else { + f++; + } + } +} + +void Enemys::drawGroundEnemys(SDL_Surface *screen) { + vector::iterator i; + for (i = enemys.begin(); i != enemys.end(); ++i) { + (*i)->drawGroundEnemy(screen); + } +} + +void Enemys::drawAirEnemys(SDL_Surface *screen) { + vector::iterator i; + for (i = enemys.begin(); i != enemys.end(); ++i) { + (*i)->drawAirEnemy(screen); + } +} + +void Enemys::drawShadows(SDL_Surface *screen) { + vector::iterator i; + for (i = enemys.begin(); i != enemys.end(); ++i) { + (*i)->drawShadow(screen); + } +} + +void Enemys::drawBossStats( SDL_Surface *screen ) { + for ( unsigned int i = 0; i < enemys.size(); i++ ) { + if ( enemys[ i ]->getType() >= NR_ENEMY_TYPES_NORMAL ) { + enemys[ i ]->drawStats( screen ); + } + } +} + +void Enemys::drawAllStats( SDL_Surface *screen ) { + for ( unsigned int i = 0; i < enemys.size(); i++ ) { + enemys[ i ]->drawStats( screen ); + } +} diff --git a/alienblaster/project/jni/alienblaster/src/enemys.h b/alienblaster/project/jni/alienblaster/src/enemys.h new file mode 100644 index 000000000..4652d82af --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/enemys.h @@ -0,0 +1,77 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +#ifndef ENEMYS_H +#define ENEMYS_H + +#include +#include "SDL.h" + + +class Enemy; +class Formation; + +class Enemys { + std::vector enemys; + + std::vector formations; + + int timeToNextEnemy; + int timeToNextFormation; + + // if != 0, only the enemys for this boss are generated + int bossActive; + + int enemysGenerated; + int enemysKilled; + + public: + + Enemys(); + ~Enemys(); + + void addEnemy( Enemy *newEnemy ); + + bool minibossDead(); + bool bossDead(); + void bossTime( int bossNr ); + void generateEnemys( int dT ); + void deleteExpiredEnemys(); + + inline Enemy *getEnemy(unsigned int i) { return enemys[i]; } + inline unsigned int getNrEnemys() { return enemys.size(); } + inline int getNrEnemysKilled() { return enemysKilled; } + inline int getNrEnemysGenerated() { return enemysGenerated; } + + + // move and shoot + void updateEnemys( int dT ); + + // a nuke exploded -> damage all enemys + void doNukeDamage(); + + // draws the enemys. + void drawGroundEnemys( SDL_Surface *screen ); + void drawAirEnemys( SDL_Surface *screen ); + void drawShadows( SDL_Surface *screen ); + void drawBossStats( SDL_Surface *screen ); + void drawAllStats( SDL_Surface *screen ); +}; + +#endif diff --git a/alienblaster/project/jni/alienblaster/src/explosion.cc b/alienblaster/project/jni/alienblaster/src/explosion.cc new file mode 100644 index 000000000..7814de017 --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/explosion.cc @@ -0,0 +1,109 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +using namespace std; + +#include "explosion.h" +#include "surfaceDB.h" +#include "mixer.h" +#include "global.h" + +Explosion::Explosion(string fn, const Vector2D &position, + const Vector2D &velocity, const ExplosionTypes &explosionType) { + sprite = surfaceDB.loadSurface(fn); + + nrAnimStages = sprite->w / sprite->h; + expired = false; + + sndExplosion = mixer.loadSample( FN_SOUND_EXPLOSION_NORMAL ); + mixer.playSample( sndExplosion, 0 ); + + this->explosionType = explosionType; + pos = position; + vel = velocity; + + switch (explosionType) { + case EXPLOSION_NORMAL_AIR: + case EXPLOSION_NORMAL_GROUND: + { + timePerStage = LIFETIME_EXPL_NORMAL / nrAnimStages; + break; + } + default: + { + timePerStage = 0; + actAnimStage = nrAnimStages; + break; + } + } + + actAnimStage = 0; + timeLived = 0; + timeNextAnimStage = timePerStage; +} + +Explosion::~Explosion() {} + +void Explosion::update( int dT ) { + if ( scrollingOn ) pos += vel * dT / 1000.0; + timeLived += dT; + if ( timeLived > timeNextAnimStage ) { + timeNextAnimStage += timePerStage; + actAnimStage++; + if (actAnimStage == nrAnimStages) expired = true; + } +} + +void Explosion::drawAirExplosion(SDL_Surface *screen) { + if (expired) return; + if ( ! ( explosionType == EXPLOSION_NORMAL_AIR ) ) return; + + SDL_Rect dest; + dest.x = lroundf(pos.getX()) - sprite->w / (2*nrAnimStages); + dest.y = lroundf(pos.getY()) - sprite->h / 2; + dest.w = sprite->w / nrAnimStages; + dest.h = sprite->h; + + SDL_Rect src; + src.x = actAnimStage * sprite->w / nrAnimStages; + src.y = 0; + src.w = sprite->w / nrAnimStages; + src.h = sprite->h; + + SDL_BlitSurface( sprite, &src, screen, &dest ); +} + +void Explosion::drawGroundExplosion(SDL_Surface *screen) { + if (expired) return; + if ( ! ( explosionType == EXPLOSION_NORMAL_GROUND ) ) return; + + SDL_Rect dest; + dest.x = lroundf(pos.getX()) - sprite->w / (2*nrAnimStages); + dest.y = lroundf(pos.getY()) - sprite->h / 2; + dest.w = sprite->w / nrAnimStages; + dest.h = sprite->h; + + SDL_Rect src; + src.x = actAnimStage * sprite->w / nrAnimStages; + src.y = 0; + src.w = sprite->w / nrAnimStages; + src.h = sprite->h; + + SDL_BlitSurface( sprite, &src, screen, &dest ); +} diff --git a/alienblaster/project/jni/alienblaster/src/explosion.h b/alienblaster/project/jni/alienblaster/src/explosion.h new file mode 100644 index 000000000..d25f5c473 --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/explosion.h @@ -0,0 +1,65 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +#ifndef EXPLOSION_H +#define EXPLOSION_H + +#include "SDL.h" +#include "geometry.h" +#include +#include "global.h" + +class Explosion { + + // a sprite, that contains horizontally all animationframes of the explosion. + // it is assumed, that every frame is quadratic. + SDL_Surface *sprite; + + // how many frames does this explosion have? + int nrAnimStages; + // which frame is now? + int actAnimStage; + // how long should one frame last (ms) + int timePerStage; + // how long is the current explosion already active + int timeLived; + // at what timeLived starts the next frame? + int timeNextAnimStage; + + // the explosion can be deleted + bool expired; + + int sndExplosion; + + Vector2D pos; + Vector2D vel; // the explosion moves - yeah + ExplosionTypes explosionType; + + public: + Explosion(string fn, const Vector2D &position, + const Vector2D &velocity, const ExplosionTypes &explosionType); + ~Explosion(); + // updates the position and the counters + void update( int dT ); + void drawAirExplosion(SDL_Surface *screen); + void drawGroundExplosion(SDL_Surface *screen); + bool isExpired() { return expired; } +}; + +#endif diff --git a/alienblaster/project/jni/alienblaster/src/explosions.cc b/alienblaster/project/jni/alienblaster/src/explosions.cc new file mode 100644 index 000000000..b9f313314 --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/explosions.cc @@ -0,0 +1,72 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +using namespace std; + +#include "explosions.h" +#include "explosion.h" + +Explosions::Explosions() { +} + +Explosions::~Explosions() { + vector::iterator i; + for (i = explosions.begin(); i != explosions.end(); ++i) { + delete *i; + } +} + +void Explosions::addExplosion(Explosion *explosion) { + if (explosion) { + explosions.push_back(explosion); + } +} + +void Explosions::drawAirExplosions(SDL_Surface *screen) { + vector::iterator i; + for (i = explosions.begin(); i != explosions.end(); ++i) { + (*i)->drawAirExplosion(screen); + } +} + +void Explosions::drawGroundExplosions(SDL_Surface *screen) { + vector::iterator i; + for (i = explosions.begin(); i != explosions.end(); ++i) { + (*i)->drawGroundExplosion(screen); + } +} + +void Explosions::updateExplosions( int dT ) { + vector::iterator i; + for (i = explosions.begin(); i != explosions.end(); ++i) { + (*i)->update( dT ); + } +} + +void Explosions::expireExplosions() { + unsigned int i = 0; + while ( i < explosions.size() ) { + if ( explosions[i]->isExpired() ) { + delete explosions[i]; + explosions.erase(explosions.begin() + i); + } else { + i++; + } + } +} diff --git a/alienblaster/project/jni/alienblaster/src/explosions.h b/alienblaster/project/jni/alienblaster/src/explosions.h new file mode 100644 index 000000000..38c1e2b25 --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/explosions.h @@ -0,0 +1,48 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +#ifndef EXPLOSIONS_H +#define EXPLOSIONS_H + +#include +#include "SDL.h" + +class Explosion; + +/* manages the explosion-objects */ +class Explosions { + vector explosions; + + public: + Explosions(); + ~Explosions(); + + inline unsigned int getNrExplosions() { return explosions.size(); } + + void addExplosion( Explosion *explosion ); + // moves the explosions and updates the counters + void updateExplosions( int dT ); + // deletes the explosions, that have timed out + void expireExplosions(); + // draws all explosions + void drawAirExplosions( SDL_Surface *screen ); + void drawGroundExplosions( SDL_Surface *screen ); +}; + +#endif diff --git a/alienblaster/project/jni/alienblaster/src/font.cc b/alienblaster/project/jni/alienblaster/src/font.cc new file mode 100644 index 000000000..a4e060261 --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/font.cc @@ -0,0 +1,157 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +using namespace std; + +#include "font.h" +#include "global.h" +#include "surfaceDB.h" +#include + +Font::Font(string fn) { + sprite = surfaceDB.loadSurface( fn ); + charset = " ABCDEFGHIJKLMNOPQRSTUVWXYZÜÄÖabcdefghijklmnopqrstuvwxyzüäöß0123456789!\"§$%&/()=?*+'#,.-;:_@°\\"; + // 94 Zeichen + charWidth = sprite->w / 94; + charHeight = sprite->h; +} + +Font::~Font() { + ; +} + +void Font::setCharWidth(int width) { + charWidth = width; +} + +int Font::getCharWidth() { + return charWidth; +} + +int Font::getCharHeight() { + return sprite->h; +} + +void Font::drawInt(SDL_Surface *screen, int posx, int posy, int val, int alignDigitCnt, int flags) { + int indent = 0; + int digitCnt = 1; + int i=1; + while ( val >= i*10 ) { + digitCnt++; + i *= 10; + } + +// cout << endl << "drawInt.val=" << val << endl; +// cout << "drawInt.digitCnt=" << digitCnt << endl; +// cout << "drawInt.alignDigitCnt-old=" << alignDigitCnt << endl; + + if (alignDigitCnt < digitCnt) { + alignDigitCnt = digitCnt; + } +// cout << "drawInt.alignDigitCnt-new=" << alignDigitCnt << endl; + + if (flags & FONT_ALIGN_CENTERED) { + indent = -(alignDigitCnt * charWidth) / 2; + } + if (flags & FONT_ALIGN_RIGHT) { + indent = -(alignDigitCnt * charWidth); + } + + SDL_Rect destR; + SDL_Rect srcR; + while (alignDigitCnt > 0) { + if ((digitCnt > 0) || + ((flags & FONT_ALIGN_FILL_ZERO) != 0)) { + + destR.x = indent + posx + (alignDigitCnt-1) * charWidth; + destR.y = posy; + destR.w = charWidth; + destR.h = charHeight; + + unsigned int charsetpos = charset.find( (char)((val % 10) + '0') ); + if (charsetpos != string::npos ) { + srcR.x = charsetpos * charWidth; + } else { + srcR.x = charWidth; + } + // srcR.x = (1 + 2*26 + (val % 10)) * charWidth; + srcR.y = 0; + srcR.w = charWidth; + srcR.h = charHeight; + + SDL_BlitSurface( sprite, &srcR, screen, &destR ); + } + val /= 10; + digitCnt--; + alignDigitCnt--; + } +} + + + +void Font::drawStr(SDL_Surface *screen, int posx, int posy, const string &text, int flags) { + + int indent = 0; + if ( flags & (FONT_ALIGN_CENTERED | FONT_ALIGN_RIGHT) ) { + for(unsigned int i=0; i < text.size(); ++i) { + if (!(flags & FONT_MONOSPACE) && text[i] == ' ') { + indent += ((charWidth * 2) / 3); + } else { + indent += charWidth; + } + } + if (flags & FONT_ALIGN_CENTERED) { + indent = -indent / 2; + } else { + indent = -indent; + } + } + + SDL_Rect destR; + SDL_Rect srcR; + + int x = 0; + unsigned int charsetpos; + for(unsigned int i=0; i < text.size(); ++i) { + x = 0; + charsetpos = charset.find(text[i]); + if (charsetpos != string::npos ) { + x = charsetpos * charWidth; + } + + destR.x = posx + indent; + destR.y = posy; + destR.w = charWidth; + destR.h = sprite->h; + + srcR.x = x; + srcR.y = 0; + srcR.w = charWidth; + srcR.h = sprite->h; + + SDL_BlitSurface( sprite, &srcR, screen, &destR ); + + if (!(flags & FONT_MONOSPACE) && text[i] == ' ') { + posx += ((charWidth * 2) / 3); + } else { + posx += charWidth; + } + } +} + diff --git a/alienblaster/project/jni/alienblaster/src/font.h b/alienblaster/project/jni/alienblaster/src/font.h new file mode 100644 index 000000000..823ce54ab --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/font.h @@ -0,0 +1,77 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +#ifndef FONT_H +#define FONT_H + +#include "SDL.h" +#include + +// *** Code *** +// +// font->drawStr( screen, 150, 260, "Zeile 1" ); +// font->drawStr( screen, 150, 290, "Zeile 2", FONT_ALIGN_CENTERED ); +// font->drawStr( screen, 150, 320, "Zeile 3", FONT_ALIGN_RIGHT ); +// font->drawInt( screen, 150, 350, 123, 0 ); +// font->drawInt( screen, 150, 380, 123, 0, FONT_ALIGN_FILL_ZERO ); +// font->drawInt( screen, 150, 410, 123, 6 ); +// font->drawInt( screen, 150, 440, 123, 6, FONT_ALIGN_FILL_ZERO ); +// font->drawInt( screen, 150, 400, 123, 6, FONT_ALIGN_CENTERED ); +// font->drawInt( screen, 150, 425, 123, 6, FONT_ALIGN_CENTERED | FONT_ALIGN_FILL_ZERO ); +// font->drawInt( screen, 150, 350, 123, 6, FONT_ALIGN_RIGHT ); +// font->drawInt( screen, 150, 375, 123, 6, FONT_ALIGN_RIGHT | FONT_ALIGN_FILL_ZERO ); +// +// *** Result *** +// +// Zeile 1 +// Zeile 2 +// Zeile 3 +// 123 +// 123 +// 123 +// 000123 +// 123 +// 000123 +// 123 +// 000123 + +const int FONT_ALIGN_FILL_ZERO = (1<<0); // fill with leading zeros +const int FONT_ALIGN_CENTERED = (1<<1); // text centered around posx/posy +const int FONT_ALIGN_RIGHT = (1<<2); // text aligned right (on the left side of posx) +const int FONT_MONOSPACE = (1<<3); + +class Font { + private: + SDL_Surface *sprite; + int charWidth; + int charHeight; + std::string charset; + + public: + Font(std::string fn); + ~Font(); + + void setCharWidth(int width); + int getCharWidth(); + int getCharHeight(); + void drawInt(SDL_Surface *screen, int posx, int posy, int val, int alignDigitCnt, int flags = 0); + void drawStr(SDL_Surface *screen, int posx, int posy, const std::string &text, int flags = 0); +}; + +#endif diff --git a/alienblaster/project/jni/alienblaster/src/formation.cc b/alienblaster/project/jni/alienblaster/src/formation.cc new file mode 100644 index 000000000..dbf3fb652 --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/formation.cc @@ -0,0 +1,645 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +#include "formation.h" +#include "enemy.h" +#include "enemys.h" +#include + +using namespace std; + +Formation::Formation( FormationTypes whichFormation, Vector2D centerAtStart, + Vector2D startVel, int nrEnemys, + FormationEnemySets enemyTypes, + int flagsFormationChangePolicy, + FormationShotPatterns shotPattern ) { + + formationType = whichFormation; + formationCenter = centerAtStart; + formationSpeed = startVel; + + changeOnKill = flagsFormationChangePolicy & FORMATION_CHANGE_ON_KILL; + changeSpontaneous = flagsFormationChangePolicy & FORMATION_CHANGE_SPONTANEOUS; + changeOften = flagsFormationChangePolicy & FORMATION_CHANGE_OFTEN; + changeSeldom = flagsFormationChangePolicy & FORMATION_CHANGE_SELDOM; + if ( changeSpontaneous && !changeSeldom && !changeOften ) changeSeldom = true; + if ( changeOften ) { + nextFormationChange = + FORMATION_CHANGE_OFTEN_DELAY + + rand() % (FORMATION_CHANGE_OFTEN_RAND_DELAY+1); + } else if ( changeSeldom ) { + nextFormationChange = + FORMATION_CHANGE_SELDOM_DELAY + + rand() % (FORMATION_CHANGE_SELDOM_RAND_DELAY+1); + } + + if ( nrEnemys > FORMATION_MAX_NR_ENEMYS[ formationType ] ) + nrInvolved = FORMATION_MAX_NR_ENEMYS[ formationType ]; + else if ( nrEnemys < 0 ) nrInvolved = 0; + else nrInvolved = nrEnemys; + + this->shotPattern = shotPattern; + actShootingEnemy = 0; + + if ( shotPattern == FORMATION_SP_NONE ) formationFires = false; + else formationFires = true; + + vector targetPos; + fillTargetPos( targetPos ); + + for ( int i = 0; i < nrInvolved; i++ ) { + Enemy *newOne; + switch ( enemyTypes ) { + case FORMATION_ENEMY_SET_DEFAULT: + case FORMATION_ENEMY_SET_FIGHTER: + { + newOne = new Enemy( formationCenter + targetPos[ i ], formationSpeed, FIGHTER, + true, formationFires ); + break; + } + case FORMATION_ENEMY_SET_BOMBER: + { + newOne = new Enemy( formationCenter + targetPos[ i ], formationSpeed, BOMBER, + true, formationFires ); + break; + } + case FORMATION_ENEMY_SET_FIGHTER_BOMBER: + { + newOne = + new Enemy( formationCenter + targetPos[ i ], formationSpeed, + (EnemyTypes)(FIGHTER + (i % 2)), + true, formationFires ); + break; + } + } + enemys->addEnemy( newOne ); + involvedEnemys.push_back( newOne ); + } + + enemyWasKilled = false; + // wait at least 100 ms before the first shot + nextFirePrimary = 100; + nextFireSecondary = 100; + + // cout << "Type: " << formationType << " SP: " << shotPattern << endl; +} + +Formation::~Formation() {} + + +void Formation::enemyKilled( Enemy *killedEnemy ) { + for ( int i = 0; i < nrInvolved; i++ ) { + if ( involvedEnemys[i] == killedEnemy ) { + enemyWasKilled = true; + involvedEnemys.erase( involvedEnemys.begin() + i ); + nrInvolved--; + break; + } + } +} + +void Formation::update( int dT ) { + if ( changeSpontaneous ) handleSpontaneousFormationChange( dT ); + + if ( enemyWasKilled ) { + // change the formation? + if ( changeOnKill && (rand() % 100 < 70) ) chooseNewFormationType(); + moveEnemyInFormation(); + enemyWasKilled = false; + } + formationCenter += formationSpeed * dT / 1000.0; + shoot( dT ); +} + + +void Formation::handleSpontaneousFormationChange( int dT ) { + nextFormationChange -= dT; + if ( changeSpontaneous && nextFormationChange < 0 ) { + + chooseNewFormationType(); + moveEnemyInFormation(); + + if ( changeOften ) { + nextFormationChange = + FORMATION_CHANGE_OFTEN_DELAY + + rand() % (FORMATION_CHANGE_OFTEN_RAND_DELAY+1); + } else if ( changeSeldom ) { + nextFormationChange = + FORMATION_CHANGE_SELDOM_DELAY + + rand() % (FORMATION_CHANGE_SELDOM_RAND_DELAY+1); + } + } +} + + +void Formation::moveEnemyInFormation() { + // calc the target positions in the new formation (relative to the center of the formation) + vector targetPos; + fillTargetPos( targetPos ); + + // choose the best mapping from enemy to targetPosition + // (shortest way for enemy to its position is best) + vector relPosForEnemies; + getBestMapping( targetPos, relPosForEnemies ); + + // give the enemy its order + for ( int i = 0; i < nrInvolved; i++ ) { + involvedEnemys[i]->setNewRelTargetPos( relPosForEnemies[ i ] ); + } +} + + +void Formation::chooseNewFormationType() { + bool found = false; + int i = 0; + while ( i < 10 && !found ) { + FormationTypes newFormationType = (FormationTypes)(rand() % (NR_FORMATION_TYPES-1)); + if ( formationType == newFormationType ) { + newFormationType = (FormationTypes)(NR_FORMATION_TYPES - 1); + } + if ( nrInvolved <= FORMATION_MAX_NR_ENEMYS[ newFormationType ] ) { + formationType = newFormationType; + found = true; + } + i++; + } +} + + +void Formation::fillTargetPos( vector &targetPos ) { + switch ( formationType ) { + case FORMATION_V: + { + fillTargetPosFormationV( targetPos ); + break; + } + case FORMATION_REVERSE_V: + { + fillTargetPosFormationReverseV( targetPos ); + break; + } + case FORMATION_BLOCK: + { + fillTargetPosFormationBlock( targetPos ); + break; + } + case FORMATION_LINE: + { + fillTargetPosFormationLine( targetPos ); + break; + } + default: + { + for ( int i = 0; i < nrInvolved; i++ ) { + targetPos.push_back( Vector2D(0,0) ); + } + break; + } + } +} + + +void Formation::fillTargetPosFormationV( vector &targetPos ) { + switch ( nrInvolved ) { + case 1: + { + targetPos.push_back( Vector2D(0,0) ); + break; + } + case 2: + { + targetPos.push_back( Vector2D(-30,0) ); + targetPos.push_back( Vector2D(30,0) ); + break; + } + case 3: + { + targetPos.push_back( Vector2D(-50,25) ); + targetPos.push_back( Vector2D(0,-25) ); + targetPos.push_back( Vector2D(50,25) ); + break; + } + case 4: + { + targetPos.push_back( Vector2D(-80,25) ); + targetPos.push_back( Vector2D(-30,-25) ); + targetPos.push_back( Vector2D(30,-25) ); + targetPos.push_back( Vector2D(80,25) ); + break; + } + case 5: + { + targetPos.push_back( Vector2D(-100,50) ); + targetPos.push_back( Vector2D(-50,0) ); + targetPos.push_back( Vector2D(0,-50) ); + targetPos.push_back( Vector2D(50,0) ); + targetPos.push_back( Vector2D(100,50) ); + break; + } + case 6: + { + targetPos.push_back( Vector2D(-130,50) ); + targetPos.push_back( Vector2D(-80,0) ); + targetPos.push_back( Vector2D(-30,-50) ); + targetPos.push_back( Vector2D(30,-50) ); + targetPos.push_back( Vector2D(80,0) ); + targetPos.push_back( Vector2D(130,50) ); + break; + } + case 7: + { + targetPos.push_back( Vector2D(-150,75) ); + targetPos.push_back( Vector2D(-100,25) ); + targetPos.push_back( Vector2D(-50,-25) ); + targetPos.push_back( Vector2D(0,-75) ); + targetPos.push_back( Vector2D(50,-25) ); + targetPos.push_back( Vector2D(100,25) ); + targetPos.push_back( Vector2D(150,75) ); + break; + } + default: + { + cout << "fillTargetPosFormationV: too many enemys involved: " << nrInvolved << endl; + for ( int i = 0; i < nrInvolved; i++ ) { + targetPos.push_back( Vector2D(0,0) ); + } + break; + } + } +} + + +void Formation::fillTargetPosFormationReverseV( vector &targetPos ) { + switch ( nrInvolved ) { + case 1: + { + targetPos.push_back( Vector2D(0,0) ); + break; + } + case 2: + { + targetPos.push_back( Vector2D(-30,0) ); + targetPos.push_back( Vector2D(30,0) ); + break; + } + case 3: + { + targetPos.push_back( Vector2D(-50,-25) ); + targetPos.push_back( Vector2D(0,25) ); + targetPos.push_back( Vector2D(50,-25) ); + break; + } + case 4: + { + targetPos.push_back( Vector2D(-80,-25) ); + targetPos.push_back( Vector2D(-30,25) ); + targetPos.push_back( Vector2D(30,25) ); + targetPos.push_back( Vector2D(80,-25) ); + break; + } + case 5: + { + targetPos.push_back( Vector2D(-100,-50) ); + targetPos.push_back( Vector2D(-50,0) ); + targetPos.push_back( Vector2D(0,50) ); + targetPos.push_back( Vector2D(50,0) ); + targetPos.push_back( Vector2D(100,-50) ); + break; + } + case 6: + { + targetPos.push_back( Vector2D(-130,-50) ); + targetPos.push_back( Vector2D(-80,0) ); + targetPos.push_back( Vector2D(-30,50) ); + targetPos.push_back( Vector2D(30,50) ); + targetPos.push_back( Vector2D(80,0) ); + targetPos.push_back( Vector2D(130,-50) ); + break; + } + case 7: + { + targetPos.push_back( Vector2D(-150,-75) ); + targetPos.push_back( Vector2D(-100,-25) ); + targetPos.push_back( Vector2D(-50,25) ); + targetPos.push_back( Vector2D(0,75) ); + targetPos.push_back( Vector2D(50,25) ); + targetPos.push_back( Vector2D(100,-25) ); + targetPos.push_back( Vector2D(150,-75) ); + break; + } + default: + { + cout << "fillTargetPosFormationReverseV: too many enemys involved: " + << nrInvolved << endl; + for ( int i = 0; i < nrInvolved; i++ ) { + targetPos.push_back( Vector2D(0,0) ); + } + break; + } + } +} + + +void Formation::fillTargetPosFormationBlock( vector &targetPos ) { + switch ( nrInvolved ) { + case 1: + { + targetPos.push_back( Vector2D(0,0) ); + break; + } + case 2: + { + targetPos.push_back( Vector2D(-30,0) ); + targetPos.push_back( Vector2D(30,0) ); + break; + } + case 3: + { + targetPos.push_back( Vector2D(-30,25) ); + targetPos.push_back( Vector2D(0,-25) ); + targetPos.push_back( Vector2D(30,25) ); + break; + } + case 4: + { + targetPos.push_back( Vector2D(-30,-25) ); + targetPos.push_back( Vector2D(-30,25) ); + targetPos.push_back( Vector2D(30,-25) ); + targetPos.push_back( Vector2D(30,25) ); + break; + } + case 5: + { + targetPos.push_back( Vector2D(-40,-30) ); + targetPos.push_back( Vector2D(-40,30) ); + targetPos.push_back( Vector2D(0,0) ); + targetPos.push_back( Vector2D(40,-30) ); + targetPos.push_back( Vector2D(40,30) ); + break; + } + case 6: + { + targetPos.push_back( Vector2D(-60,-30) ); + targetPos.push_back( Vector2D(-60,30) ); + targetPos.push_back( Vector2D(0,-30) ); + targetPos.push_back( Vector2D(0,30) ); + targetPos.push_back( Vector2D(60,-30) ); + targetPos.push_back( Vector2D(60,30) ); + break; + } + case 7: + { + targetPos.push_back( Vector2D(-60,-50) ); + targetPos.push_back( Vector2D(-60,0) ); + targetPos.push_back( Vector2D(0,-50) ); + targetPos.push_back( Vector2D(0,0) ); + targetPos.push_back( Vector2D(0,50) ); + targetPos.push_back( Vector2D(60,-50) ); + targetPos.push_back( Vector2D(60,0) ); + break; + } + default: + { + cout << "fillTargetPosFormationBlock: too many enemys involved: " << nrInvolved << endl; + for ( int i = 0; i < nrInvolved; i++ ) { + targetPos.push_back( Vector2D(0,0) ); + } + break; + } + } +} + + +void Formation::fillTargetPosFormationLine( vector &targetPos ) { + switch ( nrInvolved ) { + case 1: + { + targetPos.push_back( Vector2D(0,0) ); + break; + } + case 2: + { + targetPos.push_back( Vector2D(-30,0) ); + targetPos.push_back( Vector2D(30,0) ); + break; + } + case 3: + { + targetPos.push_back( Vector2D(-60,0) ); + targetPos.push_back( Vector2D(0,0) ); + targetPos.push_back( Vector2D(60,0) ); + break; + } + case 4: + { + targetPos.push_back( Vector2D(-90,0) ); + targetPos.push_back( Vector2D(-30,0) ); + targetPos.push_back( Vector2D(30,0) ); + targetPos.push_back( Vector2D(90,0) ); + break; + } + case 5: + { + targetPos.push_back( Vector2D(-120,0) ); + targetPos.push_back( Vector2D(-60,0) ); + targetPos.push_back( Vector2D(0,0) ); + targetPos.push_back( Vector2D(60,0) ); + targetPos.push_back( Vector2D(120,0) ); + break; + } + case 6: + { + targetPos.push_back( Vector2D(-150,0) ); + targetPos.push_back( Vector2D(-90,0) ); + targetPos.push_back( Vector2D(-30,0) ); + targetPos.push_back( Vector2D(30,0) ); + targetPos.push_back( Vector2D(90,0) ); + targetPos.push_back( Vector2D(150,0) ); + break; + } + default: + { + cout << "fillTargetPosFormationLine: too many enemys involved: " << nrInvolved << endl; + for ( int i = 0; i < nrInvolved; i++ ) { + targetPos.push_back( Vector2D(0,0) ); + } + break; + } + } +} + + + + +/////////////////////////////////////////////// + + +void Formation::getBestMapping( vector &targetPos, + vector &relPosForFighters ) { + + int actPerm[nrInvolved]; + vector *bestMapping = new vector(); + vector *testMapping = new vector(); + for ( int i = 0; i < nrInvolved; i++ ) { + bestMapping->push_back( Vector2D( 0,0 ) ); + testMapping->push_back( Vector2D( 0,0 ) ); + actPerm[ i ] = i; + } + float mapCost = 1000000; + + int nrPerm = factorial( nrInvolved ); + + for ( int perm = 0; perm < nrPerm; perm++ ) { + calcNextPerm( actPerm ); + float testMappingCost = calcTestMapping( actPerm, targetPos, testMapping ); + if ( mapCost > testMappingCost ) { + vector *tmpMapping = bestMapping; + bestMapping = testMapping; + testMapping = tmpMapping; + mapCost = testMappingCost; + } + } + + for ( int e = 0; e < nrInvolved; e++ ) { + relPosForFighters.push_back( (*bestMapping)[e] ); + } + delete bestMapping; + delete testMapping; +} + + +void Formation::calcNextPerm( int *perm ) { + int n = nrInvolved; + int i = n-1; + int j = n; + int tmp; + + while ( i != 0 && perm[ i-1 ] >= perm[ i ] ) { + i--; + } + if ( i == 0 ) { + for ( int k = 0; k < n/2; k++ ) { + tmp = perm[ k ]; + perm[ k ] = perm[ n - k - 1 ]; + perm[ n - k - 1 ] = tmp; + } + return; + } + while ( perm[ j-1 ] <= perm[ i-1 ] ) { + --j; + } + tmp = perm[ i-1 ]; + perm[ i-1 ] = perm[ j-1 ]; + perm[ j-1 ] = tmp; + + i++; + j = n; + + while ( i < j ) { + tmp = perm[ i-1 ]; + perm[ i-1 ] = perm[ j-1 ]; + perm[ j-1 ] = tmp; + i++; + j--; + } +} + + +float Formation::calcTestMapping( int *perm, vector &targetPos, + vector *mapping ) { + + float cost = 0; + + for ( int i = 0; i < nrInvolved; i++ ) { + // enemy i shall fly to the position targetPos[perm[i]] + // save the vector from its actual pos to its new targetpos in mapping + (*mapping)[ i ] = + targetPos[ perm[i] ] + formationCenter - + involvedEnemys[ i ]->getPos(); + + if ( cost < (*mapping)[ i ].getLength() ) { + cost = (*mapping)[ i ].getLength(); + } + } + return cost; +} + + +int Formation::factorial( int n ) { + int result = 1; + for ( int i = 2; i <= n; i++ ) { + result *= i; + } + return result; +} + + + +void Formation::shoot( int dT ) { + if ( shotPattern == FORMATION_SP_NONE ) return; + nextFirePrimary -= dT; + // nextFireSecondary -= dT; + + float enemyRatio = FORMATION_MAX_NR_ENEMYS[ formationType ] / (float)nrInvolved; + + while ( nextFirePrimary < 0 ) { + switch ( shotPattern ) { + case FORMATION_SP_VOLLEY_FAST: + case FORMATION_SP_VOLLEY_MEDIUM: + case FORMATION_SP_VOLLEY_SLOW: + { + for ( int i = 0; i < nrInvolved; i++ ) { + involvedEnemys[ i ]->firePrimary(); + } + break; + } + case FORMATION_SP_RAND_FAST: + case FORMATION_SP_RAND_MEDIUM: + case FORMATION_SP_RAND_SLOW: + { + involvedEnemys[ rand() % nrInvolved ]->firePrimary(); + break; + } + case FORMATION_SP_LEFT_RIGHT_FAST: + case FORMATION_SP_LEFT_RIGHT_MEDIUM: + { + actShootingEnemy = (actShootingEnemy + 1) % nrInvolved; + involvedEnemys[ actShootingEnemy ]->firePrimary(); + break; + } + case FORMATION_SP_RIGHT_LEFT_FAST: + case FORMATION_SP_RIGHT_LEFT_MEDIUM: + { + actShootingEnemy--; + if ( actShootingEnemy < 0 ) actShootingEnemy = nrInvolved-1; + involvedEnemys[ actShootingEnemy ]->firePrimary(); + break; + } + default: + { + break; + } + } + + nextFirePrimary += + lroundf( (FORMATION_SP_PRIMARY_DELAY[ shotPattern ] + + rand() % (FORMATION_SP_PRIMARY_RAND_DELAY[ shotPattern ] + 1)) * enemyRatio ); + } +} + diff --git a/alienblaster/project/jni/alienblaster/src/formation.h b/alienblaster/project/jni/alienblaster/src/formation.h new file mode 100644 index 000000000..0838ac711 --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/formation.h @@ -0,0 +1,85 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +#ifndef FORMATION_H +#define FORMATION_H + +#include +#include "global.h" +#include "geometry.h" + +class Enemy; + +class Formation { + private: + std::vector involvedEnemys; + int nrInvolved; + + FormationTypes formationType; + + Vector2D formationCenter; + Vector2D formationSpeed; + + bool enemyWasKilled; + + bool formationFires; + int nextFirePrimary; + int nextFireSecondary; + + bool changeOnKill, changeSpontaneous, changeOften, changeSeldom; + int nextFormationChange; + FormationShotPatterns shotPattern; + int actShootingEnemy; + + void chooseNewFormationType(); + + void handleSpontaneousFormationChange( int dT ); + void moveEnemyInFormation(); + void fillTargetPos( vector &targetPos ); + void fillTargetPosFormationV( vector &targetPos ); + void fillTargetPosFormationReverseV( vector &targetPos ); + void fillTargetPosFormationBlock( vector &targetPos ); + void fillTargetPosFormationLine( vector &targetPos ); + void getBestMapping( vector &targetPos, + vector &relPosForFighters ); + + void calcNextPerm( int *perm ); + float calcTestMapping( int *perm, vector &targetPos, + vector *mapping ); + int factorial( int n ); + + void shoot( int dT ); + + public: + Formation( FormationTypes whichFormation, Vector2D centerAtStart, + Vector2D startVel, int nrEnemys=66, + FormationEnemySets enemyTypes=FORMATION_ENEMY_SET_DEFAULT, + int flagsFormationChangePolicy=0, + FormationShotPatterns shotPattern=FORMATION_SP_NONE ); + ~Formation(); + + Vector2D getCenter() { return formationCenter; } + + void enemyKilled( Enemy *killedEnemy ); + void update( int dT ); + bool isExpired() { return (nrInvolved == 0); } +}; + + +#endif diff --git a/alienblaster/project/jni/alienblaster/src/game.cc b/alienblaster/project/jni/alienblaster/src/game.cc new file mode 100644 index 000000000..a75a531b9 --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/game.cc @@ -0,0 +1,927 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +using namespace std; + +#include +#include +#include +#include "SDL.h" +#include "SDL_mixer.h" +#include "game.h" +#include "surfaceDB.h" +#include "racers.h" +#include "racer.h" +#include "video.h" +#include "shots.h" +#include "shot.h" +#include "items.h" +#include "explosions.h" +#include "explosion.h" +#include "enemys.h" +#include "font.h" +#include "mixer.h" +#include "input.h" +#include "wrecks.h" +#include "wreck.h" +#include "global.h" +#include "settings.h" +#include "intro.h" +#include "setDifficulty.h" +#include "menuArcadeMode.h" +#include "asstring.h" +#include "sonic.h" +#include "banners.h" +#include "banner.h" +#include "smokePuffs.h" +#include "background.h" +#include "options.h" + +Racers *racers = NULL; +Enemys *enemys = NULL; +Shots *shots = NULL; +Explosions *explosions = NULL; +Items *items = NULL; +Wrecks *wrecks = NULL; +Banners *banners = NULL; +SmokePuffs *smokePuffs = NULL; +Options *levelConf = NULL; + +bool scrollingOn; +bool nukeIsInPlace; +bool playMusicOn; +bool onePlayerGame; +bool arcadeGame; +int difficultyLevel; +float actBackgroundPos; + +Game::Game() { + videoserver = new Video(); + screen = 0; + screen = videoserver->init(); + settings = new Settings(); + intro = new Intro( screen ); + setDifficulty = new SetDifficulty( screen ); + menuArcadeMode = new MenuArcadeMode( screen ); + + pauseSprite = surfaceDB.loadSurface( FN_PAUSED ); + youLoseSprite = surfaceDB.loadSurface( FN_YOU_LOSE ); + youWinSprite = surfaceDB.loadSurface( FN_YOU_WIN ); + // for arcadeMode + gameOverSprite = surfaceDB.loadSurface( FN_GAME_OVER ); + + nukeEffectSurface = surfaceDB.loadSurface( FN_NUKE_EFFECT ); + + bossAlarm = mixer.loadSample( FN_SOUND_BOSS_ALARM, 60 ); + + fontTime = new Font( FN_FONT_NUMBERS_TIME ); + fontSizeTime = fontTime->getCharWidth(); + + racers = 0; + explosions = 0; + enemys = 0; + shots = 0; + items = 0; + wrecks = 0; + banners = 0; + smokePuffs = 0; + // needed for calculating fps + frameCnt = 0; + tickCnt = 0; + + gameState = GS_INTRO; + paused = true; + sdlTicks = SDL_GetTicks(); + gameActRuntime = 0; + timeNukeEnd = 0; + timePauseOn = 0; + timeMinibossOn = 0; + + scrollingOn = true; + showAllShipStats = false; + playMusicOn = true; + onePlayerGame = false; + arcadeGame = false; + difficultyLevel = 1; + + sonic1 = new Sonic(); + sonic2 = new Sonic(); + + background = new Background(); + loadLevel( FN_LEVEL_ONE_PLAYER ); + + SDL_Surface *loadingSprite = surfaceDB.loadSurface( FN_LOADING ); + SDL_Rect dest; + dest.x = (SCREEN_WIDTH - loadingSprite->w ) / 2; + dest.y = (SCREEN_HEIGHT - loadingSprite->h ) / 2; + dest.w = loadingSprite->w; + dest.h = loadingSprite->h; + SDL_BlitSurface( loadingSprite, 0, screen, &dest ); + SDL_Flip( screen ); + initAllSurfaces(); +} + +Game::~Game(){ + if (videoserver) delete videoserver; + if (settings) delete settings; + if (intro) delete intro; + if (setDifficulty) delete setDifficulty; + if (racers) delete racers; + if (shots) delete shots; + if (explosions) delete explosions; + if (enemys) delete enemys; + if (items) delete items; + if (wrecks) delete wrecks; + if (fontTime) delete fontTime; + if (sonic1) delete sonic1; + if (sonic2) delete sonic2; + if (banners) delete banners; + if (smokePuffs) delete smokePuffs; +} + +void Game::initNewGame() { + parseGlobalConfigValues( difficultyLevel ); + + if (racers) delete racers; + if (shots) delete shots; + if (explosions) delete explosions; + if (enemys) delete enemys; + if (items) delete items; + if (wrecks) delete wrecks; + if (sonic1) delete sonic1; + if (sonic2) delete sonic2; + if (banners) delete banners; + if (smokePuffs) delete smokePuffs; + + banners = new Banners(); + smokePuffs = new SmokePuffs(); + + racers = new Racers(); + Racer *racer; + + if ( !arcadeGame ) { + if ( onePlayerGame ) { + loadLevel( FN_LEVEL_ONE_PLAYER ); + if ( setDifficulty->getPlayerOneLightFighter() ) { + racer = new Racer( FN_LIGHT_FIGHTER_1, 0, + Vector2D(320,350), LIGHT_FIGHTER ); + } else { + racer = new Racer( FN_HEAVY_FIGHTER_1, 0, + Vector2D(320,350), HEAVY_FIGHTER ); + } + racers->addRacer(racer); + } + // two players + else { + loadLevel( FN_LEVEL_TWO_PLAYER ); + if ( setDifficulty->getPlayerOneLightFighter() ) { + racer = new Racer( FN_LIGHT_FIGHTER_1, 0, + Vector2D(250,350), LIGHT_FIGHTER ); + } else { + racer = new Racer( FN_HEAVY_FIGHTER_1, 0, + Vector2D(250,350), HEAVY_FIGHTER ); + } + racers->addRacer(racer); + + if ( setDifficulty->getPlayerTwoLightFighter() ) { + racer = new Racer( FN_LIGHT_FIGHTER_2, 1, + Vector2D(390,350), LIGHT_FIGHTER ); + } else { + racer = new Racer( FN_HEAVY_FIGHTER_2, 1, + Vector2D(390,350), HEAVY_FIGHTER ); + } + racers->addRacer(racer); + } + } + // arcade game + else { + loadLevel( FN_LEVEL_ARCADEMODE ); + if ( menuArcadeMode->getPlayerOneLightFighter() ) { + racer = new Racer( FN_LIGHT_FIGHTER_1, 0, + Vector2D(320,350), LIGHT_FIGHTER ); + } else { + racer = new Racer( FN_HEAVY_FIGHTER_1, 0, + Vector2D(320,350), HEAVY_FIGHTER ); + } + racers->addRacer(racer); + } + + racers->getKeyActionMaps(); + + explosions = new Explosions(); + enemys = new Enemys(); + shots = new Shots(); + items = new Items(); + wrecks = new Wrecks(); + + gameActRuntime = 0; + paused = true; + bossTime = false; + bossNukeEffect = false; + bossExplosion = mixer.loadSample( FN_SOUND_EXPLOSION_BOSS ); + + minibossAlreadyKilled = false; + minibossTime = false; + timeMinibossOn = SDL_GetTicks(); + timeLastUpdate = SDL_GetTicks(); + timeNukeEnd = SDL_GetTicks(); + timePauseOn = SDL_GetTicks(); + actBackgroundPos = 0; + + scrollingOn = true; + nukeIsInPlace = false; + + sonic1 = new Sonic(); + sonic2 = new Sonic(); + sonic1->setActive( false ); + sonic2->setActive( false ); +} + +void Game::run(){ + while( gameState != GS_QUIT ) { + switch (gameState) { + case GS_SCREENSHOTS: + { + intro->showScreenshots(); + gameState = GS_INTRO; + break; + } + case GS_INTRO: + { + intro->run( gameState ); + break; + } + case GS_SET_DIFFICULTY: + { + setDifficulty->run( gameState, onePlayerGame); + break; + } + case GS_ARCADE_MODE_SETUP: + { + menuArcadeMode->run( gameState ); + break; + } + case GS_ARCADE_MODE_FINISHED: + { + menuArcadeMode->run( gameState, racers->getPointsArcadeMode() ); + break; + } + case GS_OPTIONS: + { + options(); + break; + } + case GS_ROUNDFINISHED: + { + roundFinished(); + break; + } + case GS_BOSS_KILLED: + { + bossKilled(); + break; + } + case GS_PLAYON: + { + initNewGame(); + if ( playMusicOn ) mixer.playMusic( MUSIC_PLAYON, -1, 1000 ); + playOn(); + break; + } + default: break; + } + } +} + + +/*********************************/ +/**** PlayOn *********************/ +/*********************************/ + +void Game::playOn() { + int A = SDL_GetTicks(); + frameCnt = 0; + tickCnt = 0; + cout << "frameCnt: " << frameCnt << " tickCnt: " << tickCnt + << " SDL_GetTicks()=" << A << endl; + + while ( gameState == GS_PLAYON ) { + handleEventsPlayOn(); + if (!paused) { + updateGameState(); + } + drawPlayOn(); + // miniboss + if ( minibossTime && enemys->minibossDead() ) minibossAlreadyKilled = true; + if (!minibossAlreadyKilled && !arcadeGame && !paused && !minibossTime && + (unsigned int)GAME_LENGTH / 2 <= gameActRuntime) { + generateMiniboss(); + } + if ( minibossTime && enemys->bossDead() ) minibossKilled(); + // endboss + if (!arcadeGame && !paused && !bossTime && !minibossTime && + (unsigned int)GAME_LENGTH < gameActRuntime) { + enemys->bossTime(1); // generates the boss + bossTime = true; + mixer.playSample( bossAlarm , 0, true ); + if ( playMusicOn ) mixer.playMusic( MUSIC_BOSS1, -1, 0 ); + } + if ( bossTime && enemys->bossDead() ) gameState = GS_BOSS_KILLED; + if ( racers->bothPlayersLost() ) gameState = GS_ROUNDFINISHED; + } + + int B = SDL_GetTicks(); + cout << "frameCnt: " << frameCnt << " tickCnt: " << tickCnt + << " SDL_GetTicks()=" << B << endl; + cout << "Miliseconds: " << B-A << endl; + cout << "Frames/sec : " << (float)frameCnt / ((float)(B-A) / 1000.0) << endl; + cout << "ms/Frame : " << (float)tickCnt / (float)frameCnt << endl; +} + + +void Game::pause() { + if (paused) { + Uint32 timePaused = SDL_GetTicks() - timePauseOn; + timeLastUpdate += timePaused; + } else { + timePauseOn = SDL_GetTicks(); + } + paused = !paused; +} + + +void Game::handleEventsPlayOn() { + SDL_Event event; + + while (SDL_PollEvent(&event)) { + switch(event.type) { + case SDL_JOYBUTTONDOWN: + case SDL_KEYDOWN: { + if (paused) pause(); + racers->handleEvent(input.translate(event), input.isPressed(event)); + break; + } + case SDL_KEYUP: { + switch(event.key.keysym.sym) { + case SDLK_F10: { + pause(); + break; + } + case SDLK_F5: { + videoserver->toggleFullscreen(); + break; + } + case SDLK_F6: { + showAllShipStats = !showAllShipStats; + break; + } + case SDLK_ESCAPE: { + gameState = GS_INTRO; + break; + } + case SDLK_F1: { + if (!paused) pause(); + settings->settingsDialog(screen); + racers->getKeyActionMaps(); + pause(); + break; + } + case SDLK_F7: { + if ( playMusicOn ) { + playMusicOn = false; + mixer.stopMusic(); + } else { + playMusicOn = true; + if ( bossTime ) mixer.playMusic( MUSIC_BOSS1, -1, 1000 ); + else mixer.playMusic( MUSIC_PLAYON, -1, 1000 ); + } + break; + } + default: break; + } + } + case SDL_JOYAXISMOTION: + case SDL_JOYBUTTONUP: + racers->handleEvent(input.translate(event), input.isPressed(event)); + break; + case SDL_QUIT: { + gameState = GS_QUIT; + break; + } + default: break; + } + } +} + + +// what to do in one tick +void Game::updateGameState() { + int dT = SDL_GetTicks() - timeLastUpdate; + timeLastUpdate += dT; + if ( !minibossTime ) gameActRuntime += dT; + + if ( nukeIsInPlace ) handleNuke(); + + enemys->generateEnemys( dT ); + explosions->updateExplosions( dT ); + + smokePuffs->update( dT ); + shots->moveAndCollide( dT ); + wrecks->updateWrecks( dT ); + enemys->updateEnemys( dT ); + if ( !arcadeGame ) items->generate( dT ); + items->update( dT ); + + racers->moveAndCollide( dT ); + racers->pickUpItems(); + racers->shoot(); + if ( !arcadeGame ) racers->rechargeShield( dT ); + + enemys->deleteExpiredEnemys(); + shots->expireShots(); + items->expireItems(); + explosions->expireExplosions(); + wrecks->expireWrecks(); + racers->expireRacers(); + smokePuffs->expireSmokePuffs(); + sonicDeflectorEffect(); + + banners->update( dT ); + banners->expireBanners(); + + if ( scrollingOn ) actBackgroundPos -= SCROLL_SPEED * dT / 1000.0; + + if ( arcadeGame ) { + racers->receivePointsArcade( ARCADE_POINTS_PER_TEN_SECONDS * dT / 10000.0 ); + } +} + +void Game::handleNuke() { + sonic1->setActive( false ); + sonic2->setActive( false ); + + enemys->doNukeDamage(); + shots->deleteAllShots(); + timeNukeEnd = SDL_GetTicks() + NUKE_EFFECT_DURATION; + nukeIsInPlace = false; +} + +void Game::sonicDeflectorEffect() { + for ( unsigned int i = 0; i < racers->getNrRacers(); i++) { + if ( racers->getRacer(i)->getShipType() == LIGHT_FIGHTER ) { + Shot* nearestRocket = shots->getNearestRocket( racers->getRacer(i)->getPos() ); + // a rocket exists and it is in range of the sonic + if ( nearestRocket != NULL && + (nearestRocket->getPos() - racers->getRacer(i)->getPos()).getLength() < + RACER_SONIC_ACTIVATION_DIST ) { + // activate the correct sonic + if (i == 0) { + sonic1->setPos( racers->getRacer(i)->getPos(), nearestRocket->getPos() ); + nearestRocket->deflectedBySonicFromPlayer1 = true; + } else { + sonic2->setPos( racers->getRacer(i)->getPos(), nearestRocket->getPos() ); + nearestRocket->deflectedBySonicFromPlayer2 = true; + } + // no rocket is in sonic-range + } else { + // deactivate the sonic + if (i == 0) { + sonic1->setActive( false ); + } else { + sonic2->setActive( false ); + } + } + } + } +} + +void Game::drawPlayOn() { + drawBackground(); + wrecks->draw(screen); + enemys->drawGroundEnemys(screen); + shots->drawShadows(screen); + racers->drawShadows(screen); + enemys->drawShadows(screen); + explosions->drawGroundExplosions(screen); + + smokePuffs->draw(screen); + + sonic1->draw(screen); + sonic2->draw(screen); + + shots->drawGroundShots(screen); + shots->drawGroundAirShots(screen); + items->draw(screen); + enemys->drawAirEnemys(screen); + racers->drawRacers(screen); + shots->drawAirShots(screen); + explosions->drawAirExplosions(screen); + + + if ( showAllShipStats ) enemys->drawAllStats(screen); + else { + if ( bossTime ) { + enemys->drawBossStats(screen); + fontTime->drawStr( screen, (screen->w / 2), 5, "BOSS", FONT_ALIGN_CENTERED ); + } + } + + if ( SDL_GetTicks() < timeNukeEnd ) { + drawNukeEffect(); + } + + racers->drawStats(screen); + + banners->draw(screen); + if ( !arcadeGame && !bossTime && !minibossTime ) drawTime(); + else { + if ( bossTime || minibossTime ) { + fontTime->drawStr( screen, (screen->w / 2), 5, "BOSS", FONT_ALIGN_CENTERED ); + } + else { + drawPointsArcadeMode(); + } + } + + if (paused) drawPaused(); + + SDL_Flip( screen ); + + frameCnt++; +} + +void Game::drawBackground() { + background->draw(screen, (int) (actBackgroundPos + 0.5) ); +} + + +void Game::drawTime() { + Uint32 timeToDraw; + timeToDraw = (GAME_LENGTH - gameActRuntime) / 1000; + if ( timeToDraw > 0 ) { + int digitCnt = 1; + Uint32 i=1; + while ( timeToDraw >= i*10 ) { + digitCnt++; + i *= 10; + } + fontTime->drawInt(screen, (screen->w / 2) - (fontSizeTime * digitCnt) / 2, 5, + timeToDraw, digitCnt, 0); + } +} + + +void Game::drawPointsArcadeMode() { + int pointsToDraw = racers->getPointsArcadeMode(); + if ( pointsToDraw < 0 ) return; + + int digitCnt = 1; + int i=1; + while ( pointsToDraw >= i*10 ) { + digitCnt++; + i *= 10; + } + fontTime->drawInt( screen, (screen->w / 2) - (fontSizeTime * digitCnt) / 2, 10, + pointsToDraw, digitCnt, 0); +} + + + +void Game::drawPaused() { + SDL_Rect r; + r.x = screen->w/2 - pauseSprite->w/2; + r.y = screen->h/2 - pauseSprite->h/2; + r.w = pauseSprite->w; + r.h = pauseSprite->h; + SDL_BlitSurface( pauseSprite, 0, screen, &r ); +} + + +void Game::drawNukeEffect() { + // effect-process: transparent -> nearly opaque -> transparent + int timeFromMaximum = (NUKE_EFFECT_DURATION / 2) - (timeNukeEnd - SDL_GetTicks()); + timeFromMaximum = abs(timeFromMaximum); + SDL_SetAlpha( nukeEffectSurface, SDL_SRCALPHA | SDL_RLEACCEL, + lroundf(((NUKE_EFFECT_DURATION / 2) - timeFromMaximum) * 128.0 / + (NUKE_EFFECT_DURATION / 2)) ); + SDL_BlitSurface( nukeEffectSurface, 0, screen, 0 ); + + int randRange = (int) + (( ((NUKE_EFFECT_DURATION / 2.0) - timeFromMaximum) * NUKE_QUAKE_EFFECT / + (NUKE_EFFECT_DURATION / 2.0 ) ) + 0.5); + + int randX, randY; + if ( randRange == 0 ) randRange = 1; + randX = (rand() % randRange) - randRange / 2; + randY = (rand() % randRange) - randRange / 2; + + SDL_Rect src, dest; + if ( randX < 0 ) { + src.x = -randX; + src.w = screen->w + randX; + dest.x = 0; + dest.w = screen->w + randX; + } else { + src.x = 0; + src.w = screen->w - randX; + dest.x = randX; + dest.w = screen->w - randX; + } + if ( randY < 0 ) { + src.y = -randY; + src.h = screen->h + randY; + dest.y = 0; + dest.h = screen->h + randY; + } else { + src.y = 0; + src.h = screen->h - randY; + dest.y = randY; + dest.h = screen->h - randY; + } + + SDL_BlitSurface( screen, &src, screen, &dest ); +} + + +// not in use - not needed anymore +void Game::timeManagement() { + Uint32 sdlTicksNew = SDL_GetTicks(); + tickCnt += sdlTicksNew - sdlTicks; + // 25 Frames per Second is wanted + // we needed less than 40 ms -> wait till the 40 ms are over + while ( sdlTicks + 40 > sdlTicksNew ) { + sdlTicksNew = SDL_GetTicks(); + } + sdlTicks = sdlTicksNew; +} + + + +/***********************************/ +/** Options ************************/ +/***********************************/ + +void Game::options() {} + + +/************************************/ +/** Round Finished ******************/ +/************************************/ + +void Game::roundFinished() { + drawRoundFinished(); + SDL_Flip( screen ); + while (gameState == GS_ROUNDFINISHED ) { + handleEventsRoundFinished(); + } +} + +void Game::handleEventsRoundFinished() { + SDL_Event event; + + while (SDL_PollEvent(&event)) { + switch(event.type) { + case SDL_KEYUP: + { + switch(event.key.keysym.sym) { + case SDLK_ESCAPE: + case SDLK_SPACE: + case SDLK_RETURN: + { + if ( arcadeGame ) gameState = GS_ARCADE_MODE_FINISHED; + else gameState = GS_INTRO; + break; + } + case SDLK_F5: + { + videoserver->toggleFullscreen(); + break; + } + default: + { + break; + } + } + break; + } + case SDL_QUIT: + { + if ( arcadeGame ) gameState = GS_ARCADE_MODE_FINISHED; + else gameState = GS_INTRO; + break; + } + default: break; + } + } +} + +void Game::drawRoundFinished() { + SDL_Rect r; + + if ( arcadeGame ) { + r.x = screen->w/2 - gameOverSprite->w / 2; + r.y = screen->h/2 - gameOverSprite->h / 2; + r.w = gameOverSprite->w; + r.h = gameOverSprite->h; + SDL_BlitSurface( gameOverSprite, 0, screen, &r ); + + fontTime->drawStr( screen, screen->w/2, screen->h/2 + gameOverSprite->h/2 + 50, + "SCORE: " + asString( racers->getPointsArcadeMode() ), + FONT_ALIGN_CENTERED ); + fontTime->drawStr( screen, screen->w/2, screen->h/2 + gameOverSprite->h/2 + 100, + "Kill Rate: " + asString(enemys->getNrEnemysKilled()) + + "/" + asString(enemys->getNrEnemysGenerated()), + FONT_ALIGN_CENTERED ); + } + + // normal game + else { + if ( racers->bothPlayersLost() ) { + r.x = screen->w/2 - youLoseSprite->w / 2; + r.y = screen->h/2 - youLoseSprite->h / 2; + r.w = youLoseSprite->w; + r.h = youLoseSprite->h; + SDL_BlitSurface( youLoseSprite, 0, screen, &r ); + } else { + r.x = screen->w/2 - youWinSprite->w / 2; + r.y = screen->h/2 - youWinSprite->h / 2; + r.w = youWinSprite->w; + r.h = youWinSprite->h; + SDL_BlitSurface( youWinSprite, 0, screen, &r ); + fontTime->drawStr(screen, screen->w/2, screen->h/2 + youWinSprite->h/2 + 50, + "Kill Rate: " + asString(enemys->getNrEnemysKilled()) + + ":" + asString(enemys->getNrEnemysGenerated()), + FONT_ALIGN_CENTERED); + } + } +} + + +/************************************/ +/** Miniboss ***********************/ +/************************************/ + +void Game::generateMiniboss() { + scrollingOn = false; + minibossTime = true; + enemys->bossTime(2); // generates the miniboss + mixer.playSample( bossAlarm , 0, true ); + if ( playMusicOn ) mixer.playMusic( MUSIC_BOSS1, -1, 0 ); +} + +void Game::minibossKilled() { + scrollingOn = true; + minibossTime = false; + if ( playMusicOn ) mixer.playMusic( MUSIC_PLAYON, -1, 0 ); +} + + +/************************************/ +/** Boss Killed *********************/ +/************************************/ + +void Game::bossKilled() { + int BOSS_EXPLOSION_DURATION = 3000; + int startOfBossExplosion = SDL_GetTicks(); + int actualTime; + bool bossExplosionSound = false; + timeNukeEnd = SDL_GetTicks() + BOSS_EXPLOSION_DURATION + NUKE_EFFECT_DURATION; + + while ( gameState == GS_BOSS_KILLED ) { + actualTime = SDL_GetTicks(); + updateBossKilled(); + if ( (actualTime - startOfBossExplosion) < BOSS_EXPLOSION_DURATION ) { + // explosions + Explosion *newExplosion = + new Explosion( FN_EXPLOSION_ENEMY, + Vector2D( rand() % SCREEN_WIDTH, rand() % 150 ), + Vector2D( 0, 0 ), + EXPLOSION_NORMAL_GROUND ); + explosions->addExplosion( newExplosion ); + } + else if ( (actualTime - startOfBossExplosion) < (BOSS_EXPLOSION_DURATION + NUKE_EFFECT_DURATION) ) { + // nuke effect + if ( !bossExplosionSound ) { + mixer.playSample( bossExplosion, 0, true ); + bossExplosionSound = false; + enemys->doNukeDamage(); + enemys->deleteExpiredEnemys(); + shots->deleteAllShots(); + items->deleteAllItems(); + wrecks->deleteAllWrecks(); + Wreck *newWreck = new Wreck( Vector2D( SCREEN_WIDTH / 2, 70 ), WRECK_BOSS_1_DESTROYED); + wrecks->addWreck( newWreck ); + bossNukeEffect = true; + } + } + else { + bossNukeEffect = false; + } + if ( (actualTime - startOfBossExplosion) > (BOSS_EXPLOSION_DURATION + NUKE_EFFECT_DURATION + 4000) ) { + gameState = GS_ROUNDFINISHED; + } + drawBossKilled(); + handleEventsBossKilled(); + } +} + +void Game::handleEventsBossKilled() { + SDL_Event event; + + while (SDL_PollEvent(&event)) { + switch(event.type) { + case SDL_KEYUP: { + switch(event.key.keysym.sym) { + case SDLK_ESCAPE: + case SDLK_SPACE: + case SDLK_RETURN: + { + gameState = GS_INTRO; + break; + } + case SDLK_F5: + { + videoserver->toggleFullscreen(); + break; + } + default: break; + } + break; + } + case SDL_QUIT: + { + gameState = GS_INTRO; + break; + } + default: break; + } + } +} + +void Game::drawBossKilled() { + drawBackground(); + wrecks->draw(screen); + enemys->drawGroundEnemys(screen); + shots->drawShadows(screen); + racers->drawShadows(screen); + enemys->drawShadows(screen); + explosions->drawGroundExplosions(screen); + shots->drawGroundShots(screen); + shots->drawGroundAirShots(screen); + items->draw(screen); + enemys->drawAirEnemys(screen); + racers->drawRacers(screen); + shots->drawAirShots(screen); + explosions->drawAirExplosions(screen); + if ( bossNukeEffect ) drawNukeEffect(); + racers->drawStats(screen); + SDL_Flip( screen ); +} + +void Game::updateBossKilled() { + int dT = SDL_GetTicks() - timeLastUpdate; + timeLastUpdate += dT; + explosions->updateExplosions( dT ); + explosions->expireExplosions(); +} + + +void Game::loadLevel( string fn ) { + if (levelConf) { + delete levelConf; + } + levelConf = new Options( fn ); + + // load background tiles + background->clearTileList(); + int cnt = 0; + if (!levelConf->getInt( LVL_BACKG_TILE_CNT, cnt )) { + cout << "ERROR: " << fn << " contains no '" << LVL_BACKG_TILE_CNT << "' keyword!" << endl; + exit(0); + } + for(int i=0; i < cnt; i++) { + string tilename; + if (levelConf->getStr( LVL_BACKG_TILE + asString( i ), tilename ) ) { + background->addTile( tilename ); + } + } + int len = SCREEN_WIDTH; + levelConf->getInt( LVL_BACKG_LENGTH, len ); + background->generateBackground( len ); +} diff --git a/alienblaster/project/jni/alienblaster/src/game.h b/alienblaster/project/jni/alienblaster/src/game.h new file mode 100644 index 000000000..1b92d4dd2 --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/game.h @@ -0,0 +1,142 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +#ifndef GAME_HH +#define GAME_HH + +#include "SDL.h" +#include + +class Video; +class SurfaceDB; +class Racers; +class Shots; +class Explosions; +class Enemys; +class Items; +class Font; +class Intro; +class SetDifficulty; +class MenuArcadeMode; +class Sonic; +class Background; +class Options; + +enum GameStates { GS_QUIT, GS_SCREENSHOTS, GS_INTRO, GS_SET_DIFFICULTY, + GS_OPTIONS, GS_ARCADE_MODE_SETUP, GS_ARCADE_MODE_FINISHED, + GS_PLAYON, GS_ROUNDFINISHED, GS_BOSS_KILLED }; + +/* The big class, that has to control the gamelogic and keep track of all the + game objects and their dependencies. */ +class Game { + // Video system + SDL_Surface *screen; + + SDL_Surface *pauseSprite; + SDL_Surface *youLoseSprite; + SDL_Surface *youWinSprite; + SDL_Surface *gameOverSprite; + SDL_Surface *nukeEffectSurface; + SDL_Surface *hud; + + // Time system + Font *fontTime; + int fontSizeTime; + + Uint32 frameCnt; + Uint32 tickCnt; + Uint32 sdlTicks; + Uint32 gameActRuntime; + Uint32 timePauseOn; + Uint32 timeMinibossOn; + Uint32 timeLastUpdate; + Uint32 timeNukeEnd; + + bool paused; + + bool showAllShipStats; + + Background *background; + + // is the game in playon or in intro or somewhere else? + GameStates gameState; + Intro *intro; + SetDifficulty *setDifficulty; + MenuArcadeMode *menuArcadeMode; + + // boss specific + bool bossTime; + bool minibossTime; + bool minibossAlreadyKilled; + bool bossNukeEffect; + int bossExplosion; + int bossAlarm; + + Sonic *sonic1; + Sonic *sonic2; + + public: + // for access from main() + Game(); + ~Game(); + // the outer game loop + void run(); + + private: + // starts a new game + void initNewGame(); + + /* Methods for GS_PLAYON */ + // the inner loop when the race is going on + void playOn(); + void handleEventsPlayOn(); + // toggles the pause state (takes into account the corresponding time problems) + void pause(); + void updateGameState(); + void handleNuke(); + void sonicDeflectorEffect(); + void drawPlayOn(); + void drawBackground(); + void drawTime(); + void drawPointsArcadeMode(); + void drawPaused(); + void drawNukeEffect(); + void timeManagement(); // not needed and used any more + + + /* Methods for GS_OPTIONS (not implemented by now) */ + void options(); + void loadLevel( std::string fn ); + + /* Methods for GS_ROUNDFINISHED (the time is up -> display the winner) */ + void roundFinished(); + void drawRoundFinished(); + void handleEventsRoundFinished(); + + void generateMiniboss(); + void minibossKilled(); + + void bossKilled(); + void updateBossKilled(); + void drawBossKilled(); + void handleEventsBossKilled(); +}; + +#endif //#ifndef GAME_HH + diff --git a/alienblaster/project/jni/alienblaster/src/geometry.cc b/alienblaster/project/jni/alienblaster/src/geometry.cc new file mode 100644 index 000000000..415fd0257 --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/geometry.cc @@ -0,0 +1,793 @@ +/* +Copyright (c) 2000,2001, Jelle Kok, University of Amsterdam +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +3. Neither the name of the University of Amsterdam nor the names of its +contributors may be used to endorse or promote products derived from this +software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/************************************************************************************** + * goemetry.cc + * + * implements: + * class Vector2D + * namespace Geometry + * class Line + * class Circle + * class Rectangle + * + * requires: + * + * Maintainer: wenns + * + * Changelog: + * + *************************************************************************************/ + +//Furthermore it contains some goniometric functions to work with sine, cosine +//and tangent functions using degrees and some utility functions to return +//the maximum and the minimum of two values. + +#include "geometry.h" +#include // max and min +#include // needed for sprintf + +AngDeg Rad2Deg ( AngRad x ) { return ( x * 180 / M_PI ); } +AngRad Deg2Rad ( AngDeg x ) { return ( x * M_PI / 180 ); } +float cosDeg ( AngDeg x ) { return ( cos( Deg2Rad( x ) ) ); } +float sinDeg ( AngDeg x ) { return ( sin( Deg2Rad( x ) ) ); } +float tanDeg ( AngDeg x ) { return ( tan( Deg2Rad( x ) ) ); } +AngDeg atanDeg ( float x ) { return ( Rad2Deg( atan( x ) ) ); } + +float atan2Deg( float x, float y ){ + if( fabs( x ) < EPSILON && fabs( y ) < EPSILON ) + return ( 0.0 ); + + return ( Rad2Deg( atan2( x, y ) ) ); +} + + +AngDeg acosDeg( float x ){ + if( x >= 1 ) + return ( 0.0 ); + else if( x <= -1 ) + return ( 180.0 ); + + return ( Rad2Deg( acos( x ) ) ); +} + + +AngDeg asinDeg( float x ){ + if( x >= 1 ) + return ( 90.0 ); + else if ( x <= -1 ) + return ( -90.0 ); + + return ( Rad2Deg( asin( x ) ) ); +} + + +float normalizeTo180Deg(float angle){ + while( angle > 180.0 ) angle -= 360.0; + while( angle < -180.0 ) angle += 360.0; + + return ( angle ); +} + + +bool isAngInInterval( AngDeg ang, AngDeg angMin, AngDeg angMax ){ + // convert all angles to interval 0..360 + if( ( ang + 360 ) < 360 ) ang += 360; + if( ( angMin + 360 ) < 360 ) angMin += 360; + if( ( angMax + 360 ) < 360 ) angMax += 360; + + if( angMin < angMax ) // 0 ---false-- angMin ---true-----angMax---false--360 + return angMin < ang && ang < angMax ; + else // 0 ---true--- angMax ---false----angMin---true---360 + return !( angMax < ang && ang < angMin ); +} + + +AngDeg getBisectorTwoAngles( AngDeg angMin, AngDeg angMax ){ + // separate sine and cosine part to circumvent boundary problem + //return Vector2D::normalizeAngle( + return normalizeTo180Deg( //wenns changed + atan2Deg( (sinDeg( angMin) + sinDeg( angMax ) )/2.0, + (cosDeg( angMin) + cosDeg( angMax ) )/2.0 ) ); +} + +AngDeg getAngleDifference( AngDeg ang1, AngDeg ang2 ){ + return (normalizeTo180Deg( ang1 - ang2 )); +} + +AngDeg getAbsAngleDifference( AngDeg ang1, AngDeg ang2 ){ + return fabs(normalizeTo180Deg( ang1 - ang2 )); +} + +/******************************************************************************/ +/******************** CLASS VECTOR2D **************************************/ +/******************************************************************************/ + +Vector2D::Vector2D( float x, float y, CoordSystemT cs ){ + setVector2D( x, y, cs ); +} + + +ostream& operator <<( ostream &os, Vector2D v ){ + return ( os << "( " << v.x << ", " << v.y << " )" ); +} + + +void Vector2D::show( CoordSystemT cs ){ + if( cs == CARTESIAN ) + cout << *this << endl; + else + cout << "( r: " << getLength( ) << ", phi: " << getDirection( ) << " )"; +} + +/* +bool Vector2D::isInvalid() const { + return (isUndefined(x) || (isUndefined(y)) + // || (fabs(x) >= 100000.0) || (fabs(y) >= 100000.0) + || isinf(x) || isinf(y) || isnan(x) || isnan(y)); +} +*/ + +void Vector2D::setVector2D( float dX, float dY, CoordSystemT cs){ + if( cs == CARTESIAN ) { x = dX; y = dY; } + else *this = getVector2DFromPolar( dX, dY ); +} + + + +Vector2D Vector2D::setLength( float d ){ + if( getLength( ) > EPSILON ) + ( *this ) *= ( d / getLength( ) ); + + return ( *this ); +} + +Vector2D Vector2D::rotate( AngDeg angle ){ + // determine the polar representation of the current Vector2D + float dMag = this->getLength( ); + float dNewDir = this->getDirection( ) + angle; // add rotation angle to phi + setVector2D( dMag, dNewDir, POLAR ); // convert back to Cartesian + return ( *this ); +} + +Vector2D Vector2D::globalToRelative( Vector2D origin, AngDeg ang ){ + // convert global coordinates into relative coordinates by aligning relative + // frame and world frame. First perform translation to make origins of both + // frames coincide. Then perform rotation to make axes of both frames coincide + // (use negative angle since you rotate relative frame to world frame). + *this -= origin; + return ( rotate( -ang ) ); +} + +Vector2D Vector2D::relativeToGlobal( Vector2D origin, AngDeg ang ){ + // convert relative coordinates into global coordinates by aligning world + // frame and relative frame. First perform rotation to make axes of both + // frames coincide (use positive angle since you rotate world frame to + // relative frame). Then perform translation to make origins of both frames + // coincide. + rotate( ang ); + *this += origin; + return ( *this ); +} + +Vector2D Vector2D::getVector2DOnLineFraction( Vector2D &p, + float dFrac ){ + // determine point on line that lies at fraction dFrac of whole line + // example: this --- 0.25 --------- p + // formula: this + dFrac * ( p - this ) = this - dFrac * this + dFrac * p = + // ( 1 - dFrac ) * this + dFrac * p + return ( ( *this ) * ( 1.0 - dFrac ) + ( p * dFrac ) ); +} + + +Vector2D Vector2D::getVector2DFromPolar( float dMag, AngDeg ang ){ + // cos(phi) = x/r <=> x = r*cos(phi); sin(phi) = y/r <=> y = r*sin(phi) + return ( Vector2D( dMag * cosDeg( ang ), dMag * sinDeg( ang ) ) ); +} + + +/******************************************************************************/ +/*********************** NAMESPACE GEOMETRY ***************************************/ +/******************************************************************************/ + +float Geometry::getLengthGeomSeries( float dFirst, float dRatio, float dSum ){ + if( dRatio < 0 ) + cerr << "(Geometry:getLengthGeomSeries): negative ratio" << endl; + + // s = a + ar + ar^2 + .. + ar^n-1 and thus sr = ar + ar^2 + .. + ar^n + // subtract: sr - s = - a + ar^n) => s(1-r)/a + 1 = r^n = temp + // log r^n / n = n log r / log r = n = length + float temp = (dSum * ( dRatio - 1 ) / dFirst) + 1; + if( temp <= 0 ) + return -1.0; + return log( temp ) / log( dRatio ) ; +} + + +float Geometry::getSumGeomSeries( float dFirst, float dRatio, float dLength){ + // s = a + ar + ar^2 + .. + ar^n-1 and thus sr = ar + ar^2 + .. + ar^n + // subtract: s - sr = a - ar^n) => s = a(1-r^n)/(1-r) + return dFirst * ( 1 - pow( dRatio, dLength ) ) / ( 1 - dRatio ) ; +} + + +float Geometry::getSumInfGeomSeries( float dFirst, float dRatio ){ + if( dRatio > 1 ) + cerr << "(Geometry:CalcLengthGeomSeries): series does not converge" << endl; + + // s = a(1-r^n)/(1-r) with n->inf and 0 r^n = 0 + return dFirst / ( 1 - dRatio ); +} + + +float Geometry::getFirstGeomSeries( float dSum, float dRatio, float dLength){ + // s = a + ar + ar^2 + .. + ar^n-1 and thus sr = ar + ar^2 + .. + ar^n + // subtract: s - sr = a - ar^n) => s = a(1-r^n)/(1-r) => a = s*(1-r)/(1-r^n) + return dSum * ( 1 - dRatio )/( 1 - pow( dRatio, dLength ) ) ; +} + +float Geometry::getFirstInfGeomSeries( float dSum, float dRatio ){ + if( dRatio > 1 ) + cerr << "(Geometry:getFirstInfGeomSeries):series does not converge" << endl; + + // s = a(1-r^n)/(1-r) with r->inf and 0 r^n = 0 => a = s ( 1 - r) + return dSum * ( 1 - dRatio ); +} + +int Geometry::abcFormula(float a, float b, float c, float *s1, float *s2){ + float dDiscr = b*b - 4*a*c; // discriminant is b^2 - 4*a*c + if (fabs(dDiscr) < EPSILON ) // if discriminant = 0 + { + *s1 = -b / (2 * a); // only one solution + return 1; + } + else if (dDiscr < 0) // if discriminant < 0 + return 0; // no solutions + else // if discriminant > 0 + { + dDiscr = sqrt(dDiscr); // two solutions + *s1 = (-b + dDiscr ) / (2 * a); + *s2 = (-b - dDiscr ) / (2 * a); + return 2; + } +} + +/******************************************************************************/ +/********************** CLASS CIRCLE ******************************************/ +/******************************************************************************/ + +Circle::Circle( Vector2D pos, float dR ){ + setCircle( pos, dR ); +} + +Circle::Circle( ){ + setCircle( Vector2D(-1000.0,-1000.0), 0); +} + +void Circle::show( ostream& os) const { + os << "c:" << posCenter << ", r:" << radius; +} + +bool Circle::setCircle( const Vector2D &pos, float dR ){ + setCenter( pos ); + return setRadius( dR ); +} +bool Circle::setRadius( float dR ){ + if( dR > 0 ){ + radius = dR; + return true; + } + else{ + radius = 0.0; + return false; + } +} + + +int Circle::getIntersectionPoints( const Circle &c, Vector2D *p1, + Vector2D *p2) const { + float x0, y0, r0; + float x1, y1, r1; + + x0 = getCenter( ).getX(); + y0 = getCenter( ).getY(); + r0 = getRadius( ); + x1 = c.getCenter( ).getX(); + y1 = c.getCenter( ).getY(); + r1 = c.getRadius( ); + + float d, dx, dy, h, a, x, y, p2_x, p2_y; + + // first calculate distance between two centers circles P0 and P1. + dx = x1 - x0; + dy = y1 - y0; + d = sqrt(dx*dx + dy*dy); + + // normalize differences + dx /= d; dy /= d; + + // a is distance between p0 and point that is the intersection point P2 + // that intersects P0-P1 and the line that crosses the two intersection + // points P3 and P4. + // Define two triangles: P0,P2,P3 and P1,P2,P3. + // with distances a, h, r0 and b, h, r1 with d = a + b + // We know a^2 + h^2 = r0^2 and b^2 + h^2 = r1^2 which then gives + // a^2 + r1^2 - b^2 = r0^2 with d = a + b ==> a^2 + r1^2 - (d-a)^2 = r0^2 + // ==> r0^2 + d^2 - r1^2 / 2*d + a = (r0*r0 + d*d - r1*r1) / (2.0 * d); + + // h is then a^2 + h^2 = r0^2 ==> h = sqrt( r0^2 - a^2 ) + float arg = r0*r0 - a*a; + h = (arg > 0.0) ? sqrt(arg) : 0.0; + + // First calculate P2 + p2_x = x0 + a * dx; + p2_y = y0 + a * dy; + + // and finally the two intersection points + x = p2_x - h * dy; + y = p2_y + h * dx; + p1->setVector2D( x, y ); + x = p2_x + h * dy; + y = p2_y - h * dx; + p2->setVector2D( x, y ); + + return (arg < 0.0) ? 0 : ((arg == 0.0 ) ? 1 : 2); +} + + +float Circle::getIntersectionArea( const Circle &c ) const { + Vector2D pos1, pos2, pos3; + float d, h, dArea; + AngDeg ang; + + d = getCenter().distanceTo( c.getCenter() ); // dist between two centers + if( d > c.getRadius() + getRadius() ) // larger than sum radii + return 0.0; // circles do not intersect + if( d <= fabs(c.getRadius() - getRadius() ) ) // one totally in the other + { + float dR = min( c.getRadius(), getRadius() );// return area smallest circle + return M_PI*dR*dR; + } + + int iNrSol = getIntersectionPoints( c, &pos1, &pos2 ); + if( iNrSol != 2 ) + return 0.0; + + // the intersection area of two circles can be divided into two segments: + // left and right of the line between the two intersection points p1 and p2. + // The outside area of each segment can be calculated by taking the part + // of the circle pie excluding the triangle from the center to the + // two intersection points. + // The pie equals pi*r^2 * rad(2*ang) / 2*pi = 0.5*rad(2*ang)*r^2 with ang + // the angle between the center c of the circle and one of the two + // intersection points. Thus the angle between c and p1 and c and p3 where + // p3 is the point that lies halfway between p1 and p2. + // This can be calculated using ang = asin( d / r ) with d the distance + // between p1 and p3 and r the radius of the circle. + // The area of the triangle is 2*0.5*h*d. + + pos3 = pos1.getVector2DOnLineFraction( pos2, 0.5 ); + d = pos1.distanceTo( pos3 ); + h = pos3.distanceTo( getCenter() ); + ang = asin( d / getRadius() ); + + dArea = ang*getRadius()*getRadius(); + dArea = dArea - d*h; + + // and now for the other segment the same story + h = pos3.distanceTo( c.getCenter() ); + ang = asin( d / c.getRadius() ); + dArea = dArea + ang*c.getRadius()*c.getRadius(); + dArea = dArea - d*h; + + return dArea; +} + + +bool Circle::calcTangentIntersectionPoints(const Vector2D startPoint, Vector2D &point1, Vector2D &point2){ + if(isInside(startPoint)){ + // Startpoint is inside circle -> there are no tangent interception points + return(false); + } + + //float d = posCenter.getLength()-startPoint.getLength(); + float d = (posCenter-startPoint).getLength(); + float r = radius; + + float alphaRad = asin(r/d); + + float p = sqrt(d*d-r*r); + + point1.setX(cos(alphaRad)*p); + point1.setY(sin(alphaRad)*p); + point2.setX(cos(-alphaRad)*p); + point2.setY(sin(-alphaRad)*p); + + point1=point1.rotate((posCenter-startPoint).getDirection()); + point2=point2.rotate((posCenter-startPoint).getDirection()); + + point1+=startPoint; + point2+=startPoint; + + return(true); +} + + + + + + +/******************************************************************************/ +/*********************** CLASS LINE *******************************************/ +/******************************************************************************/ + +Line::Line( float dA, float dB, float dC ){ + a = dA; + b = dB; + c = dC; +} + +Line::Line() { + a = 666.66; + b = 666.66; + c = 666.66; +} + +ostream& operator <<(ostream & os, Line l){ + float a = l.getACoefficient(); + float b = l.getBCoefficient(); + float c = l.getCCoefficient(); + + // ay + bx + c = 0 -> y = -b/a x - c/a + if( a == 0 ) + os << "x = " << -c/b; + else{ + os << "y = "; + if( b != 0 ) + os << -b/a << "x "; + if( c > 0 ) + os << "- " << fabs(c/a); + else if( c < 0 ) + os << "+ " << fabs(c/a); + } + return os; +} + +void Line::show( ostream& os){ + os << *this; +} + +Vector2D Line::getIntersection( Line line ){ + Vector2D pos(666.66,666.66); + float x, y; + + if( (b == line.getBCoefficient())&&(b!=-a) ) { // lines are parallel, no intersection + return pos; + } + if( a == 0 ){ // bx + c = 0 and a2*y + b2*x + c2 = 0 ==> x = -c/b + x = -c/b; // calculate x using the current line + y = line.getYGivenX(x); // and calculate the y using the second line + } + + // ay + bx + c = 0 and b2*x + c2 = 0 ==> x = -c2/b2 + // calculate x using 2nd line and calculate y using current line + else if( line.getACoefficient() == 0 ){ + x = -line.getCCoefficient()/line.getBCoefficient(); + y = getYGivenX(x); + } + + // ay + bx + c = 0 and a2y + b2*x + c2 = 0 + // y = (-b2/a2)x - c2/a2 + // bx = -a*y - c => bx = -a*(-b2/a2)x -a*(-c2/a2) - c ==> + // ==> a2*bx = a*b2*x + a*c2 - a2*c ==> x = (a*c2 - a2*c)/(a2*b - a*b2) + // calculate x using the above formula and the y using the current line + else{ + x = (a*line.getCCoefficient() - line.getACoefficient()*c)/ + (line.getACoefficient()*b - a*line.getBCoefficient()); + y = getYGivenX(x); + } + + return Vector2D( x, y ); +} + + +int Line::getCircleIntersectionPoints( Circle circle, + Vector2D *posSolution1, Vector2D *posSolution2 ){ + int iSol; + float dSol1, dSol2; + float h = circle.getCenter().getX(); + float k = circle.getCenter().getY(); + + // line: x = -c/b (if a = 0) + // circle: (x-h)^2 + (y-k)^2 = r^2, with h = center.x and k = center.y + // fill in:(-c/b-h)^2 + y^2 -2ky + k^2 - r^2 = 0 + // y^2 -2ky + (-c/b-h)^2 + k^2 - r^2 = 0 + // and determine solutions for y using abc-formula + if( fabs(a) < EPSILON ){ + iSol = Geometry::abcFormula( 1, -2*k, ((-c/b) - h)*((-c/b) - h) + + k*k - circle.getRadius()*circle.getRadius(), &dSol1, &dSol2); + posSolution1->setVector2D( (-c/b), dSol1 ); + posSolution2->setVector2D( (-c/b), dSol2 ); + return iSol; + } + + // ay + bx + c = 0 => y = -b/a x - c/a, with da = -b/a and db = -c/a + // circle: (x-h)^2 + (y-k)^2 = r^2, with h = center.x and k = center.y + // fill in:x^2 -2hx + h^2 + (da*x-db)^2 -2k(da*x-db) + k^2 - r^2 = 0 + // x^2 -2hx + h^2 + da^2*x^2 + 2da*db*x + db^2 -2k*da*x -2k*db + // + k^2 - r^2 = 0 + // (1+da^2)*x^2 + 2(da*db-h-k*da)*x + h2 + db^2 -2k*db + k^2 - r^2 = 0 + // and determine solutions for x using abc-formula + // fill in x in original line equation to get y coordinate + float da = -b/a; + float db = -c/a; + + float dA = 1 + da*da; + float dB = 2*( da*db - h - k*da ); + float dC = h*h + db*db - 2*k*db + k*k - circle.getRadius()*circle.getRadius(); + + iSol = Geometry::abcFormula( dA, dB, dC, &dSol1, &dSol2 ); + + posSolution1->setVector2D( dSol1, da*dSol1 + db ); + posSolution2->setVector2D( dSol2, da*dSol2 + db ); + return iSol; +} + + +Line Line::getTangentLine( Vector2D pos ){ // Senkrechte errichten, nix mit Tangente + // ay + bx + c = 0 -> y = (-b/a)x + (-c/a) + // tangent: y = (a/b)*x + C1 -> by - ax + C2 = 0 => C2 = ax - by + // with pos.y = y, pos.x = x + return Line( b, -a, a*pos.getX() - b*pos.getY() ); +} + + +Vector2D Line::getPointOnLineClosestTo( Vector2D pos ){ + Line l2 = getTangentLine( pos ); // get tangent line + return getIntersection( l2 ); // and intersection between the two lines +} + + +float Line::distanceToPoint( Vector2D pos ){ + return pos.distanceTo( getPointOnLineClosestTo( pos ) ); +} + + +bool Line::isInBetween( Vector2D pos, Vector2D point1, Vector2D point2){ + pos = getPointOnLineClosestTo( pos ); // get closest point + float dDist = point1.distanceTo( point2 ); // get distance between 2 pos + // if the distance from both points to the projection is smaller than this + // dist, the pos lies in between. + return pos.distanceTo( point1 ) <= dDist && + pos.distanceTo( point2 ) <= dDist; +} + + +float Line::getYGivenX( float x ){ + if( a == 0 ){ + cerr << "(Line::getYGivenX) Cannot calculate Y coordinate: " ; + show( cerr ); + cerr << endl; + return 0; + } + // ay + bx + c = 0 ==> ay = -(b*x + c)/a + return -(b*x+c)/a; +} + + +float Line::getXGivenY( float y ){ + if( b == 0 ){ + cerr << "(Line::getXGivenY) Cannot calculate X coordinate\n" ; + return 0; + } + // ay + bx + c = 0 ==> bx = -(a*y + c)/a + return -(a*y+c)/b; +} + + +Line Line::makeLineFromTwoPoints( Vector2D pos1, Vector2D pos2 ){ + // 1*y + bx + c = 0 => y = -bx - c + // with -b the direction coefficient (or slope) + // and c = - y - bx + float dA=1.0, dB, dC; + float dTemp = pos2.getX() - pos1.getX(); // determine the slope + if( fabs(dTemp) < EPSILON ){ + // ay + bx + c = 0 with vertical slope=> a = 0, b = 1 + dA = 0.0; + dB = 1.0; + } + else{ + // y = (-b)x -c with -b the slope of the line + dA = 1.0; + dB = -(pos2.getY() - pos1.getY())/dTemp; + } + // ay + bx + c = 0 ==> c = -a*y - b*x + dC = - dA*pos2.getY() - dB * pos2.getX(); + return Line( dA, dB, dC ); +} + + +Line Line::makeLineFromPositionAndAngle( Vector2D vec, AngDeg angle ){ + // calculate point somewhat further in direction 'angle' and make + // line from these two points. + return makeLineFromTwoPoints( vec, vec+Vector2D(1,angle,POLAR)); +} + +/******************************************************************************/ +/********************** CLASS RECTANGLE ***************************************/ +/******************************************************************************/ + +RectangleGeo::RectangleGeo( Vector2D pos, Vector2D pos2 ){ + setRectanglePoints( pos, pos2 ); +} + + +void RectangleGeo::setRectanglePoints( Vector2D pos1, Vector2D pos2 ){ + posLeftTop.setX ( min( pos1.getX(), pos2.getX() ) ); + posLeftTop.setY ( min( pos1.getY(), pos2.getY() ) ); + posRightBottom.setX( max( pos1.getX(), pos2.getX() ) ); + posRightBottom.setY( max( pos1.getY(), pos2.getY() ) ); +} + + +void RectangleGeo::show( ostream& os ) const { + os << "rect(" << posLeftTop << " " << posRightBottom << ")"; +} + + +bool RectangleGeo::isInside( Vector2D pos ) const { + return ( (getPosLeftTop().getX() <= pos.getX()) && + (pos.getX() <= getPosRightBottom().getX()) && + (getPosLeftTop().getY() <= pos.getY()) && + (pos.getY() <= getPosRightBottom().getY()) ); +} + + +/******************************************************************************/ +/********************** CLASS CONE ********************************************/ +/******************************************************************************/ + +Cone::Cone( Vector2D peak, + float fstAngle, float sndAngle, + float maxDistance, float minDistance ) { + setPeak( peak ); + setAngles( fstAngle, sndAngle ); + setMaxDistance( maxDistance ); + setMinDistance( minDistance ); +} + +void Cone::show( ostream& os ) const { + os << "(p:" << peak << " fst:" << fstAngle << " snd:" << sndAngle + << " maxDist:" << maxDistance << " minDist:" << minDistance << ")"; +} + +bool Cone::isInside( Vector2D pos ) const { + float dist = pos.distanceTo( peak ); + float angle = (pos - peak).getDirection(); + return ( ( minDistance <= dist && dist <= maxDistance && + isAngInInterval( angle, fstAngle, sndAngle ) ) || + ( dist == 0 && minDistance == 0) ); +} + + + + + +/******************************************************************************/ +/********************** TESTING PURPOSES *************************************/ +/******************************************************************************/ + +/* +#include + +int main( void ){ + float dFirst = 1.0; + float dRatio = 2.5; + float dSum = 63.4375; + float dLength = 4.0; + + printf( "sum: %f\n", Geometry::getSumGeomSeries( dFirst, dRatio, dLength)); + printf( "length: %f\n", Geometry::getLengthGeomSeries( dFirst, dRatio, dSum)); +} + +int main( void ){ + Line l1(1,-1,3 ); + Line l2(1,-0.2,10 ); + Line l3 = Line::makeLineFromTwoPoints( Vector2D(1,-1), Vector2D(2,-2) ); + l3.show(); + cout << endl; + l1.show(); + l2.show(); + l1.getIntersection( l2 ).show(); +} + +int main( void ){ + Line l( 1, -1, 0 ); + Vector2D s1, s2; + int i = l.getCircleIntersectionPoints( Circle( Vector2D(1,1), 1 ), &s1, &s2 ); + printf( "number of solutions: %d\n", i ); + if( i == 2 ){ + cout << s1 << " " << s2 ; + } + else if( i == 1 ){ + cout << s1; + } + cout << "line: " << l << endl; +} + +int main( void ){ + Circle c11( Vector2D( 10, 0 ), 10); + Circle c12( Vector2D( 40, 3 ), 40 ); + Circle c21( Vector2D( 0,0 ), 5); + Circle c22( Vector2D( 3,0 ), 40 ); + + Vector2D p1, p2; + + cout << c11.getIntersectionArea( c21 ) << endl; + cout << c12.getIntersectionArea( c21 ) << endl; + cout << c22.getIntersectionArea( c11 ) << endl; + cout << c12.getIntersectionArea( c22 ) << endl; + return 0; +} + +int main( void ){ + cout << getBisectorTwoAngles( -155.3, 179.0 ) << endl; + cout << getBisectorTwoAngles( -179.3, 179.0 ) << endl; +} + +int main( ) { + Vector2D pos = Vector2D::getVector2DFromPolar(10, 45); + cout << pos << endl; + cout << pos.getDirection() << endl; + cout << pos.getLength() << endl; + + //Vector2D pos = Vector2D(10, 0); + //cout << pos << endl; + //cout << pos.getDirection() << endl; + //pos.rotate(90); + //cout << pos << endl; + //cout << pos.getDirection() << endl; +} + +int main( ) { + Cone c( Vector2D(-10,-10), -170, -150, 50 ); + c.show(); + cout << endl + << "isInside( Vector2D(0,0)): " << c.isInside( Vector2D(0,0) ) << endl + << "isInside( Vector2D(0,-5)): " << c.isInside( Vector2D(0,-5) ) << endl + << "isInside( Vector2D(-12,-11)): " << c.isInside( Vector2D(-12,-11) ) << endl; +} +*/ + + + + + diff --git a/alienblaster/project/jni/alienblaster/src/geometry.h b/alienblaster/project/jni/alienblaster/src/geometry.h new file mode 100644 index 000000000..7f1556acb --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/geometry.h @@ -0,0 +1,863 @@ +/* +Copyright (c) 2000,2001, Jelle Kok, University of Amsterdam +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +3. Neither the name of the University of Amsterdam nor the names of its +contributors may be used to endorse or promote products derived from this +software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/************************************************************************************** + * geometry.hh + * + * implements: + * class Vector2D + * namespace Geometry + * class Line + * class Circle + * class Rectangle + * class Cone + * + * requires: + * + * Maintainer: wenns, pagra + * + * Changelog: + * + * Note: + *************************************************************************************/ + +#ifndef GEOMETRY_HH +#define GEOMETRY_HH + +#include // needed for M_PI constant +#include +using namespace std; + +const float EPSILON = 0.001; + +typedef float AngRad; /**< Type definition for angles in degrees. */ +typedef float AngDeg; /**< Type definition for angles in radians. */ + +/** + * Converts an angle in radians to the corresponding angle in degrees. + * @param x an angle in radians + * @return the corresponding angle in degrees + */ +AngDeg Rad2Deg ( AngRad x ); + +/** + * Converts an angle in degrees to the corresponding angle in radians. + * @param x an angle in degrees + * @return the corresponding angle in radians + */ +AngRad Deg2Rad ( AngDeg x ); + +/** + * Returns the cosine of a given angle in degrees using the + * built-in cosine function that works with angles in radians. + * @param x an angle in degrees + * @return the cosine of the given angle + */ +float cosDeg ( AngDeg x ); + +/** + * Returns the sine of a given angle in degrees using the + * built-in sine function that works with angles in radians. + * @param x an angle in degrees + * @return the sine of the given angle + */ +float sinDeg ( AngDeg x ); + +/** + * Returns the tangent of a given angle in degrees using the + * built-in tangent function that works with angles in radians. + * @param x an angle in degrees + * @return the tangent of the given angle + */ +float tanDeg ( AngDeg x ); + +/** + * Rreturns the principal value of the arc tangent of x in degrees + * using the built-in arc tangent function which returns this value in radians. + * @param x a float value + * @return the arc tangent of the given value in degrees + */ +AngDeg atanDeg ( float x ); + +/** + * Returns the principal value of the arc tangent of y/x in + * degrees using the signs of both arguments to determine the quadrant of the + * return value. For this the built-in 'atan2' function is used which returns + * this value in radians. + * @param x a float value + * @param y a float value + * @return the arc tangent of y/x in degrees taking the signs of x and y into + * account + */ +float atan2Deg ( float x, float y ); + +/** + * Returns the principal value of the arc cosine of x in degrees + * using the built-in arc cosine function which returns this value in radians. + * @param x a float value + * @return the arc cosine of the given value in degrees + */ +AngDeg acosDeg ( float x ); + +/** + * Returns the principal value of the arc sine of x in degrees + * using the built-in arc sine function which returns this value in radians. + * @param x a float value + * @return the arc sine of the given value in degrees + */ +AngDeg asinDeg ( float x ); + +/** + * Returns a boolean value which indicates whether the value + * 'ang' (from interval [-180..180] lies in the interval [angMin..angMax]. + * Examples: isAngInInterval( -100, 4, -150) returns false + * isAngInInterval( 45, 4, -150) returns true + * @param ang angle that should be checked + * @param angMin minimum angle in interval + * @param angMax maximum angle in interval + * @return boolean indicating whether ang lies in [angMin..angMax] + */ +bool isAngInInterval ( AngDeg ang, AngDeg angMin, AngDeg angMax ); + +/** + * Returns the bisector (average) of two angles. It deals + * with the boundary problem, thus when 'angMin' equals 170 and 'angMax' + * equals -100, -145 is returned. + * @param angMin minimum angle [-180,180] + * @param angMax maximum angle [-180,180] + * @return average of angMin and angMax. + */ +AngDeg getBisectorTwoAngles( AngDeg angMin, AngDeg angMax ); + +/** + * Returns the difference of two angles in degrees [-180,180] + * @param ang1 first angle [-180,180] + * @param ang2 second angle [-180,180] + */ +AngDeg getAngleDifference( AngDeg ang1, AngDeg ang2 ); + + +/** + * Returns the absolute difference of two angles in degrees [0,180] + * @param ang1 first angle [-180,180] + * @param ang2 second angle [-180,180] + */ +AngDeg getAbsAngleDifference( AngDeg ang1, AngDeg ang2 ); + + +/** + * Normalizes an arbitrary angle in 180 Deg System + * @param angle: the angle to normalize + * @return float (-180..180] + */ +float normalizeTo180Deg(float angle); + + +/** + * CoordSystem is an enumeration of the different specified coordinate systems. + * The two possibilities are CARTESIAN or POLAR. These values are for instance + * used in the initializing a Vector2D. The CoordSystem indicates whether + * the supplied arguments represent the position in cartesian or in polar + * coordinates. + */ +enum CoordSystemT { + CARTESIAN, + POLAR +}; + +/******************************************************************************/ +/******************** CLASS VECTOR2D **************************************/ +/******************************************************************************/ + +/** + * This class contains an x- and y-coordinate of a position (x,y) as member + * data and methods which operate on this position. The standard arithmetic + * operators are overloaded and can thus be applied to positions (x,y). It is + * also possible to represent a position in polar coordinates (r,phi), since + * the class contains a method to convert these into cartesian coordinates (x,y). + */ +class Vector2D { + private: + float x; /**< x-coordinate of this position */ + float y; /**< y-coordinate of this position */ + + public: + + /** + * Constructor for the Vector2D class. When the supplied Coordinate System + * type equals CARTESIAN, the arguments x and y denote the x- and y-coordinates + * of the new position. When it equals POLAR however, the arguments x and y + * denote the polar coordinates of the new position; in this case x is thus + * equal to the distance r from the origin and y is equal to the angle phi that + * the polar vector makes with the x-axis. + * @param x the x-coordinate of the new position when cs == CARTESIAN; the + * distance of the new position from the origin when cs = POLAR + * @param y the y-coordinate of the new position when cs = CARTESIAN; the + * angle that the polar vector makes with the x-axis when cs = POLAR + * @param cs a CoordSystemT indicating whether x and y denote cartesian + * coordinates or polar coordinates + * @return the Vector2D corresponding to the given arguments + */ + Vector2D ( float x = 0, + float y = 0, + CoordSystemT cs = CARTESIAN); + + //////////////////// overloaded arithmetic operators ///////////////////////////// + /* + * Note: all operators parametrized with float values apply these values to both + * coordinates of the vector + */ + + /** + * Overloaded version of unary minus operator for Vector2Ds. The current Vector2D + * itself is left unchanged. + * @return a negated version of the current Vector2D + */ + Vector2D operator - ( ) { return ( Vector2D( -x, -y ) ); } + + Vector2D operator + ( const float &d ) const { return ( Vector2D( x + d, y + d ) ); } + Vector2D operator + ( const Vector2D &p ) const { return ( Vector2D( x + p.x, y + p.y ) ); } + Vector2D operator - ( const float &d ) const { return ( Vector2D( x - d, y - d ) ); } + Vector2D operator - ( const Vector2D &p ) const { return ( Vector2D( x - p.x, y - p.y ) ); } + Vector2D operator * ( const float &d ) const { return ( Vector2D( x * d, y * d ) ); } + Vector2D operator * ( const Vector2D &p ) const { return ( Vector2D( x * p.x, y * p.y ) ); } + Vector2D operator / ( const float &d ) const { return ( Vector2D( x / d, y / d ) ); } + Vector2D operator / ( const Vector2D &p ) const { return ( Vector2D( x / p.x, y / p.y ) ); } + void operator = ( const float &d ) { x = d; y = d; } + void operator += ( const Vector2D &p ) { x += p.x; y += p.y; } + void operator += ( const float &d ) { x += d; y += d; } + void operator -= ( const Vector2D &p ) { x -= p.x; y -= p.y; } + void operator -= ( const float &d ) { x -= d; y -= d; } + void operator *= ( const Vector2D &p ) { x *= p.x; y *= p.y; } + void operator *= ( const float &d ) { x *= d; y *= d; } + void operator /= ( const Vector2D &p ) { x /= p.x; y /= p.y; } + void operator /= ( const float &d ) { x /= d; y /= d; } + bool operator != ( const Vector2D &p ) const { return ( ( x != p.x ) || ( y != p.y ) ); } + bool operator != ( const float &d ) const { return ( ( x != d ) || ( y != d ) ); } + bool operator == ( const Vector2D &p ) const { return ( ( x == p.x ) && ( y == p.y ) ); } + bool operator == ( const float &d ) const { return ( ( x == d ) && ( y == d ) ); } + + //////////////////////// methods for producing output //////////////////////////// + friend ostream& operator << ( ostream &os, + Vector2D p ); + /** + * Writes the current Vector2D to standard output. It can also print a polar + * representation of the current Vector2D. + * @param cs a CoordSystemtT indicating whether a POLAR or CARTESIAN + * representation of the current Vector2D should be printed + */ + void show ( CoordSystemT cs = CARTESIAN ); + + // accessors + void setX ( float newX ) { x = newX; } + float getX ( ) const { return x; } + void setY ( float newY ) { y = newY; } + float getY ( ) const { return y; } + + /** + * decides if the Vector2D is invalid + * @return true, if the Vector2D is invalid, false otherwise + */ + bool isInvalid() const; + + /** + * (re)sets the coordinates of the current Vector2D. The given + * coordinates can either be polar or Cartesian coordinates. + * @param newX a float value indicating either a new Cartesian x-coordinate when + * cs=CARTESIAN or a new polar r-coordinate (distance) when cs=POLAR + * @param newY a float value indicating either a new Cartesian y-coordinate when + * cs=CARTESIAN or a new polar phi-coordinate (angle) when cs=POLAR + * @param cs a CoordSystemT indicating whether x and y denote cartesian + * coordinates or polar coordinates + */ + void setVector2D ( float newX = 0, + float newY = 0, + CoordSystemT cs = CARTESIAN); + + //wenns: temp workaround + //void setVector2D_Orig( float dX, float dY, CoordSystemT cs); + + /** + * Determines the distance between the current Vector2D and a + * given Vector2D. + * @param p a Vector2D + * @return the distance between the current Vector2D and the given + * Vector2D + */ + inline float distanceTo ( const Vector2D &p ) const + { return ( ( *this - p ).getLength( ) ); } + + /** + * Adjusts the coordinates of the current Vector2D in such a way + * that the length of the corresponding vector equals the float value which + * is supplied as an argument. + * @param f a float value representing a new length + * @return the result of scaling the vector corresponding with the current + * Vector2D to the given length thus yielding a different Vector2D + */ + Vector2D setLength ( float f ); + + /** + * This method determines the length of Vector2D using the formula of Pythagoras. + * @return the length of the Vector2D + */ + inline float getLength ( ) const { return ( sqrt( x * x + y * y ) ); } + + /** + * This method determines the direction of the current Vector2D (the phi-coordinate + * in polar representation) + * @return the direction in degrees of the current Vector2D + */ + inline AngDeg getDirection ( ) const { return ( atan2Deg( y, x ) ); } + + /////////////////////// comparison methods for positions /////////////////////////// + + /** + * Determines whether the current Vector2D is in front of a + * given Vector2D, i.e. whether the x-coordinate of the current Vector2D + * is larger than the x-coordinate of the given Vector2D. + * @param p a Vector2D to which the current Vector2D must be compared + * @return true when the current Vector2D is in front of the given + * Vector2D; false otherwise + */ + bool isInFrontOf ( const Vector2D &p ) + { return ( ( x > p.getX( ) ) ? true : false ); } + /**< similar as above */ + bool isInFrontOf ( const float &d ) { return ( ( x > d ) ? true : false ); } + + /** + * Determines whether the current Vector2D is behind a given + * Vector2D, i.e. whether the x-coordinate of the current Vector2D is + * smaller than the x-coordinate of the given Vector2D. + * @param p a Vector2D to which the current Vector2D must be compared + * @return true when the current Vector2D is behind the given Vector2D; + * false otherwise + */ + bool isBehindOf ( const Vector2D &p ) + { return ( ( x < p.getX( ) ) ? true : false ); } + /**< similar as above */ + bool isBehindOf ( const float &d ) { return ( ( x < d ) ? true : false ); } + + /** + * Determines whether the current Vector2D is to the left of a + * given Vector2D, i.e. whether the y-coordinate of the current Vector2D + * is smaller than the y-coordinate of the given Vector2D. + * @param p a Vector2D to which the current Vector2D must be compared + * @return true when the current Vector2D is to the left of the given + * Vector2D; false otherwise + */ + bool isLeftOf ( const Vector2D &p ) + { return ( ( y < p.getY( ) ) ? true : false ); } + /**< similar as above */ + bool isLeftOf ( const float &d ) { return ( ( y < d ) ? true : false ); } + + /** + * This method determines whether the current Vector2D is to the right of a + * given Vector2D, i.e. whether the y-coordinate of the current Vector2D + * is larger than the y-coordinate of the given Vector2D. + * @param p a Vector2D to which the current Vector2D must be compared + * @return true when the current Vector2D is to the right of the given + * Vector2D; false otherwise + */ + bool isRightOf ( const Vector2D &p ) + { return ( ( y > p.getY( ) ) ? true : false ); } + /**< similar as above */ + bool isRightOf ( const float &d ) { return ( ( y > d ) ? true : false ); } + + /** + * Determines whether the current Vector2D is in between two + * given Vector2Ds when looking in the x-direction, i.e. whether the current + * Vector2D is in front of the first argument and behind the second. + * @param p1 a Vector2D to which the current Vector2D must be compared + * @param p2 a Vector2D to which the current Vector2D must be compared + * @return true when the current Vector2D is in between the two given + * Vector2Ds when looking in the x-direction; false otherwise + */ + inline bool isBetweenX ( const Vector2D &p1, + const Vector2D &p2 ) + { return ( ( isInFrontOf( p1 ) && isBehindOf( p2 ) ) ? true : false ); } + /**< similar as above */ + inline bool isBetweenX ( const float &d1, + const float &d2 ) + { return ( ( isInFrontOf( d1 ) && isBehindOf( d2 ) ) ? true : false ); } + + /** + * Determines whether the current Vector2D is in between two + * given Vector2Ds when looking in the y-direction, i.e. whether the current + * Vector2D is to the right of the first argument and to the left of the + * second. + * @param p1 a Vector2D to which the current Vector2D must be compared + * @param p2 a Vector2D to which the current Vector2D must be compared + * @return true when the current Vector2D is in between the two given + * Vector2Ds when looking in the y-direction; false otherwise + */ + bool isBetweenY ( const Vector2D &p1, + const Vector2D &p2 ) + { return ( ( isRightOf( p1 ) && isLeftOf( p2 ) ) ? true : false ); } + /**< similar as above */ + bool isBetweenY ( const float &d1, + const float &d2 ) + { return ( ( isRightOf( d1 ) && isLeftOf( d2 ) ) ? true : false ); } + + /////////////////// conversion methods for positions //////////////////////////// + + /** + * Normalizes a Vector2D by setting the length of the + * corresponding vector to 1. + * @return the result of normalizing the current Vector2D + */ + inline Vector2D normalize ( ) { return ( setLength( 1.0 ) ); } + + /** + * Rotates the current Vector2D over a given angle . + * @param angle an angle in degrees over which the current Vector2D must be rotated + * @return the result of rotating the current Vector2D over the given angle + */ + Vector2D rotate ( AngDeg angle ); + + /** + * Converts the coordinates of the current Vector2D (which are represented in an + * global coordinate system with the origin at (0,0)) into relative coordinates + * in a different coordinate system (e.g. relative to a player). The new coordinate + * system is defined by the arguments to the method. + * @param origin the origin of the relative coordinate frame + * @param ang the angle between the world frame and the relative frame + * (reasoning from the world frame) + * @return the result of converting the current global Vector2D into a + * relative Vector2D + */ + Vector2D globalToRelative ( Vector2D orig, + AngDeg ang ); + /**< similar to above */ + Vector2D relativeToGlobal ( Vector2D orig, + AngDeg ang ); + /** + * Returns a Vector2D that lies somewhere on the vector between + * the current Vector2D and a given Vector2D. The desired position is + * specified by a given fraction of this vector (e.g. 0.5 means exactly in + * the middle of the vector). + * @param p a Vector2D which defines the vector to the current Vector2D + * @param dFrac float representing the fraction of the connecting vector at + * which the desired Vector2D lies. + * @return the Vector2D which lies at fraction dFrac on the vector + * connecting p and the current Vector2D + */ + Vector2D getVector2DOnLineFraction( Vector2D &p, + float dFrac ); + + /** + * Converts a polar representation of a Vector2D into a Cartesian. + * @param dMag a float representing the polar r-coordinate, i.e. the distance + * from the point to the origin + * @param ang the angle that the polar vector makes with the x-axis, i.e. the + * polar phi-coordinate + * @return the result of converting the given polar representation into a + * Cartesian representation thus yielding a Cartesian Vector2D + */ + //static Vector2D getVector2DFromPolar( float dMag, + // AngDeg ang ); + + //wenns: temp workaround + static Vector2D getVector2DFromPolar/*_Orig*/( float dMag, AngDeg ang ); +}; + +/******************************************************************************/ +/********************* NAMESPACE GEOMETRY *********************************/ +/******************************************************************************/ + +namespace Geometry { + ///////////////////////////// geometric series ////////////////////////////////// + + /* + * A geometric series is one in which there is a constant ratio between each + * element and the one preceding it. + * Normally: s = a + ar + ar^2 + ... + ar^n + * Now: Sum = First + First*Ratio + First*Ratio^2 + .. + Fist*Ratio^n + */ + + /** + * Determines the length of a geometric series given its first element, the sum + * of the elements in the series and the constant ratio between the elements. + * @param first first term of the series + * @param ratio ratio with which the the first term is multiplied + * @param sum the total sum of all the serie + * @return the length(n in above example) of the series + */ + float getLengthGeomSeries (float first, float ratio, float sum ); + + /** + * Determines the sum of a geometric series given its first element, the ratio and + * the number of steps in the series + * @param first first term of the series + * @param ratio ratio with which the the first term is multiplied + * @param length the number of steps to be taken into account + * @return the sum of the series + */ + float getSumGeomSeries ( float first, float ratio, float length ); + /** + * Determines the sum of an infinite geometric series given its first element and + * the constant ratio between the elements. Note that such an infinite series will + * only converge when 0 0 ) + * @return bool indicating whether radius was set + */ + bool setCircle ( const Vector2D &pos, float r ); + + /** + * Sets the radius of the circle. + * @param r new radius of the circle ( > 0 ) + * @return bool indicating whether radius was set + */ + bool setRadius ( const float r ); + void setCenter ( const Vector2D &pos ) { posCenter = pos; } + + float getRadius () const { return radius; } + Vector2D getCenter () const { return posCenter; } + float getCircumference () const { return 2.0*M_PI*getRadius(); } + float getArea () const { return M_PI*getRadius()*getRadius(); } + + /** + * Returns a boolean that indicates whether 'pos' is located inside the circle. + * @param pos position of which should be checked whether it is located in the + * circle + * @return bool indicating whether pos lies inside the circle + */ + bool isInside ( const Vector2D &pos ) const + { return posCenter.distanceTo( pos ) < getRadius(); } + + /** + * Returns the two possible intersection points between two circles. This method + * returns the number of solutions that were found. + * @param c circle with which intersection should be found + * @param p1 will be filled with first solution + * @param p2 will be filled with second solution + * @return number of solutions. + */ + int getIntersectionPoints ( const Circle &c, Vector2D *p1, Vector2D *p2) const; + + /** + * Returns the size of the intersection area of two circles. + * @param c circle with which intersection should be determined + * @return size of the intersection area. + */ + float getIntersectionArea ( const Circle &c ) const ; + + + bool calcTangentIntersectionPoints(const Vector2D, Vector2D &point1, Vector2D &point2); + +}; + + +/******************************************************************************/ +/*********************** CLASS LINE *******************************************/ +/******************************************************************************/ + +/** + * This class contains the representation of a line. A line is defined + * by the formula ay + bx + c = 0. The coefficients a, b and c are stored + * and used in the calculations. + */ +class Line { + // a line is defined by the formula: ay + bx + c = 0 + float a; /**< This is the a coefficient in the line ay + bx + c = 0 */ + float b; /**< This is the b coefficient in the line ay + bx + c = 0 */ + float c; /**< This is the c coefficient in the line ay + bx + c = 0 */ + +public: + Line( float a, float b, float c ); + Line(); + + //accessors + float getACoefficient ( ) const { return a; } + float getBCoefficient ( ) const { return b; } + float getCCoefficient ( ) const { return c; } + + + // print methods + void show( ostream& os = cout ); + friend ostream& operator << (ostream & os, Line l); + + /** + * Returns the intersection point between the current Line and the specified line. + * @param line line with which the intersection should be calculated. + * @return Vector2D position that is the intersection point. + */ + Vector2D getIntersection ( Line line ); + + /** + * This method calculates the intersection points between the current line + * and the circle specified with as center 'posCenter' and radius 'radius'. + * The number of solutions are returned and the corresponding points are put + * in the third and fourth argument of the method + * @param c circle with which intersection points should be found + * @param posSolution1 first intersection (if any) + * @param posSolution2 second intersection (if any) + */ + int getCircleIntersectionPoints( Circle circle, + Vector2D *posSolution1, + Vector2D *posSolution2 ); + + /** + * Returns the tangent line to a Vector2D. This is the line between the specified + * position and the closest point on the line to this position. + * @param pos Vector2D point with which tangent line is calculated. + * @return Line line tangent to this position + */ + Line getTangentLine ( Vector2D pos ); + + /** + * Returns the closest point on a line to a given position. + * @param pos point to which closest point should be determined + * @return Vector2D closest point on line to 'pos'. + */ + Vector2D getPointOnLineClosestTo ( Vector2D pos ); + + /** + * Returns the distance between a specified position and the closest point on + * the given line. + * @param pos position to which distance should be calculated + * @return float indicating the distance to the line. + */ + float distanceToPoint ( Vector2D pos ); + + /** + * Determines whether the projection of a point on the current line lies between + * two other points ('point1' and 'point2') that lie on the same line. + * @param pos point of which projection is checked. + * @param point1 first point on line + * @param point2 second point on line + * @return true when projection of 'pos' lies between 'point1' and 'point2'. + */ + bool isInBetween ( Vector2D pos, + Vector2D point1, + Vector2D point2 ); + + /** + * Calculates the y coordinate given the x coordinate + * @param x coordinate + * @return y coordinate on this line + */ + float getYGivenX ( float x ); + + /** + * Calculates the x coordinate given the y coordinate + * @param y coordinate + * @return x coordinate on this line + */ + float getXGivenY ( float y ); + + /////// static methods to make a line using an easier representation //////// + /** + * Creates a line given two points. + * @param pos1 first point + * @param pos2 second point + * @return line that passes through the two specified points. + */ + static Line makeLineFromTwoPoints ( Vector2D pos1, + Vector2D pos2 ); + + /** + * Creates a line given a position and an angle. + * @param vec position through which the line passes + * @param angle direction of the line. + * @return line that goes through position 'vec' with angle 'angle'. + */ + static Line makeLineFromPositionAndAngle ( Vector2D vec, + AngDeg angle ); +}; + +/******************************************************************************/ +/********************** CLASS RECTANGLE ***************************************/ +/******************************************************************************/ + +/** + * This class represents a rectangle. A rectangle is defined by two Vector2Ds + * the one at the upper left corner and the one at the right bottom. + */ +class RectangleGeo { + Vector2D posLeftTop; /**< top left position of the rectangle */ + Vector2D posRightBottom; /**< bottom right position of the rectangle */ + +public: + /** + * This is the constructor of a Rectangle. Two points will be given. The + * order does not matter as long as two opposite points are given (left + * top and right bottom or right top and left bottom). + * @param pos first point that defines corner of rectangle + * @param pos2 second point that defines other corner of rectangle + * @return rectangle with 'pos' and 'pos2' as opposite corners. + */ + RectangleGeo ( Vector2D pos, Vector2D pos2 ); + + void show ( ostream& os = cout ) const; + + /** + * Determines whether the given position lies inside the current rectangle. + * @param pos position which is checked whether it lies in rectangle + * @return true when 'pos' lies in the rectangle, false otherwise + */ + bool isInside ( Vector2D pos ) const; + + /** + * Sets the upper left and right bottom point of the current rectangle. + * @param pos first point that defines corner of rectangle + * @param pos2 second point that defines other corner of rectangle + */ + void setRectanglePoints( Vector2D pos1, + Vector2D pos2 ); + + void setPosLeftTop ( Vector2D pos ) { posLeftTop = pos; } + void setPosRightBottom ( Vector2D pos ) { posRightBottom = pos; } + Vector2D getPosLeftTop () const { return posLeftTop; } + Vector2D getPosRightBottom () const { return posRightBottom; } +}; + + + +/******************************************************************************/ +/********************** CLASS CONE **** ***************************************/ +/******************************************************************************/ + +/** + * This class represents a cone. A cone is defined by one point, + * two angles (-180 to 180), a maximum and a minimum distance. + * The point gives the peak of the cone. A point that lies in the cone + * is at least minimum distance and at most maximum distance away from + * the peak. Additionally the point must lie in the segment between + * the first angle (the left edge) and the second angle (the other edge). + * The area is defined by rotating the first edge (given by the first angle) + * clockwise (mit dem Uhrzeigersinn) till the second angle is reached. + */ +class Cone { + Vector2D peak; /**< peak of the cone */ + float fstAngle; /**< the left edge. Start of clockwise rotation. */ + float sndAngle; /**< the right edge. End of clockwise rotation. */ + float maxDistance; /**< the max. distance a point on the cone can be away from the peak. */ + float minDistance; /**< the min. distance a point on the cone must be away from the peak. */ + +public: + /** + * This is the constructor of a Cone. The cone lies between fstAngle and sndAngle, + * where sndAngle is interpreted as being clockwise rotated in relation + * to fstAngle. + * @param peak first point that defines top of the cone + * @param fstAngle absolute angle of the first edge + * @param sndAngle absolute angle of the second edge. + * @param maxDistance max. distance a point on the cone can be away from the peak + * @param minDistance min. distance a point on the cone must be away from the peak + */ + Cone( Vector2D peak, + float fstAngle, float sndAngle, + float maxDistance, float minDistance = 0 ); + + void show( ostream& os = cout ) const; + + /** + * Determines whether the given position lies inside the current cone. + * @param pos position which is checked whether it lies in cone + * @return true when 'pos' lies in the cone, false otherwise + */ + bool isInside( Vector2D pos ) const; + + inline void setPeak( Vector2D newPeak ) { peak = newPeak; } + inline void setAngles( float newFstAngle, float newSndAngle ) { + fstAngle = newFstAngle, sndAngle = newSndAngle; + } + inline void setFstAngle( float newFstAngle ) { fstAngle = newFstAngle; } + inline void setSndAngle( float newSndAngle ) { sndAngle = newSndAngle; } + inline void setMaxDistance( float newMaxDistance) { maxDistance = newMaxDistance; } + inline void setMinDistance( float newMinDistance) { minDistance = newMinDistance; } + +}; + +#endif //Geometry.hh + diff --git a/alienblaster/project/jni/alienblaster/src/global.cc b/alienblaster/project/jni/alienblaster/src/global.cc new file mode 100644 index 000000000..e5dda4a1d --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/global.cc @@ -0,0 +1,380 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +#include "global.h" +#include "options.h" +#include "asstring.h" +#include +#include "SDL.h" +#include "surfaceDB.h" + +using namespace std; + +int GAME_LENGTH = 300000; // ms +int ITEM_LIFETIME = 20000; // ms +int ITEM_APPEAR_DELAY = 10000; // ms +int ITEM_APPEAR_RAND_DELAY = 20000; // ms +int ITEM_HEALTH_REPAIR_AMOUNT = 100; + +int ITEM_HEATSEEKER_AMMO = 70; +int ITEM_NUKE_AMMO = 2; +int ITEM_DEFLECTOR_AMMO = 1; +int ITEM_DEFLECTOR_ACTIVATION_DIST = 200; +int ITEM_DEFLECTOR_POWER = 100; +int ITEM_DEFLECTOR_DURATION = 15000; + +int ITEM_APPEAR_CHANCES[] = { 50, 20, 30, 30, 30, 50, 20, 20, 30, 20, 20 }; + +int GENERATE_ENEMY_DELAY = 100; +int GENERATE_ENEMY_RAND_DELAY = 2000; + +int LIGHT_FIGHTER_MAX_SHIELD = 200; +int HEAVY_FIGHTER_MAX_SHIELD = 500; +int LIGHT_FIGHTER_MAX_DAMAGE = 200; +int HEAVY_FIGHTER_MAX_DAMAGE = 500; + +int LIGHT_FIGHTER_SHIELD_RECHARGE = 80; +int HEAVY_FIGHTER_SHIELD_RECHARGE = 110; + +int RACER_DEFLECTOR_ACTIVATION_DIST = 150; +int RACER_DEFLECTOR_POWER = 50; +int RACER_SONIC_ACTIVATION_DIST = 200; +int RACER_SONIC_POWER = 50; + +int ENEMY_HITPOINTS[] = { 80, 120, 150, 2000, 1500, 1000, 1000, 3000 }; +int ENEMY_COLLISION_DAMAGE[] = {20, 40, 0, 0, 0, 0, 0, 2000}; +int ENEMY_DIES_ITEM_APPEAR_CHANCE[] = {15, 12, 8, 0, 0, 0, 0, 1}; +int ENEMY_APPEAR_CHANCES[] = {40, 40, 10, 0, 0, 0, 0, 0}; +int ENEMY_COOLDOWN_PRIMARY[] = {400, 400, 400, 50, 500, 100, 100, 300}; +int ENEMY_COOLDOWN_SECONDARY[] = {0, 0, 2000, 0, 0, 0, 0, 600}; +int ENEMY_RAND_WAIT_PRIMARY[] = {1500, 1000, 300, 80, 1000, 200, 200, 2000}; +int ENEMY_RAND_WAIT_SECONDARY[] = {0, 0, 10000, 0, 0, 0, 0, 400}; + +int GENERATE_FORMATION_DELAY = 5000; +int GENERATE_FORMATION_RAND_DELAY = 20000; + +int FORMATION_MAX_NR_ENEMYS[] = {7,7,7,6}; +int FORMATION_SP_CHANCES[] = { 10, 10, 5, 5, 20, 10, 5, 20, 10, 20, 10 }; +int FORMATION_SP_PRIMARY_DELAY[] = {0, 80, 120, 160, + 500, 800, 1100, + 150, 250, 150, 250}; +int FORMATION_SP_PRIMARY_RAND_DELAY[] = { 0, 80, 120, 160, + 1000, 1500, 2000, + 0, 0, 0, 0 }; + + + + +void parseGlobalConfigValues( int difficultyLevel ) { + + Options *op = 0; + op = new Options( FN_DIFFICULTY_CONFIG + + asString(difficultyLevel) + + FN_DIFFICULTY_CONFIG_SUFFIX ); + + op->getInt( "GAME_LENGTH", GAME_LENGTH ); + + op->getInt( "ITEM_LIFETIME", ITEM_LIFETIME ); + op->getInt( "ITEM_APPEAR_DELAY", ITEM_APPEAR_DELAY ); + op->getInt( "ITEM_APPEAR_RAND_DELAY", ITEM_APPEAR_RAND_DELAY ); + + op->getInt( "ITEM_HEALTH_REPAIR_AMOUNT", ITEM_HEALTH_REPAIR_AMOUNT ); + + op->getInt( "ITEM_HEATSEEKER_AMMO", ITEM_HEATSEEKER_AMMO ); + op->getInt( "ITEM_NUKE_AMMO", ITEM_NUKE_AMMO ); + op->getInt( "ITEM_DEFLECTOR_AMMO", ITEM_DEFLECTOR_AMMO ); + op->getInt( "ITEM_DEFLECTOR_DURATION", ITEM_DEFLECTOR_DURATION ); + op->getInt( "ITEM_DEFLECTOR_ACTIVATION_DIST", ITEM_DEFLECTOR_ACTIVATION_DIST ); + op->getInt( "ITEM_DEFLECTOR_POWER", ITEM_DEFLECTOR_POWER ); + + op->getInt( "GENERATE_ENEMY_DELAY", GENERATE_ENEMY_DELAY ); + op->getInt( "GENERATE_ENEMY_RAND_DELAY", GENERATE_ENEMY_RAND_DELAY ); + + op->getInt( "LIGHT_FIGHTER_MAX_SHIELD", LIGHT_FIGHTER_MAX_SHIELD ); + op->getInt( "HEAVY_FIGHTER_MAX_SHIELD", HEAVY_FIGHTER_MAX_SHIELD ); + op->getInt( "LIGHT_FIGHTER_MAX_DAMAGE", LIGHT_FIGHTER_MAX_DAMAGE ); + op->getInt( "HEAVY_FIGHTER_MAX_DAMAGE", HEAVY_FIGHTER_MAX_DAMAGE ); + op->getInt( "LIGHT_FIGHTER_SHIELD_RECHARGE", LIGHT_FIGHTER_SHIELD_RECHARGE ); + op->getInt( "HEAVY_FIGHTER_SHIELD_RECHARGE", HEAVY_FIGHTER_SHIELD_RECHARGE ); + + op->getInt( "HEAVY_FIGHTER_DEFLECTOR_ACTIVATION_DIST", + RACER_DEFLECTOR_ACTIVATION_DIST ); + op->getInt( "HEAVY_FIGHTER_DEFLECTOR_POWER", + RACER_DEFLECTOR_POWER ); + + op->getInt( "FIGHTER_HITPOINTS", ENEMY_HITPOINTS[ FIGHTER ] ); + op->getInt( "BOMBER_HITPOINTS", ENEMY_HITPOINTS[ BOMBER ] ); + op->getInt( "TURRET_HITPOINTS", ENEMY_HITPOINTS[ TANK ] ); + op->getInt( "BOSS1_MAIN_GUN_HITPOINTS", ENEMY_HITPOINTS[ BOSS_1_MAIN_GUN ] ); + op->getInt( "BOSS1_ROCKET_LAUNCHER_HITPOINTS", ENEMY_HITPOINTS[ BOSS_1_ROCKET_LAUNCHER ] ); + op->getInt( "BOSS1_SHOT_BATTERY_LEFT_HITPOINTS", + ENEMY_HITPOINTS[ BOSS_1_SHOT_BATTERY_LEFT ] ); + op->getInt( "BOSS1_SHOT_BATTERY_RIGHT_HITPOINTS", + ENEMY_HITPOINTS[ BOSS_1_SHOT_BATTERY_RIGHT ] ); + + op->getInt( "COLLISION_DAMAGE_FIGHTER", ENEMY_COLLISION_DAMAGE[ FIGHTER ] ); + op->getInt( "COLLISION_DAMAGE_BOMBER", ENEMY_COLLISION_DAMAGE[ BOMBER ] ); + op->getInt( "ENEMY_DIES_ITEM_APPEAR_CHANCE_FIGHTER", + ENEMY_DIES_ITEM_APPEAR_CHANCE[ FIGHTER ] ); + op->getInt( "ENEMY_DIES_ITEM_APPEAR_CHANCE_BOMBER", + ENEMY_DIES_ITEM_APPEAR_CHANCE[ BOMBER ] ); + op->getInt( "ENEMY_DIES_ITEM_APPEAR_CHANCE_TURRET", + ENEMY_DIES_ITEM_APPEAR_CHANCE[ TANK ] ); + + op->getInt( "ENEMY_APPEAR_CHANCE_FIGHTER", + ENEMY_APPEAR_CHANCES[ FIGHTER ] ); + op->getInt( "ENEMY_APPEAR_CHANCE_BOMBER", + ENEMY_APPEAR_CHANCES[ BOMBER ] ); + op->getInt( "ENEMY_APPEAR_CHANCE_TURRET", + ENEMY_APPEAR_CHANCES[ TANK ] ); + + op->getInt( "ENEMY_COOLDOWN_FIGHTER", + ENEMY_COOLDOWN_PRIMARY[ FIGHTER ] ); + op->getInt( "ENEMY_COOLDOWN_BOMBER", + ENEMY_COOLDOWN_PRIMARY[ BOMBER ] ); + op->getInt( "ENEMY_COOLDOWN_TURRET", + ENEMY_COOLDOWN_PRIMARY[ TANK ] ); + op->getInt( "ENEMY_COOLDOWN_BOSS1_MAIN_GUN", + ENEMY_COOLDOWN_PRIMARY[ BOSS_1_MAIN_GUN ] ); + op->getInt( "ENEMY_COOLDOWN_BOSS1_ROCKET_LAUNCHER", + ENEMY_COOLDOWN_PRIMARY[ BOSS_1_ROCKET_LAUNCHER] ); + op->getInt( "ENEMY_COOLDOWN_BOSS1_SHOT_BATTERY_LEFT", + ENEMY_COOLDOWN_PRIMARY[ BOSS_1_SHOT_BATTERY_LEFT] ); + op->getInt( "ENEMY_COOLDOWN_BOSS1_SHOT_BATTERY_RIGHT", + ENEMY_COOLDOWN_PRIMARY[ BOSS_1_SHOT_BATTERY_RIGHT ] ); + + op->getInt( "ENEMY_COOLDOWN_SECONDARY_TURRET", ENEMY_COOLDOWN_SECONDARY[ TANK ] ); + + op->getInt( "ENEMY_RAND_WAIT_FIGHTER", + ENEMY_RAND_WAIT_PRIMARY[ FIGHTER ] ); + op->getInt( "ENEMY_RAND_WAIT_BOMBER", + ENEMY_RAND_WAIT_PRIMARY[ BOMBER ] ); + op->getInt( "ENEMY_RAND_WAIT_TURRET", + ENEMY_RAND_WAIT_PRIMARY[ TANK ] ); + op->getInt( "ENEMY_RAND_WAIT_BOSS1_MAIN_GUN", + ENEMY_RAND_WAIT_PRIMARY[ BOSS_1_MAIN_GUN ] ); + op->getInt( "ENEMY_RAND_WAIT_BOSS1_ROCKET_LAUNCHER", + ENEMY_RAND_WAIT_PRIMARY[ BOSS_1_ROCKET_LAUNCHER ] ); + op->getInt( "ENEMY_RAND_WAIT_BOSS1_SHOT_BATTERY_LEFT", + ENEMY_RAND_WAIT_PRIMARY[ BOSS_1_SHOT_BATTERY_LEFT ] ); + op->getInt( "ENEMY_RAND_WAIT_BOSS1_SHOT_BATTERY_RIGHT", + ENEMY_RAND_WAIT_PRIMARY[ BOSS_1_SHOT_BATTERY_RIGHT ] ); + + op->getInt( "ENEMY_RAND_WAIT_SECONDARY_TURRET", + ENEMY_RAND_WAIT_SECONDARY[ TANK ] ); + + op->getInt( "ITEM_APPEAR_CHANCE_PRIMARY_UPGRADE", + ITEM_APPEAR_CHANCES[ ITEM_PRIMARY_UPGRADE ] ); + op->getInt( "ITEM_APPEAR_CHANCE_DUMBRIFE_DOUBLE", + ITEM_APPEAR_CHANCES[ ITEM_DUMBFIRE_DOUBLE ] ); + op->getInt( "ITEM_APPEAR_CHANCE_KICK_ASS_ROCKET", + ITEM_APPEAR_CHANCES[ ITEM_KICK_ASS_ROCKET ] ); + op->getInt( "ITEM_APPEAR_CHANCE_HELLFIRE", + ITEM_APPEAR_CHANCES[ ITEM_HELLFIRE ] ); + op->getInt( "ITEM_APPEAR_CHANCE_MACHINE_GUN", + ITEM_APPEAR_CHANCES[ ITEM_MACHINE_GUN ] ); + op->getInt( "ITEM_APPEAR_CHANCE_HEALTH", + ITEM_APPEAR_CHANCES[ ITEM_HEALTH ] ); + op->getInt( "ITEM_APPEAR_CHANCE_HEATSEEKER", + ITEM_APPEAR_CHANCES[ ITEM_HEATSEEKER ] ); + op->getInt( "ITEM_APPEAR_CHANCE_NUKE", + ITEM_APPEAR_CHANCES[ ITEM_NUKE ] ); + op->getInt( "ITEM_APPEAR_CHANCE_DEFLECTOR", + ITEM_APPEAR_CHANCES[ ITEM_DEFLECTOR ] ); + op->getInt( "ITEM_APPEAR_CHANCE_ENERGY_BEAM", + ITEM_APPEAR_CHANCES[ ITEM_ENERGY_BEAM ] ); + op->getInt( "ITEM_APPEAR_CHANCE_LASER", + ITEM_APPEAR_CHANCES[ ITEM_LASER ] ); + + op->getInt( "GENERATE_FORMATION_DELAY", GENERATE_FORMATION_DELAY ); + op->getInt( "GENERATE_FORMATION_RAND_DELAY", GENERATE_FORMATION_RAND_DELAY ); + + op->getInt( "FORMATION_MAX_NR_ENEMYS_V", + FORMATION_MAX_NR_ENEMYS[ FORMATION_V ] ); + op->getInt( "FORMATION_MAX_NR_ENEMYS_REVERSE_V", + FORMATION_MAX_NR_ENEMYS[ FORMATION_REVERSE_V ] ); + op->getInt( "FORMATION_MAX_NR_ENEMYS_BLOCK", + FORMATION_MAX_NR_ENEMYS[ FORMATION_BLOCK ] ); + op->getInt( "FORMATION_MAX_NR_ENEMYS_LINE", + FORMATION_MAX_NR_ENEMYS[ FORMATION_LINE ] ); + for ( int i = 0; i < NR_FORMATION_TYPES; i++ ) { + if ( FORMATION_MAX_NR_ENEMYS[ i ] > FORMATION_MAX_NR_ENEMYS_HARD_LIMIT[ i ] ) + FORMATION_MAX_NR_ENEMYS[ i ] = FORMATION_MAX_NR_ENEMYS_HARD_LIMIT[ i ]; + } + + op->getInt( "FORMATION_SP_CHANCE_NONE", + FORMATION_SP_CHANCES[ FORMATION_SP_NONE ] ); + op->getInt( "FORMATION_SP_CHANCE_RAND_FAST", + FORMATION_SP_CHANCES[ FORMATION_SP_RAND_FAST ] ); + op->getInt( "FORMATION_SP_CHANCE_RAND_MEDIUM", + FORMATION_SP_CHANCES[ FORMATION_SP_RAND_MEDIUM ] ); + op->getInt( "FORMATION_SP_CHANCE_RAND_SLOW", + FORMATION_SP_CHANCES[ FORMATION_SP_RAND_SLOW ] ); + op->getInt( "FORMATION_SP_CHANCE_VOLLEY_FAST", + FORMATION_SP_CHANCES[ FORMATION_SP_VOLLEY_FAST ] ); + op->getInt( "FORMATION_SP_CHANCE_VOLLEY_MEDIUM", + FORMATION_SP_CHANCES[ FORMATION_SP_VOLLEY_MEDIUM ] ); + op->getInt( "FORMATION_SP_CHANCE_VOLLEY_SLOW", + FORMATION_SP_CHANCES[ FORMATION_SP_VOLLEY_SLOW ] ); + op->getInt( "FORMATION_SP_CHANCE_LEFT_RIGHT_FAST", + FORMATION_SP_CHANCES[ FORMATION_SP_LEFT_RIGHT_FAST ] ); + op->getInt( "FORMATION_SP_CHANCE_LEFT_RIGHT_MEDIUM", + FORMATION_SP_CHANCES[ FORMATION_SP_LEFT_RIGHT_MEDIUM ] ); + op->getInt( "FORMATION_SP_CHANCE_RIGHT_LEFT_FAST", + FORMATION_SP_CHANCES[ FORMATION_SP_RIGHT_LEFT_FAST ] ); + op->getInt( "FORMATION_SP_CHANCE_RIGHT_LEFT_MEDIUM", + FORMATION_SP_CHANCES[ FORMATION_SP_RIGHT_LEFT_MEDIUM ] ); + + op->getInt( "FORMATION_SP_PRIM_DELAY_RAND_FAST", + FORMATION_SP_PRIMARY_DELAY[ FORMATION_SP_RAND_FAST ] ); + op->getInt( "FORMATION_SP_PRIM_DELAY_RAND_MEDIUM", + FORMATION_SP_PRIMARY_DELAY[ FORMATION_SP_RAND_MEDIUM ] ); + op->getInt( "FORMATION_SP_PRIM_DELAY_RAND_SLOW", + FORMATION_SP_PRIMARY_DELAY[ FORMATION_SP_RAND_SLOW ] ); + op->getInt( "FORMATION_SP_PRIM_DELAY_VOLLEY_FAST", + FORMATION_SP_PRIMARY_DELAY[ FORMATION_SP_VOLLEY_FAST ] ); + op->getInt( "FORMATION_SP_PRIM_DELAY_VOLLEY_MEDIUM", + FORMATION_SP_PRIMARY_DELAY[ FORMATION_SP_VOLLEY_MEDIUM ] ); + op->getInt( "FORMATION_SP_PRIM_DELAY_VOLLEY_SLOW", + FORMATION_SP_PRIMARY_DELAY[ FORMATION_SP_VOLLEY_SLOW ] ); + op->getInt( "FORMATION_SP_PRIM_DELAY_LEFT_RIGHT_FAST", + FORMATION_SP_PRIMARY_DELAY[ FORMATION_SP_LEFT_RIGHT_FAST ] ); + op->getInt( "FORMATION_SP_PRIM_DELAY_LEFT_RIGHT_MEDIUM", + FORMATION_SP_PRIMARY_DELAY[ FORMATION_SP_LEFT_RIGHT_MEDIUM ] ); + op->getInt( "FORMATION_SP_PRIM_DELAY_RIGHT_LEFT_FAST", + FORMATION_SP_PRIMARY_DELAY[ FORMATION_SP_RIGHT_LEFT_FAST ] ); + op->getInt( "FORMATION_SP_PRIM_DELAY_RIGHT_LEFT_MEDIUM", + FORMATION_SP_PRIMARY_DELAY[ FORMATION_SP_RIGHT_LEFT_MEDIUM ] ); + + op->getInt( "FORMATION_SP_PRIM_RAND_DELAY_RAND_FAST", + FORMATION_SP_PRIMARY_RAND_DELAY[ FORMATION_SP_RAND_FAST ] ); + op->getInt( "FORMATION_SP_PRIM_RAND_DELAY_RAND_MEDIUM", + FORMATION_SP_PRIMARY_RAND_DELAY[ FORMATION_SP_RAND_MEDIUM ] ); + op->getInt( "FORMATION_SP_PRIM_RAND_DELAY_RAND_SLOW", + FORMATION_SP_PRIMARY_RAND_DELAY[ FORMATION_SP_RAND_SLOW ] ); + op->getInt( "FORMATION_SP_PRIM_RAND_DELAY_VOLLEY_FAST", + FORMATION_SP_PRIMARY_RAND_DELAY[ FORMATION_SP_VOLLEY_FAST ] ); + op->getInt( "FORMATION_SP_PRIM_RAND_DELAY_VOLLEY_MEDIUM", + FORMATION_SP_PRIMARY_RAND_DELAY[ FORMATION_SP_VOLLEY_MEDIUM ] ); + op->getInt( "FORMATION_SP_PRIM_RAND_DELAY_VOLLEY_SLOW", + FORMATION_SP_PRIMARY_RAND_DELAY[ FORMATION_SP_VOLLEY_SLOW ] ); + op->getInt( "FORMATION_SP_PRIM_RAND_DELAY_LEFT_RIGHT_FAST", + FORMATION_SP_PRIMARY_RAND_DELAY[ FORMATION_SP_LEFT_RIGHT_FAST ] ); + op->getInt( "FORMATION_SP_PRIM_RAND_DELAY_LEFT_RIGHT_MEDIUM", + FORMATION_SP_PRIMARY_RAND_DELAY[ FORMATION_SP_LEFT_RIGHT_MEDIUM ] ); + op->getInt( "FORMATION_SP_PRIM_RAND_DELAY_RIGHT_LEFT_FAST", + FORMATION_SP_PRIMARY_RAND_DELAY[ FORMATION_SP_RIGHT_LEFT_FAST ] ); + op->getInt( "FORMATION_SP_PRIM_RAND_DELAY_RIGHT_LEFT_MEDIUM", + FORMATION_SP_PRIMARY_RAND_DELAY[ FORMATION_SP_RIGHT_LEFT_MEDIUM ] ); + + delete op; +} + +///////////////////// + +int getRandValue( const int *choicesWeights, int nrChoices, int sumWeights ) { + int sum = 0; + if ( sumWeights != 0 ) sum = sumWeights; + else for ( int i = 0; i < nrChoices; i++ ) sum += choicesWeights[ i ]; + + if ( sum == 0 ) { + cout << "Error in getRandValue: sum==0!" << endl; + exit(1); + } + + int val = rand() % sum; + + int idx = 0; + int tmpSum = 0; + while ( idx < nrChoices ) { + tmpSum += choicesWeights[ idx ]; + if ( val < tmpSum ) { + return idx; + } + idx++; + } + cout << "Error in getRandValue: val: " << val << endl; + exit(1); +} + + +///////////////////////////// + +void initAllSurfaces() { + surfaceDB.loadSurface("./images/fighter.bmp" ); + surfaceDB.loadSurface("./images/fighterShadow.bmp", true); + surfaceDB.loadSurface("./images/bomber.bmp"); + surfaceDB.loadSurface("./images/bomberShadow.bmp", true); + surfaceDB.loadSurface("./images/tank.bmp"); + surfaceDB.loadSurface("./images/boss1MainGun.bmp"); + surfaceDB.loadSurface("./images/boss1RocketLauncher.bmp"); + surfaceDB.loadSurface("./images/boss1ShotBatteryLeft.bmp"); + surfaceDB.loadSurface("./images/boss1ShotBatteryRight.bmp"); + surfaceDB.loadSurface("./images/wreckFighter.bmp"); + surfaceDB.loadSurface("./images/wreckBomber.bmp"); + surfaceDB.loadSurface("./images/wreckTank.bmp"); + surfaceDB.loadSurface("./images/wreckBoss1.bmp"); + surfaceDB.loadSurface("./images/wreckBossBackground.bmp"); + surfaceDB.loadSurface("./images/boss.bmp"); + surfaceDB.loadSurface("./images/normalShot.bmp"); + surfaceDB.loadSurface("./images/heavyShot.bmp"); + surfaceDB.loadSurface("./images/normalShotHF.bmp"); + surfaceDB.loadSurface("./images/dumbfire.bmp"); + surfaceDB.loadSurface("./images/kickAssRocket.bmp"); + surfaceDB.loadSurface("./images/kickAssRocketShadow.bmp", true); + surfaceDB.loadSurface("./images/hellfire.bmp"); + surfaceDB.loadSurface("./images/hellfireShadow.bmp", true); + surfaceDB.loadSurface("./images/machineGun.bmp"); + surfaceDB.loadSurface("./images/energyBeam.bmp", true); + surfaceDB.loadSurface("./images/laser.bmp"); + surfaceDB.loadSurface("./images/enemyShotNormal.bmp"); + surfaceDB.loadSurface("./images/tankRocket.bmp"); + surfaceDB.loadSurface("./images/tankRocketShadow.bmp", true); + surfaceDB.loadSurface("./images/heatseeker.bmp"); + surfaceDB.loadSurface("./images/shotNuke.bmp"); + surfaceDB.loadSurface("./images/shotNukeShadow.bmp", true); + surfaceDB.loadSurface("./images/nukeEffect.bmp"); + surfaceDB.loadSurface("./images/sonic.bmp"); + surfaceDB.loadSurface("./images/itemPrimaryUpgrade.bmp"); + surfaceDB.loadSurface("./images/itemDumbfireDouble.bmp"); + surfaceDB.loadSurface("./images/itemKickAssRocket.bmp"); + surfaceDB.loadSurface("./images/itemHellfire.bmp"); + surfaceDB.loadSurface("./images/itemMachineGun.bmp"); + surfaceDB.loadSurface("./images/itemHealth.bmp"); + surfaceDB.loadSurface("./images/itemHeatseeker.bmp"); + surfaceDB.loadSurface("./images/itemNuke.bmp"); + surfaceDB.loadSurface("./images/itemDeflector.bmp"); + surfaceDB.loadSurface("./images/itemEnergyBeam.bmp"); + surfaceDB.loadSurface("./images/itemLaser.bmp"); + surfaceDB.loadSurface("./images/background.bmp"); + surfaceDB.loadSurface("./images/lightFighterShieldDamaged.bmp"); + surfaceDB.loadSurface("./images/heavyFighterShieldDamaged.bmp"); + surfaceDB.loadSurface("./images/heavyFighterDeflector.bmp", true); + surfaceDB.loadSurface("./images/font-20red.bmp"); + surfaceDB.loadSurface("./images/font-20blue.bmp"); + surfaceDB.loadSurface("./images/explosion.bmp"); + surfaceDB.loadSurface("./images/explosionEnemy.bmp"); + surfaceDB.loadSurface("./images/bannerExcellent.bmp", true); + surfaceDB.loadSurface("./images/bannerYouRule.bmp", true); + surfaceDB.loadSurface("./images/bannerHeiho.bmp", true); + surfaceDB.loadSurface("./images/bannerHealth.bmp", true); + surfaceDB.loadSurface("./images/bannerEnemysKilled.bmp", true); + surfaceDB.loadSurface("./images/bannerBonus100.bmp", true); + surfaceDB.loadSurface("./images/bannerBonus200.bmp", true); +} diff --git a/alienblaster/project/jni/alienblaster/src/global.h b/alienblaster/project/jni/alienblaster/src/global.h new file mode 100644 index 000000000..94a73f64b --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/global.h @@ -0,0 +1,691 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +#ifndef GLOBAL_H +#define GLOBAL_H + +#include + +class Racers; +class Enemys; +class Shots; +class Explosions; +class Items; +class Wrecks; +class Banners; +class SmokePuffs; +class Options; + +extern Racers *racers; +extern Enemys *enemys; +extern Shots *shots; +extern Explosions *explosions; +extern Items *items; +extern Wrecks *wrecks; +extern Banners *banners; +extern SmokePuffs *smokePuffs; +extern Options *levelConf; + +extern int GAME_LENGTH; +extern bool scrollingOn; +extern bool nukeIsInPlace; +extern bool playMusicOn; +extern bool onePlayerGame; +extern bool arcadeGame; +extern int difficultyLevel; +extern float actBackgroundPos; + +void parseGlobalConfigValues( int difficultyLevel ); +int getRandValue( const int *choicesWeights, int nrChoices, int sumWeights=0 ); +void initAllSurfaces(); + +// screen options +const int SCREEN_WIDTH = 320; +const int SCREEN_HEIGHT = 430; +const int BIT_DEPTH = 16; + +const int MAX_PLAYER_CNT = 2; + +// the speed of the background scrolling +const float SCROLL_SPEED = 20; + +// where is the absolute border of no return for the heatseeker? +// they have a chance to return within SCREEN_BORDER pixels outside the screen... +// outside this area shots are deleted +const int SHOT_SCREEN_BORDER = 50; + + +/********************************* ARCADE MODE ***********************************/ + +const int ARCADE_DIFFICULTY_LEVEL = 4; +const int ARCADE_POINTS_PER_TEN_SECONDS = 30; + +// BANNER_RANDOM: no real mode, just the value to choose one randomly +enum BannerModes { BANNER_MODE_FLY_FROM_LEFT=0, + BANNER_MODE_FROM_TOP, + BANNER_MODE_ITEM_COLLECTED_SINGLE_PLAYER, + BANNER_MODE_ITEM_COLLECTED_PLAYER_ONE, + BANNER_MODE_ITEM_COLLECTED_PLAYER_TWO, + BANNER_MODE_RANDOM=1000 }; +const int BANNER_MODE_LIFETIME[] = { 5000, 5000, 2000, 2000, 2000 }; +const int NR_BANNER_MODES = 2; + +enum BannerTexts { BANNER_EXCELLENT=0, BANNER_YOU_RULE, BANNER_HEIHO, + BANNER_HEALTH, BANNER_ENEMYS_KILLED, + BANNER_ITEM_HEALTH_COLLECTED, + BANNER_ITEM_PRIMARY_UPGRADE_COLLECTED, + BANNER_ITEM_DUMBFIRE_DOUBLE_COLLECTED, + BANNER_ITEM_KICK_ASS_ROCKET_COLLECTED, + BANNER_ITEM_HELLFIRE_COLLECTED, + BANNER_ITEM_MACHINE_GUN_COLLECTED, + BANNER_ITEM_HEATSEEKER_COLLECTED, + BANNER_ITEM_NUKE_COLLECTED, + BANNER_ITEM_DEFLECTOR_COLLECTED, + BANNER_ITEM_ENERGY_BEAM_COLLECTED, + BANNER_ITEM_LASER_COLLECTED }; +const std::string FN_BANNER_TEXTS[] = +{ "./images/bannerExcellent.bmp", + "./images/bannerYouRule.bmp", + "./images/bannerHeiho.bmp", + "./images/bannerHealth.bmp", + "./images/bannerEnemysKilled.bmp", + "./images/bannerItemHealthCollected.bmp", + "./images/bannerItemPrimaryUpgradeCollected.bmp", + "./images/bannerItemDumbfireDoubleCollected.bmp", + "./images/bannerItemKickAssRocketCollected.bmp", + "./images/bannerItemHellfireCollected.bmp", + "./images/bannerItemMachineGunCollected.bmp", + "./images/bannerItemHeatseekerCollected.bmp", + "./images/bannerItemNukeCollected.bmp", + "./images/bannerItemDeflectorCollected.bmp", + "./images/bannerItemEnergyBeamCollected.bmp", + "./images/bannerItemLaserCollected.bmp" }; +const int NR_BANNER_TEXTS = 3; + +enum BannerBoni { BANNER_BONUS_100=0, + BANNER_BONUS_200, + BANNER_BONUS_NONE=1000 }; +const std::string FN_BANNER_BONUS[] = +{ "./images/bannerBonus100.bmp", + "./images/bannerBonus200.bmp" }; +const int NR_BANNER_BONI = 2; + +const float ARCADE_POINTS_FOR_FORMATION_DESTRUCTION = 100; +const BannerBoni ARCADE_BONUS_FOR_FORMATION_DESTRUCTION = BANNER_BONUS_100; + +const float ARCADE_POINTS_FOR_ENEMYS_KILLED = 200; +const BannerBoni ARCADE_BONUS_FOR_ENEMYS_KILLED = BANNER_BONUS_200; + +const int NR_ARCACE_POINTS_FOR_HEALTH_ITEM = 7; +const float ARCADE_POINTS_FOR_HEALTH_ITEM[ NR_ARCACE_POINTS_FOR_HEALTH_ITEM ] = +{ 2000, 5000, 10000, 15000, 25000, 35000, 50000 }; + + +/********************************** ITEMS ****************************************/ + +enum ItemTypes { ITEM_PRIMARY_UPGRADE=0, + ITEM_DUMBFIRE_DOUBLE, + ITEM_KICK_ASS_ROCKET, + ITEM_HELLFIRE, + ITEM_MACHINE_GUN, + ITEM_HEALTH, + ITEM_HEATSEEKER, + ITEM_NUKE, + ITEM_DEFLECTOR, + ITEM_LASER, + ITEM_ENERGY_BEAM }; + +const int NR_ITEM_TYPES = 11; + +extern int ITEM_LIFETIME; // ms +extern int ITEM_APPEAR_DELAY; // ms +extern int ITEM_APPEAR_RAND_DELAY; // ms + +// ITEM_HEALTH_REPAIR_AMOUNT points are restored, if collected +extern int ITEM_HEALTH_REPAIR_AMOUNT; +// if collected by heavy fighter the amount will be multiplied by this factor +const float ITEM_HEALTH_REPAIR_FACTOR_HEAVY_FIGHTER = 2.0; + +// if collected ITEM_HEATSEEKER_AMMO rockets can be fired +extern int ITEM_HEATSEEKER_AMMO; +extern int ITEM_NUKE_AMMO; +extern int ITEM_DEFLECTOR_AMMO; + +extern int ITEM_DEFLECTOR_DURATION; +extern int ITEM_DEFLECTOR_ACTIVATION_DIST; +extern int ITEM_DEFLECTOR_POWER; + +// the items have different probabilities to appear. +// bigger number -> greater chance +extern int ITEM_APPEAR_CHANCES[]; + +enum ExplosionTypes { EXPLOSION_NORMAL_AIR=0, EXPLOSION_NORMAL_GROUND }; +const int NR_EXPLOSION_TYPES = 2; +const int LIFETIME_EXPL_NORMAL = 1500; + +const int NUKE_EFFECT_DURATION = 1000; +const int NUKE_QUAKE_EFFECT = 40; + +enum ShipTypes { LIGHT_FIGHTER=0, HEAVY_FIGHTER }; +const int NR_SHIPS = 2; + + +/*********************************** SHOTS ********************************/ + + +enum ShotTypes { SHOT_NORMAL=0, + SHOT_NORMAL_HEAVY, + SHOT_DOUBLE, + SHOT_DOUBLE_HEAVY, + SHOT_TRIPLE, + SHOT_HF_NORMAL, + SHOT_HF_DOUBLE, + SHOT_HF_TRIPLE, + SHOT_HF_QUATTRO, + SHOT_HF_QUINTO, + SHOT_DUMBFIRE=100, + SHOT_DUMBFIRE_DOUBLE, + SHOT_KICK_ASS_ROCKET, + SHOT_HELLFIRE, + SHOT_MACHINE_GUN, + SHOT_ENERGY_BEAM, + SHOT_HF_DUMBFIRE, + SHOT_HF_DUMBFIRE_DOUBLE, + SHOT_HF_KICK_ASS_ROCKET, + SHOT_HF_LASER, + ENEMY_SHOT_NORMAL=1000, + ENEMY_SHOT_TANK_ROCKET, + SPECIAL_SHOT_HEATSEEKER=10000, + SPECIAL_SHOT_NUKE }; +const int NR_SECONDARY_WEAPONS = 10; + +enum SpecialTypes { SPECIAL_NONE=0, SPECIAL_NUKE, SPECIAL_HEATSEEKER, SPECIAL_DEFLECTOR }; +const int NR_SPECIALS = 4; + +// after that many ms the shot is expired +const int LIFETIME_SHOT_NORMAL = 5000; +const int LIFETIME_SHOT_NORMAL_HEAVY = 5000; +const int LIFETIME_SHOT_DOUBLE = 5000; +const int LIFETIME_SHOT_DOUBLE_HEAVY = 5000; +const int LIFETIME_SHOT_TRIPLE = 5000; +const int LIFETIME_SHOT_HF_NORMAL = 6000; +const int LIFETIME_SHOT_HF_DOUBLE = 6000; +const int LIFETIME_SHOT_HF_TRIPLE = 6000; +const int LIFETIME_SHOT_HF_QUATTRO = 6000; +const int LIFETIME_SHOT_HF_QUINTO = 6000; + +const int LIFETIME_SHOT_DUMBFIRE = 6000; +const int LIFETIME_SHOT_DUMBFIRE_DOUBLE = 6000; +const int LIFETIME_SHOT_KICK_ASS_ROCKET = 7000; +const int LIFETIME_SHOT_HELLFIRE = 6000; +const int LIFETIME_SHOT_MACHINE_GUN = 5000; +const int LIFETIME_SHOT_ENERY_BEAM = 5000; + +const int LIFETIME_SHOT_HF_DUMBFIRE = 6000; +const int LIFETIME_SHOT_HF_DUMBFIRE_DOUBLE = 6000; +const int LIFETIME_SHOT_HF_KICK_ASS_ROCKET = 7000; +const int LIFETIME_SHOT_HF_LASER = 2000; + +const int LIFETIME_SPECIAL_SHOT_HEATSEEKER = 10000; +const int LIFETIME_SPECIAL_SHOT_NUKE = 10000; + +const int VEL_SHOT_NORMAL = 150; +const int VEL_SHOT_NORMAL_HEAVY = 150; +const int VEL_SHOT_DOUBLE = 150; +const int VEL_SHOT_DOUBLE_HEAVY = 150; +const int VEL_SHOT_TRIPLE = 150; + +const int VEL_SHOT_HF_NORMAL = 180; +const int VEL_SHOT_HF_DOUBLE = 180; +const int VEL_SHOT_HF_TRIPLE = 180; +const int VEL_SHOT_HF_QUATTRO = 180; +const int VEL_SHOT_HF_QUINTO = 180; + +const int VEL_SHOT_DUMBFIRE = 100; +const int VEL_SHOT_DUMBFIRE_DOUBLE = 100; +const int VEL_SHOT_KICK_ASS_ROCKET = 80; +const int VEL_SHOT_HELLFIRE = 110; +const int VEL_SHOT_MACHINE_GUN = 130; +const int VEL_SHOT_ENERGY_BEAM = 105; + +const int VEL_SHOT_HF_DUMBFIRE = 160; +const int VEL_SHOT_HF_DUMBFIRE_DOUBLE = 160; +const int VEL_SHOT_HF_KICK_ASS_ROCKET = 80; +const int VEL_SHOT_HF_LASER = 600; + +const int VEL_SPECIAL_SHOT_HEATSEEKER = 130; +const int VEL_SPECIAL_SHOT_NUKE = 180; + +const float DAMAGE_SHOT_NORMAL = 5; +const float DAMAGE_SHOT_NORMAL_HEAVY = 8; +const float DAMAGE_SHOT_DOUBLE = 5; +const float DAMAGE_SHOT_DOUBLE_HEAVY = 8; +const float DAMAGE_SHOT_TRIPLE = 7; + +const int DAMAGE_SHOT_HF_NORMAL = 20; +const int DAMAGE_SHOT_HF_DOUBLE = 20; +const int DAMAGE_SHOT_HF_TRIPLE = 20; +const int DAMAGE_SHOT_HF_QUATTRO = 20; +const int DAMAGE_SHOT_HF_QUINTO = 20; + +const float DAMAGE_SHOT_DUMBFIRE = 40; +const float DAMAGE_SHOT_DUMBFIRE_DOUBLE = 30; +const float DAMAGE_SHOT_KICK_ASS_ROCKET = 151; // should kill a tank/turret with one shot +const float DAMAGE_SHOT_HELLFIRE = 50; +const float DAMAGE_SHOT_MACHINE_GUN = 8; +const float DAMAGE_SHOT_ENERGY_BEAM = 80; + +const int DAMAGE_SHOT_HF_DUMBFIRE = 40; +const int DAMAGE_SHOT_HF_DUMBFIRE_DOUBLE = 40; +const int DAMAGE_SHOT_HF_KICK_ASS_ROCKET = 151; +const int DAMAGE_SHOT_HF_LASER = 70; + +const float DAMAGE_SPECIAL_SHOT_HEATSEEKER = 20; +const float DAMAGE_SPECIAL_SHOT_NUKE = 250; + +const int SPREAD_ANGLE_SHOT_NORMAL = 6; + +const int LIFETIME_ENEMY_SHOT_NORMAL = 6000; +const int LIFETIME_ENEMY_SHOT_TANK_ROCKET = 10000; + +const int VEL_ENEMY_SHOT_NORMAL = 130; +const int VEL_ENEMY_SHOT_TANK_ROCKET = 70; + +const float DAMAGE_ENEMY_SHOT_NORMAL = 8; +const float DAMAGE_ENEMY_SHOT_TANK_ROCKET = 25; + +/***************************** SMOKE PUFFS ***************************/ + +enum SmokePuffTypes { SMOKE_PUFF_SMALL=0, SMOKE_PUFF_MEDIUM }; +const int NR_SMOKE_PUFF_TYPES = 2; +const std::string FN_SMOKE_PUFF[ NR_SMOKE_PUFF_TYPES ] = +{ "./images/smokePuffSmall.bmp", + "./images/smokePuffMedium.bmp" }; +const int LIFETIME_SMOKE_PUFF[ NR_SMOKE_PUFF_TYPES ] = { 500, 1000 }; +const int SMOKE_PUFF_DELAY_TO_NEXT_PUFF[ NR_SMOKE_PUFF_TYPES ] = { 100, 100 }; +const float SMOKE_PUFF_VELOCITY_FACTOR = 0.3; +const bool SMOKE_PUFF_ALPHA_BLENDING = true; + +/********************************** ENEMIES ********************************/ + + +enum EnemyTypes { + FIGHTER=0, + BOMBER, + TANK, + BOSS_1_MAIN_GUN, + BOSS_1_ROCKET_LAUNCHER, + BOSS_1_SHOT_BATTERY_RIGHT, + BOSS_1_SHOT_BATTERY_LEFT, + BOSS_2}; +const int NR_ENEMY_TYPES = 8; +const int NR_ENEMY_TYPES_NORMAL = 3; +const int NR_ENEMY_TYPES_BOSS_1 = 4; + +const float BOSS_1_END_Y = 110; + +enum WreckTypes { + WRECK_FIGHTER=0, + WRECK_BOMBER, + WRECK_TANK, + WRECK_BOSS_1_MAIN_GUN, + WRECK_BOSS_1_ROCKET_LAUNCHER, + WRECK_BOSS_1_BATTERY_RIGHT, + WRECK_BOSS_1_BATTERY_LEFT, + WRECK_BOSS_1_BACKGROUND, + WRECK_BOSS_1_DESTROYED, + WRECK_BOSS_2_DESTROYED }; +const int NR_WRECK_TYPES = 10; +const WreckTypes WRECK_FOR_ENEMYTYPE[] = { + WRECK_FIGHTER, + WRECK_BOMBER, + WRECK_TANK, + WRECK_BOSS_1_MAIN_GUN, + WRECK_BOSS_1_ROCKET_LAUNCHER, + WRECK_BOSS_1_BATTERY_RIGHT, + WRECK_BOSS_1_BATTERY_LEFT, + WRECK_BOSS_2_DESTROYED }; + +extern int GENERATE_ENEMY_DELAY; +extern int GENERATE_ENEMY_RAND_DELAY; + +extern int ENEMY_HITPOINTS[]; +//const float ENEMY_HITPOINTS[] = { 80, 120, 150, 10, 10, 10, 10 }; +const bool ENEMY_FLYING[] = {true, true, false, false, false, false, false, true}; +// determines the difference between shadow and enemy plane +const int ENEMY_FLYING_HEIGHT[] = {10, 15, 0, 0, 0, 0, 0, 10}; +const int ENEMY_POINTS_FOR_DEST[] = {10,20,20,0,0,0,0,0}; + +extern int ENEMY_COLLISION_DAMAGE[]; + +// the enemys have different probabilities to appear in the different levels. +// bigger number -> greater chance +extern int ENEMY_APPEAR_CHANCES[]; + +// on average one of that many enemys carries an item +extern int ENEMY_DIES_ITEM_APPEAR_CHANCE[]; + +// minimal waittime (ms) between two shots +extern int ENEMY_COOLDOWN_PRIMARY[]; +extern int ENEMY_COOLDOWN_SECONDARY[]; +// random additional waittime between two shots +extern int ENEMY_RAND_WAIT_PRIMARY[]; +extern int ENEMY_RAND_WAIT_SECONDARY[]; + + + +/******************************** FORMATION ***************************************/ + + +enum FormationTypes { FORMATION_V=0, FORMATION_REVERSE_V, + FORMATION_BLOCK, + FORMATION_LINE }; + +const int NR_FORMATION_TYPES = 4; + +const int FORMATION_MAX_NR_ENEMYS_HARD_LIMIT[] = {7,7,7,6}; +extern int FORMATION_MAX_NR_ENEMYS[]; + +enum FormationEnemySets { FORMATION_ENEMY_SET_DEFAULT=0, + FORMATION_ENEMY_SET_FIGHTER, + FORMATION_ENEMY_SET_BOMBER, + FORMATION_ENEMY_SET_FIGHTER_BOMBER }; +const int NR_FORMATION_ENEMY_SETS = 4; + +const int FORMATION_CHANGE_ON_KILL = 1; +const int FORMATION_CHANGE_SPONTANEOUS = 2; +const int FORMATION_CHANGE_SELDOM = 4; +const int FORMATION_CHANGE_OFTEN = 8; + +const int FORMATION_CHANGE_OFTEN_DELAY = 3000; +const int FORMATION_CHANGE_OFTEN_RAND_DELAY = 8000; +const int FORMATION_CHANGE_SELDOM_DELAY = 4000; +const int FORMATION_CHANGE_SELDOM_RAND_DELAY = 15000; + + +enum FormationShotPatterns { FORMATION_SP_NONE=0, + FORMATION_SP_RAND_FAST, + FORMATION_SP_RAND_MEDIUM, + FORMATION_SP_RAND_SLOW, + + FORMATION_SP_VOLLEY_FAST, + FORMATION_SP_VOLLEY_MEDIUM, + FORMATION_SP_VOLLEY_SLOW, + + FORMATION_SP_LEFT_RIGHT_FAST, + FORMATION_SP_LEFT_RIGHT_MEDIUM, + FORMATION_SP_RIGHT_LEFT_FAST, + FORMATION_SP_RIGHT_LEFT_MEDIUM }; + +const int NR_FORMATION_SP = 11; + +extern int FORMATION_SP_CHANCES[]; +extern int FORMATION_SP_PRIMARY_DELAY[]; +extern int FORMATION_SP_PRIMARY_RAND_DELAY[]; + +extern int GENERATE_FORMATION_DELAY; +extern int GENERATE_FORMATION_RAND_DELAY; + + + +/************************* RACER *********************************/ + + +// max speed of the racer in pixels per second +const float LIGHT_FIGHTER_VEL_MAX = 90; +const float HEAVY_FIGHTER_VEL_MAX = 60; + +// shield recharge points per 100 seconds +extern int LIGHT_FIGHTER_SHIELD_RECHARGE; +extern int HEAVY_FIGHTER_SHIELD_RECHARGE; + +// Cooldown rates (in ms) of the weapons +const int RACER_COOLDOWN_SHOT_NORMAL = 100; +const int RACER_COOLDOWN_SHOT_NORMAL_HEAVY = 100; +const int RACER_COOLDOWN_SHOT_DOUBLE = 130; +const int RACER_COOLDOWN_SHOT_DOUBLE_HEAVY = 130; +const int RACER_COOLDOWN_SHOT_TRIPLE = 130; + +const int RACER_COOLDOWN_SHOT_HF_NORMAL = 300; +const int RACER_COOLDOWN_SHOT_HF_DOUBLE = 300; +const int RACER_COOLDOWN_SHOT_HF_TRIPLE = 300; +const int RACER_COOLDOWN_SHOT_HF_QUATTRO = 350; +const int RACER_COOLDOWN_SHOT_HF_QUINTO = 400; + +const int RACER_COOLDOWN_DUMBFIRE = 600; +const int RACER_COOLDOWN_DUMBFIRE_DOUBLE = 300; +const int RACER_COOLDOWN_KICK_ASS_ROCKET = 1500; +const int RACER_COOLDOWN_HELLFIRE = 600; +const int RACER_COOLDOWN_MACHINE_GUN = 150; +const int RACER_COOLDOWN_ENERGY_BEAM = 500; + +const int RACER_COOLDOWN_HF_DUMBFIRE = 600; +const int RACER_COOLDOWN_HF_DUMBFIRE_DOUBLE = 300; +const int RACER_COOLDOWN_HF_KICK_ASS_ROCKET = 1300; +const int RACER_COOLDOWN_HF_LASER = 700; + +const int RACER_COOLDOWN_SPECIAL_HEATSEEKER = 400; +const int RACER_COOLDOWN_SPECIAL_NUKE = 3000; + +extern int RACER_DEFLECTOR_ACTIVATION_DIST; +extern int RACER_DEFLECTOR_POWER; +extern int RACER_SONIC_ACTIVATION_DIST; +extern int RACER_SONIC_POWER; + +// how long (in ms) does the shield glow, when the racer is hit +const int RACER_SHIELD_DAMAGE_LIFETIME = 200; + +// shields +extern int LIGHT_FIGHTER_MAX_SHIELD; +extern int HEAVY_FIGHTER_MAX_SHIELD; +// hitpoints +extern int LIGHT_FIGHTER_MAX_DAMAGE; +extern int HEAVY_FIGHTER_MAX_DAMAGE; + +const std::string FN_SOUND_SHOT_PRIMARY = "./sound/shotPrimary.wav"; +const std::string FN_SOUND_SHOT_SECONDARY = "./sound/shotSecondary.wav"; +const std::string FN_SOUND_EXPLOSION_NORMAL = "./sound/explosion.wav"; +const std::string FN_SOUND_EXPLOSION_BOSS = "./sound/explosionBoss.wav"; +const std::string FN_SOUND_BOSS_ALARM = "./sound/alarm.wav"; +const std::string FN_SOUND_ARCADE_CONFIRM = "./sound/alarm.wav"; +const std::string FN_SOUND_ARCADE_CHOOSE = "./sound/choose.wav"; +const std::string FN_SOUND_INTRO_CONFIRM = "./sound/confirm.wav"; +const std::string FN_SOUND_INTRO_CHOOSE = "./sound/choose.wav"; + +const std::string FN_ENEMY_FIGHTER = "./images/fighter.bmp"; +const std::string FN_ENEMY_FIGHTER_SHADOW = "./images/fighterShadow.bmp"; +const std::string FN_ENEMY_BOMBER = "./images/bomber.bmp"; +const std::string FN_ENEMY_BOMBER_SHADOW = "./images/bomberShadow.bmp"; +const std::string FN_ENEMY_TANK = "./images/tank.bmp"; +const std::string FN_ENEMY_BOSS_1_MAIN_GUN = "./images/boss1MainGun.bmp"; +const std::string FN_ENEMY_BOSS_1_ROCKET_LAUNCHER = "./images/boss1RocketLauncher.bmp"; +const std::string FN_ENEMY_BOSS_1_SHOT_BATTERY_LEFT = "./images/boss1ShotBatteryLeft.bmp"; +const std::string FN_ENEMY_BOSS_1_SHOT_BATTERY_RIGHT = "./images/boss1ShotBatteryRight.bmp"; +const std::string FN_ENEMY_BOSS_2 = "./images/boss2.bmp"; +const std::string FN_ENEMY_BOSS_2_SHADOW = "./images/boss2Shadow.bmp"; + +const std::string FN_WRECK_FIGHTER = "./images/wreckFighter.bmp"; +const std::string FN_WRECK_BOMBER = "./images/wreckBomber.bmp"; +const std::string FN_WRECK_TANK = "./images/wreckTank.bmp"; +const std::string FN_WRECK_BOSS_1 = "./images/wreckBoss1.bmp"; +const std::string FN_WRECK_BOSS_1_BACKGROUND = "./images/wreckBossBackground.bmp"; +const std::string FN_WRECK_BOSS_1_DESTROYED = "./images/boss.bmp"; +const std::string FN_WRECK_BOSS_2_DESTROYED = "./images/wreckBoss2.bmp"; + +const std::string FN_SHOT_NORMAL = "./images/normalShot.bmp"; +const std::string FN_SHOT_NORMAL_HEAVY = "./images/heavyShot.bmp"; +const std::string FN_SHOT_DOUBLE = "./images/normalShot.bmp"; +const std::string FN_SHOT_DOUBLE_HEAVY = "./images/heavyShot.bmp"; +const std::string FN_SHOT_TRIPLE = "./images/heavyShot.bmp"; + +const std::string FN_SHOT_HF_NORMAL = "./images/normalShotHF.bmp"; +const std::string FN_SHOT_HF_DOUBLE = "./images/normalShotHF.bmp"; +const std::string FN_SHOT_HF_TRIPLE = "./images/normalShotHF.bmp"; +const std::string FN_SHOT_HF_QUATTRO = "./images/normalShotHF.bmp"; +const std::string FN_SHOT_HF_QUINTO = "./images/normalShotHF.bmp"; + +const std::string FN_SHOT_DUMBFIRE = "./images/dumbfire.bmp"; +const std::string FN_SHOT_DUMBFIRE_DOUBLE = "./images/dumbfire.bmp"; +const std::string FN_SHOT_KICK_ASS_ROCKET = "./images/kickAssRocket.bmp"; +const std::string FN_SHOT_KICK_ASS_ROCKET_SHADOW = "./images/kickAssRocketShadow.bmp"; +const std::string FN_SHOT_HELLFIRE = "./images/hellfire.bmp"; +const std::string FN_SHOT_HELLFIRE_SHADOW = "./images/hellfireShadow.bmp"; +const std::string FN_SHOT_MACHINE_GUN = "./images/machineGun.bmp"; +const std::string FN_SHOT_ENERGY_BEAM = "./images/energyBeam.bmp"; + +const std::string FN_SHOT_HF_DUMBFIRE = "./images/dumbfire.bmp"; +const std::string FN_SHOT_HF_DUMBFIRE_DOUBLE = "./images/dumbfire.bmp"; +const std::string FN_SHOT_HF_KICK_ASS_ROCKET = "./images/kickAssRocket.bmp"; +const std::string FN_SHOT_HF_KICK_ASS_ROCKET_SHADOW = "./images/kickAssRocketShadow.bmp"; +const std::string FN_SHOT_HF_LASER = "./images/laser.bmp"; + +const std::string FN_ENEMY_SHOT_NORMAL = "./images/enemyShotNormal.bmp"; +const std::string FN_ENEMY_SHOT_TANK_ROCKET = "./images/tankRocket.bmp"; +const std::string FN_ENEMY_SHOT_TANK_ROCKET_SHADOW = "./images/tankRocketShadow.bmp"; + +const std::string FN_SPECIAL_SHOT_HEATSEEKER = "./images/heatseeker.bmp"; +const std::string FN_SPECIAL_SHOT_NUKE = "./images/shotNuke.bmp"; +const std::string FN_SPECIAL_SHOT_NUKE_SHADOW = "./images/shotNukeShadow.bmp"; +const std::string FN_NUKE_EFFECT = "./images/nukeEffect.bmp"; +const std::string FN_SONIC_EFFECT = "./images/sonic.bmp"; + +const std::string FN_ITEM_PRIMARY_UPGRADE = "./images/itemPrimaryUpgrade.bmp"; +const std::string FN_ITEM_DUMBFIRE_DOUBLE = "./images/itemDumbfireDouble.bmp"; +const std::string FN_ITEM_KICK_ASS_ROCKET = "./images/itemKickAssRocket.bmp"; +const std::string FN_ITEM_HELLFIRE = "./images/itemHellfire.bmp"; +const std::string FN_ITEM_MACHINE_GUN = "./images/itemMachineGun.bmp"; +const std::string FN_ITEM_HEALTH = "./images/itemHealth.bmp"; +const std::string FN_ITEM_HEATSEEKER = "./images/itemHeatseeker.bmp"; +const std::string FN_ITEM_NUKE = "./images/itemNuke.bmp"; +const std::string FN_ITEM_DEFLECTOR = "./images/itemDeflector.bmp"; +const std::string FN_ITEM_ENERGY_BEAM = "./images/itemEnergyBeam.bmp"; +const std::string FN_ITEM_LASER = "./images/itemLaser.bmp"; + +const std::string FN_ALIENBLASTER_INTRO = "./images/alienblasterintro.bmp"; +const std::string FN_ALIENBLASTER_ICON = "./images/alienblastericon.bmp"; +const std::string FN_BACKGROUND = "./images/background.bmp"; +const std::string FN_PAUSED = "./images/paused.bmp"; +const std::string FN_YOU_LOSE = "./images/youLose.bmp"; +const std::string FN_YOU_WIN = "./images/youWin.bmp"; +const std::string FN_GAME_OVER = "./images/gameOver.bmp"; +const std::string FN_ARCADE_LOGO = "./images/arcadeLogo.bmp"; + +// numbers of images (animation-frames) per racer +const int RACER_IMAGE_CNT = 9; + +const std::string FN_LIGHT_FIGHTER_1 = "./images/lightFighter1.bmp"; +const std::string FN_LIGHT_FIGHTER_2 = "./images/lightFighter2.bmp"; +const std::string FN_LIGHT_FIGHTER_SHADOW = "./images/lightFighterShadow.bmp"; +const std::string FN_LIGHT_FIGHTER_SHIELD_DAMAGED = "./images/lightFighterShieldDamaged.bmp"; +const std::string FN_LIGHT_FIGHTER_1_ICON = "./images/lightFighter1Icon.bmp"; +const std::string FN_LIGHT_FIGHTER_2_ICON = "./images/lightFighter2Icon.bmp"; +const std::string FN_LIGHT_FIGHTER_1_SMALL = "./images/lightFighter1Small.bmp"; +const std::string FN_LIGHT_FIGHTER_2_SMALL = "./images/lightFighter2Small.bmp"; + +const std::string FN_HEAVY_FIGHTER_1 = "./images/heavyFighter1.bmp"; +const std::string FN_HEAVY_FIGHTER_2 = "./images/heavyFighter2.bmp"; +const std::string FN_HEAVY_FIGHTER_SHADOW = "./images/heavyFighterShadow.bmp"; +const std::string FN_HEAVY_FIGHTER_SHIELD_DAMAGED = "./images/heavyFighterShieldDamaged.bmp"; +const std::string FN_HEAVY_FIGHTER_DEFLECTOR = "./images/heavyFighterDeflector.bmp"; +const std::string FN_HEAVY_FIGHTER_1_ICON = "./images/heavyFighter1Icon.bmp"; +const std::string FN_HEAVY_FIGHTER_2_ICON = "./images/heavyFighter2Icon.bmp"; +const std::string FN_HEAVY_FIGHTER_1_SMALL = "./images/heavyFighter1Small.bmp"; +const std::string FN_HEAVY_FIGHTER_2_SMALL = "./images/heavyFighter2Small.bmp"; + +const std::string FN_ICONS_SPECIALS = "./images/iconsSpecials.bmp"; +const std::string FN_ICONS_SECONDARY_WEAPONS = "./images/iconsSecondaryWeapons.bmp"; + +const std::string FN_HITPOINTS_STAT = "./images/hpStat.bmp"; + +const std::string FN_INTRO_SHOW_CHOICE = "./images/menuIcon.bmp"; + +const std::string FN_FONT_PATH = "./images/"; +const std::string FN_FONT_SUFFIX_SURFACE = ".bmp"; +const std::string FN_FONT_INTRO = "./images/font-20white.bmp"; +const std::string FN_FONT_INTRO_HIGHLIGHTED = "./images/font-20lightblue.bmp"; +const std::string FN_FONT_NUMBERS_TIME = "./images/font-20red.bmp"; +const std::string FN_FONT_NUMBERS_LEFT = "./images/font-20red.bmp"; +const std::string FN_FONT_NUMBERS_RIGHT = "./images/font-20blue.bmp"; +const std::string FN_FONT_SETTINGS = "./images/font-20white.bmp"; +const std::string FN_FONT_SETTINGS_HIGHLIGHTED = "./images/font-20lightblue.bmp"; +const std::string FN_FONT_SETTINGS_SMALL = "./images/font-14white.bmp"; +const std::string FN_FONT_SETTINGS_SMALL_BLUE = "./images/font-14lightblue.bmp"; +const std::string FN_FONT_SETTINGS_SMALL_HIGHLIGHTED = "./images/font-14red.bmp"; + +const std::string FN_SETTINGS_BLUE = "./images/bluePlain.bmp"; +const std::string FN_SETTINGS_WHITE = "./images/whitePlain.bmp"; + +const std::string FN_EXPLOSION_NORMAL = "./images/explosion.bmp"; +const std::string FN_EXPLOSION_ENEMY = "./images/explosionEnemy.bmp"; + +const std::string FN_LOADING = "./images/loading.bmp"; + +const std::string FN_SETTINGS = "./cfg/alienBlaster.cfg"; + +const std::string FN_DIFFICULTY_CONFIG = "./cfg/alienBlasterDifficulty"; +const std::string FN_DIFFICULTY_CONFIG_SUFFIX = ".cfg"; + +const std::string FN_HIGHSCORE = "./cfg/highscore.dat"; + +enum MusicTracks { MUSIC_INTRO=0, MUSIC_PLAYON, MUSIC_BOSS1, MUSIC_NONE }; +const int NR_MUSIC_TRACKS = 3; +const std::string FN_MUSIC[] = { "./sound/intro.wav", + "./sound/playon.wav", + "./sound/intro.wav" }; + +const std::string FN_LEVEL_ONE_PLAYER = "./cfg/level1.cfg"; +const std::string FN_LEVEL_TWO_PLAYER = "./cfg/level2.cfg"; +const std::string FN_LEVEL_ARCADEMODE = "./cfg/levelArcade.cfg"; + +const std::string FN_SCREENSHOT0 = "./intro/HellShot0.bmp"; +const std::string FN_SCREENSHOT1 = "./intro/HellShot1.bmp"; +const std::string FN_SCREENSHOT2 = "./intro/HellShot2.bmp"; +const std::string FN_SCREENSHOT3 = "./intro/HellShot3.bmp"; +const std::string FN_SCREENSHOT4 = "./intro/HellShot5.bmp"; +const std::string FN_SCREENSHOT5 = "./intro/HellShot4.bmp"; +const std::string FN_SCREENSHOT6 = "./intro/HellShot6.bmp"; +const std::string FN_SCREENSHOT7 = "./intro/HellShot7.bmp"; +const std::string FN_SCREENSHOT8 = "./intro/HellShot8.bmp"; +const std::string FN_SCREENSHOT9 = "./intro/HellShot9.bmp"; + +const std::string LVL_BACKG_TILE_CNT = "BACKG_TILES"; +const std::string LVL_BACKG_TILE = "BACKG_TILE"; +const std::string LVL_BACKG_LENGTH = "BACKG_LENGTH"; + +const std::string LVL_ENEMY_FIGHTER = "ENEMY_FIGHTER"; +const std::string LVL_ENEMY_BOMBER = "ENEMY_BOMBER"; +const std::string LVL_ENEMY_TANK = "ENEMY_TANK"; +const std::string LVL_ENEMY_BOSS_BACKGROUND = "ENEMY_BOSS_BACKGROUND"; +const std::string LVL_ENEMY_BOSS_DESTROYED = "ENEMY_BOSS_DESTROYED"; + +const std::string LVL_WRECK_FIGHTER = "WRECK_FIGHTER"; +const std::string LVL_WRECK_BOMBER = "WRECK_BOMBER"; +const std::string LVL_WRECK_TANK = "WRECK_TANK"; +const std::string LVL_WRECK_BOSS_BACKGROUND = "WRECK_BOSS_BACKGROUND"; +const std::string LVL_WRECK_BOSS_DESTROYED = "WRECK_BOSS_DESTROYED"; + +const std::string LVL_ENEMY_BOSS_1_SHOT_BATTERY_RIGHT = "ENEMY_BOSS_1_SHOT_BATTERY_RIGHT"; +const std::string LVL_ENEMY_BOSS_1_SHOT_BATTERY_LEFT = "ENEMY_BOSS_1_SHOT_BATTERY_LEFT"; +const std::string LVL_ENEMY_BOSS_1_ROCKET_LAUNCHER = "ENEMY_BOSS_1_ROCKET_LAUNCHER"; +const std::string LVL_ENEMY_BOSS_1_MAIN_GUN = "ENEMY_BOSS_1_MAIN_GUN"; + +const std::string LVL_ENEMY_FIGHTER_SHADOW = "ENEMY_FIGHTER_SHADOW"; +const std::string LVL_ENEMY_BOMBER_SHADOW = "ENEMY_BOMBER_SHADOW"; + +#endif diff --git a/alienblaster/project/jni/alienblaster/src/gpl.txt b/alienblaster/project/jni/alienblaster/src/gpl.txt new file mode 100644 index 000000000..5b6e7c66c --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/gpl.txt @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/alienblaster/project/jni/alienblaster/src/infoscreen.cc b/alienblaster/project/jni/alienblaster/src/infoscreen.cc new file mode 100644 index 000000000..d37e6bf3b --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/infoscreen.cc @@ -0,0 +1,389 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +using namespace std; + +#include "infoscreen.h" +#include "global.h" +#include "surfaceDB.h" +#include "mixer.h" +#include "video.h" +#include "font.h" +#include "items.h" +#include "item.h" + +Items *infoscreenItems; + +Infoscreen::Infoscreen( SDL_Surface *scr ) { + screen = scr; + font = new Font( FN_FONT_INTRO ); + fontHighlighted = new Font( FN_FONT_INTRO_HIGHLIGHTED ); + activeChoiceSprite = surfaceDB.loadSurface( FN_INTRO_SHOW_CHOICE ); + lightFighterIcon1 = surfaceDB.loadSurface( FN_LIGHT_FIGHTER_1_ICON ); + lightFighterIcon2 = surfaceDB.loadSurface( FN_LIGHT_FIGHTER_2_ICON ); + heavyFighterIcon1 = surfaceDB.loadSurface( FN_HEAVY_FIGHTER_1_ICON ); + heavyFighterIcon2 = surfaceDB.loadSurface( FN_HEAVY_FIGHTER_2_ICON ); + choose = mixer.loadSample( FN_SOUND_INTRO_CHOOSE, 100 ); + confirm = mixer.loadSample( FN_SOUND_INTRO_CONFIRM, 100 ); + if (infoscreenItems) delete infoscreenItems; + infoscreenItems = new Items(); + activeChoice = 0; +} + +Infoscreen::~Infoscreen() { + if (infoscreenItems) delete infoscreenItems; +} + +void Infoscreen::run() { + draw(); + quitInfoscreen = false; + activeChoice = 0; + while ( !quitInfoscreen ) { + handleEvents(); + draw(); + SDL_Delay( 50 ); + } +} + +void Infoscreen::putBitmapAtPosition( int x, int y, SDL_Surface* bitmap ) { + SDL_Rect d; + d.x = x - bitmap->w / 2; + d.y = y - bitmap->h / 2; + d.w = bitmap->w; + d.h = bitmap->h; + SDL_BlitSurface( bitmap, 0, screen, &d ); +} + +void Infoscreen::draw() { + // clear the screen + videoserver->clearScreen(); + // draw vertical green line + SDL_Rect r; + r.x = 250; + r.y = 0; + r.w = 1; + r.h = screen->h; + SDL_FillRect(screen, &r, SDL_MapRGB(screen->format, 0, 255, 0) ); + + for ( int i = 0; i < NR_INFOSCREEN_CHOICES; i++ ) { + int ypos = 30 + i * 25; + if ( i == INFO_CREDITS ) ypos += 15; + if ( i == INFO_BACK_TO_MAIN_MENU ) ypos += 30; + if( activeChoice == i ) { + putBitmapAtPosition( 15, ypos + 8, activeChoiceSprite ); + fontHighlighted->drawStr( screen, 30, ypos, SET_INFOSCREEN_CHOICES[ i ] ); + } else { + font->drawStr( screen, 30, ypos, SET_INFOSCREEN_CHOICES[ i ] ); + } + } + switch ( activeChoice ) { + case INFO_LIGHT_FIGHTER: + { + putBitmapAtPosition( 386, 50, lightFighterIcon1 ); + putBitmapAtPosition( 502, 50, lightFighterIcon2 ); + font->drawStr( screen, 270, 100, "The Light Fighter is more"); + font->drawStr( screen, 270, 130, "vulnerable but smaller and"); + font->drawStr( screen, 270, 160, "faster than the Heavy Fighter."); + font->drawStr( screen, 270, 200, "Possible Updates:"); + newItem = new Item( Vector2D ( 270, 240 ) , Vector2D(0,0), ITEM_PRIMARY_UPGRADE ); + infoscreenItems->addItem( newItem ); + font->drawStr( screen, 300, 230, "Primary Weapon Upgrade"); + newItem = new Item( Vector2D ( 270, 270 ) , Vector2D(0,0), ITEM_MACHINE_GUN ); + infoscreenItems->addItem( newItem ); + font->drawStr( screen, 300, 260, "Machinegun"); + newItem = new Item( Vector2D ( 270, 300 ) , Vector2D(0,0), ITEM_DUMBFIRE_DOUBLE ); + infoscreenItems->addItem( newItem ); + font->drawStr( screen, 300, 290, "Double Dumbfire"); + newItem = new Item( Vector2D ( 270, 330 ) , Vector2D(0,0), ITEM_KICK_ASS_ROCKET ); + infoscreenItems->addItem( newItem ); + font->drawStr( screen, 300, 320, "Kick-Ass Rocket"); + newItem = new Item( Vector2D ( 270, 360 ) , Vector2D(0,0), ITEM_HELLFIRE ); + infoscreenItems->addItem( newItem ); + font->drawStr( screen, 300, 350, "Hellfire Rocket"); + newItem = new Item( Vector2D ( 270, 390 ) , Vector2D(0,0), ITEM_HEATSEEKER ); + infoscreenItems->addItem( newItem ); + font->drawStr( screen, 300, 380, "Heatseeker"); + newItem = new Item( Vector2D ( 270, 420 ) , Vector2D(0,0), ITEM_NUKE ); + infoscreenItems->addItem( newItem ); + font->drawStr( screen, 300, 410, "The Great Nuke"); + newItem = new Item( Vector2D ( 270, 450 ) , Vector2D(0,0), ITEM_ENERGY_BEAM ); + infoscreenItems->addItem( newItem ); + font->drawStr( screen, 300, 440, "Energy Beam"); + infoscreenItems->draw( screen ); + break; + } + case INFO_HEAVY_FIGHTER: + { + putBitmapAtPosition( 386, 50, heavyFighterIcon1 ); + putBitmapAtPosition( 502, 50, heavyFighterIcon2 ); + font->drawStr( screen, 270, 100, "The Heavy Fighter has superior"); + font->drawStr( screen, 270, 130, "firepower and an energyweapon"); + font->drawStr( screen, 270, 160, "deflector. He lacks agility."); + font->drawStr( screen, 270, 200, "Possible Updates:"); + newItem = new Item( Vector2D ( 270, 240 ) , Vector2D(0,0), ITEM_PRIMARY_UPGRADE ); + infoscreenItems->addItem( newItem ); + font->drawStr( screen, 300, 230, "Primary Weapon Upgrade"); + newItem = new Item( Vector2D ( 270, 270 ) , Vector2D(0,0), ITEM_KICK_ASS_ROCKET ); + infoscreenItems->addItem( newItem ); + font->drawStr( screen, 300, 260, "Kick-Ass Rocket"); + newItem = new Item( Vector2D ( 270, 300 ) , Vector2D(0,0), ITEM_HEATSEEKER ); + infoscreenItems->addItem( newItem ); + font->drawStr( screen, 300, 290, "Heatseeker"); + newItem = new Item( Vector2D ( 270, 330 ) , Vector2D(0,0), ITEM_NUKE ); + infoscreenItems->addItem( newItem ); + font->drawStr( screen, 300, 320, "The Great Nuke"); + newItem = new Item( Vector2D ( 270, 360 ) , Vector2D(0,0), ITEM_DEFLECTOR ); + infoscreenItems->addItem( newItem ); + font->drawStr( screen, 300, 350, "Energyweapon Deflector"); + newItem = new Item( Vector2D ( 270, 390 ) , Vector2D(0,0), ITEM_LASER ); + infoscreenItems->addItem( newItem ); + font->drawStr( screen, 300, 380, "Heavy Laser"); + infoscreenItems->draw( screen ); + break; + } + case INFO_PRIMARY_WEAPON: + { + newItem = new Item( Vector2D ( 270, 50 ) , Vector2D(0,0), ITEM_PRIMARY_UPGRADE ); + infoscreenItems->addItem( newItem ); + font->drawStr( screen, 300, 40, "Primary Weapon Upgrade"); + font->drawStr( screen, 270, 100, "The Primary Weapon Upgrade can"); + font->drawStr( screen, 270, 130, "be used multiple times and each"); + font->drawStr( screen, 270, 160, "time the primary weapon will"); + font->drawStr( screen, 270, 190, "gain one extra shot or improve"); + font->drawStr( screen, 270, 220, "its damage. The maximum for the"); + font->drawStr( screen, 270, 250, "light fighter are three heavy"); + font->drawStr( screen, 270, 280, "shots and for the heavy figher"); + font->drawStr( screen, 270, 310, "five shots."); + infoscreenItems->draw( screen ); + break; + } + case INFO_MACHINE_GUN: + { + newItem = new Item( Vector2D ( 270, 50 ) , Vector2D(0,0), ITEM_MACHINE_GUN ); + infoscreenItems->addItem( newItem ); + font->drawStr( screen, 300, 40, "Machine Gun"); + font->drawStr( screen, 270, 100, "The Machine Gun fires a"); + font->drawStr( screen, 270, 130, "massive amount of steel per"); + font->drawStr( screen, 270, 160, "minute at the enemy on the"); + font->drawStr( screen, 270, 190, "ground and in the air."); + font->drawStr( screen, 270, 220, "It has the ability to aim in a"); + font->drawStr( screen, 270, 250, "small angle at nearby enemys."); + font->drawStr( screen, 270, 280, "This makes it useful to"); + font->drawStr( screen, 270, 310, "attack formations from the"); + font->drawStr( screen, 270, 340, "side."); + infoscreenItems->draw( screen ); + break; + } + case INFO_DUMBFIRE_DOUBLE: + { + newItem = new Item( Vector2D ( 270, 50 ) , Vector2D(0,0), ITEM_DUMBFIRE_DOUBLE ); + infoscreenItems->addItem( newItem ); + font->drawStr( screen, 300, 40, "Double Dumbfire Rocket"); + font->drawStr( screen, 270, 100, "With this upgrade, you get one"); + font->drawStr( screen, 270, 130, "extra dumbfire missile for the"); + font->drawStr( screen, 270, 160, "light fighter. These rockets"); + font->drawStr( screen, 270, 190, "hit targets on the ground and"); + font->drawStr( screen, 270, 220, "in the air."); + infoscreenItems->draw( screen ); + break; + } + case INFO_KICK_ASS_ROCKET: + { + newItem = new Item( Vector2D ( 270, 50 ) , Vector2D(0,0), ITEM_KICK_ASS_ROCKET ); + infoscreenItems->addItem( newItem ); + font->drawStr( screen, 300, 40, "Kick-Ass Rocket"); + font->drawStr( screen, 270, 100, "This is the strongest air to"); + font->drawStr( screen, 270, 130, "ground rocket. It takes only"); + font->drawStr( screen, 270, 160, "one shot to let a turret"); + font->drawStr( screen, 270, 190, "explode but reloading takes"); + font->drawStr( screen, 270, 220, "longer."); + infoscreenItems->draw( screen ); + break; + } + case INFO_HELLFIRE: + { + newItem = new Item( Vector2D ( 270, 50 ) , Vector2D(0,0), ITEM_HELLFIRE ); + infoscreenItems->addItem( newItem ); + font->drawStr( screen, 300, 40, "Hellfire Rocket"); + font->drawStr( screen, 270, 100, "Medium air to ground missiles"); + font->drawStr( screen, 270, 130, "that are fired in pairs and"); + font->drawStr( screen, 270, 160, "look much better than the"); + font->drawStr( screen, 270, 190, "fat clumsy Kick-Ass-Rocket."); + infoscreenItems->draw( screen ); + break; + } + // heatseaker (für Paul :-) + case INFO_HEATSEEKER: + { + newItem = new Item( Vector2D ( 270, 50 ) , Vector2D(0,0), ITEM_HEATSEEKER ); + infoscreenItems->addItem( newItem ); + font->drawStr( screen, 300, 40, "Heatseaker Rocket"); + font->drawStr( screen, 270, 100, "Just hit the trigger and this"); + font->drawStr( screen, 270, 130, "missile will find the enemy"); + font->drawStr( screen, 270, 160, "itself. Ground targets as well"); + font->drawStr( screen, 270, 190, "as air targets will be hit."); + font->drawStr( screen, 270, 220, "Each item gives 70 of these."); + infoscreenItems->draw( screen ); + break; + } + case INFO_NUKE: + { + newItem = new Item( Vector2D ( 270, 50 ) , Vector2D(0,0), ITEM_NUKE ); + infoscreenItems->addItem( newItem ); + font->drawStr( screen, 300, 40, "The Great Nuke"); + font->drawStr( screen, 270, 100, "Not much is known about this"); + font->drawStr( screen, 270, 130, "weapon because everyone who"); + font->drawStr( screen, 270, 160, "saw it exploding was dead in"); + font->drawStr( screen, 270, 190, "just that moment."); + infoscreenItems->draw( screen ); + break; + } + case INFO_DEFLECTOR: + { + newItem = new Item( Vector2D ( 270, 50 ) , Vector2D(0,0), ITEM_DEFLECTOR ); + infoscreenItems->addItem( newItem ); + font->drawStr( screen, 300, 40, "Energyweapon Deflector"); + font->drawStr( screen, 270, 100, "This is a very useful"); + font->drawStr( screen, 270, 130, "equipment for the heavy"); + font->drawStr( screen, 270, 160, "fighter. It amplifies the"); + font->drawStr( screen, 270, 190, "builtin deflector, so that"); + font->drawStr( screen, 270, 220, "it is very hard to be hit"); + font->drawStr( screen, 270, 250, "by an energy weapon."); + infoscreenItems->draw( screen ); + break; + } + case INFO_ENERGY_BEAM: + { + newItem = new Item( Vector2D ( 270, 50 ) , Vector2D(0,0), ITEM_ENERGY_BEAM ); + infoscreenItems->addItem( newItem ); + font->drawStr( screen, 300, 40, "Energy Beam"); + font->drawStr( screen, 270, 100, "The Energy Beam was built"); + font->drawStr( screen, 270, 130, "for the light fighter and"); + font->drawStr( screen, 270, 160, "its devastating power"); + font->drawStr( screen, 270, 190, "makes it the best choice"); + font->drawStr( screen, 270, 220, "against air targets. In"); + font->drawStr( screen, 270, 250, "addition its really hard"); + font->drawStr( screen, 270, 280, "to evade this weapon."); + infoscreenItems->draw( screen ); + break; + } + case INFO_LASER: + { + newItem = new Item( Vector2D ( 270, 50 ) , Vector2D(0,0), ITEM_LASER ); + infoscreenItems->addItem( newItem ); + font->drawStr( screen, 300, 40, "Heavy Laser"); + font->drawStr( screen, 270, 100, "This is the newest type"); + font->drawStr( screen, 270, 130, "of equipment for the heavy"); + font->drawStr( screen, 270, 160, "fighter. A skilled pilot"); + font->drawStr( screen, 270, 190, "can take down two air"); + font->drawStr( screen, 270, 220, "enemies at once with this"); + font->drawStr( screen, 270, 250, "heavy laser."); + infoscreenItems->draw( screen ); + break; + } + case INFO_SHIELD_UP: + { + newItem = new Item( Vector2D ( 270, 50 ) , Vector2D(0,0), ITEM_HEALTH ); + infoscreenItems->addItem( newItem ); + font->drawStr( screen, 300, 40, "Health Powerup"); + font->drawStr( screen, 270, 100, "If your shield goes down"); + font->drawStr( screen, 270, 130, "this powerup is especially"); + font->drawStr( screen, 270, 160, "useful for instant repairs."); + font->drawStr( screen, 270, 190, "Try to get it as often as"); + font->drawStr( screen, 270, 220, "you can."); + infoscreenItems->draw( screen ); + break; + } + case INFO_CREDITS: + { + font->drawStr( screen, 445, 40, "Alien Blaster", FONT_ALIGN_CENTERED ); + font->drawStr( screen, 270, 100, "Programming:"); + font->drawStr( screen, 280, 130, "Arne Hormann, Daniel Kühn,"); + font->drawStr( screen, 280, 160, "Paul Grathwohl, Sönke Schwardt"); + font->drawStr( screen, 270, 210, "Art Work: Arne Hormann", FONT_MONOSPACE); + font->drawStr( screen, 270, 240, "Music: Paul Grathwohl", FONT_MONOSPACE); + font->drawStr( screen, 620, 440, "Contact: AlienBlaster@gmx.de", FONT_ALIGN_RIGHT); + break; + } + case INFO_BACK_TO_MAIN_MENU: + { + font->drawStr( screen, 445, 220, "GO AND FIGHT !", FONT_ALIGN_CENTERED ); + break; + } + } + SDL_Flip( screen ); +} + +void Infoscreen::handleEvents() { + SDL_Event event; + + while ( SDL_PollEvent(&event) ) { + switch(event.type) { + case SDL_KEYDOWN: { + switch ( event.key.keysym.sym ) { + case SDLK_F5: { + videoserver->toggleFullscreen(); + break; + } + case SDLK_F7: { + if ( playMusicOn ) { + playMusicOn = false; + mixer.stopMusic(); + } else { + playMusicOn = true; + mixer.playMusic( MUSIC_INTRO, -1, 1000 ); + } + break; + } + case SDLK_UP: { + mixer.playSample( choose, 0 ); + infoscreenItems->deleteAllItems(); + activeChoice--; + if ( activeChoice < 0 ) activeChoice = NR_INFOSCREEN_CHOICES - 1; + break; + } + case SDLK_DOWN: { + mixer.playSample( choose, 0 ); + infoscreenItems->deleteAllItems(); + activeChoice = (activeChoice + 1) % NR_INFOSCREEN_CHOICES; + break; + } + case SDLK_ESCAPE: { + quitInfoscreen = true; + break; + } + case SDLK_RETURN: { + mixer.playSample( confirm, 0 ); + switch (activeChoice) { + case INFO_BACK_TO_MAIN_MENU: { + quitInfoscreen = true; + break; + } + } + break; + } + default: break; + } + break; + } + default: break; + } + } +} + diff --git a/alienblaster/project/jni/alienblaster/src/infoscreen.h b/alienblaster/project/jni/alienblaster/src/infoscreen.h new file mode 100644 index 000000000..91c7825da --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/infoscreen.h @@ -0,0 +1,96 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +#ifndef INFOSCREEN_H +#define INFOSCREEN_H + +#include "SDL.h" +#include +#include "item.h" + +class Font; +class Items; + +enum INFOSCREEN_CHOICES { + INFO_LIGHT_FIGHTER, + INFO_HEAVY_FIGHTER, + INFO_PRIMARY_WEAPON, + INFO_MACHINE_GUN, + INFO_DUMBFIRE_DOUBLE, + INFO_KICK_ASS_ROCKET, + INFO_HELLFIRE, + INFO_HEATSEEKER, + INFO_NUKE, + INFO_DEFLECTOR, + INFO_ENERGY_BEAM, + INFO_LASER, + INFO_SHIELD_UP, + INFO_CREDITS, + INFO_BACK_TO_MAIN_MENU +}; +const std::string SET_INFOSCREEN_CHOICES[] = { + "Light Fighter", + "Heavy Fighter", + "Primary Weapon", + "Machine Gun", + "Double Dumbfire", + "Kick-Ass Rocket", + "Hellfire Rocket", + "Heatseaker Rocket", + "The Great Nuke", + "Deflector", + "Energy Beam", + "Heavy Laser", + "Health Powerup", + "Credits", + "Back To Main Menu" +}; + +const int NR_INFOSCREEN_CHOICES = 15; + +class Infoscreen { + private: + SDL_Surface *screen; + SDL_Surface *activeChoiceSprite; + SDL_Surface *lightFighterIcon1; + SDL_Surface *lightFighterIcon2; + SDL_Surface *heavyFighterIcon1; + SDL_Surface *heavyFighterIcon2; + Font *font; + Font *fontHighlighted; + Item *newItem; + + int activeChoice; + bool quitInfoscreen; + + // sounds + int choose, confirm; + + public: + Infoscreen( SDL_Surface *scr ); + ~Infoscreen(); + void run(); + + private: + void handleEvents(); + void draw(); + void putBitmapAtPosition( int x, int y, SDL_Surface* bitmap ); +}; + +#endif diff --git a/alienblaster/project/jni/alienblaster/src/input.cc b/alienblaster/project/jni/alienblaster/src/input.cc new file mode 100644 index 000000000..fe0e97ee4 --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/input.cc @@ -0,0 +1,112 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +using namespace std; + +#include +#include "input.h" +#include "SDL.h" + +Input input; + +const int initialSensitivity = 4096; + +Input::Input(){ + joystick = 0; + getJoystick(); +} + +Input::~Input(){ + freeJoystick(); + joystick = 0; +} + +void Input::getJoystick() { + if (joystick) return; + if (!SDL_InitSubSystem(SDL_INIT_JOYSTICK)) { + SDL_JoystickEventState(SDL_ENABLE); + if (SDL_NumJoysticks() > 0) { + joystick = SDL_JoystickOpen(0); + } else { + freeJoystick(); + } + } +} + +void Input::freeJoystick() { + if (joystick) { + SDL_JoystickClose(joystick); + joystick = 0; + } + SDL_QuitSubSystem(SDL_INIT_JOYSTICK); +} + +#ifdef DEBUG +const bool pressed(const SDL_Event& event) { + if (event.type == SDL_JOYBUTTONDOWN || event.type == SDL_KEYDOWN) return true; + if (event.type == SDL_JOYAXISMOTION) return event.jaxis.value / 3200; + return false; +} + +void debugEvent(const SDL_Event& event, const SDLKey code) { + if (event.type == SDL_JOYBUTTONDOWN || event.type == SDL_JOYBUTTONUP) { + printf("Joystick button%d event: %s (%d)\n", + event.jbutton.button, (pressed(event)) ? "pressed" : "released", code); + } else if (event.type == SDL_JOYAXISMOTION && pressed(event)) { + printf("Joystick axis%d event: %s (%d)\n", + event.jaxis.axis, (event.jaxis.value > 0) ? "raised" : "lowered", code); + } +} + +const SDLKey translateEvent(const SDL_Event& event) { + if (event.type == SDL_KEYDOWN || event.type == SDL_KEYUP) { + return event.key.keysym.sym; + } + if (event.type == SDL_JOYAXISMOTION) { + return (SDLKey) (1024 + event.jaxis.axis * 2 + ((event.jaxis.value > 0) ? 1 : 0)); + } + if (event.type == SDL_JOYBUTTONDOWN || event.type == SDL_JOYBUTTONUP) { + return (SDLKey) (1040 + event.jbutton.button); + } + return (SDLKey) 0; +} +#endif + +const SDLKey Input::translate(const SDL_Event& event) { +#ifdef DEBUG + debugEvent(event, translateEvent(event)); +#endif + if (event.type == SDL_KEYDOWN || event.type == SDL_KEYUP) { + return event.key.keysym.sym; + } + if (event.type == SDL_JOYAXISMOTION) { + return (SDLKey) (1024 + event.jaxis.axis * 2 + ((event.jaxis.value > 0) ? 1 : 0)); + } + if (event.type == SDL_JOYBUTTONDOWN || event.type == SDL_JOYBUTTONUP) { + return (SDLKey) (1040 + event.jbutton.button); + } + return (SDLKey) 0; +} + +const bool Input::isPressed(const SDL_Event& event) { + /* || event.type == SDL_MOUSEBUTTONDOWN*/ + if (event.type == SDL_JOYBUTTONDOWN || event.type == SDL_KEYDOWN) return true; + if (event.type == SDL_JOYAXISMOTION) return event.jaxis.value / initialSensitivity; + return false; +} diff --git a/alienblaster/project/jni/alienblaster/src/input.h b/alienblaster/project/jni/alienblaster/src/input.h new file mode 100644 index 000000000..9ccb0aaaf --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/input.h @@ -0,0 +1,46 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +#ifndef INPUT_H +#define INPUT_H + +#include "SDL.h" + +class Input; + +extern Input input; + +class Input { + +private: + Uint16 currentJoystick; + SDL_Joystick *joystick; + +public: + Input(); + ~Input(); + void getJoystick(); + void freeJoystick(); + const SDLKey translate(const SDL_Event& event); + const bool isPressed(const SDL_Event& event); + + static const Input input(); +}; + +#endif //#ifndef INPUT_H diff --git a/alienblaster/project/jni/alienblaster/src/intro.cc b/alienblaster/project/jni/alienblaster/src/intro.cc new file mode 100644 index 000000000..542034aa1 --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/intro.cc @@ -0,0 +1,232 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +using namespace std; + +#include "intro.h" +#include "global.h" +#include "surfaceDB.h" +#include "mixer.h" +#include "video.h" +#include "font.h" +#include "settings.h" +#include "infoscreen.h" + +Intro::Intro( SDL_Surface *scr ) { + screen = scr; + introSprite = surfaceDB.loadSurface( FN_ALIENBLASTER_INTRO ); + activeChoiceSprite = surfaceDB.loadSurface( FN_INTRO_SHOW_CHOICE ); + font = new Font( FN_FONT_INTRO ); + fontHighlighted = new Font( FN_FONT_INTRO_HIGHLIGHTED ); + activeChoice = 0; + choose = mixer.loadSample( FN_SOUND_INTRO_CHOOSE, 100 ); + confirm = mixer.loadSample( FN_SOUND_INTRO_CONFIRM, 100 ); + infoscreen = new Infoscreen( screen ); +} + +Intro::~Intro() {} + +void Intro::run( GameStates &gameState ) { + + if ( playMusicOn && mixer.whichMusicPlaying() != MUSIC_INTRO ) { + mixer.playMusic( MUSIC_INTRO, -1, 1000 ); + } + + draw(); + while ( gameState == GS_INTRO ) { + handleEvents( gameState ); + draw(); + SDL_Delay( 50 ); + } +} + +void Intro::draw() { + videoserver->clearScreen(); + SDL_Rect r; + r.x = screen->w / 2 - introSprite->w / 2; + r.y = 0; + r.w = introSprite->w; + r.h = introSprite->h; + SDL_BlitSurface( introSprite, 0, screen, &r ); + + for ( int i = 0; i < NR_INTRO_CHOICES; i++ ) { + if ( activeChoice == i ) { + r.x = 230 - activeChoiceSprite->w - 8; + r.y = 258 + i * 35; + r.w = activeChoiceSprite->w; + r.h = activeChoiceSprite->h; + SDL_BlitSurface(activeChoiceSprite, 0, screen, &r ); + fontHighlighted->drawStr( screen, 230, 260 + i * 35, INTRO_CHOICES[ i ] ); + } else { + font->drawStr( screen, 230, 260 + i * 35, INTRO_CHOICES[ i ] ); + } + } + SDL_Flip( screen ); +} + +void Intro::handleEvents( GameStates &gameState ) { + SDL_Event event; + + while (SDL_PollEvent(&event)) { + switch(event.type) { + case SDL_KEYDOWN: { + switch(event.key.keysym.sym) { + case SDLK_F5: { + videoserver->toggleFullscreen(); + break; + } + case SDLK_F7: { + if ( playMusicOn ) { + playMusicOn = false; + mixer.stopMusic(); + } else { + playMusicOn = true; + mixer.playMusic( MUSIC_INTRO, -1, 1000 ); + } + break; + } + case SDLK_UP: { + mixer.playSample( choose, 0 ); + activeChoice--; + if ( activeChoice < 0 ) activeChoice = NR_INTRO_CHOICES - 1; + break; + } + case SDLK_DOWN: { + mixer.playSample( choose, 0 ); + activeChoice = (activeChoice + 1) % NR_INTRO_CHOICES; + break; + } + case SDLK_ESCAPE: { + gameState = GS_QUIT; + break; + } + case SDLK_RETURN: { + mixer.playSample( confirm, 0 ); + switch (activeChoice) { + case ONE_PLAYER_GAME: { + onePlayerGame = true; + arcadeGame = false; + gameState = GS_SET_DIFFICULTY; + break; + } + case TWO_PLAYER_GAME: { + onePlayerGame = false; + arcadeGame = false; + gameState = GS_SET_DIFFICULTY; + break; + } + case ARCADE_GAME: { + onePlayerGame = true; + arcadeGame = true; + gameState = GS_ARCADE_MODE_SETUP; + break; + } + case CONFIGURE_KEYS: { + settings->settingsDialog(screen); + draw(); + break; + } + case INFOSCREEN: { + infoscreen->run(); + break; + } + case QUIT_AND_DIE: { + gameState = GS_QUIT; + break; + } + } + break; + } + default: break; + } + break; + } + case SDL_QUIT: { + gameState = GS_QUIT; + break; + } + default: break; + } + } +} + + +void Intro::showScreenshots() { + if ( playMusicOn && mixer.whichMusicPlaying() != MUSIC_INTRO ) { + mixer.playMusic( MUSIC_INTRO, -1, 1000 ); + } + + SDL_Surface *surfS = SDL_LoadBMP( FN_ALIENBLASTER_INTRO.c_str() ); + SDL_Surface *surf0 = SDL_LoadBMP( FN_SCREENSHOT0.c_str() ); + SDL_Surface *surf1 = SDL_LoadBMP( FN_SCREENSHOT1.c_str() ); + SDL_Surface *surf2 = SDL_LoadBMP( FN_SCREENSHOT2.c_str() ); + SDL_Surface *surf3 = SDL_LoadBMP( FN_SCREENSHOT3.c_str() ); + SDL_Surface *surf4 = SDL_LoadBMP( FN_SCREENSHOT4.c_str() ); + SDL_Surface *surf5 = SDL_LoadBMP( FN_SCREENSHOT5.c_str() ); + SDL_Surface *surf6 = SDL_LoadBMP( FN_SCREENSHOT6.c_str() ); + SDL_Surface *surf7 = SDL_LoadBMP( FN_SCREENSHOT7.c_str() ); + SDL_Surface *surf8 = SDL_LoadBMP( FN_SCREENSHOT8.c_str() ); + SDL_Surface *surf9 = SDL_LoadBMP( FN_SCREENSHOT9.c_str() ); + + SDL_BlitSurface( surfS, 0, screen, 0 ); + SDL_Flip(screen); + SDL_Delay(3000); + int sps = 50; // steps per second + if (blendImages( screen, surfS, 0, surf0, 0, sps )) + if (blendImages( screen, surf0, 0, surf1, 0, sps )) + if (blendImages( screen, surf1, 0, surf2, 0, sps )) + if (blendImages( screen, surf2, 0, surf3, 0, sps )) + if (blendImages( screen, surf3, 0, surf4, 0, sps )) + if (blendImages( screen, surf4, 0, surf5, 0, sps )) + if (blendImages( screen, surf5, 0, surf6, 0,sps )) + if (blendImages( screen, surf6, 0, surf7, 0, sps )) + if (blendImages( screen, surf7, 0, surf8, 0, sps )) + blendImages( screen, surf8, 0, surf9, 0, sps ); +} + +bool Intro::blendImages( SDL_Surface *screen, SDL_Surface *surf0, SDL_Rect *r1, SDL_Surface *surf1, SDL_Rect *r2, int sps ) { + SDL_Event event; + + int i = 0; + int t = SDL_GetTicks(); + while (i < 255) { + if (i>255) i=255; + + SDL_SetAlpha( surf0, SDL_SRCALPHA, 255-i ); + SDL_SetAlpha( surf1, SDL_SRCALPHA, i ); + SDL_BlitSurface( surf0, 0, screen, r1 ); + SDL_BlitSurface( surf1, 0, screen, r2 ); + SDL_Flip( screen ); + int t2 = SDL_GetTicks(); + int dt= SDL_GetTicks() - t; + t = t2; + i += (dt * sps / 1000); + + while (SDL_PollEvent(&event)) { + switch(event.type) { + case SDL_KEYDOWN: { + return false; + } + default: + break; + } + } + } + return true; +} diff --git a/alienblaster/project/jni/alienblaster/src/intro.h b/alienblaster/project/jni/alienblaster/src/intro.h new file mode 100644 index 000000000..27d5e1c63 --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/intro.h @@ -0,0 +1,64 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +#ifndef INTRO_H +#define INTRO_H + +#include +#include "SDL.h" +#include "game.h" + +class Font; +class Infoscreen; + +enum IntroChoices { ONE_PLAYER_GAME, TWO_PLAYER_GAME, ARCADE_GAME, + CONFIGURE_KEYS, INFOSCREEN, QUIT_AND_DIE }; +const std::string INTRO_CHOICES[] = { "1-Player Action", "2-Player Fight", + "Arcade", + "Configure Keys", "Infoscreen", "Quit and Die" }; +const int NR_INTRO_CHOICES = 6; + +class Intro { + private: + SDL_Surface *screen; + SDL_Surface *introSprite; + SDL_Surface *activeChoiceSprite; + Font *font; + Font *fontHighlighted; + Infoscreen *infoscreen; + + int activeChoice; + + // sound + int choose; + int confirm; + + public: + Intro( SDL_Surface *scr ); + ~Intro(); + void run( GameStates &gameState ); + void showScreenshots(); + bool blendImages( SDL_Surface *screen, SDL_Surface *surf0, SDL_Rect *r1, SDL_Surface *surf1, SDL_Rect *r2, int sps ); + + private: + void handleEvents( GameStates &gameState ); + void draw(); +}; + +#endif diff --git a/alienblaster/project/jni/alienblaster/src/item.cc b/alienblaster/project/jni/alienblaster/src/item.cc new file mode 100644 index 000000000..65e6c8a95 --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/item.cc @@ -0,0 +1,136 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +#include +#include "item.h" +#include "boundingBox.h" +#include "surfaceDB.h" +#include "global.h" + +Item::Item(const Vector2D &position, const Vector2D &velocity, ItemTypes itemType) { + + this->itemType = itemType; + + pos = position; + vel = velocity; + timeLived = 0; + + switch (itemType) { + case ITEM_PRIMARY_UPGRADE: + { + sprite = surfaceDB.loadSurface( FN_ITEM_PRIMARY_UPGRADE ); + break; + } + case ITEM_DUMBFIRE_DOUBLE: + { + sprite = surfaceDB.loadSurface( FN_ITEM_DUMBFIRE_DOUBLE ); + break; + } + case ITEM_KICK_ASS_ROCKET: + { + sprite = surfaceDB.loadSurface( FN_ITEM_KICK_ASS_ROCKET ); + break; + } + case ITEM_HELLFIRE: + { + sprite = surfaceDB.loadSurface( FN_ITEM_HELLFIRE ); + break; + } + case ITEM_MACHINE_GUN: + { + sprite = surfaceDB.loadSurface( FN_ITEM_MACHINE_GUN ); + break; + } + case ITEM_HEALTH: + { + sprite = surfaceDB.loadSurface( FN_ITEM_HEALTH ); + break; + } + case ITEM_HEATSEEKER: + { + sprite = surfaceDB.loadSurface( FN_ITEM_HEATSEEKER ); + break; + } + case ITEM_NUKE: + { + sprite = surfaceDB.loadSurface( FN_ITEM_NUKE ); + break; + } + case ITEM_DEFLECTOR: + { + sprite = surfaceDB.loadSurface( FN_ITEM_DEFLECTOR ); + break; + } + case ITEM_LASER: + { + sprite = surfaceDB.loadSurface( FN_ITEM_LASER ); + break; + } + case ITEM_ENERGY_BEAM: + { + sprite = surfaceDB.loadSurface( FN_ITEM_ENERGY_BEAM ); + break; + } + + default: + { + cout << "Item(): unexpected itemType: " << itemType << endl; + sprite = surfaceDB.loadSurface( FN_ITEM_PRIMARY_UPGRADE ); + break; + } + } + + boundingBox = new BoundingBox( lroundf(pos.getX() - sprite->w / 2.0), + lroundf(pos.getY() - sprite->h / 2.0), + sprite->w, sprite->h ); +} + +Item::~Item() { + delete boundingBox; +} + + +void Item::update( int dT ) { + pos += vel * dT / 1000.0; + updateBoundingBox(); + timeLived += dT; +} + +void Item::deleteItem() { + timeLived = ITEM_LIFETIME; +} + +void Item::updateBoundingBox() { + boundingBox->moveUpperBound( lroundf(pos.getY() - sprite->h * 0.5) ); + boundingBox->moveLeftBound( lroundf(pos.getX() - sprite->w * 0.5) ); +} + +void Item::draw(SDL_Surface *screen) { + SDL_Rect r; + r.x = lroundf(pos.getX()) - sprite->w / 2; + r.y = lroundf(pos.getY()) - sprite->h / 2; + r.w = sprite->w; + r.h = sprite->h; + SDL_BlitSurface( sprite, 0, screen, &r ); +} + +BoundingBox *Item::getBoundingBox() { + return boundingBox; +} + diff --git a/alienblaster/project/jni/alienblaster/src/item.h b/alienblaster/project/jni/alienblaster/src/item.h new file mode 100644 index 000000000..917363ffe --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/item.h @@ -0,0 +1,60 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +#ifndef ITEM_H +#define ITEM_H + +#include "SDL.h" +#include "geometry.h" +#include +#include "global.h" + +class BoundingBox; + +class Item { + SDL_Surface *sprite; + BoundingBox *boundingBox; + + Vector2D pos; + Vector2D vel; + ItemTypes itemType; + + int timeLived; + + void updateBoundingBox(); + + public: + Item( const Vector2D &position, const Vector2D &velocity, ItemTypes itemType ); + ~Item(); + + void update( int dT ); + + void deleteItem(); + + void draw(SDL_Surface *screen); + + inline bool isExpired() { return (timeLived >= ITEM_LIFETIME); } + inline Vector2D getPos() { return pos; } + inline Vector2D getVel() { return vel; } + inline void pickedUp() { timeLived = ITEM_LIFETIME; } + inline ItemTypes getType() { return itemType; } + BoundingBox *getBoundingBox(); +}; + +#endif diff --git a/alienblaster/project/jni/alienblaster/src/items.cc b/alienblaster/project/jni/alienblaster/src/items.cc new file mode 100644 index 000000000..1948460a6 --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/items.cc @@ -0,0 +1,131 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +#include "item.h" +#include "items.h" +#include "surfaceDB.h" +#include "geometry.h" +#include "global.h" +#include "racers.h" + +Items::Items() { + timeNextItemAppear = + ITEM_APPEAR_DELAY + + (rand() % ITEM_APPEAR_RAND_DELAY); +} + +Items::~Items() { + vector::iterator i; + for (i = items.begin(); i != items.end(); ++i) { + delete *i; + } +} + +void Items::addItem(Item *item) { + if (item) { + items.push_back(item); + } +} + +void Items::expireItems() { + unsigned int i = 0; + while ( i < items.size() ) { + if ( items[i]->isExpired() ) { + delete items[i]; + items.erase(items.begin() + i); + } else { + i++; + } + } +} + +void Items::update( int dT ) { + vector::iterator i; + for (i = items.begin(); i != items.end(); ++i) { + (*i)->update( dT ); + } +} + +void Items::draw(SDL_Surface *screen) { + vector::iterator i; + for (i = items.begin(); i != items.end(); ++i) { + (*i)->draw(screen); + } +} + +Item *Items::getItem(unsigned int idx) { + return items[idx]; +} + + +void Items::generateItemNow( Vector2D pos, Vector2D vel ) { + if ( pos.getX() < 10 ) pos.setX( 10 ); + if ( pos.getX() > SCREEN_WIDTH-10 ) pos.setX( SCREEN_WIDTH-10 ); + if ( pos.getY() < 100 && vel.getY() < 5 ) vel.setY( 5 ); + + int itemType; + // 10 tries for a correct item + for ( int i = 0; i < 10; i++ ) { + itemType = getRandValue( ITEM_APPEAR_CHANCES, NR_ITEM_TYPES ); + if ( ( racers->isShipTypeActive( LIGHT_FIGHTER ) && + racers->isShipTypeActive( HEAVY_FIGHTER ) ) || + ( racers->isShipTypeActive( LIGHT_FIGHTER ) && + ( itemType == ITEM_PRIMARY_UPGRADE || + itemType == ITEM_DUMBFIRE_DOUBLE || + itemType == ITEM_KICK_ASS_ROCKET || + itemType == ITEM_HELLFIRE || + itemType == ITEM_MACHINE_GUN || + itemType == ITEM_HEALTH || + itemType == ITEM_HEATSEEKER || + itemType == ITEM_NUKE || + itemType == ITEM_ENERGY_BEAM ) ) || + ( racers->isShipTypeActive( HEAVY_FIGHTER ) && + ( itemType == ITEM_PRIMARY_UPGRADE || + itemType == ITEM_DUMBFIRE_DOUBLE || + itemType == ITEM_KICK_ASS_ROCKET || + itemType == ITEM_HEALTH || + itemType == ITEM_HEATSEEKER || + itemType == ITEM_NUKE || + itemType == ITEM_DEFLECTOR || + itemType == ITEM_LASER ) ) ) { + Item *item = new Item( pos, vel, (ItemTypes)itemType ); + addItem( item ); + break; + } + } +} + +void Items::generate( int dT ) { + timeNextItemAppear -= dT; + + if ( timeNextItemAppear < 0 ) { + timeNextItemAppear = ITEM_APPEAR_DELAY + (rand() % ITEM_APPEAR_RAND_DELAY); + generateItemNow( Vector2D( 150 + (rand() % 340), -20 ), + Vector2D( (rand() % lroundf(SCROLL_SPEED)) - SCROLL_SPEED / 2, + SCROLL_SPEED + (rand() % lroundf(SCROLL_SPEED)) ) ); + } +} + +void Items::deleteAllItems() { + vector::iterator i; + for (i = items.begin(); i != items.end(); ++i) { + (*i)->deleteItem(); + } + expireItems(); +} diff --git a/alienblaster/project/jni/alienblaster/src/items.h b/alienblaster/project/jni/alienblaster/src/items.h new file mode 100644 index 000000000..dc673ebe6 --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/items.h @@ -0,0 +1,51 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +#ifndef ITEMS_H +#define ITEMS_H + +#include "SDL.h" +#include + +class Item; +class Vector2D; + +class Items { + vector items; + + int timeNextItemAppear; + + public: + Items(); + ~Items(); + + void addItem(Item *item); + void generateItemNow( Vector2D pos, Vector2D vel ); + void generate( int dT ); + void expireItems(); + void update( int dT ); + void draw(SDL_Surface *screen); + void deleteAllItems(); + + inline unsigned int getNrItems() { return items.size(); } + Item *getItem(unsigned int idx); +}; + + +#endif diff --git a/alienblaster/project/jni/alienblaster/src/main.cc b/alienblaster/project/jni/alienblaster/src/main.cc new file mode 100644 index 000000000..347188e9c --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/main.cc @@ -0,0 +1,33 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +#include "game.h" +#include "SDL.h" +#include + +using namespace std; + +int main(int argc, char *argv[]) { + SDL_Init(0); + srand(0); + Game game; + game.run(); + SDL_Quit(); + return 0; +} diff --git a/alienblaster/project/jni/alienblaster/src/menuArcadeMode.cc b/alienblaster/project/jni/alienblaster/src/menuArcadeMode.cc new file mode 100644 index 000000000..f139dd972 --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/menuArcadeMode.cc @@ -0,0 +1,366 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +using namespace std; + +#include "menuArcadeMode.h" +#include "global.h" +#include "surfaceDB.h" +#include "mixer.h" +#include "video.h" +#include "font.h" +#include "racer.h" +#include "racers.h" +#include "asstring.h" +#include "options.h" +#include +#include + +MenuArcadeMode::MenuArcadeMode( SDL_Surface *scr ) { + screen = scr; + arcadeSprite = surfaceDB.loadSurface( FN_ARCADE_LOGO ); + activeChoiceSprite = surfaceDB.loadSurface( FN_INTRO_SHOW_CHOICE ); + + font = new Font( FN_FONT_INTRO ); + fontHighlighted = new Font( FN_FONT_INTRO_HIGHLIGHTED ); + lightFighterIcon1 = surfaceDB.loadSurface( FN_LIGHT_FIGHTER_1_ICON ); + heavyFighterIcon1 = surfaceDB.loadSurface( FN_HEAVY_FIGHTER_1_ICON ); + choose = mixer.loadSample( FN_SOUND_ARCADE_CHOOSE, 100 ); + confirm = mixer.loadSample( FN_SOUND_ARCADE_CONFIRM, 60 ); + activeChoice = 0; + playerOneLightFighter = true; + + op = new Options( FN_HIGHSCORE ); + + // check, if the highscore is open + int highscoreTest; + if ( !op->getInt( "POINTS_1", highscoreTest ) ) { + cout << "Creating the highscore..." << endl; + op->setStr( "ALIENBLASTER", "NAME_1" ); + op->setInt( 1666, "POINTS_1" ); + op->setStr( "GNOSTICAL", "NAME_2" ); + op->setInt( 1000, "POINTS_2" ); + op->setStr( "SLOBJOK", "NAME_3" ); + op->setInt( 1000, "POINTS_3" ); + op->setStr( "SNOWBALL", "NAME_4" ); + op->setInt( 1000, "POINTS_4" ); + op->setStr( "THUNDERBIRD", "NAME_5" ); + op->setInt( 1000, "POINTS_5" ); + op->setStr( "KaoT", "NAME_6" ); + op->setInt( 666, "POINTS_6" ); + op->setStr( "SDL", "NAME_7" ); + op->setInt( 500, "POINTS_7" ); + op->setStr( "DEBIAN", "NAME_8" ); + op->setInt( 400, "POINTS_8" ); + op->setStr( "DEV-CPP", "NAME_9" ); + op->setInt( 300, "POINTS_9" ); + op->setStr( "I RULE", "NAME_10" ); + op->setInt( 200, "POINTS_10" ); + op->saveFile( FN_HIGHSCORE ); + } +} + +MenuArcadeMode::~MenuArcadeMode() { + op->saveFile( FN_HIGHSCORE ); + delete op; +} + +void MenuArcadeMode::run( GameStates &gameState, int points ) { + activeChoice = 0; + + if ( GS_ARCADE_MODE_FINISHED ) { + updateHighScore( points ); + gameState = GS_ARCADE_MODE_SETUP; + } + + draw(); + while ( gameState == GS_ARCADE_MODE_SETUP ) { + handleEvents( gameState ); + draw(); + SDL_Delay( 50 ); + } +} + + +bool MenuArcadeMode::getPlayerOneLightFighter() { + return playerOneLightFighter; +} + +void MenuArcadeMode::draw() { + videoserver->clearScreen(); + SDL_Rect r; + r.x = screen->w / 2 - arcadeSprite->w / 2; + r.y = 0; + r.w = arcadeSprite->w; + r.h = arcadeSprite->h; + SDL_BlitSurface( arcadeSprite, 0, screen, &r ); + + string name = "UNKNOWN"; + int points = 0; + op->getStr( "NAME_1", name ); + op->getInt( "POINTS_1", points ); + fontHighlighted->drawStr( screen, 230, 60, "1. " + name + ": " + asString(points) ); + for ( int i = 2; i <= 10; i++ ) { + op->getStr( "NAME_" + asString( i ), name ); + op->getInt( "POINTS_" + asString( i ), points ); + font->drawStr( screen, 230, 40 + i * 25, + asString( i ) + ". " + name + ": " + asString(points) ); + } + + for ( int i = 0; i < NR_MENU_ARCADE_CHOICES; i++ ) { + if ( activeChoice == i ) { + r.x = 230 - activeChoiceSprite->w - 8; + r.y = 338 + i * 40; + r.w = activeChoiceSprite->w; + r.h = activeChoiceSprite->h; + SDL_BlitSurface( activeChoiceSprite, 0, screen, &r ); + fontHighlighted->drawStr( screen, 230, 340 + i * 40, STRINGS_MENU_ARCADE_CHOICES[ i ] ); + } else { + font->drawStr( screen, 230, 340 + i * 40, STRINGS_MENU_ARCADE_CHOICES[ i ] ); + } + } + + font->drawStr( screen, 50, 270, "Player 1" ); + if ( playerOneLightFighter ) { + r.x = 100 - lightFighterIcon1->w / 2; + r.y = 340 - lightFighterIcon1->h / 2; + r.w = lightFighterIcon1->w; + r.h = lightFighterIcon1->h; + SDL_BlitSurface( lightFighterIcon1, 0, screen, &r ); + } else { + r.x = 100 - heavyFighterIcon1->w / 2; + r.y = 340 - heavyFighterIcon1->h / 2; + r.w = heavyFighterIcon1->w; + r.h = heavyFighterIcon1->h; + SDL_BlitSurface( heavyFighterIcon1, 0, screen, &r ); + } + fontHighlighted->drawStr( screen, 100, 400, "Press \"1\"", FONT_ALIGN_CENTERED ); + fontHighlighted->drawStr( screen, 100, 430, "To Change", FONT_ALIGN_CENTERED ); + + SDL_Flip( screen ); +} + + +void MenuArcadeMode::handleEvents( GameStates &gameState ) { + SDL_Event event; + + while ( SDL_PollEvent(&event) ) { + switch(event.type) { + case SDL_KEYDOWN: { + switch ( event.key.keysym.sym ) { + case SDLK_1: { + playerOneLightFighter = !playerOneLightFighter; + break; + } + case SDLK_F5: { + videoserver->toggleFullscreen(); + break; + } + case SDLK_F7: { + if ( playMusicOn ) { + playMusicOn = false; + mixer.stopMusic(); + } else { + playMusicOn = true; + mixer.playMusic( MUSIC_INTRO, -1, 1000 ); + } + break; + } + case SDLK_UP: { + mixer.playSample( choose, 0 ); + activeChoice--; + if ( activeChoice < 0 ) activeChoice = NR_MENU_ARCADE_CHOICES - 1; + break; + } + case SDLK_DOWN: { + mixer.playSample( choose, 0 ); + activeChoice = (activeChoice + 1) % NR_MENU_ARCADE_CHOICES; + break; + } + case SDLK_ESCAPE: { + gameState = GS_INTRO; + break; + } + case SDLK_RETURN: { + switch (activeChoice) { + case ARCADE_FIGHT: { + mixer.playSample( confirm, 0 ); + difficultyLevel = ARCADE_DIFFICULTY_LEVEL; + gameState = GS_PLAYON; + break; + } + case ARCADE_BACK_TO_MAIN_MENU: { + gameState = GS_INTRO; + break; + } + } + break; + } + default: break; + } + break; + } + case SDL_QUIT: { + gameState = GS_QUIT; + break; + } + default: break; + } + } +} + +/**************** read the new name for the highscore ***********************/ + + +void MenuArcadeMode::updateHighScore( int points ) { + int pointTenth = -1; + op->getInt( "POINTS_10", pointTenth ); + // the player made it in the hall of fame! + if ( points >= pointTenth ) { + + int pointsOfEntry = -1; + int newPos = -1; + for ( int i = 1; i <= 10; i++ ) { + op->getInt( "POINTS_" + asString( i ), pointsOfEntry ); + if ( pointsOfEntry <= points ) { + newPos = i; + break; + } + } + if ( newPos != -1 ) { + // move the positions after newPos one position further down + int pointsPrev; + string namePrev; + for ( int i = 10; i > newPos; i-- ) { + op->getInt( "POINTS_" + asString( i-1 ), pointsPrev ); + op->getStr( "NAME_" + asString( i-1 ), namePrev ); + op->setInt( pointsPrev, "POINTS_" + asString ( i ) ); + op->setStr( namePrev, "NAME_" + asString( i ) ); + } + op->setInt( points, "POINTS_" + asString( newPos ) ); + op->setStr( "? ? ? ?", "NAME_" + asString( newPos ) ); + readHighScoreName( newPos ); + } + op->saveFile( FN_HIGHSCORE ); + } +} + + +void MenuArcadeMode::readHighScoreName( int pos ) { + videoserver->clearScreen(); + SDL_Rect r; + r.x = screen->w / 2 - arcadeSprite->w / 2; + r.y = 0; + r.w = arcadeSprite->w; + r.h = arcadeSprite->h; + SDL_BlitSurface( arcadeSprite, 0, screen, &r ); + + string name = "UNKNOWN"; + int points = 0; + for ( int i = 1; i <= 10; i++ ) { + op->getStr( "NAME_" + asString( i ), name ); + op->getInt( "POINTS_" + asString( i ), points ); + if ( pos == i ) { + fontHighlighted->drawStr( screen, 230, 40 + i * 25, + asString( i ) + ". " + name + ": " + asString(points) ); + } else { + font->drawStr( screen, 230, 40 + i * 25, + asString( i ) + ". " + name + ": " + asString(points) ); + } + } + + fontHighlighted->drawStr( screen, 320, 340, "CONGRATULATION - Enter your worthy name!", + FONT_ALIGN_CENTERED ); + + string newName = ""; + while ( handleEventsReadName( newName ) ) { + drawReadName( newName ); + SDL_Flip( screen ); + SDL_Delay( 50 ); + } + op->setStr( newName, "NAME_" + asString( pos ) ); +} + +bool MenuArcadeMode::handleEventsReadName( string &newName ) { + bool moreToRead = true; + SDL_Event event; + + while ( SDL_PollEvent(&event) ) { + if ( event.type == SDL_KEYDOWN ) { + switch ( event.key.keysym.sym ) { + case SDLK_F5: { + videoserver->toggleFullscreen(); + break; + } + case SDLK_F7: + { + if ( playMusicOn ) { + playMusicOn = false; + mixer.stopMusic(); + } else { + playMusicOn = true; + mixer.playMusic( MUSIC_INTRO, -1, 1000 ); + } + break; + } + case SDLK_RETURN: + { + moreToRead = false; + break; + } + case SDLK_BACKSPACE: + { + if ( newName.length() > 0 ) { + newName.resize( newName.length() - 1 ); + } + break; + } + default: + { + if ( newName.length() <= 15 ) { + if ( SDLK_a <= event.key.keysym.sym && + event.key.keysym.sym <= SDLK_z ) { + if ( ((SDL_GetModState()) & KMOD_LSHIFT != 0 ) || + ((SDL_GetModState()) & KMOD_RSHIFT != 0 ) ) { + newName += asString( (char)('A' + event.key.keysym.sym - SDLK_a ) ); + } else { + newName += asString( (char)('a' + event.key.keysym.sym - SDLK_a ) ); + } + } else if ( event.key.keysym.sym == SDLK_SPACE ) { + newName += " "; + } + } + break; + } + } + } + } + return moreToRead; +} + +void MenuArcadeMode::drawReadName( string &name ) { + SDL_Rect r; + r.x = 150; + r.y = 380; + r.w = 400; + r.h = 40; + SDL_FillRect(screen, &r, SDL_MapRGB(screen->format, 0, 0, 0) ); + + fontHighlighted->drawStr( screen, 320, 380, name, FONT_ALIGN_CENTERED ); +} diff --git a/alienblaster/project/jni/alienblaster/src/menuArcadeMode.h b/alienblaster/project/jni/alienblaster/src/menuArcadeMode.h new file mode 100644 index 000000000..41b7e8a43 --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/menuArcadeMode.h @@ -0,0 +1,72 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +#ifndef MENU_ARCADE_MODE_H +#define MENU_ARCADE_MODE_H + +#include "SDL.h" +#include "game.h" +#include + +class Font; +class Options; + +enum MENU_ARCADE_CHOICES { ARCADE_FIGHT, ARCADE_BACK_TO_MAIN_MENU }; + +const std::string STRINGS_MENU_ARCADE_CHOICES[] = +{ "FIGHT", + "Back to Main Menu" }; +const int NR_MENU_ARCADE_CHOICES = 2; + +class MenuArcadeMode { + private: + SDL_Surface *screen; + SDL_Surface *arcadeSprite; + SDL_Surface *activeChoiceSprite; + SDL_Surface *lightFighterIcon1; + SDL_Surface *heavyFighterIcon1; + Font *font; + Font *fontHighlighted; + + Options *op; + + int activeChoice; + // sounds + int choose; + int confirm; + + bool playerOneLightFighter; + + public: + MenuArcadeMode( SDL_Surface *scr ); + ~MenuArcadeMode(); + void run( GameStates &gameState, int points=-1 ); + bool getPlayerOneLightFighter(); + + private: + void updateHighScore( int points ); + void readHighScoreName( int pos ); + void drawReadName( string &newName ); + bool handleEventsReadName( string &newName ); + + void handleEvents( GameStates &gameState ); + void draw(); +}; + +#endif diff --git a/alienblaster/project/jni/alienblaster/src/mixer.cc b/alienblaster/project/jni/alienblaster/src/mixer.cc new file mode 100644 index 000000000..f1cd6015c --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/mixer.cc @@ -0,0 +1,172 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +using namespace std; + +#include "mixer.h" +#include "SDL_mixer.h" +#include +#include +#include + +Mixer mixer; + +Mixer::Mixer() { + if (SDL_InitSubSystem(SDL_INIT_AUDIO) < 0) { + printf("Couldn't initialize SDL audio subsystem: %s\n", SDL_GetError()); + exit(1); + } + mixChunks = MixChunks(0); + musics = Musics(0); + enabled = false; + initMixer(); + lastUsedReservedChannel = 0; + reservedChannels = 0; + musicPlaying = MUSIC_NONE; +} + +Mixer::~Mixer() { + if (enabled) { + freeMixer(); + } +} + +void Mixer::initMixer() { + enabled = (Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, MIX_DEFAULT_FORMAT, 1, 1024) >= 0); + if (enabled) { + Mix_AllocateChannels(MIXER_NUMBER_CHANNELS); + reservedChannels = Mix_ReserveChannels( MIXER_RESERVED_CHANNELS ); + if ( MIXER_RESERVED_CHANNELS != reservedChannels ) + cout << "reserve channels not successfull: reserved: " << reservedChannels << endl; + lastUsedReservedChannel = 0; + fn2snd.clear(); + fn2mus.clear(); + playsOn.clear(); + } +} + +void Mixer::freeMixer() { + if (enabled) { + Mix_ExpireChannel(-1, 0); + for (unsigned int index = 0; index < mixChunks.size(); index++) { + Mix_FreeChunk(mixChunks[index]); + } + for (unsigned int index = 0; index < musics.size(); index++) { + Mix_FreeMusic(musics[index]); + } + } +} + +int Mixer::loadSample(string fileName, int volume) { + if (enabled) { + if (fn2snd.find(fileName) == fn2snd.end()) { + // open the file for reading + ifstream inputFile ( fileName.c_str(), ios::in); + if (!inputFile.good()) { + cout << "ERROR: file " << fileName << " does not exist!" << endl; + exit(1); + } + mixChunks.push_back(Mix_LoadWAV(fileName.c_str())); + fn2snd[ fileName ] = mixChunks.size() - 1; + if ( 0 <= volume && volume < 128 ) { + Mix_VolumeChunk( mixChunks[ mixChunks.size() - 1 ], volume ); + } + return mixChunks.size() - 1; + } + return fn2snd[ fileName ]; + } + return 0; +} + + +bool Mixer::playSample( int sampleId, int loop, bool withPriority ) { + int ret = -1; + if (enabled) { + if ( !withPriority || reservedChannels == 0 ) { + ret = Mix_PlayChannel(-1, mixChunks[sampleId], loop); + playsOn[ sampleId ] = ret; + } else { + lastUsedReservedChannel = (lastUsedReservedChannel+1) % reservedChannels; + ret = Mix_PlayChannel( lastUsedReservedChannel, mixChunks[sampleId], loop ); + playsOn[ sampleId ] = ret; + } + //if ( ret == -1 ) cout << "playSample: error: " << Mix_GetError() << endl; + return ret != -1; + } + return true; +} + +bool Mixer::stopSample(int sampleId) { + if (enabled) { + return Mix_HaltChannel( playsOn[sampleId] ) != -1; + } + return true; +} + +void Mixer::reset() { + freeMixer(); + if (enabled) { + initMixer(); + } +} + +void Mixer::fadeOut(int mSecs) { + if (enabled) { + Mix_FadeOutChannel(-1, mSecs); + } +} + + +int Mixer::loadMusic( string fn ) { + if (enabled) { + if (fn2mus.find(fn) == fn2mus.end()) { + // open the file for reading + ifstream inputFile ( fn.c_str(), ios::in); + if (!inputFile.good()) { + cout << "ERROR: file " << fn << " does not exist!" << endl; + exit(1); + } + + musics.push_back(Mix_LoadMUS(fn.c_str())); + fn2mus[ fn ] = musics.size() - 1; + return musics.size() - 1; + } + return fn2mus[ fn ]; + } + return 0; +} + +void Mixer::playMusic( MusicTracks musNum, int loop, int fadeInTime ) { + if (enabled) { + if ( musNum < NR_MUSIC_TRACKS ) { + Mix_FadeInMusic( musics[ loadMusic( FN_MUSIC[ (int)musNum ] ) ], loop, fadeInTime ); + musicPlaying = musNum; + } + } +} + +void Mixer::stopMusic( int fadeOutTime ) { + if (enabled) { + Mix_FadeOutMusic( fadeOutTime ); + } +} + +MusicTracks Mixer::whichMusicPlaying() { + return musicPlaying; +} diff --git a/alienblaster/project/jni/alienblaster/src/mixer.h b/alienblaster/project/jni/alienblaster/src/mixer.h new file mode 100644 index 000000000..4970dfa5d --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/mixer.h @@ -0,0 +1,106 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +#ifndef MIXER_HH +#define MIXER_HH + +#include "SDL.h" +#include "SDL_mixer.h" +#include +#include +#include +#include "global.h" + +typedef vector MixChunks; +typedef vector Musics; + +class Mixer; + +extern Mixer mixer; + +const int MIXER_NUMBER_CHANNELS = 32; +// reserved for samples, which should play with priority +const int MIXER_RESERVED_CHANNELS = 8; + +class Mixer { + +private: + MixChunks mixChunks; + Musics musics; + + void initMixer(); + void freeMixer(); + + map< string, int > fn2mus; + map< string, int > fn2snd; + map< int, int > playsOn; + + bool enabled; + int reservedChannels; + int lastUsedReservedChannel; + + MusicTracks musicPlaying; + +public: + + Mixer(); + ~Mixer(); + + /* + Loads a sample, returns an id used for playSample + 0 as a return value indicates an error on loading + param volume: use with care: if the sound is loaded + for the first time, its volumevalue will be set to + volume, else it will be ignored. (0..127) + */ + int loadSample(string fileName, int volume=10); + + /* + plays the sample with the given id + if withPriority==true the sample will be played in one of the reserved channels + returns true if successfull, false otherwise + */ + bool playSample(int sampleId, int loop, bool withPriority=false); + + bool stopSample(int sampleId); + + /* + resets the Mixer (frees all samples and channels, inits new ones). + Use with care: + - samples still playing will be apruptly halted + - keep in mind that there is only one mixer + => it is resetted globally!!! + */ + void reset(); + + /* + fades out all channels + */ + void fadeOut(int mSecs); + + int loadMusic( string fileName ); + void playMusic( MusicTracks musNum, int loop, int fadeInTime=0 ); + void stopMusic( int fadeOutTime=0 ); + + MusicTracks whichMusicPlaying(); + + static const Mixer mixer(); +}; + +#endif //#define MIXER_HH diff --git a/alienblaster/project/jni/alienblaster/src/options.cc b/alienblaster/project/jni/alienblaster/src/options.cc new file mode 100644 index 000000000..ba99f7352 --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/options.cc @@ -0,0 +1,183 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +using namespace std; + +#include "options.h" +#include +#include +#include +#include +#include +#include + +Options::Options(const string lFilename) { + if (lFilename == "") { + cout << "Options: no filename given!" << endl; + filename = string("config"); + } else { + // save the filename for later use + filename = lFilename; + } + + // open the file for reading + ifstream inputFile (filename.c_str(), ios::in); + + // TODO FIXME ordentliches Filelocking machen + // fcntl(inputFile.rdbuf()->fd(), F_SETLKW, fileLock(F_RDLCK)); + + if (inputFile.good()) { + // while still data there + while (!inputFile.eof()) { + string newLine; + getline( inputFile, newLine ); + // search delimiter + unsigned int pos = newLine.find("="); + // comment line or no delimiter found + if (( newLine[0] != '#' ) && ( pos != string::npos )) { + string key = newLine.substr(0,pos); + string val = newLine.substr(pos+1); + keymap[ key ] = val; + } + } + } + else { + cout << "Options: Error while opening " << filename << endl; + } + + // TODO FIXME ordentliches Filelocking machen + // fcntl(inputFile.rdbuf()->fd(), F_SETLKW, fileLock(F_UNLCK)); + + inputFile.close(); +// if (inputFile.fail()) { +// cout << "Options: Error while closing " << filename << endl; +// } +} + + +Options::~Options() { + ; +} + + +// flock* Options::fileLock(const short type) { +// static flock ret ; +// ret.l_type = type ; +// ret.l_start = 0 ; +// ret.l_whence = SEEK_SET ; +// ret.l_len = 0 ; +// ret.l_pid = getpid() ; +// return &ret ; +// } + + +int Options::saveFile( const string lFilename ) { + // alternative filename given ? + if (lFilename != "") { + filename = lFilename; + } + + // delete original options-file + remove(filename.c_str()); + + ofstream outputFile( filename.c_str(), ios::out ); + + // TODO FIXME ordentliches Filelocking machen + // fcntl(outputFile.rdbuf()->fd(), F_SETLKW, fileLock(F_WRLCK)); + + if (outputFile.good()) { + map< string, string >::const_iterator iter; + for(iter = keymap.begin(); iter != keymap.end(); iter++){ + outputFile << iter->first << "=" << iter->second << endl; + } + } + else { + cout << "Options::saveFile(): error while opening file " << filename << endl; + return -1; + } + + // TODO FIXME ordentliches Filelocking machen + // fcntl(outputFile.rdbuf()->fd(), F_SETLKW, fileLock(F_UNLCK)); + + outputFile.close(); + if (!outputFile.good()) { + cout << "Options::saveFile(): error while closing file " << filename << endl; + return -2; + } + + return 0; // everything's fine +} + + +bool Options::exist(const string keyword) { + return (keymap.find(keyword) != keymap.end()); +} + + +bool Options::getStr(const string keyword, string &val) { + if (exist(keyword)) { + val = keymap[keyword]; + return true; + } + return false; +} + + +bool Options::getInt(const string keyword, int &val) { + if (exist(keyword)) { + val = atoi( keymap[keyword].c_str() ); + return true; + } + return false; +} + + +bool Options::getUInt(const string keyword, unsigned int &val) { + if (exist(keyword)) { + val = atoll( keymap[keyword].c_str() ); + return true; + } + return false; +} + + +bool Options::setStr(const string newValue, const string keyword) { + keymap[keyword] = newValue; + return true; +} + + +bool Options::setInt(const int newValue, const string keyword) { + keymap[keyword] = asString( newValue ); + return true; +} + + +bool Options::setUInt(const unsigned int newValue, const string keyword) { + keymap[keyword] = asString( newValue ); + return true; +} + + +void Options::printall() { + map< string, string >::const_iterator iter; + for(iter = keymap.begin(); iter != keymap.end(); iter++){ + cout << iter->first << "=" << iter->second << endl; + } +} diff --git a/alienblaster/project/jni/alienblaster/src/options.h b/alienblaster/project/jni/alienblaster/src/options.h new file mode 100644 index 000000000..8c629babe --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/options.h @@ -0,0 +1,84 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ + +/** + * @file Options.h + * @brief The Options-class can manage a configuration file. + * @date 23.06.02 + * The Options-class can manage a configuration file of this style: + * KEYWORD=value + * Provides easy-access functions for the keywords. + * $Id: options.h,v 1.2 2003/12/08 18:21:21 schwardt Exp $ + */ + +#ifndef __OPTIONS_H__ +#define __OPTIONS_H__ + + +#include +#include +#include +#include +#include +#include "asstring.h" + +class Options { + + private: + std::map< std::string, std::string > keymap; + std::string filename; + + public: + /// Constructor. Reads the configurationfile specified by lFilename. + Options( const std::string lFilename ); + /// Destructor. Frees all memory allocated. + ~Options(); + + /// Returns structure used for filelocking + // flock* Options::fileLock(const short type); // FIXME + /// Returns true if the given keyword exist + bool exist(const std::string keyword); + /// Returns the int value of keyword. + /// If keyword is not found returns 0. + bool getInt( const std::string keyword, int &val ); + /// Returns the unsigned int value of keyword. + /// If keyword is not found returns 0. + bool getUInt( const std::string keyword, unsigned int &val ); + /// Returns a copy of the char* value of keyword. + /// If keyword is not found returns NULL. + bool getStr( const std::string keyword, std::string &val ); + + /// sets the value of the given keyword to newValue + bool setInt( const int newValue, const std::string keyword ); + /// sets the value of the given keyword to newValue + bool setUInt( const unsigned int newValue, const std::string keyword ); + /// sets the value of the given keyword to newValue + bool setStr( const std::string newValue, const std::string keyword ); + + /// Stores the config-File to disk (filename as specified in the constructor). + /// You should call this function after changing a value. + int saveFile( const std::string lFilename ); + + /// Prints all lines of the actual configuration to cout. + void printall(); + +}; + +#endif diff --git a/alienblaster/project/jni/alienblaster/src/racer.cc b/alienblaster/project/jni/alienblaster/src/racer.cc new file mode 100644 index 000000000..c94f29303 --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/racer.cc @@ -0,0 +1,1154 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +using namespace std; + +#include "racer.h" +#include "surfaceDB.h" +#include "shot.h" +#include "shots.h" +#include "items.h" +#include "item.h" +#include "font.h" +#include "boundingBox.h" +#include "enemys.h" +#include "enemy.h" +#include "mixer.h" +#include "global.h" +#include "banners.h" +#include "shieldGlow.h" + +Racer::Racer( string fnSprite, int whichPlayer, Vector2D startpos , int newShipType) { + + spriteRacerBase = surfaceDB.loadSurface( fnSprite ); + drawRectBase.w = spriteRacerBase->w; + drawRectBase.h = spriteRacerBase->h; + playerNr = whichPlayer; + pos = startpos; + shipType = newShipType; + + // init weaponary and specials + timeLastShotPrimary = SDL_GetTicks(); + timeLastShotSecondary = SDL_GetTicks(); + lastDumbfireWasLeft = false; + timeLastHeatseekerUsed = SDL_GetTicks(); + timeLastNukeUsed = SDL_GetTicks(); + lastHeatseekerWasLeft = false; + deflectorActive = false; + deflectorTimeLeft = -1; + + for ( int i = 0; i < NR_SECONDARY_WEAPONS; i++ ) { + secondaryWeaponsAvailability[ i ] = false; + } + for ( int i = 0; i < NR_SPECIALS; i++ ) { + specialsAvailability[ i ] = 0; + } + specialsAvailability[ SPECIAL_NONE ] = 1; // this one is always present + + // assign values dependant on shiptype + switch (shipType) { + case LIGHT_FIGHTER: + { + maxShield = LIGHT_FIGHTER_MAX_SHIELD; + maxDamage = LIGHT_FIGHTER_MAX_DAMAGE; + shield = maxShield; + damage = maxDamage; + maxVel = LIGHT_FIGHTER_VEL_MAX; + spriteShadow = surfaceDB.loadSurface( FN_LIGHT_FIGHTER_SHADOW, true ); + shieldGlow = new ShieldGlow( LIGHT_FIGHTER ); + if ( playerNr == 0 ) { + spriteFighterIcon = surfaceDB.loadSurface( FN_LIGHT_FIGHTER_1_SMALL ); + } else { + spriteFighterIcon = surfaceDB.loadSurface( FN_LIGHT_FIGHTER_2_SMALL ); + } + if ( arcadeGame ) { + secondaryWeaponsAvailability[ SHOT_DUMBFIRE_DOUBLE-100 ] = true; + secondaryWeaponsAvailability[ SHOT_KICK_ASS_ROCKET-100 ] = true; + secondaryWeaponsAvailability[ SHOT_HELLFIRE-100 ] = true; + secondaryWeaponsAvailability[ SHOT_MACHINE_GUN-100 ] = true; + secondaryWeaponsAvailability[ SHOT_ENERGY_BEAM-100 ] = true; + primaryShotType = SHOT_TRIPLE; + activeSecondary = SHOT_HELLFIRE; + activeSpecial = SPECIAL_NUKE; switchSpecials(); // init specials + } else { + secondaryWeaponsAvailability[ 0 ] = true; // Dumbfire is always available + primaryShotType = SHOT_NORMAL; + activeSecondary = SHOT_DUMBFIRE; + activeSpecial = SPECIAL_NUKE; switchSpecials(); // init specials + } + break; + } + case HEAVY_FIGHTER: + { + maxShield = HEAVY_FIGHTER_MAX_SHIELD; + maxDamage = HEAVY_FIGHTER_MAX_DAMAGE; + shield = maxShield; + damage = maxDamage; + maxVel = HEAVY_FIGHTER_VEL_MAX; + spriteShadow = surfaceDB.loadSurface( FN_HEAVY_FIGHTER_SHADOW, true ); + shieldGlow = new ShieldGlow( HEAVY_FIGHTER ); + if ( playerNr == 0 ) { + spriteFighterIcon = surfaceDB.loadSurface( FN_HEAVY_FIGHTER_1_SMALL ); + } else { + spriteFighterIcon = surfaceDB.loadSurface( FN_HEAVY_FIGHTER_2_SMALL ); + } + if ( arcadeGame ) { + secondaryWeaponsAvailability[ SHOT_HF_DUMBFIRE_DOUBLE-100 ] = true; + secondaryWeaponsAvailability[ SHOT_HF_KICK_ASS_ROCKET-100 ] = true; + secondaryWeaponsAvailability[ SHOT_HF_LASER-100 ] = true; + primaryShotType = SHOT_HF_QUINTO; + activeSecondary = SHOT_HF_KICK_ASS_ROCKET; + activeSpecial = SPECIAL_NUKE; switchSpecials(); // init specials + } else { + // Dumbfire is always available + secondaryWeaponsAvailability[ SHOT_HF_DUMBFIRE-100 ] = true; + specialsAvailability[ SPECIAL_DEFLECTOR ] = 1; + primaryShotType = SHOT_HF_NORMAL; + activeSecondary = SHOT_HF_DUMBFIRE; + specialsAvailability[ SPECIAL_NUKE ] = 1; + activeSpecial = SPECIAL_NUKE; switchSpecials(); // init specials + } + break; + } + } + + spriteHPStat = surfaceDB.loadSurface( FN_HITPOINTS_STAT ); + pixPerHP = spriteHPStat->w / (maxDamage + maxShield); + + shieldDamageEndTime = 0; + shieldDamageActive = false; + + if ( whichPlayer == 0 ) { + font = new Font( FN_FONT_NUMBERS_LEFT ); + } else { + font = new Font( FN_FONT_NUMBERS_RIGHT ); + } + fontSize = font->getCharWidth(); + + sndShotPrimary = mixer.loadSample( FN_SOUND_SHOT_PRIMARY ); + sndShotSecondary = mixer.loadSample( FN_SOUND_SHOT_SECONDARY ); + + spriteSpecials = surfaceDB.loadSurface( FN_ICONS_SPECIALS ); + spriteSecondaryWeapons = surfaceDB.loadSurface( FN_ICONS_SECONDARY_WEAPONS ); + + spriteDeflector = surfaceDB.loadSurface( FN_HEAVY_FIGHTER_DEFLECTOR, true ); + drawRectDeflector.w = spriteDeflector->w; + drawRectDeflector.h = spriteDeflector->h; + + boundaryRect = + new RectangleGeo(Vector2D(spriteRacerBase->w/(2*RACER_IMAGE_CNT), spriteRacerBase->h/2), + Vector2D(320-spriteRacerBase->w/(2*RACER_IMAGE_CNT), 200-spriteRacerBase->h/2)); + + boundingBox = new BoundingBox( lroundf(pos.getX() - (spriteRacerBase->w / RACER_IMAGE_CNT) * 0.45), + lroundf(pos.getY() - spriteRacerBase->h * 0.45), + lroundf((spriteRacerBase->w / RACER_IMAGE_CNT) * 0.9), + lroundf(spriteRacerBase->h * 0.9) ); + + shipAngle = -90; + vel = Vector2D(0,0); + thrust = false; + backwards = false; + left = false; + right = false; + fireWeapons = false; + useSpecial = false; + + points = 0; + + timeLastMove = SDL_GetTicks(); +} + + +Racer::~Racer() { + delete boundaryRect; + delete boundingBox; + if (font) delete font; + delete shieldGlow; +} + + +Vector2D Racer::move( int dT ) { + // TODO: move this to a correct place + if ( deflectorActive ) { + deflectorTimeLeft -= dT; + if (deflectorTimeLeft < 0) deflectorActive = false; + } + + Vector2D oldPos = pos; + + if ( thrust ) { + pos += Vector2D( 0, -maxVel ) * dT / 1000.0; + } + if ( backwards ) { + pos += Vector2D( 0, maxVel ) * dT / 1000.0; + } + if ( left ) { + pos += Vector2D( -maxVel, 0 ) * dT / 1000.0; + } + if ( right ) { + pos += Vector2D( maxVel, 0 ) * dT / 1000.0; + } + + clipWorld(); + + updateBoundingBox(); + + return oldPos; +} + + +void Racer::clipWorld() { + int left = lroundf(pos.getX()) - (spriteRacerBase->w / (2*RACER_IMAGE_CNT)); + int top = lroundf(pos.getY()) - (spriteRacerBase->h / 2); + int right = lroundf(pos.getX()) + (spriteRacerBase->w / (2*RACER_IMAGE_CNT)); + int bottom = lroundf(pos.getY()) + (spriteRacerBase->h / 2); + if ( left <= 1 ) { + pos.setX( 1 + spriteRacerBase->w / (2*RACER_IMAGE_CNT) ); + } else if ( right >= SCREEN_WIDTH - 1 ) { + pos.setX( SCREEN_WIDTH - 2 - spriteRacerBase->w / (2*RACER_IMAGE_CNT)); + } + if ( top <= 1 ) { + pos.setY( 1 + spriteRacerBase->h / 2 ); + } else if ( bottom >= SCREEN_HEIGHT - 1 ) { + pos.setY( SCREEN_HEIGHT - 2 - spriteRacerBase->h / 2 ); + } +} + + +void Racer::drawStats( SDL_Surface *screen ) { + SDL_Rect srcR, destR; + + int indent = 5; + + if ( playerNr == 1 ) { + indent = screen->w - + ( 7 + 3 * fontSize + (spriteSpecials->w / (NR_SPECIALS-1)) ) - + ( 5 + spriteSecondaryWeapons->w / NR_SECONDARY_WEAPONS ); + } + + int x = indent; + + // draw Secondary Weapon + srcR.x = (activeSecondary - SHOT_DUMBFIRE) * spriteSecondaryWeapons->w / NR_SECONDARY_WEAPONS; + srcR.y = 0; + srcR.w = spriteSecondaryWeapons->w / NR_SECONDARY_WEAPONS; + srcR.h = spriteSecondaryWeapons->h; + destR.x = x; + destR.y = 25; + destR.w = spriteSecondaryWeapons->w / NR_SECONDARY_WEAPONS; + x += destR.w + 5; + destR.h = spriteSecondaryWeapons->h; + SDL_BlitSurface( spriteSecondaryWeapons, &srcR, screen, &destR ); + + // draw active special and amount of it + if ( activeSpecial != SPECIAL_NONE ) { + int pixPerSpecial = spriteSpecials->w / (NR_SPECIALS - 1); + srcR.y = 0; + srcR.w = pixPerSpecial; + srcR.h = spriteSpecials->h; + srcR.x = (activeSpecial - SPECIAL_NUKE) * pixPerSpecial; + destR.x = x; + destR.y = 25; + destR.w = pixPerSpecial; + x += pixPerSpecial + 2; + destR.h = spriteSpecials->h; + SDL_BlitSurface( spriteSpecials, &srcR, screen, &destR ); + int digitCnt = 1; + int i=1; + while ( specialsAvailability[ activeSpecial ] >= i*10 ) { + digitCnt++; + i *= 10; + } + font->drawInt( screen, x, 25, + specialsAvailability[ activeSpecial ], digitCnt, 0); + } + + if ( !onePlayerGame ) { + // draw Icon + switch (playerNr) { + case 0: indent = 10 + spriteHPStat->w; break; + case 1: indent = screen->w - (20 + spriteHPStat->w + spriteFighterIcon->w); break; + default: break; + } + destR.x = indent; + destR.w = spriteFighterIcon->w; + destR.y = 2; + destR.h = spriteFighterIcon->h; + SDL_BlitSurface( spriteFighterIcon, 0, screen, &destR ); + } + + // draw shields and damage + switch (playerNr) { + case 0: indent = 5; break; + case 1: indent = screen->w - (15 + spriteHPStat->w); break; + default: break; + } + + // draw damage + srcR.x = 0; + srcR.y = 0; + srcR.w = lroundf(damage * pixPerHP); + srcR.h = spriteHPStat->h; + destR.x = indent; + destR.w = srcR.w; + destR.y = 5; + destR.h = spriteHPStat->h; + SDL_BlitSurface( spriteHPStat, &srcR, screen, &destR ); + // draw shield + destR.x = indent + srcR.w; + srcR.x = spriteHPStat->w / 2; + srcR.w = lroundf(shield * pixPerHP); + destR.w = srcR.w; + destR.h = spriteHPStat->h; + SDL_BlitSurface( spriteHPStat, &srcR, screen, &destR ); +} + + +void Racer::drawShadow( SDL_Surface *screen ) { + SDL_Rect destR; + destR.x = lroundf(pos.getX()) - (spriteShadow->w / 2) - 10; + destR.y = lroundf(pos.getY()) - (spriteShadow->h / 2) + 10; + destR.w = spriteShadow->w; + destR.h = spriteShadow->h; + SDL_BlitSurface( spriteShadow, 0, screen, &destR ); +} + + +void Racer::drawRacer( SDL_Surface *screen ) { + + SDL_Rect srcR; + SDL_Rect destR; + + destR.x = lroundf(pos.getX()) - (spriteRacerBase->w / (2*RACER_IMAGE_CNT)); + destR.y = lroundf(pos.getY()) - (spriteRacerBase->h / 2); + destR.w = spriteRacerBase->w / RACER_IMAGE_CNT; + destR.h = spriteRacerBase->h; + + int idx = 0; // normal pos + if ( !left && !right && !thrust && !backwards ) idx = 0; //stop + else if ( left && !right && !thrust && !backwards ) idx = 1; // left + else if ( !left && right && !thrust && !backwards ) idx = 2; // right + else if ( !left && !right && thrust && !backwards ) idx = 3; // forward + else if ( !left && !right && !thrust && backwards ) idx = 4; // backward + else if ( left && !right && thrust && !backwards ) idx = 5; // left-forward + else if ( !left && right && thrust && !backwards ) idx = 6; // right-forward + else if ( left && !right && !thrust && backwards ) idx = 7; // left-backward + else if ( !left && right && !thrust && backwards ) idx = 8; // right-backward + srcR.x = idx * (spriteRacerBase->w / RACER_IMAGE_CNT); + srcR.y = 0; + srcR.w = (spriteRacerBase->w / RACER_IMAGE_CNT); + srcR.h = spriteRacerBase->h; + + SDL_BlitSurface( spriteRacerBase, &srcR, screen, &destR ); + + if ( shieldDamageActive ) { + int shieldGlowTimeLeft = shieldDamageEndTime - SDL_GetTicks(); + if ( shieldGlowTimeLeft < 0 ) { + shieldDamageActive = false; + } else { + shieldGlow->draw( screen, pos, RACER_SHIELD_DAMAGE_LIFETIME - shieldGlowTimeLeft ); + } + } + + if ( deflectorActive ) { + drawRectDeflector.x = lroundf(pos.getX()) - spriteDeflector->w / 2; + drawRectDeflector.y = lroundf(pos.getY()) - spriteDeflector->h / 2; + SDL_BlitSurface( spriteDeflector, 0, screen, &drawRectDeflector ); + } +} + + +void Racer::switchSecondary() { + int newActive = (activeSecondary-100 + 1) % NR_SECONDARY_WEAPONS; + while ( newActive != activeSecondary-100 && + secondaryWeaponsAvailability[ newActive ] == false ) { + newActive = (newActive + 1) % NR_SECONDARY_WEAPONS; + } + activeSecondary = (ShotTypes)(newActive+100); + + if ( activeSecondary == SHOT_DUMBFIRE && + secondaryWeaponsAvailability[ SHOT_DUMBFIRE_DOUBLE - 100 ] ) { + activeSecondary = SHOT_DUMBFIRE_DOUBLE; + } + // same for heavy-fighter + if ( activeSecondary == SHOT_HF_DUMBFIRE && + secondaryWeaponsAvailability[ SHOT_HF_DUMBFIRE_DOUBLE - 100 ] ) { + activeSecondary = SHOT_HF_DUMBFIRE_DOUBLE; + } + + // TODO: ugly workaround... + if ( activeSecondary == SHOT_KICK_ASS_ROCKET || + activeSecondary == SHOT_HF_KICK_ASS_ROCKET ) { + timeLastShotSecondary -= RACER_COOLDOWN_KICK_ASS_ROCKET / 2; + } +} + +void Racer::switchSpecials() { + int newActive = activeSpecial + 1; + if ( newActive == NR_SPECIALS ) newActive = 1; + for(int i=0; i < NR_SPECIALS-1; ++i) { + // Only Sönke knows what the following does ;-) + if (specialsAvailability[ ((activeSpecial + i) % (NR_SPECIALS-1))+1 ] != 0) { + activeSpecial = (SpecialTypes)(((activeSpecial + i) % (NR_SPECIALS-1))+1); + return; + } + } + activeSpecial = SPECIAL_NONE; +} + + +void Racer::shootPrimary() { + if ( fireWeapons ) { + + switch ( primaryShotType ) { + case SHOT_NORMAL: + { + if ( (SDL_GetTicks() - RACER_COOLDOWN_SHOT_NORMAL) > timeLastShotPrimary ) { + Shot *shot = + new Shot( SHOT_NORMAL, playerNr, + pos + Vector2D(0, -spriteRacerBase->h / 2), + -90 + (rand() % SPREAD_ANGLE_SHOT_NORMAL) - + SPREAD_ANGLE_SHOT_NORMAL / 2 ); + shots->addShot( shot ); + mixer.playSample( sndShotPrimary, 0 ); + timeLastShotPrimary = SDL_GetTicks(); + } + break; + } + case SHOT_NORMAL_HEAVY: + { + if ( SDL_GetTicks() - RACER_COOLDOWN_SHOT_NORMAL_HEAVY > timeLastShotPrimary ) { + Shot *shot = + new Shot( SHOT_NORMAL_HEAVY, playerNr, + pos + Vector2D(0, -spriteRacerBase->h / 2), -90 ); + shots->addShot( shot ); + mixer.playSample( sndShotPrimary, 0 ); + timeLastShotPrimary = SDL_GetTicks(); + } + break; + } + case SHOT_DOUBLE: + { + if ( SDL_GetTicks() - RACER_COOLDOWN_SHOT_DOUBLE > timeLastShotPrimary ) { + Shot *shot1 = + new Shot( SHOT_DOUBLE, playerNr, pos + Vector2D(-8,-2), -95 ); + Shot *shot2 = + new Shot( SHOT_DOUBLE, playerNr, pos + Vector2D(8,-2), -85 ); + shots->addShot(shot1); + shots->addShot(shot2); + mixer.playSample( sndShotPrimary, 0 ); + timeLastShotPrimary = SDL_GetTicks(); + } + break; + } + case SHOT_DOUBLE_HEAVY: + { + if ( SDL_GetTicks() - RACER_COOLDOWN_SHOT_DOUBLE_HEAVY > timeLastShotPrimary ) { + Shot *shot1 = + new Shot( SHOT_DOUBLE_HEAVY, playerNr, pos + Vector2D(-8,-2), -95 ); + Shot *shot2 = + new Shot( SHOT_DOUBLE_HEAVY, playerNr, pos + Vector2D(8,-2), -85 ); + shots->addShot(shot1); + shots->addShot(shot2); + mixer.playSample( sndShotPrimary, 0 ); + timeLastShotPrimary = SDL_GetTicks(); + } + break; + } + case SHOT_TRIPLE: + { + if ( SDL_GetTicks() - RACER_COOLDOWN_SHOT_TRIPLE > timeLastShotPrimary ) { + Shot *shot1 = + new Shot( SHOT_TRIPLE, playerNr, pos + Vector2D(-8, -2), -100 ); + Shot *shot2 = + new Shot( SHOT_TRIPLE, playerNr, pos + Vector2D(0, -spriteRacerBase->h / 2), -90 ); + Shot *shot3 = + new Shot( SHOT_TRIPLE, playerNr, pos + Vector2D(8, -2), -80 ); + shots->addShot(shot1); + shots->addShot(shot2); + shots->addShot(shot3); + mixer.playSample( sndShotPrimary, 0 ); + timeLastShotPrimary = SDL_GetTicks(); + } + break; + } + + // HEAVY FIGHTER SHOTS + case SHOT_HF_NORMAL: + { + if ( (SDL_GetTicks() - RACER_COOLDOWN_SHOT_HF_NORMAL) > timeLastShotPrimary ) { + Shot *shot = + new Shot( SHOT_HF_NORMAL, playerNr, + pos + Vector2D(0, -spriteRacerBase->h / 2), -90 ); + shots->addShot( shot ); + mixer.playSample( sndShotPrimary, 0 ); + timeLastShotPrimary = SDL_GetTicks(); + } + break; + } + case SHOT_HF_DOUBLE: + { + if ( (SDL_GetTicks() - RACER_COOLDOWN_SHOT_HF_DOUBLE) > timeLastShotPrimary ) { + Shot *shot = new Shot( SHOT_HF_DOUBLE, playerNr, pos + Vector2D(-12, -12), -90 ); + shots->addShot( shot ); + shot = new Shot( SHOT_HF_DOUBLE, playerNr, pos + Vector2D(12, -12), -90 ); + shots->addShot( shot ); + mixer.playSample( sndShotPrimary, 0 ); + timeLastShotPrimary = SDL_GetTicks(); + } + break; + } + case SHOT_HF_TRIPLE: + { + if ( (SDL_GetTicks() - RACER_COOLDOWN_SHOT_HF_TRIPLE) > timeLastShotPrimary ) { + Shot *shot = new Shot( SHOT_HF_TRIPLE, playerNr, pos + Vector2D(-12, -12), -103 ); + shots->addShot( shot ); + shot = new Shot( SHOT_HF_TRIPLE, playerNr, + pos + Vector2D(0, -spriteRacerBase->h / 2), -90 ); + shots->addShot( shot ); + shot = new Shot( SHOT_HF_TRIPLE, playerNr, pos + Vector2D(12, -12), -77 ); + shots->addShot( shot ); + mixer.playSample( sndShotPrimary, 0 ); + timeLastShotPrimary = SDL_GetTicks(); + } + break; + } + case SHOT_HF_QUATTRO: + { + if ( (SDL_GetTicks() - RACER_COOLDOWN_SHOT_HF_QUATTRO) > timeLastShotPrimary ) { + Shot *shot = new Shot( SHOT_HF_QUATTRO, playerNr, pos + Vector2D(-30, -15), -100 ); + shots->addShot( shot ); + shot = new Shot( SHOT_HF_QUATTRO, playerNr, pos + Vector2D(-12, -12), -90 ); + shots->addShot( shot ); + shot = new Shot( SHOT_HF_QUATTRO, playerNr, pos + Vector2D(12, -12), -90 ); + shots->addShot( shot ); + shot = new Shot( SHOT_HF_QUATTRO, playerNr, pos + Vector2D(30, -15), -80 ); + shots->addShot( shot ); + mixer.playSample( sndShotPrimary, 0 ); + timeLastShotPrimary = SDL_GetTicks(); + } + break; + } + case SHOT_HF_QUINTO: + { + if ( (SDL_GetTicks() - RACER_COOLDOWN_SHOT_HF_QUINTO) > timeLastShotPrimary ) { + Shot *shot = new Shot( SHOT_HF_QUINTO, playerNr, pos + Vector2D(-30, -15), -110 ); + shots->addShot( shot ); + shot = new Shot( SHOT_HF_QUINTO, playerNr, pos + Vector2D(-12, -12), -100 ); + shots->addShot( shot ); + shot = new Shot( SHOT_HF_QUINTO, playerNr, + pos + Vector2D(0, -spriteRacerBase->h / 2), -90 ); + shots->addShot( shot ); + shot = new Shot( SHOT_HF_QUINTO, playerNr, pos + Vector2D(12, -12), -80 ); + shots->addShot( shot ); + shot = new Shot( SHOT_HF_QUINTO, playerNr, pos + Vector2D(30, -15), -70 ); + shots->addShot( shot ); + mixer.playSample( sndShotPrimary, 0 ); + timeLastShotPrimary = SDL_GetTicks(); + } + break; + } + + default: + { + cout << "Racer::shootPrimary: unexpected primaryShotType: " + << primaryShotType << endl; + break; + } + } + } +} + + +void Racer::shootSecondary() { + if ( fireWeapons ) { + + switch ( activeSecondary ) { + + case SHOT_DUMBFIRE: + { + if ( SDL_GetTicks() - RACER_COOLDOWN_DUMBFIRE > timeLastShotSecondary ) { + Shot *shot = + new Shot( SHOT_DUMBFIRE, playerNr, pos + Vector2D(0, -5), -90 ); + shots->addShot(shot); + mixer.playSample( sndShotSecondary, 0 ); + timeLastShotSecondary = SDL_GetTicks(); + } + break; + } + case SHOT_DUMBFIRE_DOUBLE: + { + if ( SDL_GetTicks() - RACER_COOLDOWN_DUMBFIRE_DOUBLE > timeLastShotSecondary ) { + Shot *shot; + if ( lastDumbfireWasLeft ) { + shot = new Shot( SHOT_DUMBFIRE_DOUBLE, playerNr, pos + Vector2D(15,-3), -90 ); + } else { + shot = new Shot( SHOT_DUMBFIRE_DOUBLE, playerNr, pos + Vector2D(-15,-3), -90 ); + } + lastDumbfireWasLeft = !lastDumbfireWasLeft; + shots->addShot(shot); + mixer.playSample( sndShotSecondary, 0 ); + timeLastShotSecondary = SDL_GetTicks(); + } + break; + } + case SHOT_KICK_ASS_ROCKET: + { + if ( SDL_GetTicks() - RACER_COOLDOWN_KICK_ASS_ROCKET > timeLastShotSecondary ) { + Shot *shot = + new Shot( SHOT_KICK_ASS_ROCKET, playerNr, pos, -90 ); + shots->addShot(shot); + mixer.playSample( sndShotSecondary, 0 ); + timeLastShotSecondary = SDL_GetTicks(); + } + break; + } + case SHOT_HELLFIRE: + { + if ( SDL_GetTicks() - RACER_COOLDOWN_HELLFIRE > timeLastShotSecondary ) { + Shot *shot1 = + new Shot( SHOT_HELLFIRE, playerNr, pos + Vector2D(-15, -3), -180 ); + Shot *shot2 = + new Shot( SHOT_HELLFIRE, playerNr, pos + Vector2D(15, -3), 0 ); + shots->addShot(shot1); + shots->addShot(shot2); + mixer.playSample( sndShotSecondary, 0 ); + timeLastShotSecondary = SDL_GetTicks(); + } + break; + } + case SHOT_MACHINE_GUN: + { + if ( SDL_GetTicks() - RACER_COOLDOWN_MACHINE_GUN > timeLastShotSecondary ) { + + int idxNearestEnemy1 = 0; + float distFarestY1 = -1; + int idxNearestEnemy2 = 0; + float distFarestY2 = -1; + float angle1 = -90; + float angle2 = -90; + float maxDistY = pos.getY() + 40; // only enemys in or already in the screen + for ( unsigned int i = 0; i < enemys->getNrEnemys(); i++ ) { + // angle of the vector from the racer position to the enemy + float angleEnemy = (enemys->getEnemy(i)->getPos() - pos).getDirection(); + if ( -90 <= angleEnemy && angleEnemy < -60 ) { + float distY = pos.getY() - enemys->getEnemy(i)->getPos().getY(); + if ( distFarestY1 < distY && distY < maxDistY ) { + distFarestY1 = distY; + idxNearestEnemy1 = i; + angle2 = angleEnemy + 5; + } + } else { + if ( -120 < angleEnemy && angleEnemy < -90 ) { + float distY = pos.getY() - enemys->getEnemy(i)->getPos().getY(); + if ( distFarestY2 < distY && distY < maxDistY ) { + distFarestY2 = distY; + idxNearestEnemy2 = i; + angle1 = angleEnemy - 5; + } + } + } + } + + Shot *shot1 = + new Shot( SHOT_MACHINE_GUN, playerNr, + pos + Vector2D(-3, -spriteRacerBase->h/2), angle1 ); + Shot *shot2 = + new Shot( SHOT_MACHINE_GUN, playerNr, + pos + Vector2D(+3, -spriteRacerBase->h/2), angle2 ); + shots->addShot(shot1); + shots->addShot(shot2); + mixer.playSample( sndShotSecondary, 0 ); + timeLastShotSecondary = SDL_GetTicks(); + } + break; + } + case SHOT_ENERGY_BEAM: + { + if ( SDL_GetTicks() - RACER_COOLDOWN_ENERGY_BEAM > timeLastShotSecondary ) { + Shot *shot = + new Shot( SHOT_ENERGY_BEAM, playerNr, pos + Vector2D(-1, -10), -90 ); + shots->addShot(shot); + mixer.playSample( sndShotSecondary, 0 ); + timeLastShotSecondary = SDL_GetTicks(); + } + break; + } + + // HEAVY FIGHTER SHOTS + case SHOT_HF_DUMBFIRE: + { + if ( SDL_GetTicks() - RACER_COOLDOWN_HF_DUMBFIRE > timeLastShotSecondary ) { + Shot *shot = + new Shot( SHOT_HF_DUMBFIRE, playerNr, pos + Vector2D(-30, -5), -90 ); + shots->addShot(shot); + shot = + new Shot( SHOT_HF_DUMBFIRE, playerNr, pos + Vector2D(30, -5), -90 ); + shots->addShot(shot); + mixer.playSample( sndShotSecondary, 0 ); + timeLastShotSecondary = SDL_GetTicks(); + } + break; + } + case SHOT_HF_DUMBFIRE_DOUBLE: + { + if ( SDL_GetTicks() - RACER_COOLDOWN_HF_DUMBFIRE_DOUBLE > timeLastShotSecondary ) { + Shot *shot = + new Shot( SHOT_HF_DUMBFIRE_DOUBLE, playerNr, pos + Vector2D(-30, -5), -90 ); + shots->addShot(shot); + shot = + new Shot( SHOT_HF_DUMBFIRE_DOUBLE, playerNr, pos + Vector2D(30, -5), -90 ); + shots->addShot(shot); + mixer.playSample( sndShotSecondary, 0 ); + timeLastShotSecondary = SDL_GetTicks(); + } + break; + } + case SHOT_HF_KICK_ASS_ROCKET: + { + if ( SDL_GetTicks() - RACER_COOLDOWN_HF_KICK_ASS_ROCKET > timeLastShotSecondary ) { + Shot *shot1 = + new Shot( SHOT_HF_KICK_ASS_ROCKET, playerNr, pos + Vector2D(-30,0), -90 ); + shots->addShot(shot1); + Shot *shot2 = + new Shot( SHOT_HF_KICK_ASS_ROCKET, playerNr, pos + Vector2D(30,0), -90 ); + shots->addShot(shot2); + mixer.playSample( sndShotSecondary, 0 ); + timeLastShotSecondary = SDL_GetTicks(); + } + break; + } + case SHOT_HF_LASER: + { + if ( SDL_GetTicks() - RACER_COOLDOWN_HF_LASER > timeLastShotSecondary ) { + Shot *shot1 = + new Shot( SHOT_HF_LASER, playerNr, pos + Vector2D(-30,-10), -90 ); + shots->addShot(shot1); + Shot *shot2 = + new Shot( SHOT_HF_LASER, playerNr, pos + Vector2D(30,-10), -90 ); + shots->addShot(shot2); + mixer.playSample( sndShotSecondary, 0 ); + timeLastShotSecondary = SDL_GetTicks(); + } + break; + } + + default: + { + cout << "Racer::shootSecondary: unexpected activeSecondary: " + << activeSecondary << endl; + break; + } + } + + } +} + + +void Racer::shootSpecial() { + if ( useSpecial ) { + + switch ( activeSpecial ) { + + case SPECIAL_HEATSEEKER: + { + if ( SDL_GetTicks() - RACER_COOLDOWN_SPECIAL_HEATSEEKER > timeLastHeatseekerUsed && + specialsAvailability[ SPECIAL_HEATSEEKER ] > 0 ) { + Shot *shot; + if ( lastHeatseekerWasLeft ) { + shot = new Shot( SPECIAL_SHOT_HEATSEEKER, playerNr, pos + Vector2D(15,-3), -90 ); + } else { + shot = new Shot( SPECIAL_SHOT_HEATSEEKER, playerNr, pos + Vector2D(-15,-3), -90 ); + } + lastHeatseekerWasLeft = !lastHeatseekerWasLeft; + shots->addShot(shot); + mixer.playSample( sndShotSecondary, 0 ); + timeLastHeatseekerUsed = SDL_GetTicks(); + specialsAvailability[ SPECIAL_HEATSEEKER ]--; + } + break; + } + default: break; + } + } +} + + +bool Racer::collidesWith( const Vector2D &shotPosOld, const Vector2D &shotPosNew ) { + return boundingBox->overlaps(shotPosOld, shotPosNew); +} + +bool Racer::collidesWith( BoundingBox *box ) { + return boundingBox->overlaps( box ); +} + +bool Racer::collidesWith( const Circle &circle ) { + return boundingBox->overlaps( circle ); +} + +bool Racer::collidesWithAsCircle( const Circle &circle ) { + return ( (circle.getRadius() + (spriteRacerBase->w / RACER_IMAGE_CNT)/2) > circle.getCenter().distanceTo( pos ) ); +} + +bool Racer::collidesWithAsCircle( BoundingBox *box ) { + return ( box->overlaps( Circle( pos, spriteRacerBase->h >> 1 ) ) ); +} + +BoundingBox *Racer::getBoundingBox() { + return boundingBox; +} + + +bool Racer::isDead() { + return (damage < 0); +} + + +void Racer::receiveDamage( float amount ) { + if ( lroundf(shield) >= amount ) { + shield -= amount; + shieldDamageActive = true; + shieldDamageEndTime = SDL_GetTicks() + RACER_SHIELD_DAMAGE_LIFETIME; + return; + } + amount -= shield; + shield = 0; + damage -= amount; +} + +void Racer::doDamage( ShotTypes shotType ) { + + switch (shotType) { + case ENEMY_SHOT_NORMAL: + { + receiveDamage( DAMAGE_ENEMY_SHOT_NORMAL ); + break; + } + case ENEMY_SHOT_TANK_ROCKET: + { + receiveDamage( DAMAGE_ENEMY_SHOT_TANK_ROCKET ); + break; + } + default: + { + cout << "Racer::doDamage: unexpected shotType: " << shotType << endl; + break; + } + } +} + +void Racer::rechargeShield ( int dT ) { + float amount; + if ( shipType == LIGHT_FIGHTER ) { + amount = LIGHT_FIGHTER_SHIELD_RECHARGE * dT / 100000.0; + } else { + amount = HEAVY_FIGHTER_SHIELD_RECHARGE * dT / 100000.0; + } + if (shield + amount < maxShield) shield += amount; + else shield = maxShield; +} + +void Racer::receivePoints( float amount ) { + float oldPoints = points; + points += amount; + + if ( arcadeGame ) { + // time for a health item? + for ( int i = 0; i < NR_ARCACE_POINTS_FOR_HEALTH_ITEM; i++ ) { + if ( oldPoints < ARCADE_POINTS_FOR_HEALTH_ITEM[ i ] && + ARCADE_POINTS_FOR_HEALTH_ITEM[ i ] <= points ) { + Item *health = new Item( Vector2D( SCREEN_WIDTH / 2, -30 ), + Vector2D( 0, 30 ), + ITEM_HEALTH ); + items->addItem( health ); + banners->addBanner( BANNER_HEALTH, BANNER_MODE_FLY_FROM_LEFT, BANNER_BONUS_NONE ); + break; + } + } + } + +} + + +Vector2D Racer::setVel( const Vector2D &newVel ) { + Vector2D temp = vel; + vel = newVel; + if ( vel.getLength() >= getActVelMax() ) { + vel.setLength(getActVelMax()); + } + return temp; +} + + +void Racer::setPos( const Vector2D &newPos ) { + pos = newPos; + updateBoundingBox(); +} + + +void Racer::updateBoundingBox() { + boundingBox->moveUpperBound( lroundf(pos.getY() - spriteRacerBase->h * 0.45) ); + boundingBox->moveLeftBound( lroundf(pos.getX() - (spriteRacerBase->w / RACER_IMAGE_CNT) * 0.45) ); +} + + +void Racer::pickUpItems() { + for ( unsigned int i = 0; i < items->getNrItems(); i++ ) { + Item *item = items->getItem(i); + if ( !item->isExpired() && boundingBox->overlaps( item->getBoundingBox() ) ) { + switch (item->getType()) { + case ITEM_PRIMARY_UPGRADE: + { + int newPrimaryShotType = primaryShotType + 1; + if ( shipType == LIGHT_FIGHTER && newPrimaryShotType <= SHOT_TRIPLE ) + primaryShotType = (ShotTypes)newPrimaryShotType; + else if ( shipType == HEAVY_FIGHTER && newPrimaryShotType <= SHOT_HF_QUINTO ) + primaryShotType = (ShotTypes)newPrimaryShotType; + item->pickedUp(); + addBannerItemCollected( BANNER_ITEM_PRIMARY_UPGRADE_COLLECTED ); + break; + } + case ITEM_DUMBFIRE_DOUBLE: + { + if ( shipType == LIGHT_FIGHTER ) { + secondaryWeaponsAvailability[ SHOT_DUMBFIRE_DOUBLE - 100 ] = true; + if (activeSecondary == SHOT_DUMBFIRE ) activeSecondary = SHOT_DUMBFIRE_DOUBLE; + } else { + secondaryWeaponsAvailability[ SHOT_HF_DUMBFIRE_DOUBLE - 100 ] = true; + if (activeSecondary == SHOT_HF_DUMBFIRE ) activeSecondary = SHOT_HF_DUMBFIRE_DOUBLE; + } + item->pickedUp(); + addBannerItemCollected( BANNER_ITEM_DUMBFIRE_DOUBLE_COLLECTED ); + break; + } + case ITEM_KICK_ASS_ROCKET: + { + if ( shipType == LIGHT_FIGHTER ) + secondaryWeaponsAvailability[ SHOT_KICK_ASS_ROCKET - 100 ] = true; + else + secondaryWeaponsAvailability[ SHOT_HF_KICK_ASS_ROCKET - 100 ] = true; + item->pickedUp(); + addBannerItemCollected( BANNER_ITEM_KICK_ASS_ROCKET_COLLECTED ); + break; + } + case ITEM_HELLFIRE: + { + if ( shipType == LIGHT_FIGHTER ) { + secondaryWeaponsAvailability[ SHOT_HELLFIRE - 100 ] = true; + item->pickedUp(); + addBannerItemCollected( BANNER_ITEM_HELLFIRE_COLLECTED ); + } + break; + } + case ITEM_MACHINE_GUN: + { + if ( shipType == LIGHT_FIGHTER ) { + secondaryWeaponsAvailability[ SHOT_MACHINE_GUN - 100 ] = true; + item->pickedUp(); + addBannerItemCollected( BANNER_ITEM_MACHINE_GUN_COLLECTED ); + } + break; + } + case ITEM_HEALTH: + { + if ( arcadeGame ) { + repair( ITEM_HEALTH_REPAIR_AMOUNT ); + } else { + if ( shipType == LIGHT_FIGHTER ) + repair( ITEM_HEALTH_REPAIR_AMOUNT ); + else repair( ITEM_HEALTH_REPAIR_AMOUNT * ITEM_HEALTH_REPAIR_FACTOR_HEAVY_FIGHTER ); + } + item->pickedUp(); + addBannerItemCollected( BANNER_ITEM_HEALTH_COLLECTED ); + break; + } + case ITEM_HEATSEEKER: + { + specialsAvailability[ SPECIAL_HEATSEEKER ] += ITEM_HEATSEEKER_AMMO; + activeSpecial = SPECIAL_HEATSEEKER; + item->pickedUp(); + addBannerItemCollected( BANNER_ITEM_HEATSEEKER_COLLECTED ); + break; + } + case ITEM_NUKE: + { + specialsAvailability[ SPECIAL_NUKE ] += ITEM_NUKE_AMMO; + if ( activeSpecial == SPECIAL_NONE ) { + activeSpecial = SPECIAL_NUKE; + } + item->pickedUp(); + addBannerItemCollected( BANNER_ITEM_NUKE_COLLECTED ); + break; + } + case ITEM_DEFLECTOR: + { + if (shipType == HEAVY_FIGHTER ) { + specialsAvailability[ SPECIAL_DEFLECTOR ] += ITEM_DEFLECTOR_AMMO; + if ( activeSpecial == SPECIAL_NONE ) { + activeSpecial = SPECIAL_DEFLECTOR; + } + item->pickedUp(); + addBannerItemCollected( BANNER_ITEM_DEFLECTOR_COLLECTED ); + } + break; + } + case ITEM_ENERGY_BEAM: + { + if ( shipType == LIGHT_FIGHTER ) { + secondaryWeaponsAvailability[ SHOT_ENERGY_BEAM - 100 ] = true; + item->pickedUp(); + addBannerItemCollected( BANNER_ITEM_ENERGY_BEAM_COLLECTED ); + } + break; + } + case ITEM_LASER: + { + if ( shipType == HEAVY_FIGHTER ) { + secondaryWeaponsAvailability[ SHOT_HF_LASER - 100 ] = true; + addBannerItemCollected( BANNER_ITEM_LASER_COLLECTED ); + item->pickedUp(); + } + break; + } + + default: + { + cout << "pickUpItems: unexpected itemType: " << item->getType() << endl; + break; + } + } + } + } +} + + +float Racer::getActVelMax() { + return maxVel; +} + + +void Racer::repair( float amount ) { + float possibleDamageAdd = maxDamage - damage; + if ( possibleDamageAdd >= amount ) { + damage += amount; + } else { + damage += possibleDamageAdd; + amount -= possibleDamageAdd; + shield += amount; + } + if ( shield > maxShield ) shield = maxShield; +} + + +void Racer::specialKeyDown() { + switch ( activeSpecial ) { + case SPECIAL_NUKE: + { + if ( timeLastNukeUsed + RACER_COOLDOWN_SPECIAL_NUKE < SDL_GetTicks() ) { + shots->addShot( new Shot( SPECIAL_SHOT_NUKE, + playerNr, pos, + (Vector2D( SCREEN_WIDTH / 2.0, + SCREEN_HEIGHT / 2.0 ) - pos).getDirection() ) ); + specialsAvailability[ SPECIAL_NUKE ]--; + timeLastNukeUsed = SDL_GetTicks(); + } + break; + } + case SPECIAL_DEFLECTOR: + { + if ( !deflectorActive ) { + deflectorActive = true; + deflectorTimeLeft = ITEM_DEFLECTOR_DURATION; + specialsAvailability[ SPECIAL_DEFLECTOR ]--; + } + break; + } + default: + { + break; + } + } + if ( specialsAvailability[ activeSpecial ] == 0 ) { + switchSpecials(); + } +} + +void Racer::specialKeyUp() { + if ( specialsAvailability[ activeSpecial ] == 0 ) { + switchSpecials(); + } +} + +void Racer::handlePlayerEvent( PlayerEvent pEvent, bool keyDown ) { + switch (pEvent) { + case PE_UP: if ( keyDown ) thrust = true; else thrust = false; break; + case PE_DOWN: if ( keyDown ) backwards = true; else backwards = false; break; + case PE_LEFT: if ( keyDown ) left = true; else left = false; break; + case PE_RIGHT: if ( keyDown ) right = true; else right = false; break; + case PE_FIRE_WEAPONS: if ( keyDown ) fireWeapons = true; else fireWeapons = false; break; + case PE_CHOOSE_WEAPON_SECONDARY: + { + if ( !keyDown ) { + switchSecondary(); + } + break; + } + case PE_CHOOSE_WEAPON_SPECIALS: + { + if ( !keyDown ) { + switchSpecials(); + } + break; + } + case PE_FIRE_SPECIALS: + { + if ( keyDown ) { + useSpecial = true; + specialKeyDown(); + } else { + useSpecial = false; + specialKeyUp(); + break; + } + } + default: break; + } +} + + +void Racer::addBannerItemCollected( BannerTexts text ) { + if ( onePlayerGame ) { + banners->addBanner( text, + BANNER_MODE_ITEM_COLLECTED_SINGLE_PLAYER, + BANNER_BONUS_NONE ); + } else { + if ( playerNr == 0 ) { + banners->addBanner( text, + BANNER_MODE_ITEM_COLLECTED_PLAYER_ONE, + BANNER_BONUS_NONE ); + } else { + banners->addBanner( text, + BANNER_MODE_ITEM_COLLECTED_PLAYER_TWO, + BANNER_BONUS_NONE ); + } + } +} + + + diff --git a/alienblaster/project/jni/alienblaster/src/racer.h b/alienblaster/project/jni/alienblaster/src/racer.h new file mode 100644 index 000000000..5f24c0afd --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/racer.h @@ -0,0 +1,195 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +#ifndef RACER_HH +#define RACER_HH + +#include "SDL.h" +#include "geometry.h" +#include +#include "global.h" +#include "settings.h" + +class SurfaceDB; +class Gate; +class Track; +class Shot; +class Shots; +class Items; +class Font; +class BoundingBox; +class ShieldGlow; + + +/* The Racer is the vehicle, that the player can steer. */ +class Racer { + + SDL_Surface *spriteRacerBase; + SDL_Rect drawRectBase; + SDL_Surface *spriteShadow; + SDL_Surface *spriteDeflector; + SDL_Rect drawRectDeflector; + SDL_Surface *spriteHPStat; + SDL_Surface *spriteFighterIcon; + + // for collision with other racers or shots. + // A rectangle with racersize * 0.9 is used. + BoundingBox *boundingBox; + + int playerNr; + int shipType; + + Font *font; // font used for displaying ammo and lapcnt + int fontSize; + SDL_Surface *spriteSecondaryWeapons; + SDL_Surface *spriteSpecials; + + int sndShotPrimary; + int sndShotSecondary; + + float points; + + // Movement-System + Vector2D pos; // absolute position + float shipAngle; // the orientation + Vector2D vel; // the velocity vector + // the boundary of the world (i.e. the reachable section of the screen) + RectangleGeo *boundaryRect; + + // Weapon-System + ShotTypes primaryShotType; + Uint32 timeLastShotPrimary; + + ShotTypes activeSecondary; + Uint32 timeLastShotSecondary; + bool secondaryWeaponsAvailability[ NR_SECONDARY_WEAPONS ]; + bool lastDumbfireWasLeft; + + SpecialTypes activeSpecial; + int specialsAvailability[ NR_SPECIALS ]; + Uint32 timeLastNukeUsed; + Uint32 timeLastHeatseekerUsed; + bool lastHeatseekerWasLeft; + + bool deflectorActive; + int deflectorTimeLeft; + + // Damage-System + float shield; + float damage; + float pixPerHP; + float maxShield; + float maxDamage; + // not used at the moment: + // returns the maximum reachable velocity. + // if damage < 100 the reachable velocity will be reduced linearly + float getActVelMax(); + float maxVel; + // needed for displaying the shield glow, when hit + Uint32 shieldDamageEndTime; + bool shieldDamageActive; + ShieldGlow *shieldGlow; + + Uint32 timeLastMove; + + void repair( float amount ); + + bool thrust; + bool backwards; + bool left; + bool right; + bool fireWeapons; + bool useSpecial; + + void addBannerItemCollected( BannerTexts text ); + + public: + // Input-System - which keys are pressed at the moment + void handlePlayerEvent( PlayerEvent pEvent, bool keyDown ); + + Racer( string fnSprite, int whichPlayer, Vector2D startpos, int newShipType ); + ~Racer(); + + bool isDeflectorSpecialActive() { return deflectorActive; } + inline int getPlayerNr() { return playerNr; } + inline int getShipType() { return shipType; } + void setPos( const Vector2D &newPos ); + inline Vector2D getPos() { return pos; } + inline Vector2D getVel() { return vel; } + Vector2D setVel( const Vector2D &newVel ); // returns old vel + + // moves the racer according to his velocity and the pressed keys. + // Already collides with the boundaryRect (the border of the world) + Vector2D move( int dT ); + void clipWorld(); + // move the boundingBox accordingly to the movement + void updateBoundingBox(); + + // fire the Guns! + void shootPrimary(); + void shootSecondary(); + void shootSpecial(); + // switch to the next available weapon + // void switchPrimary(); + void switchSecondary(); + void switchSpecials(); + + // use the active special, if it should be used _once_ when keyDown-Event occurs + void specialKeyDown(); + // switch special, if the activespecial is out of ammo + void specialKeyUp(); + + void drawRacer( SDL_Surface *screen ); + void drawShadow( SDL_Surface *screen ); + void drawStats( SDL_Surface *screen ); + + // collision system + // return if the line between the two points collides with the boundingBox + bool collidesWith( const Vector2D &shotPosOld, const Vector2D &shotPosNew ); + // return if the racers boundingBox overlaps with box + bool collidesWith( BoundingBox *box ); + // return if the racers boundingBox overlaps with circle + bool collidesWith( const Circle &circle ); + // returns if a inner circle around the racer overlaps with circle + bool collidesWithAsCircle( const Circle &circle ); + // returns if a inner circle around the racer overlaps with circle + bool collidesWithAsCircle( BoundingBox *box ); + // returns the boundingBox of the racer + BoundingBox *getBoundingBox(); + + // the racer got hit -> do the damage according to the shotType + void doDamage( ShotTypes shotType ); + // recharge the shield + void rechargeShield( int dT ); + // the racer was hit + void receiveDamage( float amount ); + + bool isDead(); + + + void receivePoints( float amount ); + + // picks up items, if flown over + void pickUpItems(); + + // returns the number of laps completed by the racer + int getPoints() { return (int)(points + 0.5); } +}; + +#endif diff --git a/alienblaster/project/jni/alienblaster/src/racers.cc b/alienblaster/project/jni/alienblaster/src/racers.cc new file mode 100644 index 000000000..2b225aae4 --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/racers.cc @@ -0,0 +1,204 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +#include +#include "racer.h" +#include "racers.h" +#include "shots.h" +#include "items.h" +#include "enemys.h" +#include "enemy.h" +#include "explosions.h" +#include "explosion.h" +#include "global.h" + +Racers::Racers() { + pointsInArcadeMode = 0; +} + +Racers::~Racers() { + vector::iterator i; + for ( i = racers.begin(); i != racers.end(); ++i ) { + delete *i; + } +} + +bool Racers::isShipTypeActive( int shipType ) { + vector::iterator i; + for ( i = racers.begin(); i != racers.end(); ++i ) { + if ( (*i)->getShipType() == shipType ) { + return true; + } + } + return false; +} + +Racer *Racers::getRacer( unsigned int i ) { + return racers[i]; +} + +void Racers::addRacer( Racer *racer ) { + if (racer) { + racers.push_back(racer); + } +} + +void Racers::deleteRacers() { + racers.clear(); +} + +void Racers::collideWithEnemys() { + for ( unsigned int i = 0; i < racers.size(); ++i ) { + for ( unsigned int j = 0; j < enemys->getNrEnemys(); ++j ) { + + // wurde noch nicht von einem anderen Racer gerammt und fliegt ebenfalls + if ( !(enemys->getEnemy( j )->isExpired()) && + ENEMY_FLYING[ enemys->getEnemy( j )->getType() ] ) { + // kollidiert + if ( racers[i]->collidesWithAsCircle( enemys->getEnemy( j )->getBoundingCircle() ) ) { + // explosion + Explosion *newExplosion = + new Explosion( FN_EXPLOSION_ENEMY, enemys->getEnemy( j )->getPos(), enemys->getEnemy( j )->getVel(), EXPLOSION_NORMAL_AIR ); + explosions->addExplosion( newExplosion ); + enemys->getEnemy( j )->expire(); + racers[i]->receiveDamage( ENEMY_COLLISION_DAMAGE[ enemys->getEnemy( j )->getType() ]); + } + } + + } + } +} + +void Racers::moveAndCollide( int dT ) { + for ( unsigned int i = 0; i < racers.size(); ++i ) { + racers[i]->move( dT ); + collideWithEnemys(); + } +} + +void Racers::pickUpItems() { + vector::iterator i; + for ( i = racers.begin(); i != racers.end(); ++i ) { + (*i)->pickUpItems(); + } +} + +void Racers::shoot() { + for ( unsigned int i = 0; i < racers.size(); i++ ) { + racers[i]->shootPrimary(); + racers[i]->shootSecondary(); + racers[i]->shootSpecial(); + } +} + +void Racers::rechargeShield( int dT ) { + vector::iterator i; + for (i = racers.begin(); i != racers.end(); ++i) { + (*i)->rechargeShield( dT ); + } +} + +void Racers::drawRacers( SDL_Surface *screen ) { + vector::iterator i; + for (i = racers.begin(); i != racers.end(); ++i) { + (*i)->drawRacer(screen); + } +} + +void Racers::drawShadows( SDL_Surface *screen ) { + vector::iterator i; + for (i = racers.begin(); i != racers.end(); ++i) { + (*i)->drawShadow(screen); + } +} + +void Racers::drawStats( SDL_Surface *screen ) { + vector::iterator i; + for (i = racers.begin(); i != racers.end(); ++i) { + (*i)->drawStats(screen); + } +} + +bool Racers::bothPlayersLost() { + bool allLost = true; + for ( unsigned int i = 0; i < racers.size(); ++i) { + if ( !racers[i]->isDead() ) { + allLost = false; + } + } + return allLost; +} + +void Racers::receivePointsArcade( float amount ) { + for ( unsigned int i = 0; i < racers.size(); ++i) { + racers[i]->receivePoints( amount ); + } +} + +int Racers::getPointsArcadeMode() { + if (!arcadeGame) return -1; + if (!racers.empty()) { + return racers[0]->getPoints(); + } + else return pointsInArcadeMode; +} + +void Racers::expireRacers() { + unsigned int i = 0; + while ( i < racers.size() ) { + if ( racers[i]->isDead() ) { + // explode + Explosion *newExplosion = + new Explosion( FN_EXPLOSION_ENEMY, racers[i]->getPos(), + racers[i]->getVel(), EXPLOSION_NORMAL_AIR ); + explosions->addExplosion( newExplosion ); + + if ( arcadeGame ) pointsInArcadeMode = racers[i]->getPoints(); + + delete racers[i]; + racers.erase(racers.begin() + i); + } else { + i++; + } + } +} + +void Racers::getKeyActionMaps() { + playerKeys0 = settings->getPlayerKeys( 0 ); + playerKeys1 = settings->getPlayerKeys( 1 ); +} + +void Racers::handleEvent( const SDLKey key, const bool pressed ) { + PlayerEvent pEvent0 = playerKeys0[ key ]; + if ( pEvent0 != PE_UNKNOWN ) { + handlePlayerEvent( pEvent0, 0, pressed ); + } + PlayerEvent pEvent1 = playerKeys1[ key ]; + if ( pEvent1 != PE_UNKNOWN ) { + handlePlayerEvent( pEvent1, 1, pressed ); + } +} + +void Racers::handlePlayerEvent( PlayerEvent pEvent, int playerNr, bool keyDown ) { + for ( unsigned int i = 0; i < racers.size(); i++ ) + if ( racers[i]->getPlayerNr() == playerNr ) + racers[i]->handlePlayerEvent( pEvent, keyDown ); +} + + diff --git a/alienblaster/project/jni/alienblaster/src/racers.h b/alienblaster/project/jni/alienblaster/src/racers.h new file mode 100644 index 000000000..72564c658 --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/racers.h @@ -0,0 +1,92 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +#ifndef RACER_H +#define RACER_H + +#include +#include "SDL.h" +#include "settings.h" + +class Racer; +class Shots; +class Items; +class Enemys; +class Explosions; + +/* A class, that manages the individual racers. + It is used for everything, that the racers are capable of doing. + */ +class Racers { + vector racers; + + // points reached by racer 0 in arcade mode + int pointsInArcadeMode; + + void collideWithEnemys(); + + PlayerKeys playerKeys0; + PlayerKeys playerKeys1; + + public: + + Racers(); + ~Racers(); + + bool isShipTypeActive( int shipType ); + + void addRacer( Racer *racer ); + void deleteRacers(); + Racer *getRacer(unsigned int i); + unsigned int getNrRacers() { return racers.size(); } + + // Moves the racers. Calculates collisions between the racers and + // collisions between a racer and enemies. + void moveAndCollide( int dT ); + + // Checks if a racer has picked up an item by flying over it. + void pickUpItems(); + // Checks if a racer was at his pitstop and is being repaired. + // void repair( PitStops *pitStops ); + // Lets the racers shoot, if they want to. + void shoot(); + // recharge the shields + void rechargeShield( int dT ); + // draws the racers. + void drawRacers( SDL_Surface *screen ); + void drawShadows( SDL_Surface *screen ); + void drawStats( SDL_Surface *screen ); + + // returns, which racer has shot more enemys + //int getWinner(); + + void expireRacers(); + + bool bothPlayersLost(); + + void receivePointsArcade( float amount ); + int getPointsArcadeMode(); + + void getKeyActionMaps(); + void handleEvent( const SDLKey key, const bool pressed ); + private: + void handlePlayerEvent( PlayerEvent pEvent, int playerNr, bool keyDown ); +}; + +#endif diff --git a/alienblaster/project/jni/alienblaster/src/setDifficulty.cc b/alienblaster/project/jni/alienblaster/src/setDifficulty.cc new file mode 100644 index 000000000..37cf4cac8 --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/setDifficulty.cc @@ -0,0 +1,236 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +using namespace std; + +#include "setDifficulty.h" +#include "global.h" +#include "surfaceDB.h" +#include "mixer.h" +#include "video.h" +#include "font.h" +#include "settings.h" +#include "racer.h" +#include "racers.h" + +SetDifficulty::SetDifficulty( SDL_Surface *scr ) { + screen = scr; + introSprite = surfaceDB.loadSurface( FN_ALIENBLASTER_INTRO ); + activeChoiceSprite = surfaceDB.loadSurface( FN_INTRO_SHOW_CHOICE ); + + font = new Font( FN_FONT_INTRO ); + fontHighlighted = new Font( FN_FONT_INTRO_HIGHLIGHTED ); + lightFighterIcon1 = surfaceDB.loadSurface( FN_LIGHT_FIGHTER_1_ICON ); + lightFighterIcon2 = surfaceDB.loadSurface( FN_LIGHT_FIGHTER_2_ICON ); + heavyFighterIcon1 = surfaceDB.loadSurface( FN_HEAVY_FIGHTER_1_ICON ); + heavyFighterIcon2 = surfaceDB.loadSurface( FN_HEAVY_FIGHTER_2_ICON ); + choose = mixer.loadSample( FN_SOUND_INTRO_CHOOSE, 100 ); + confirm = mixer.loadSample( FN_SOUND_INTRO_CONFIRM, 100 ); + + activeChoice = 0; + playerOneLightFighter = true; + playerTwoLightFighter = false; +} + +SetDifficulty::~SetDifficulty() {} + +void SetDifficulty::run( GameStates &gameState, bool onePlayerGame ) { + activeChoice = 0; + SetDifficulty::onePlayerGame = onePlayerGame; + draw(); + while ( gameState == GS_SET_DIFFICULTY ) { + handleEvents( gameState ); + draw(); + SDL_Delay( 50 ); + } +} + +bool SetDifficulty::getPlayerOneLightFighter() { + return playerOneLightFighter; +} + +bool SetDifficulty::getPlayerTwoLightFighter() { + return playerTwoLightFighter; +} + +void SetDifficulty::draw() { + videoserver->clearScreen(); + SDL_Rect r; + r.x = screen->w / 2 - introSprite->w / 2; + r.y = 0; + r.w = introSprite->w; + r.h = introSprite->h; + SDL_BlitSurface( introSprite, 0, screen, &r ); + + for ( int i = 0; i < NR_DIFFICULTY_CHOICES; i++ ) { + if( activeChoice == i ) { + r.x = 230 - activeChoiceSprite->w - 8; + r.y = 258 + i * 40; + r.w = activeChoiceSprite->w; + r.h = activeChoiceSprite->h; + SDL_BlitSurface( activeChoiceSprite, 0, screen, &r ); + fontHighlighted->drawStr( screen, 230, 260 + i * 40, SET_DIFFICULTY_CHOICES[ i ] ); + } else { + font->drawStr( screen, 230, 260 + i * 40, SET_DIFFICULTY_CHOICES[ i ] ); + } + if( onePlayerGame ) { + font->drawStr( screen, 20, 20, "1-Player" ); + font->drawStr( screen, 100, 270, "Player 1", FONT_ALIGN_CENTERED ); + if ( playerOneLightFighter ) { + r.x = 100 - lightFighterIcon1->w / 2; + r.y = 340 - lightFighterIcon1->h / 2; + r.w = lightFighterIcon1->w; + r.h = lightFighterIcon1->h; + SDL_BlitSurface( lightFighterIcon1, 0, screen, &r ); + } else { + r.x = 100 - heavyFighterIcon1->w / 2; + r.y = 340 - heavyFighterIcon1->h / 2; + r.w = heavyFighterIcon1->w; + r.h = heavyFighterIcon1->h; + SDL_BlitSurface( heavyFighterIcon1, 0, screen, &r ); + } + fontHighlighted->drawStr( screen, 100, 400, "Press \"1\"", FONT_ALIGN_CENTERED ); + fontHighlighted->drawStr( screen, 100, 430, "To Change", FONT_ALIGN_CENTERED ); + } + else { + font->drawStr( screen, 20, 20, "2-Player" ); + font->drawStr( screen, 100, 270, "Player 1", FONT_ALIGN_CENTERED ); + if ( playerOneLightFighter ) { + r.x = 100 - lightFighterIcon1->w / 2; + r.y = 340 - lightFighterIcon1->h / 2; + r.w = lightFighterIcon1->w; + r.h = lightFighterIcon1->h; + SDL_BlitSurface( lightFighterIcon1, 0, screen, &r ); + } else { + r.x = 100 - heavyFighterIcon1->w / 2; + r.y = 340 - heavyFighterIcon1->h / 2; + r.w = heavyFighterIcon1->w; + r.h = heavyFighterIcon1->h; + SDL_BlitSurface( heavyFighterIcon1, 0, screen, &r ); + } + fontHighlighted->drawStr( screen, 100, 400, "Press \"1\"", FONT_ALIGN_CENTERED ); + fontHighlighted->drawStr( screen, 100, 430, "To Change", FONT_ALIGN_CENTERED ); + font->drawStr( screen, 560, 270, "Player 2", FONT_ALIGN_CENTERED ); + if ( playerTwoLightFighter ) { + r.x = 560 - lightFighterIcon1->w / 2; + r.y = 340 - lightFighterIcon1->h / 2; + r.w = lightFighterIcon2->w; + r.h = lightFighterIcon2->h; + SDL_BlitSurface( lightFighterIcon2, 0, screen, &r ); + } else { + r.x = 560 - heavyFighterIcon1->w / 2; + r.y = 340 - heavyFighterIcon1->h / 2; + r.w = heavyFighterIcon2->w; + r.h = heavyFighterIcon2->h; + SDL_BlitSurface( heavyFighterIcon2, 0, screen, &r ); + } + fontHighlighted->drawStr( screen, 560, 400, "Press \"2\"", FONT_ALIGN_CENTERED ); + fontHighlighted->drawStr( screen, 560, 430, "To Change", FONT_ALIGN_CENTERED ); + } + } + SDL_Flip( screen ); +} + +void SetDifficulty::handleEvents( GameStates &gameState ) { + SDL_Event event; + + while ( SDL_PollEvent(&event) ) { + switch(event.type) { + case SDL_KEYDOWN: { + switch ( event.key.keysym.sym ) { + case SDLK_1: { + playerOneLightFighter = !playerOneLightFighter; + break; + } + case SDLK_2: { + playerTwoLightFighter = !playerTwoLightFighter; + break; + } + case SDLK_F5: { + SDL_WM_ToggleFullScreen( screen ); + break; + } + case SDLK_F7: { + if ( playMusicOn ) { + playMusicOn = false; + mixer.stopMusic(); + } else { + playMusicOn = true; + mixer.playMusic( MUSIC_INTRO, -1, 1000 ); + } + break; + } + case SDLK_UP: { + mixer.playSample( choose, 0 ); + activeChoice--; + if ( activeChoice < 0 ) activeChoice = NR_DIFFICULTY_CHOICES - 1; + break; + } + case SDLK_DOWN: { + mixer.playSample( choose, 0 ); + activeChoice = (activeChoice + 1) % NR_DIFFICULTY_CHOICES; + break; + } + case SDLK_ESCAPE: { + gameState = GS_INTRO; + break; + } + case SDLK_RETURN: { + mixer.playSample( confirm, 0 ); + switch (activeChoice) { + case DIFFICULTY_0: { + difficultyLevel = 0; + gameState = GS_PLAYON; + break; + } + case DIFFICULTY_1: { + difficultyLevel = 1; + gameState = GS_PLAYON; + break; + } + case DIFFICULTY_2: { + difficultyLevel = 2; + gameState = GS_PLAYON; + break; + } + case DIFFICULTY_3: { + difficultyLevel = 3; + gameState = GS_PLAYON; + break; + } + case BACK_TO_MAIN_MENU: { + gameState = GS_INTRO; + break; + } + } + break; + } + default: break; + } + break; + } + case SDL_QUIT: { + gameState = GS_QUIT; + break; + } + default: break; + } + } +} + diff --git a/alienblaster/project/jni/alienblaster/src/setDifficulty.h b/alienblaster/project/jni/alienblaster/src/setDifficulty.h new file mode 100644 index 000000000..ffb862e8c --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/setDifficulty.h @@ -0,0 +1,70 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +#ifndef SET_DIFFICULTY_H +#define SET_DIFFICULTY_H + +#include "SDL.h" +#include "game.h" +#include + +class Font; + +enum DIFFICULTY_CHOICES { DIFFICULTY_0, DIFFICULTY_1, DIFFICULTY_2, DIFFICULTY_3, + BACK_TO_MAIN_MENU }; +const std::string SET_DIFFICULTY_CHOICES[] = +{ "Easy Going", "Let's Rock", + "Kick Some Ass", "Argh...", + "Back to Main Menu" }; +const int NR_DIFFICULTY_CHOICES = 5; + +class SetDifficulty { + private: + SDL_Surface *screen; + SDL_Surface *introSprite; + SDL_Surface *activeChoiceSprite; + SDL_Surface *lightFighterIcon1; + SDL_Surface *lightFighterIcon2; + SDL_Surface *heavyFighterIcon1; + SDL_Surface *heavyFighterIcon2; + Font *font; + Font *fontHighlighted; + + int activeChoice; + bool onePlayerGame; + bool playerOneLightFighter; + bool playerTwoLightFighter; + + // sounds + int confirm; + int choose; + + public: + SetDifficulty( SDL_Surface *scr ); + ~SetDifficulty(); + void run( GameStates &gameState, bool onePlayerGame ); + bool getPlayerOneLightFighter(); + bool getPlayerTwoLightFighter(); + + private: + void handleEvents( GameStates &gameState ); + void draw(); +}; + +#endif diff --git a/alienblaster/project/jni/alienblaster/src/settings.cc b/alienblaster/project/jni/alienblaster/src/settings.cc new file mode 100644 index 000000000..5a0527ce2 --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/settings.cc @@ -0,0 +1,685 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +using namespace std; + +#include +#include +#include +#include "SDL.h" +#include "options.h" +#include "settings.h" +#include "global.h" +#include "surfaceDB.h" +#include "asstring.h" +#include "font.h" +#include "video.h" +#include "mixer.h" +#include "input.h" + +Settings *settings; + +Settings::Settings() { + opfile = NULL; + + introSprite = surfaceDB.loadSurface( FN_ALIENBLASTER_INTRO ); + activeChoiceSprite = surfaceDB.loadSurface( FN_INTRO_SHOW_CHOICE ); + bluePlain = surfaceDB.loadSurface( FN_SETTINGS_BLUE, true ); + whitePlain = surfaceDB.loadSurface( FN_SETTINGS_WHITE, false ); + + fontMenu = new Font ( FN_FONT_SETTINGS ); + fontMenuHighlighted = new Font ( FN_FONT_SETTINGS_HIGHLIGHTED ); + fontNormal = new Font( FN_FONT_SETTINGS_SMALL ); + fontKey = new Font ( FN_FONT_SETTINGS_SMALL_BLUE ); + fontHighlighted = new Font( FN_FONT_SETTINGS_SMALL_HIGHLIGHTED ); + + playerEventNames[ PE_UNKNOWN ] = "UNKNOWN"; + playerEventNames[ PE_UP ] = "UP"; + playerEventNames[ PE_DOWN ] = "DOWN"; + playerEventNames[ PE_LEFT ] = "LEFT"; + playerEventNames[ PE_RIGHT ] = "RIGHT"; + playerEventNames[ PE_FIRE_WEAPONS ] = "FIRE"; + playerEventNames[ PE_FIRE_SPECIALS ] = "FIRE-SPECIAL"; + playerEventNames[ PE_CHOOSE_WEAPON_SECONDARY ] = "CHOOSE-WEAPON"; + playerEventNames[ PE_CHOOSE_WEAPON_SPECIALS ] = "CHOOSE-SPECIALS"; + + defaultSettings[ string("PLAYER0-") + playerEventNames[ PE_UP ] ] = SDLK_UP; + defaultSettings[ string("PLAYER0-") + playerEventNames[ PE_DOWN ] ] = SDLK_DOWN; + defaultSettings[ string("PLAYER0-") + playerEventNames[ PE_LEFT ] ] = SDLK_LEFT; + defaultSettings[ string("PLAYER0-") + playerEventNames[ PE_RIGHT ] ] = SDLK_RIGHT; + defaultSettings[ string("PLAYER0-") + playerEventNames[ PE_CHOOSE_WEAPON_SECONDARY ] ] = SDLK_RSHIFT; + defaultSettings[ string("PLAYER0-") + playerEventNames[ PE_CHOOSE_WEAPON_SPECIALS ] ] = SDLK_PERIOD; + defaultSettings[ string("PLAYER0-") + playerEventNames[ PE_FIRE_WEAPONS ] ] = SDLK_RCTRL; + defaultSettings[ string("PLAYER0-") + playerEventNames[ PE_FIRE_SPECIALS ] ] = SDLK_MODE; + + defaultSettings[ string("PLAYER1-") + playerEventNames[ PE_UP ] ] = SDLK_e; + defaultSettings[ string("PLAYER1-") + playerEventNames[ PE_DOWN ] ] = SDLK_d; + defaultSettings[ string("PLAYER1-") + playerEventNames[ PE_LEFT ] ] = SDLK_s; + defaultSettings[ string("PLAYER1-") + playerEventNames[ PE_RIGHT ] ] = SDLK_f; + defaultSettings[ string("PLAYER1-") + playerEventNames[ PE_CHOOSE_WEAPON_SECONDARY ] ] = SDLK_LSHIFT; + defaultSettings[ string("PLAYER1-") + playerEventNames[ PE_CHOOSE_WEAPON_SPECIALS ] ] = SDLK_y; + defaultSettings[ string("PLAYER1-") + playerEventNames[ PE_FIRE_WEAPONS ] ] = SDLK_LCTRL; + defaultSettings[ string("PLAYER1-") + playerEventNames[ PE_FIRE_SPECIALS ] ] = SDLK_LALT; + + setKeyNames(); + + loadSettings(); +} + + +Settings::~Settings() { + if (fontKey) delete fontKey; + if (fontHighlighted) delete fontHighlighted; + if (fontNormal) delete fontNormal; + if (fontMenu) delete fontMenu; + if (opfile) delete opfile; +} + + +void Settings::loadSettings() { + bool restoredSettings = false; + if (opfile) { + delete opfile; + } + opfile = new Options( FN_SETTINGS ); + playerKeys.clear(); + for(int i=0; i < MAX_PLAYER_CNT; ++i) { + PlayerEventKeys pk; + for(int t=1; t < PlayerEventCnt; ++t) { + int key; + string keyname = string("PLAYER") + asString(i) + "-" + playerEventNames[(PlayerEvent)t]; + if (!opfile->getInt( keyname , key)) { + key = defaultSettings[ keyname ]; + restoredSettings = true; + } + pk[ (PlayerEvent)t ] = (SDLKey)key; + } + playerKeys.push_back(pk); + } + if (restoredSettings) { + saveSettings(); + } +} + +void Settings::saveSettings() { + for(int i=0; i < MAX_PLAYER_CNT; ++i) { + string name; + for(int t=1; t < PlayerEventCnt; ++t) { + opfile->setInt( (int)playerKeys[i][ (PlayerEvent)t ], + string("PLAYER") + asString(i) + "-" + playerEventNames[(PlayerEvent)t] ); + } + } + if (opfile) { + opfile->saveFile( FN_SETTINGS ); + } +} + + +void Settings::draw( SDL_Surface *screen, bool getNewKey ) { + videoserver->clearScreen(); + SDL_Rect r; + r.x = screen->w / 2 - introSprite->w / 2; + r.y = 0; + r.w = introSprite->w; + r.h = introSprite->h; + SDL_BlitSurface( introSprite, 0, screen, &r ); + showSpecialKeys( screen ); + showSettings( screen, getNewKey ); + showMenu( screen ); + SDL_Flip( screen ); +} + + +void Settings::showSpecialKeys( SDL_Surface *screen ) { + fontNormal->drawStr(screen, screen->w/2, screen->h - 2*fontNormal->getCharHeight() - 10, + "F1: Configure Keys F5: Fullscreen", FONT_ALIGN_CENTERED ); + fontNormal->drawStr(screen, screen->w/2, screen->h - fontNormal->getCharHeight() - 5, + "F6: Display Enemy Stats F7: Toggle Music F10: Pause Game", + FONT_ALIGN_CENTERED ); +} + + +void Settings::showSettings( SDL_Surface *screen, bool getNewKey ) { + int playerOfActiveItem = -1; + if ( actChoice <= SC_FIRE_SPEC_1 ) playerOfActiveItem = 0; + else if ( actChoice <= SC_FIRE_SPEC_2 ) playerOfActiveItem = 1; + int activePlayerEvent = actChoice - (8*playerOfActiveItem) + 1; + SDL_Rect r; + SDL_Rect srcDesc; + srcDesc.x = 0; + srcDesc.y = 0; + srcDesc.w = 155; + srcDesc.h = 14; + SDL_Rect srcKey; + srcKey.x = 0; + srcKey.y = 0; + srcKey.w = 100; + srcKey.h = 14; + + int i = 150; + fontHighlighted->drawStr( screen, 15, i - fontHighlighted->getCharHeight() - 5, "Player 1" ); + fontHighlighted->drawStr( screen, screen->w/2 + 5, i - fontHighlighted->getCharHeight() - 5, + "Player 2" ); + + std::map< PlayerEvent, SDLKey >::const_iterator pkiter; + for ( pkiter = playerKeys[0].begin(); pkiter != playerKeys[0].end(); ++pkiter ) { + + if ( !(playerOfActiveItem == 0 && pkiter->first == activePlayerEvent) ) { + r.x = 15; + r.y = i - 1; + SDL_BlitSurface(bluePlain, &srcDesc, screen, &r ); + fontNormal->drawStr( screen, 20, i, playerEventNames[ pkiter->first ] + ":" ); + + r.x = 175; + r.y = i-1; + SDL_BlitSurface(bluePlain, &srcKey, screen, &r ); + fontNormal->drawStr( screen, 270, i, keyName[ pkiter->second ], FONT_ALIGN_RIGHT ); + } + if ( !(playerOfActiveItem == 1 && pkiter->first == activePlayerEvent) ) { + r.x = screen->w/2 + 5; + r.y = i - 1; + SDL_BlitSurface(bluePlain, &srcDesc, screen, &r ); + + fontNormal->drawStr( screen, screen->w/2 + 10, i, + playerEventNames[ pkiter->first ] + ":" ); + + r.x = screen->w/2 + 165; + r.y = i-1; + SDL_BlitSurface(bluePlain, &srcKey, screen, &r ); + fontNormal->drawStr( screen, screen->w/2 + 260, i, + keyName[ playerKeys[1][pkiter->first] ], FONT_ALIGN_RIGHT ); + } + + if ( playerOfActiveItem == 0 && pkiter->first == activePlayerEvent ) { + r.x = 15; + r.y = i - 1; + SDL_BlitSurface(bluePlain, &srcDesc, screen, &r ); + fontNormal->drawStr( screen, 20, i, playerEventNames[ pkiter->first ] + ":" ); + + r.x = 175; + r.y = i-1; + SDL_BlitSurface(whitePlain, &srcKey, screen, &r ); + if (!getNewKey) { + fontHighlighted->drawStr( screen, 270, i, keyName[ pkiter->second ], FONT_ALIGN_RIGHT ); + } + } + if ( playerOfActiveItem == 1 && pkiter->first == activePlayerEvent ) { + r.x = screen->w/2 + 5; + r.y = i - 1; + SDL_BlitSurface(bluePlain, &srcDesc, screen, &r ); + + fontNormal->drawStr( screen, screen->w/2 + 10, i, + playerEventNames[ pkiter->first ] + ":" ); + r.x = screen->w/2 + 165; + r.y = i-1; + SDL_BlitSurface(whitePlain, &srcKey, screen, &r ); + if (!getNewKey) { + fontHighlighted->drawStr( screen, screen->w/2 + 260, i, + keyName[ playerKeys[1][pkiter->first] ], FONT_ALIGN_RIGHT ); + } + } + + i = i + fontNormal->getCharHeight() + 5; + } +} + +void Settings::showMenu( SDL_Surface *screen ) { + SDL_Rect r; + r.x = 230 - activeChoiceSprite->w - 8; + r.w = activeChoiceSprite->w; + r.h = activeChoiceSprite->h; + + if ( actChoice == SC_DEFAULTS ) { + r.y = 328; + SDL_BlitSurface(activeChoiceSprite, 0, screen, &r ); + fontMenuHighlighted->drawStr( screen, 230, 330, "Reset Defaults" ); + } else fontMenu->drawStr( screen, 230, 330, "Reset Defaults" ); + + if ( actChoice == SC_CANCEL ) { + r.y = 363; + SDL_BlitSurface(activeChoiceSprite, 0, screen, &r ); + fontMenuHighlighted->drawStr( screen, 230, 365, "Cancel" ); + } else fontMenu->drawStr( screen, 230, 365, "Cancel" ); + + if ( actChoice == SC_FINISH ) { + r.y = 398; + SDL_BlitSurface(activeChoiceSprite, 0, screen, &r ); + fontMenuHighlighted->drawStr( screen, 230, 400, "Finish" ); + } else fontMenu->drawStr( screen, 230, 400, "Finish" ); +} + +void Settings::settingsDialog( SDL_Surface *screen ) { + bool run = true; + actChoice = SC_FINISH; + wasLeftColumn = true; + draw( screen ); + while(run) { + SDL_Event event; + while (SDL_PollEvent(&event)) { + switch(event.type) { + case SDL_KEYDOWN: { + switch(event.key.keysym.sym) { + case SDLK_UP: { + if ( actChoice == SC_DEFAULTS ) { + if ( wasLeftColumn ) actChoice = SC_FIRE_SPEC_1; + else actChoice = SC_FIRE_SPEC_2; + } else if ( actChoice == SC_UP2 || actChoice == SC_UP1 ) { + actChoice = SC_FINISH; + } else { + actChoice = (SettingsChoices)(actChoice - 1); + } + break; + } + case SDLK_DOWN: { + if ( actChoice == SC_FINISH ) { + if ( wasLeftColumn ) actChoice = SC_UP1; + else actChoice = SC_UP2; + } else if ( actChoice == SC_FIRE_SPEC_1 ) { + actChoice = SC_DEFAULTS; + } else { + actChoice = (SettingsChoices)(actChoice + 1); + } + break; + } + case SDLK_RIGHT: { + if (actChoice <= SC_FIRE_SPEC_1) { + actChoice = (SettingsChoices)(actChoice + 8); + wasLeftColumn = false; + } + break; + } + case SDLK_LEFT: { + if ( SC_UP2 <= actChoice && actChoice <= SC_FIRE_SPEC_2 ) { + actChoice = (SettingsChoices)(actChoice - 8); + wasLeftColumn = true; + } + break; + } + case SDLK_TAB: { + if ( SC_UP1 <= actChoice && actChoice <= SC_FIRE_SPEC_1 ) { + actChoice = (SettingsChoices)(actChoice + 8); + wasLeftColumn = false; + } else { + if ( SC_UP2 <= actChoice && actChoice <= SC_FIRE_SPEC_2 ) { + actChoice = (SettingsChoices)(actChoice - 8); + wasLeftColumn = true; + } + } + break; + } + case SDLK_RETURN: + case SDLK_SPACE: { + if ( actChoice == SC_DEFAULTS ) { + loadDefaultSettings(); + } else if ( actChoice == SC_CANCEL ) { + run = false; + loadSettings(); + } else if ( actChoice == SC_FINISH ) { + run = false; + saveSettings(); + } else { + draw( screen, true ); + getNewKeyFromUser(); + } + break; + } + case SDLK_F5: { + videoserver->toggleFullscreen(); + break; + } + case SDLK_F7: { + if ( playMusicOn ) { + playMusicOn = false; + mixer.stopMusic(); + } else { + playMusicOn = true; + mixer.playMusic( MUSIC_INTRO, -1, 1000 ); + } + break; + } + case SDLK_ESCAPE: { + run = false; + loadDefaultSettings(); + break; + } + default: break; + } + } + } + draw( screen ); + SDL_Delay( 50 ); // save cpu-power + } + } +} + +void Settings::loadDefaultSettings() { + playerKeys.clear(); + for(int i=0; i < MAX_PLAYER_CNT; ++i) { + PlayerEventKeys pk; + for(int t=1; t < PlayerEventCnt; ++t) { + int key; + string keyname = string("PLAYER") + asString(i) + "-" + playerEventNames[(PlayerEvent)t]; + key = defaultSettings[ keyname ]; + pk[ (PlayerEvent)t ] = (SDLKey)key; + } + playerKeys.push_back(pk); + } +} + +void Settings::getNewKeyFromUser() { + SDL_Event event; + bool keypressed = false; + while( !keypressed ) { + while (!SDL_PollEvent(&event)) {} + switch(event.type) { + case SDL_KEYDOWN: + case SDL_JOYBUTTONDOWN: + case SDL_JOYAXISMOTION: { + if (input.isPressed(event)) { + int player = (actChoice >= SC_UP2) ? 1 : 0; + playerKeys[player][ (PlayerEvent)(actChoice - (player * 8) + 1) ] = + input.translate(event); + keypressed = true; + } + break; + } + } + } +} + +const PlayerKeys Settings::getPlayerKeys(unsigned int player) const { + assert( player < playerKeys.size() ); + PlayerKeys pk; + for(int i=SDLK_FIRST; i <= SDLK_LAST; ++i) { + pk[ (SDLKey)i ] = PE_UNKNOWN; + } + std::map< PlayerEvent, SDLKey >::const_iterator pkiter; + for(pkiter = playerKeys[player].begin(); pkiter != playerKeys[player].end(); ++pkiter) { + pk[ pkiter->second ] = pkiter->first; + } + return pk; +} + +void Settings::setKeyNames() { + keyName[ (SDLKey)0 ] = "UNKNOWN"; + keyName[ (SDLKey)8 ] = "BACKSPACE"; + keyName[ (SDLKey)9 ] = "TAB"; + keyName[ (SDLKey)12 ] = "CLEAR"; + keyName[ (SDLKey)13 ] = "RETURN"; + keyName[ (SDLKey)19 ] = "PAUSE"; + keyName[ (SDLKey)27 ] = "ESCAPE"; + keyName[ (SDLKey)32 ] = "SPACE"; + keyName[ (SDLKey)33 ] = "EXCLAIM"; + keyName[ (SDLKey)34 ] = "QUOTEDBL"; + keyName[ (SDLKey)35 ] = "HASH"; + keyName[ (SDLKey)36 ] = "DOLLAR"; + keyName[ (SDLKey)38 ] = "AMPERSAND"; + keyName[ (SDLKey)39 ] = "QUOTE"; + keyName[ (SDLKey)40 ] = "LEFTPAREN"; + keyName[ (SDLKey)41 ] = "RIGHTPAREN"; + keyName[ (SDLKey)42 ] = "ASTERISK"; + keyName[ (SDLKey)43 ] = "PLUS"; + keyName[ (SDLKey)44 ] = "COMMA"; + keyName[ (SDLKey)45 ] = "MINUS"; + keyName[ (SDLKey)46 ] = "PERIOD"; + keyName[ (SDLKey)47 ] = "SLASH"; + keyName[ (SDLKey)48 ] = "0"; + keyName[ (SDLKey)49 ] = "1"; + keyName[ (SDLKey)50 ] = "2"; + keyName[ (SDLKey)51 ] = "3"; + keyName[ (SDLKey)52 ] = "4"; + keyName[ (SDLKey)53 ] = "5"; + keyName[ (SDLKey)54 ] = "6"; + keyName[ (SDLKey)55 ] = "7"; + keyName[ (SDLKey)56 ] = "8"; + keyName[ (SDLKey)57 ] = "9"; + keyName[ (SDLKey)58 ] = "COLON"; + keyName[ (SDLKey)59 ] = "SEMICOLON"; + keyName[ (SDLKey)60 ] = "LESS"; + keyName[ (SDLKey)61 ] = "EQUALS"; + keyName[ (SDLKey)62 ] = "GREATER"; + keyName[ (SDLKey)63 ] = "QUESTION"; + keyName[ (SDLKey)64 ] = "AT"; + keyName[ (SDLKey)91 ] = "LEFTBRACKET"; + keyName[ (SDLKey)92 ] = "BACKSLASH"; + keyName[ (SDLKey)93 ] = "RIGHTBRACKET"; + keyName[ (SDLKey)94 ] = "CARET"; + keyName[ (SDLKey)95 ] = "UNDERSCORE"; + keyName[ (SDLKey)96 ] = "BACKQUOTE"; + keyName[ (SDLKey)97 ] = "a"; + keyName[ (SDLKey)98 ] = "b"; + keyName[ (SDLKey)99 ] = "c"; + keyName[ (SDLKey)100 ] = "d"; + keyName[ (SDLKey)101 ] = "e"; + keyName[ (SDLKey)102 ] = "f"; + keyName[ (SDLKey)103 ] = "g"; + keyName[ (SDLKey)104 ] = "h"; + keyName[ (SDLKey)105 ] = "i"; + keyName[ (SDLKey)106 ] = "j"; + keyName[ (SDLKey)107 ] = "k"; + keyName[ (SDLKey)108 ] = "l"; + keyName[ (SDLKey)109 ] = "m"; + keyName[ (SDLKey)110 ] = "n"; + keyName[ (SDLKey)111 ] = "o"; + keyName[ (SDLKey)112 ] = "p"; + keyName[ (SDLKey)113 ] = "q"; + keyName[ (SDLKey)114 ] = "r"; + keyName[ (SDLKey)115 ] = "s"; + keyName[ (SDLKey)116 ] = "t"; + keyName[ (SDLKey)117 ] = "u"; + keyName[ (SDLKey)118 ] = "v"; + keyName[ (SDLKey)119 ] = "w"; + keyName[ (SDLKey)120 ] = "x"; + keyName[ (SDLKey)121 ] = "y"; + keyName[ (SDLKey)122 ] = "z"; + keyName[ (SDLKey)127 ] = "DELETE"; + keyName[ (SDLKey)160 ] = "WORLD_0"; + keyName[ (SDLKey)161 ] = "WORLD_1"; + keyName[ (SDLKey)162 ] = "WORLD_2"; + keyName[ (SDLKey)163 ] = "WORLD_3"; + keyName[ (SDLKey)164 ] = "WORLD_4"; + keyName[ (SDLKey)165 ] = "WORLD_5"; + keyName[ (SDLKey)166 ] = "WORLD_6"; + keyName[ (SDLKey)167 ] = "WORLD_7"; + keyName[ (SDLKey)168 ] = "WORLD_8"; + keyName[ (SDLKey)169 ] = "WORLD_9"; + keyName[ (SDLKey)170 ] = "WORLD_10"; + keyName[ (SDLKey)171 ] = "WORLD_11"; + keyName[ (SDLKey)172 ] = "WORLD_12"; + keyName[ (SDLKey)173 ] = "WORLD_13"; + keyName[ (SDLKey)174 ] = "WORLD_14"; + keyName[ (SDLKey)175 ] = "WORLD_15"; + keyName[ (SDLKey)176 ] = "WORLD_16"; + keyName[ (SDLKey)177 ] = "WORLD_17"; + keyName[ (SDLKey)178 ] = "WORLD_18"; + keyName[ (SDLKey)179 ] = "WORLD_19"; + keyName[ (SDLKey)180 ] = "WORLD_20"; + keyName[ (SDLKey)181 ] = "WORLD_21"; + keyName[ (SDLKey)182 ] = "WORLD_22"; + keyName[ (SDLKey)183 ] = "WORLD_23"; + keyName[ (SDLKey)184 ] = "WORLD_24"; + keyName[ (SDLKey)185 ] = "WORLD_25"; + keyName[ (SDLKey)186 ] = "WORLD_26"; + keyName[ (SDLKey)187 ] = "WORLD_27"; + keyName[ (SDLKey)188 ] = "WORLD_28"; + keyName[ (SDLKey)189 ] = "WORLD_29"; + keyName[ (SDLKey)190 ] = "WORLD_30"; + keyName[ (SDLKey)191 ] = "WORLD_31"; + keyName[ (SDLKey)192 ] = "WORLD_32"; + keyName[ (SDLKey)193 ] = "WORLD_33"; + keyName[ (SDLKey)194 ] = "WORLD_34"; + keyName[ (SDLKey)195 ] = "WORLD_35"; + keyName[ (SDLKey)196 ] = "WORLD_36"; + keyName[ (SDLKey)197 ] = "WORLD_37"; + keyName[ (SDLKey)198 ] = "WORLD_38"; + keyName[ (SDLKey)199 ] = "WORLD_39"; + keyName[ (SDLKey)200 ] = "WORLD_40"; + keyName[ (SDLKey)201 ] = "WORLD_41"; + keyName[ (SDLKey)202 ] = "WORLD_42"; + keyName[ (SDLKey)203 ] = "WORLD_43"; + keyName[ (SDLKey)204 ] = "WORLD_44"; + keyName[ (SDLKey)205 ] = "WORLD_45"; + keyName[ (SDLKey)206 ] = "WORLD_46"; + keyName[ (SDLKey)207 ] = "WORLD_47"; + keyName[ (SDLKey)208 ] = "WORLD_48"; + keyName[ (SDLKey)209 ] = "WORLD_49"; + keyName[ (SDLKey)210 ] = "WORLD_50"; + keyName[ (SDLKey)211 ] = "WORLD_51"; + keyName[ (SDLKey)212 ] = "WORLD_52"; + keyName[ (SDLKey)213 ] = "WORLD_53"; + keyName[ (SDLKey)214 ] = "WORLD_54"; + keyName[ (SDLKey)215 ] = "WORLD_55"; + keyName[ (SDLKey)216 ] = "WORLD_56"; + keyName[ (SDLKey)217 ] = "WORLD_57"; + keyName[ (SDLKey)218 ] = "WORLD_58"; + keyName[ (SDLKey)219 ] = "WORLD_59"; + keyName[ (SDLKey)220 ] = "WORLD_60"; + keyName[ (SDLKey)221 ] = "WORLD_61"; + keyName[ (SDLKey)222 ] = "WORLD_62"; + keyName[ (SDLKey)223 ] = "WORLD_63"; + keyName[ (SDLKey)224 ] = "WORLD_64"; + keyName[ (SDLKey)225 ] = "WORLD_65"; + keyName[ (SDLKey)226 ] = "WORLD_66"; + keyName[ (SDLKey)227 ] = "WORLD_67"; + keyName[ (SDLKey)228 ] = "WORLD_68"; + keyName[ (SDLKey)229 ] = "WORLD_69"; + keyName[ (SDLKey)230 ] = "WORLD_70"; + keyName[ (SDLKey)231 ] = "WORLD_71"; + keyName[ (SDLKey)232 ] = "WORLD_72"; + keyName[ (SDLKey)233 ] = "WORLD_73"; + keyName[ (SDLKey)234 ] = "WORLD_74"; + keyName[ (SDLKey)235 ] = "WORLD_75"; + keyName[ (SDLKey)236 ] = "WORLD_76"; + keyName[ (SDLKey)237 ] = "WORLD_77"; + keyName[ (SDLKey)238 ] = "WORLD_78"; + keyName[ (SDLKey)239 ] = "WORLD_79"; + keyName[ (SDLKey)240 ] = "WORLD_80"; + keyName[ (SDLKey)241 ] = "WORLD_81"; + keyName[ (SDLKey)242 ] = "WORLD_82"; + keyName[ (SDLKey)243 ] = "WORLD_83"; + keyName[ (SDLKey)244 ] = "WORLD_84"; + keyName[ (SDLKey)245 ] = "WORLD_85"; + keyName[ (SDLKey)246 ] = "WORLD_86"; + keyName[ (SDLKey)247 ] = "WORLD_87"; + keyName[ (SDLKey)248 ] = "WORLD_88"; + keyName[ (SDLKey)249 ] = "WORLD_89"; + keyName[ (SDLKey)250 ] = "WORLD_90"; + keyName[ (SDLKey)251 ] = "WORLD_91"; + keyName[ (SDLKey)252 ] = "WORLD_92"; + keyName[ (SDLKey)253 ] = "WORLD_93"; + keyName[ (SDLKey)254 ] = "WORLD_94"; + keyName[ (SDLKey)255 ] = "WORLD_95"; + keyName[ (SDLKey)256 ] = "KP0"; + keyName[ (SDLKey)257 ] = "KP1"; + keyName[ (SDLKey)258 ] = "KP2"; + keyName[ (SDLKey)259 ] = "KP3"; + keyName[ (SDLKey)260 ] = "KP4"; + keyName[ (SDLKey)261 ] = "KP5"; + keyName[ (SDLKey)262 ] = "KP6"; + keyName[ (SDLKey)263 ] = "KP7"; + keyName[ (SDLKey)264 ] = "KP8"; + keyName[ (SDLKey)265 ] = "KP9"; + keyName[ (SDLKey)266 ] = "KP_PERIOD"; + keyName[ (SDLKey)267 ] = "KP_DIVIDE"; + keyName[ (SDLKey)268 ] = "KP_MULTIPLY"; + keyName[ (SDLKey)269 ] = "KP_MINUS"; + keyName[ (SDLKey)270 ] = "KP_PLUS"; + keyName[ (SDLKey)271 ] = "KP_ENTER"; + keyName[ (SDLKey)272 ] = "KP_EQUALS"; + keyName[ (SDLKey)273 ] = "UP"; + keyName[ (SDLKey)274 ] = "DOWN"; + keyName[ (SDLKey)275 ] = "RIGHT"; + keyName[ (SDLKey)276 ] = "LEFT"; + keyName[ (SDLKey)277 ] = "INSERT"; + keyName[ (SDLKey)278 ] = "HOME"; + keyName[ (SDLKey)279 ] = "END"; + keyName[ (SDLKey)280 ] = "PAGEUP"; + keyName[ (SDLKey)281 ] = "PAGEDOWN"; + keyName[ (SDLKey)282 ] = "F1"; + keyName[ (SDLKey)283 ] = "F2"; + keyName[ (SDLKey)284 ] = "F3"; + keyName[ (SDLKey)285 ] = "F4"; + keyName[ (SDLKey)286 ] = "F5"; + keyName[ (SDLKey)287 ] = "F6"; + keyName[ (SDLKey)288 ] = "F7"; + keyName[ (SDLKey)289 ] = "F8"; + keyName[ (SDLKey)290 ] = "F9"; + keyName[ (SDLKey)291 ] = "F10"; + keyName[ (SDLKey)292 ] = "F11"; + keyName[ (SDLKey)293 ] = "F12"; + keyName[ (SDLKey)294 ] = "F13"; + keyName[ (SDLKey)295 ] = "F14"; + keyName[ (SDLKey)296 ] = "F15"; + keyName[ (SDLKey)300 ] = "NUMLOCK"; + keyName[ (SDLKey)301 ] = "CAPSLOCK"; + keyName[ (SDLKey)302 ] = "SCROLLOCK"; + keyName[ (SDLKey)303 ] = "RSHIFT"; + keyName[ (SDLKey)304 ] = "LSHIFT"; + keyName[ (SDLKey)305 ] = "RCTRL"; + keyName[ (SDLKey)306 ] = "LCTRL"; + keyName[ (SDLKey)307 ] = "RALT"; + keyName[ (SDLKey)308 ] = "LALT"; + keyName[ (SDLKey)309 ] = "RMETA"; + keyName[ (SDLKey)310 ] = "LMETA"; + keyName[ (SDLKey)311 ] = "LSUPER"; + keyName[ (SDLKey)312 ] = "RSUPER"; + keyName[ (SDLKey)313 ] = "MODE"; + keyName[ (SDLKey)314 ] = "COMPOSE"; + keyName[ (SDLKey)315 ] = "HELP"; + keyName[ (SDLKey)316 ] = "PRINT"; + keyName[ (SDLKey)317 ] = "SYSREQ"; + keyName[ (SDLKey)318 ] = "BREAK"; + keyName[ (SDLKey)319 ] = "MENU"; + keyName[ (SDLKey)320 ] = "POWER"; + keyName[ (SDLKey)321 ] = "EURO"; + keyName[ (SDLKey)322 ] = "UNDO"; + // the following entries are chosen by us... just for the mapping + keyName[ (SDLKey)1024 ] = "GPD1_L"; + keyName[ (SDLKey)1025 ] = "GPD1_R"; + keyName[ (SDLKey)1026 ] = "GPD1_U"; + keyName[ (SDLKey)1027 ] = "GPD1_D"; + keyName[ (SDLKey)1028 ] = "GPD2_L"; + keyName[ (SDLKey)1029 ] = "GPD2_R"; + keyName[ (SDLKey)1030 ] = "GPD2_U"; + keyName[ (SDLKey)1031 ] = "GPD2_D"; + keyName[ (SDLKey)1032 ] = "GPD3_L"; + keyName[ (SDLKey)1033 ] = "GPD3_R"; + keyName[ (SDLKey)1034 ] = "GPD3_U"; + keyName[ (SDLKey)1035 ] = "GPD3_D"; + keyName[ (SDLKey)1036 ] = "GPD4_L"; + keyName[ (SDLKey)1037 ] = "GPD4_R"; + keyName[ (SDLKey)1038 ] = "GPD4_U"; + keyName[ (SDLKey)1039 ] = "GPD4_D"; + keyName[ (SDLKey)1040 ] = "GPB_0"; + keyName[ (SDLKey)1041 ] = "GPB_1"; + keyName[ (SDLKey)1042 ] = "GPB_2"; + keyName[ (SDLKey)1043 ] = "GPB_3"; + keyName[ (SDLKey)1044 ] = "GPB_4"; + keyName[ (SDLKey)1045 ] = "GPB_5"; + keyName[ (SDLKey)1046 ] = "GPB_6"; + keyName[ (SDLKey)1047 ] = "GPB_7"; + keyName[ (SDLKey)1048 ] = "GPB_8"; + keyName[ (SDLKey)1049 ] = "GPB_9"; + keyName[ (SDLKey)1050 ] = "GPB_10"; + keyName[ (SDLKey)1051 ] = "GPB_11"; + keyName[ (SDLKey)1052 ] = "GPB_12"; + keyName[ (SDLKey)1053 ] = "GPB_13"; + keyName[ (SDLKey)1054 ] = "GPB_14"; + keyName[ (SDLKey)1055 ] = "GPB_15"; +} diff --git a/alienblaster/project/jni/alienblaster/src/settings.h b/alienblaster/project/jni/alienblaster/src/settings.h new file mode 100644 index 000000000..efa8c19f4 --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/settings.h @@ -0,0 +1,96 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +#ifndef _SETTINGS_H_ +#define _SETTINGS_H_ + +#include +#include +#include +#include "SDL.h" + +class Font; +class Options; + +enum PlayerEvent { PE_UNKNOWN = 0, PE_UP, PE_DOWN, PE_LEFT, PE_RIGHT, + PE_CHOOSE_WEAPON_SECONDARY, PE_CHOOSE_WEAPON_SPECIALS, + PE_FIRE_WEAPONS, PE_FIRE_SPECIALS }; + +const int PlayerEventCnt = 9; + +enum SettingsChoices { SC_UP1 = 0, SC_DOWN1, SC_LEFT1, SC_RIGHT1, + SC_CHOOSE_WEAP_SEC_1, SC_CHOOSE_WEAP_SPEC_1, + SC_FIRE_WEAP_1, SC_FIRE_SPEC_1, + SC_UP2, SC_DOWN2, SC_LEFT2, SC_RIGHT2, + SC_CHOOSE_WEAP_SEC_2, SC_CHOOSE_WEAP_SPEC_2, + SC_FIRE_WEAP_2, SC_FIRE_SPEC_2, + SC_DEFAULTS, SC_CANCEL, SC_FINISH }; + +const int NR_SETTINGS_CHOICES = 19; + + +typedef std::map< PlayerEvent, SDLKey > PlayerEventKeys; +typedef std::map< SDLKey, PlayerEvent > PlayerKeys; +typedef std::map< PlayerEvent, std::string > PlayerEventName; +typedef std::map< std::string, SDLKey > DefaultSettings; + +class Settings; + +extern Settings *settings; + +class Settings { + public: + + Settings(); + ~Settings(); + + void settingsDialog(SDL_Surface *screen); + const PlayerKeys getPlayerKeys(unsigned int player) const; + + private: + + SDL_Surface *introSprite; + SDL_Surface *activeChoiceSprite; + SDL_Surface *bluePlain; + SDL_Surface *whitePlain; + SettingsChoices actChoice; + bool wasLeftColumn; + Options *opfile; + Font *fontMenu; + Font *fontMenuHighlighted; + Font *fontNormal; + Font *fontKey; + Font *fontHighlighted; + std::vector< PlayerEventKeys > playerKeys; + std::map< SDLKey, std::string > keyName; + PlayerEventName playerEventNames; + DefaultSettings defaultSettings; + void getNewKeyFromUser(); + void loadDefaultSettings(); + void loadSettings(); + void saveSettings(); + void draw( SDL_Surface *screen, bool getNewKey=false ); + void showSpecialKeys( SDL_Surface *screen ); + void showSettings( SDL_Surface *screen, bool getNewKey ); + void showMenu( SDL_Surface *screen ); + void changeCurrentSettings(SDL_Surface *screen, int player); + void setKeyNames(); +}; + +#endif diff --git a/alienblaster/project/jni/alienblaster/src/shieldGlow.cc b/alienblaster/project/jni/alienblaster/src/shieldGlow.cc new file mode 100644 index 000000000..fda735c09 --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/shieldGlow.cc @@ -0,0 +1,62 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +#include "shieldGlow.h" +#include "surfaceDB.h" + +ShieldGlow::ShieldGlow( ShipTypes shipType ) { + switch ( shipType ) { + case LIGHT_FIGHTER: + { + spriteShieldGlow = surfaceDB.loadSurface( FN_LIGHT_FIGHTER_SHIELD_DAMAGED, true ); + break; + } + case HEAVY_FIGHTER: + { + spriteShieldGlow = surfaceDB.loadSurface( FN_HEAVY_FIGHTER_SHIELD_DAMAGED, true ); + break; + } + } + nrFrames = spriteShieldGlow->w / spriteShieldGlow->h; + timePerFrame = RACER_SHIELD_DAMAGE_LIFETIME / nrFrames; + frameWidth = spriteShieldGlow->w / nrFrames; + halfFrameWidth = frameWidth / 2; + halfFrameHeight = spriteShieldGlow->h / 2; +} + +ShieldGlow::~ShieldGlow() {} + +void ShieldGlow::draw( SDL_Surface *screen, Vector2D pos, int time ) { + if ( time < 0 || RACER_SHIELD_DAMAGE_LIFETIME < time ) return; + + int actFrame = time / timePerFrame; + + SDL_Rect src, dest; + src.x = actFrame*frameWidth; + src.y = 0; + src.w = frameWidth; + src.h = spriteShieldGlow->h; + dest.x = lroundf(pos.getX()) - halfFrameWidth; + dest.y = lroundf(pos.getY()) - halfFrameHeight; + dest.w = frameWidth; + dest.h = spriteShieldGlow->h; + + SDL_BlitSurface( spriteShieldGlow, &src, screen, &dest ); +} + diff --git a/alienblaster/project/jni/alienblaster/src/shieldGlow.h b/alienblaster/project/jni/alienblaster/src/shieldGlow.h new file mode 100644 index 000000000..9664c2884 --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/shieldGlow.h @@ -0,0 +1,43 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +#ifndef SHIELD_GLOW_H +#define SHIELD_GLOW_H + +#include "SDL.h" +#include "geometry.h" +#include "global.h" + +class ShieldGlow { + SDL_Surface *spriteShieldGlow; + int nrFrames; + int frameWidth; + int halfFrameWidth; + int halfFrameHeight; + int timePerFrame; + + public: + ShieldGlow( ShipTypes shipType ); + ~ShieldGlow(); + + void draw( SDL_Surface *screen, Vector2D drawPos, int time ); + +}; + +#endif diff --git a/alienblaster/project/jni/alienblaster/src/shot.cc b/alienblaster/project/jni/alienblaster/src/shot.cc new file mode 100644 index 000000000..db0e3fc52 --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/shot.cc @@ -0,0 +1,857 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +using namespace std; + +#include +#include "shot.h" +#include "surfaceDB.h" +#include "racers.h" +#include "racer.h" +#include "explosions.h" +#include "explosion.h" +#include "enemys.h" +#include "enemy.h" +#include "smokePuffs.h" +#include "boundingBox.h" + +Shot::Shot( ShotTypes shotType, int playerNr, Vector2D position, float angle ) { + + this->shotType = shotType; + fromWhichPlayer = playerNr; + + pos = position; + collidedWithGround = false; + deflectedBySonicFromPlayer1 = false; + deflectedBySonicFromPlayer2 = false; + + generatesSmokePuffs = false; + timeToNextSmokePuff = 100; + + switch (shotType) { + // primary shots + case SHOT_NORMAL: + { + vel = Vector2D( VEL_SHOT_NORMAL, angle, POLAR); + timeToLive = LIFETIME_SHOT_NORMAL; + sprite = surfaceDB.loadSurface( FN_SHOT_NORMAL ); + break; + } + case SHOT_NORMAL_HEAVY: + { + vel = Vector2D( VEL_SHOT_NORMAL_HEAVY, angle, POLAR); + timeToLive = LIFETIME_SHOT_NORMAL_HEAVY; + sprite = surfaceDB.loadSurface( FN_SHOT_NORMAL_HEAVY ); + break; + } + case SHOT_DOUBLE: + { + vel = Vector2D(VEL_SHOT_DOUBLE, angle, POLAR); + timeToLive = LIFETIME_SHOT_DOUBLE; + sprite = surfaceDB.loadSurface( FN_SHOT_DOUBLE ); + break; + } + case SHOT_DOUBLE_HEAVY: + { + vel = Vector2D(VEL_SHOT_DOUBLE_HEAVY, angle, POLAR); + timeToLive = LIFETIME_SHOT_DOUBLE_HEAVY; + sprite = surfaceDB.loadSurface( FN_SHOT_DOUBLE_HEAVY ); + break; + } + case SHOT_TRIPLE: + { + vel = Vector2D(VEL_SHOT_TRIPLE, angle, POLAR); + timeToLive = LIFETIME_SHOT_TRIPLE; + sprite = surfaceDB.loadSurface( FN_SHOT_TRIPLE ); + break; + } + + // primary shots heavy fighter + case SHOT_HF_NORMAL: + { + vel = Vector2D( VEL_SHOT_HF_NORMAL, angle, POLAR); + timeToLive = LIFETIME_SHOT_HF_NORMAL; + sprite = surfaceDB.loadSurface( FN_SHOT_HF_NORMAL ); + break; + } + case SHOT_HF_DOUBLE: + { + vel = Vector2D( VEL_SHOT_HF_DOUBLE, angle, POLAR); + timeToLive = LIFETIME_SHOT_HF_DOUBLE; + sprite = surfaceDB.loadSurface( FN_SHOT_HF_DOUBLE ); + break; + } + case SHOT_HF_TRIPLE: + { + vel = Vector2D(VEL_SHOT_HF_TRIPLE, angle, POLAR); + timeToLive = LIFETIME_SHOT_HF_TRIPLE; + sprite = surfaceDB.loadSurface( FN_SHOT_HF_TRIPLE ); + break; + } + case SHOT_HF_QUATTRO: + { + vel = Vector2D(VEL_SHOT_HF_QUATTRO, angle, POLAR); + timeToLive = LIFETIME_SHOT_HF_QUATTRO; + sprite = surfaceDB.loadSurface( FN_SHOT_HF_QUATTRO ); + break; + } + case SHOT_HF_QUINTO: + { + vel = Vector2D(VEL_SHOT_HF_QUINTO, angle, POLAR); + timeToLive = LIFETIME_SHOT_HF_QUINTO; + sprite = surfaceDB.loadSurface( FN_SHOT_HF_QUINTO ); + break; + } + + // secondary shots + case SHOT_DUMBFIRE: + { + vel = Vector2D(VEL_SHOT_DUMBFIRE, angle, POLAR); + timeToLive = LIFETIME_SHOT_DUMBFIRE; + sprite = surfaceDB.loadSurface( FN_SHOT_DUMBFIRE ); + generatesSmokePuffs = true; + break; + } + case SHOT_DUMBFIRE_DOUBLE: + { + vel = Vector2D(VEL_SHOT_DUMBFIRE_DOUBLE, angle, POLAR); + timeToLive = LIFETIME_SHOT_DUMBFIRE_DOUBLE; + sprite = surfaceDB.loadSurface( FN_SHOT_DUMBFIRE_DOUBLE ); + generatesSmokePuffs = true; + break; + } + case SHOT_KICK_ASS_ROCKET: + { + vel = Vector2D(VEL_SHOT_KICK_ASS_ROCKET, angle, POLAR); + timeToLive = LIFETIME_SHOT_KICK_ASS_ROCKET; + sprite = surfaceDB.loadSurface( FN_SHOT_KICK_ASS_ROCKET ); + spriteShadow = surfaceDB.loadSurface( FN_SHOT_KICK_ASS_ROCKET_SHADOW, true ); + break; + } + case SHOT_HELLFIRE: + { + vel = Vector2D(VEL_SHOT_HELLFIRE / 2.0, angle, POLAR); + timeToLive = LIFETIME_SHOT_HELLFIRE; + sprite = surfaceDB.loadSurface( FN_SHOT_HELLFIRE ); + spriteShadow = surfaceDB.loadSurface( FN_SHOT_HELLFIRE_SHADOW, true ); + generatesSmokePuffs = true; + break; + } + case SHOT_MACHINE_GUN: + { + vel = Vector2D(VEL_SHOT_MACHINE_GUN, angle, POLAR); + timeToLive = LIFETIME_SHOT_MACHINE_GUN; + sprite = surfaceDB.loadSurface( FN_SHOT_MACHINE_GUN ); + break; + } + case SHOT_ENERGY_BEAM: + { + vel = Vector2D(VEL_SHOT_ENERGY_BEAM, angle, POLAR); + timeToLive = LIFETIME_SHOT_ENERY_BEAM; + sprite = surfaceDB.loadSurface( FN_SHOT_ENERGY_BEAM, true ); + break; + } + + // secondary shots heavy fighter + case SHOT_HF_DUMBFIRE: + { + vel = Vector2D(VEL_SHOT_HF_DUMBFIRE, angle, POLAR); + timeToLive = LIFETIME_SHOT_HF_DUMBFIRE; + sprite = surfaceDB.loadSurface( FN_SHOT_HF_DUMBFIRE ); + generatesSmokePuffs = true; + break; + } + case SHOT_HF_DUMBFIRE_DOUBLE: + { + vel = Vector2D(VEL_SHOT_HF_DUMBFIRE_DOUBLE, angle, POLAR); + timeToLive = LIFETIME_SHOT_HF_DUMBFIRE_DOUBLE; + sprite = surfaceDB.loadSurface( FN_SHOT_HF_DUMBFIRE_DOUBLE ); + generatesSmokePuffs = true; + break; + } + case SHOT_HF_KICK_ASS_ROCKET: + { + vel = Vector2D(VEL_SHOT_HF_KICK_ASS_ROCKET, angle, POLAR); + timeToLive = LIFETIME_SHOT_HF_KICK_ASS_ROCKET; + sprite = surfaceDB.loadSurface( FN_SHOT_HF_KICK_ASS_ROCKET ); + spriteShadow = surfaceDB.loadSurface( FN_SHOT_HF_KICK_ASS_ROCKET_SHADOW, true ); + break; + } + case SHOT_HF_LASER: + { + vel = Vector2D(VEL_SHOT_HF_LASER, angle, POLAR); + timeToLive = LIFETIME_SHOT_HF_LASER; + sprite = surfaceDB.loadSurface( FN_SHOT_HF_LASER ); + break; + } + + // special shots + case SPECIAL_SHOT_HEATSEEKER: + { + vel = Vector2D(VEL_SPECIAL_SHOT_HEATSEEKER, angle, POLAR); + timeToLive = LIFETIME_SPECIAL_SHOT_HEATSEEKER; + sprite = surfaceDB.loadSurface( FN_SPECIAL_SHOT_HEATSEEKER ); + generatesSmokePuffs = true; + break; + } + case SPECIAL_SHOT_NUKE: + { + vel = Vector2D( VEL_SPECIAL_SHOT_NUKE, angle, POLAR ); + timeToLive = LIFETIME_SPECIAL_SHOT_NUKE; + sprite = surfaceDB.loadSurface( FN_SPECIAL_SHOT_NUKE ); + spriteShadow = surfaceDB.loadSurface( FN_SPECIAL_SHOT_NUKE_SHADOW, true ); + break; + } + + // enemy shots + case ENEMY_SHOT_NORMAL: + { + vel = Vector2D(VEL_ENEMY_SHOT_NORMAL, angle, POLAR); + timeToLive = LIFETIME_ENEMY_SHOT_NORMAL; + sprite = surfaceDB.loadSurface( FN_ENEMY_SHOT_NORMAL ); + break; + } + case ENEMY_SHOT_TANK_ROCKET: + { + vel = Vector2D(VEL_ENEMY_SHOT_TANK_ROCKET, angle, POLAR); + timeToLive = LIFETIME_ENEMY_SHOT_TANK_ROCKET; + sprite = surfaceDB.loadSurface( FN_ENEMY_SHOT_TANK_ROCKET ); + spriteShadow = surfaceDB.loadSurface( FN_ENEMY_SHOT_TANK_ROCKET_SHADOW, true ); + generatesSmokePuffs = true; + break; + } + + default: + { + vel = Vector2D(0,0); + timeToLive = 0; + sprite = surfaceDB.loadSurface( FN_SHOT_NORMAL ); + break; + } + } + +} + + +void Shot::moveAndCollide( int dT ) { + + if ( fromWhichPlayer == 666 ) { + moveAndCollideEnemyShot( dT ); + } else { + moveAndCollidePlayerShot( dT ); + } + + generateSmokePuff( dT ); + + timeToLive -= dT; +} + + +void Shot::moveAndCollidePlayerShot( int dT ) { + + Vector2D posOld = pos; + + // move the shot + movePlayerShot( dT ); + + if ( !isExpired() && collidePlayerShot( posOld ) ) { + addExplosion(); + } +} + + +void Shot::movePlayerShot( int dT ) { + switch (shotType) { + case SHOT_NORMAL: + case SHOT_NORMAL_HEAVY: + case SHOT_DOUBLE: + case SHOT_DOUBLE_HEAVY: + case SHOT_TRIPLE: + case SHOT_HF_NORMAL: + case SHOT_HF_DOUBLE: + case SHOT_HF_TRIPLE: + case SHOT_HF_QUATTRO: + case SHOT_HF_QUINTO: + case SHOT_DUMBFIRE: + case SHOT_DUMBFIRE_DOUBLE: + case SHOT_KICK_ASS_ROCKET: + case SHOT_MACHINE_GUN: + case SHOT_ENERGY_BEAM: + case SHOT_HF_DUMBFIRE: + case SHOT_HF_DUMBFIRE_DOUBLE: + case SHOT_HF_KICK_ASS_ROCKET: + case SHOT_HF_LASER: + { + pos = pos + vel * dT / 1000.0; + break; + } + case SHOT_HELLFIRE: + { + pos = pos + vel * dT / 1000.0; + if ( timeToLive < LIFETIME_SHOT_HELLFIRE - 100 ) { + vel = Vector2D( 0, -VEL_SHOT_HELLFIRE ); + } + break; + } + case SPECIAL_SHOT_HEATSEEKER: + { + pos = pos + vel * dT / 1000.0; + if ( timeToLive >= LIFETIME_SPECIAL_SHOT_HEATSEEKER - 200 ) break; + int idxNearestEnemy = 0; + float distNearest = 10000; + for ( unsigned int i = 0; i < enemys->getNrEnemys(); i++ ) { + // vector from the shotPosition to the enemy + Vector2D v = enemys->getEnemy(i)->getPos() - pos; + if ( getAbsAngleDifference( vel.getDirection(), v.getDirection() ) < 180 ) { + float dist = (enemys->getEnemy(i)->getPos() - pos).getLength(); + if ( dist < distNearest ) { + distNearest = dist; + idxNearestEnemy = i; + } + } + } + if ( distNearest != 10000 ) { + float angle = + getAngleDifference( (enemys->getEnemy(idxNearestEnemy)->getPos()-pos).getDirection(), + vel.getDirection() ); + if ( fabs(angle) < 80 * dT / 1000.0 ) { + vel.rotate(angle); + } else if ( angle < 0 ) { + vel.rotate( -80 * dT / 1000.0 ); + } else { + vel.rotate( 80 * dT / 1000.0 ); + } + } + + break; + } + + case SPECIAL_SHOT_NUKE: + { + pos = pos + vel * dT / 1000.0; + // Nuke is in its place! + if ( (pos - Vector2D( SCREEN_WIDTH / 2.0, SCREEN_HEIGHT / 2.0 )).getLength() + <= (vel * dT / 1000.0).getLength() ) { + nukeIsInPlace = true; + } + break; + } + + default: + { + cout << "movePlayerShot: unexpected shotType: " << shotType << endl; + break; + } + } + + // clip at the outside of the window + if ( !RectangleGeo( Vector2D( -SHOT_SCREEN_BORDER, -SHOT_SCREEN_BORDER ), + Vector2D( SCREEN_WIDTH + SHOT_SCREEN_BORDER, + SCREEN_HEIGHT + SHOT_SCREEN_BORDER )).isInside(pos) ) { + timeToLive = 0; + } +} + + +bool Shot::collidePlayerShot( Vector2D posOld ) { + switch (shotType) { + // only against air + case SHOT_ENERGY_BEAM: + { + BoundingBox box( lroundf(posOld.getX()) - sprite->w / 2, + lroundf(pos.getY()) - sprite->w / 2, + sprite->w, + lroundf((posOld-pos).getY()) + sprite->h ); + for ( unsigned int i = 0; i < enemys->getNrEnemys(); i++ ) { + if ( ENEMY_FLYING[ enemys->getEnemy(i)->getType() ] && + enemys->getEnemy(i)->collidesWith( &box ) ) { + enemys->getEnemy(i)->doDamage( shotType, fromWhichPlayer ); + timeToLive = 0; + collidedWithGround = !ENEMY_FLYING[ enemys->getEnemy(i)->getType() ]; + return true; + } + } + break; + } + //only against air + case SHOT_HF_LASER: + { + for ( unsigned int i = 0; i < enemys->getNrEnemys(); i++ ) { + if ( ENEMY_FLYING[ enemys->getEnemy(i)->getType() ] && + enemys->getEnemy(i)->collidesWith( posOld, pos ) ) { + enemys->getEnemy(i)->doDamage( shotType, fromWhichPlayer ); + timeToLive = 0; + collidedWithGround = false; + return true; + } + } + break; + } + // against air and ground + case SHOT_NORMAL: + case SHOT_NORMAL_HEAVY: + case SHOT_DOUBLE: + case SHOT_DOUBLE_HEAVY: + case SHOT_TRIPLE: + case SHOT_HF_NORMAL: + case SHOT_HF_DOUBLE: + case SHOT_HF_TRIPLE: + case SHOT_HF_QUATTRO: + case SHOT_HF_QUINTO: + { + for ( unsigned int i = 0; i < enemys->getNrEnemys(); i++ ) { + if ( //ENEMY_FLYING[ enemys->getEnemy(i)->getType() ] && + enemys->getEnemy(i)->collidesWith( posOld, pos ) ) { + enemys->getEnemy(i)->doDamage( shotType, fromWhichPlayer ); + timeToLive = 0; + collidedWithGround = !ENEMY_FLYING[ enemys->getEnemy(i)->getType() ]; + return true; + } + } + break; + } + // against air and ground + case SHOT_DUMBFIRE: + case SHOT_DUMBFIRE_DOUBLE: + case SHOT_HF_DUMBFIRE: + case SHOT_HF_DUMBFIRE_DOUBLE: + { + for ( unsigned int i = 0; i < enemys->getNrEnemys(); i++ ) { + if ( enemys->getEnemy(i)->collidesWith( Circle(pos, 15) ) ) { + enemys->getEnemy(i)->doDamage( shotType, fromWhichPlayer ); + timeToLive = 0; + collidedWithGround = !ENEMY_FLYING[ enemys->getEnemy(i)->getType() ]; + return true; + } + } + break; + } + // only against ground + case SHOT_KICK_ASS_ROCKET: + case SHOT_HF_KICK_ASS_ROCKET: + { + for ( unsigned int i = 0; i < enemys->getNrEnemys(); i++ ) { + if ( (!ENEMY_FLYING[ enemys->getEnemy(i)->getType() ]) && + enemys->getEnemy(i)->collidesWith( Circle(pos, 15) ) ) { + enemys->getEnemy(i)->doDamage( shotType, fromWhichPlayer ); + timeToLive = 0; + collidedWithGround = true; + return true; + } + } + break; + } + // only against ground, but has to hit more exactly than kickAssRocket + case SHOT_HELLFIRE: + { + for ( unsigned int i = 0; i < enemys->getNrEnemys(); i++ ) { + if ( (!ENEMY_FLYING[ enemys->getEnemy(i)->getType() ]) && + enemys->getEnemy(i)->collidesWith( Circle(pos, 5) ) ) { + enemys->getEnemy(i)->doDamage( shotType, fromWhichPlayer ); + timeToLive = 0; + collidedWithGround = true; + return true; + } + } + break; + } + // against air and ground + case SHOT_MACHINE_GUN: + { + for ( unsigned int i = 0; i < enemys->getNrEnemys(); i++ ) { + if ( enemys->getEnemy(i)->collidesWith( posOld, pos ) ) { + enemys->getEnemy(i)->doDamage( shotType, fromWhichPlayer ); + timeToLive = 0; + collidedWithGround = !ENEMY_FLYING[ enemys->getEnemy(i)->getType() ]; + return true; + } + } + break; + } + + // against air and ground + case SPECIAL_SHOT_HEATSEEKER: + { + for ( unsigned int i = 0; i < enemys->getNrEnemys(); i++ ) { + if ( enemys->getEnemy(i)->collidesWith( Circle(pos, 5) ) ) { + enemys->getEnemy(i)->doDamage( shotType, fromWhichPlayer ); + timeToLive = 0; + collidedWithGround = !ENEMY_FLYING[ enemys->getEnemy(i)->getType() ]; + return true; + } + } + break; + } + case SPECIAL_SHOT_NUKE: break; + + default: + { + cout << "collidePlayerShot: unexpected shotType: " << shotType << endl; + return false; + } + } + return false; +} + +/////////////////////////// + +void Shot::moveAndCollideEnemyShot( int dT ) { + Vector2D posOld = pos; + + moveEnemyShot( dT ); + + if ( !isExpired() && collideEnemyShot( posOld ) ) { + addExplosion(); + } +} + + +void Shot::moveEnemyShot( int dT ) { + switch (shotType) { + case ENEMY_SHOT_NORMAL: { + // is this shot near the deflector of a racer? + for ( unsigned int i = 0; i < racers->getNrRacers(); i++) { + if ( racers->getRacer(i)->getShipType() == HEAVY_FIGHTER ) { + Vector2D racerToShot = pos - racers->getRacer(i)->getPos(); + if ( racerToShot.getLength() < RACER_DEFLECTOR_ACTIVATION_DIST ) { + vel += Vector2D( RACER_DEFLECTOR_POWER * (dT / 1000.0), + racerToShot.getDirection(), POLAR ); + } + if ( racers->getRacer(i)->isDeflectorSpecialActive() ) { + if ( racerToShot.getLength() < ITEM_DEFLECTOR_ACTIVATION_DIST ) { + vel += Vector2D( ITEM_DEFLECTOR_POWER * (dT / 1000.0), + racerToShot.getDirection(), POLAR ); + } + } + } + } + pos = pos + vel * dT / 1000.0; + break; + } + case ENEMY_SHOT_TANK_ROCKET: { + if ( deflectedBySonicFromPlayer1 ) { + Vector2D racerToShot = pos - racers->getRacer(0)->getPos(); + if ( racerToShot.getLength() < RACER_SONIC_ACTIVATION_DIST ) { + vel += Vector2D( RACER_SONIC_POWER * (dT / 1000.0), + racerToShot.getDirection(), POLAR ); + deflectedBySonicFromPlayer1 = false; + } + } + if ( deflectedBySonicFromPlayer2 ) { + Vector2D racerToShot = pos - racers->getRacer(1)->getPos(); + if ( racerToShot.getLength() < RACER_SONIC_ACTIVATION_DIST ) { + vel += Vector2D( RACER_SONIC_POWER * (dT / 1000.0), + racerToShot.getDirection(), POLAR ); + deflectedBySonicFromPlayer2 = false; + } + } + pos = pos + vel * dT / 1000.0; + break; + } + default: { + cout << "moveEnemyShot: unexpected shotType: " << shotType << endl; + break; + } + } + + // clip at the outside of the window + if ( !RectangleGeo(Vector2D( -SHOT_SCREEN_BORDER, -SHOT_SCREEN_BORDER ), + Vector2D( SCREEN_WIDTH + SHOT_SCREEN_BORDER, + SCREEN_HEIGHT + SHOT_SCREEN_BORDER )).isInside(pos) ) { + timeToLive = 0; + } +} + + +bool Shot::collideEnemyShot( Vector2D posOld ) { + switch (shotType) { + case ENEMY_SHOT_NORMAL: + { + for ( unsigned int i = 0; i < racers->getNrRacers(); i++ ) { + if ( racers->getRacer(i)->collidesWith( posOld, pos ) ) { + racers->getRacer(i)->doDamage( shotType ); + timeToLive = 0; + collidedWithGround = false; + return true; + } + } + break; + } + case ENEMY_SHOT_TANK_ROCKET: + { + for ( unsigned int i = 0; i < racers->getNrRacers(); i++ ) { + if ( racers->getRacer(i)->collidesWith( Circle(pos, 5) ) ) { + racers->getRacer(i)->doDamage( shotType ); + timeToLive = 0; + collidedWithGround = false; + return true; + } + } + break; + } + default: + { + cout << "collideEnemyShot: unexpected shotType: " << shotType << endl; + return false; + } + } + return false; +} + +///////////// + +void Shot::addExplosion() { + Explosion *explosion; + switch (shotType) { + default: + { + if ( collidedWithGround ) { + explosion = new Explosion( FN_EXPLOSION_NORMAL, pos, + vel / 10.0, EXPLOSION_NORMAL_GROUND ); + } else { + if ( shotType == SHOT_HF_LASER ) { + // Laser is too fast... + explosion = new Explosion( FN_EXPLOSION_NORMAL, pos, + vel / 30.0, EXPLOSION_NORMAL_AIR ); + } else { + explosion = new Explosion( FN_EXPLOSION_NORMAL, pos, + vel / 10.0, EXPLOSION_NORMAL_AIR ); + } + } + break; + } + } + explosions->addExplosion( explosion ); +} + +//////////////////// + +void Shot::drawShadow(SDL_Surface *screen) { + switch (shotType) { + case SHOT_KICK_ASS_ROCKET: + case SHOT_HF_KICK_ASS_ROCKET: + case SHOT_HELLFIRE: + case SPECIAL_SHOT_NUKE: + { + SDL_Rect shadowR; + shadowR.x = lroundf(pos.getX()) - spriteShadow->w / 2 - 7; + shadowR.y = lroundf(pos.getY()) - spriteShadow->h / 2 + 7; + shadowR.w = spriteShadow->w; + shadowR.h = spriteShadow->h; + SDL_BlitSurface( spriteShadow, 0, screen, &shadowR ); + break; + } + case ENEMY_SHOT_TANK_ROCKET: + { + SDL_Rect destR; + SDL_Rect srcR; + destR.x = lroundf(pos.getX()) - spriteShadow->w / 16 - 10; + destR.y = lroundf(pos.getY()) - spriteShadow->h / 2 + 10; + destR.w = spriteShadow->w / 8; + destR.h = spriteShadow->h; + float angle = vel.getDirection() + 202.5; + int idx = lroundf(angle) % 360; + idx = idx / 45; + srcR.x = idx * spriteShadow->w / 8; + srcR.y = 0; + srcR.w = spriteShadow->w / 8; + srcR.h = spriteShadow->h; + + SDL_BlitSurface( spriteShadow, &srcR, screen, &destR ); + break; + } + default: break; + } +} + +void Shot::drawGroundShot(SDL_Surface *screen) { + switch (shotType) { + case SHOT_KICK_ASS_ROCKET: + case SHOT_HF_KICK_ASS_ROCKET: + case SHOT_HELLFIRE: + { + SDL_Rect destR; + SDL_Rect srcR; + destR.x = lroundf(pos.getX()) - sprite->w / 2; + destR.y = lroundf(pos.getY()) - sprite->h / 2; + destR.w = sprite->w; + destR.h = sprite->h; + srcR.x = 0; + srcR.y = 0; + srcR.w = sprite->w; + srcR.h = sprite->h; + + SDL_BlitSurface( sprite, &srcR, screen, &destR ); + break; + } + default: break; + } +} + +void Shot::drawGroundAirShot(SDL_Surface *screen) { + switch (shotType) { + case SHOT_DUMBFIRE: + case SHOT_DUMBFIRE_DOUBLE: + case SHOT_HF_DUMBFIRE: + case SHOT_HF_DUMBFIRE_DOUBLE: + { + SDL_Rect destR; + SDL_Rect srcR; + destR.x = lroundf(pos.getX()) - sprite->w / 16; + destR.y = lroundf(pos.getY()) - sprite->h / 2; + destR.w = sprite->w / 8; + destR.h = sprite->h; + // TODO: eight directions are outdated for dumbfire, but existent in the image + float angle = vel.getDirection() + 202.5; + int idx = lroundf(angle) % 360; + idx = idx / 45; + srcR.x = idx * 8; + srcR.y = 0; + srcR.w = 8; + srcR.h = 8; + + SDL_BlitSurface( sprite, &srcR, screen, &destR ); + break; + } + case SHOT_MACHINE_GUN: + case SHOT_HF_LASER: + { + SDL_Rect destR; + destR.x = lroundf(pos.getX()) - sprite->w / 2; + destR.y = lroundf(pos.getY()) - sprite->h / 2; + destR.w = sprite->w; + destR.h = sprite->h; + SDL_BlitSurface( sprite, 0, screen, &destR ); + break; + } + case SHOT_ENERGY_BEAM: + { + SDL_Rect destR; + destR.x = lroundf(pos.getX()) - sprite->w / 2; + destR.y = lroundf(pos.getY()) - sprite->h / 2; + destR.w = sprite->w; + destR.h = sprite->h; + SDL_BlitSurface( sprite, 0, screen, &destR ); + destR.x = lroundf(pos.getX()) - sprite->w / 2; + destR.y = lroundf(pos.getY()) - sprite->h / 2; + SDL_BlitSurface( sprite, 0, screen, &destR ); + break; + } + case SPECIAL_SHOT_HEATSEEKER: + { + SDL_Rect destR; + SDL_Rect srcR; + destR.x = lroundf(pos.getX()) - sprite->w / 16; + destR.y = lroundf(pos.getY()) - sprite->h / 2; + destR.w = sprite->w / 8; + destR.h = sprite->h; + + float angle = vel.getDirection() + 202.5; + int idx = lroundf(angle) % 360; + idx = idx / 45; + srcR.x = idx * 8; + srcR.y = 0; + srcR.w = 8; + srcR.h = 8; + + SDL_BlitSurface( sprite, &srcR, screen, &destR ); + break; + } + case ENEMY_SHOT_TANK_ROCKET: + { + SDL_Rect destR; + SDL_Rect srcR; + destR.x = lroundf(pos.getX()) - sprite->w / 16; + destR.y = lroundf(pos.getY()) - sprite->h / 2; + destR.w = sprite->w / 8; + destR.h = sprite->h; + + float angle = vel.getDirection() + 202.5; + int idx = lroundf(angle) % 360; + idx = idx / 45; + srcR.x = idx * sprite->w / 8; + srcR.y = 0; + srcR.w = sprite->w / 8; + srcR.h = sprite->h; + + SDL_BlitSurface( sprite, &srcR, screen, &destR ); + break; + } + + default: break; + } +} + +void Shot::drawAirShot(SDL_Surface *screen) { + switch (shotType) { + case SHOT_NORMAL: + case SHOT_NORMAL_HEAVY: + case SHOT_DOUBLE: + case SHOT_DOUBLE_HEAVY: + case SHOT_TRIPLE: + case SHOT_HF_NORMAL: + case SHOT_HF_DOUBLE: + case SHOT_HF_TRIPLE: + case SHOT_HF_QUATTRO: + case SHOT_HF_QUINTO: + case SPECIAL_SHOT_NUKE: + case ENEMY_SHOT_NORMAL: + { + SDL_Rect destR; + destR.x = lroundf(pos.getX()) - sprite->w / 2; + destR.y = lroundf(pos.getY()) - sprite->h / 2; + destR.w = sprite->w; + destR.h = sprite->h; + SDL_BlitSurface( sprite, 0, screen, &destR ); + break; + } + default: break; + } +} + +ShotTypes Shot::getShotType() { + return shotType; +} + + +void Shot::generateSmokePuff( int dT) { + if ( ! generatesSmokePuffs ) return; + + timeToNextSmokePuff -= dT; + if ( timeToNextSmokePuff < 0 ) { + Vector2D relPos = -vel; + relPos.setLength( sprite->h / 2 ); + if ( shotType == SHOT_HELLFIRE || + shotType == ENEMY_SHOT_TANK_ROCKET ) { + + smokePuffs->addSmokePuff( pos + relPos, + vel * SMOKE_PUFF_VELOCITY_FACTOR, + SMOKE_PUFF_MEDIUM ); + timeToNextSmokePuff += SMOKE_PUFF_DELAY_TO_NEXT_PUFF[ SMOKE_PUFF_MEDIUM ]; + } else { + smokePuffs->addSmokePuff( pos + relPos, + vel * SMOKE_PUFF_VELOCITY_FACTOR, + SMOKE_PUFF_SMALL ); + timeToNextSmokePuff += SMOKE_PUFF_DELAY_TO_NEXT_PUFF[ SMOKE_PUFF_SMALL ]; + } + } +} + + + diff --git a/alienblaster/project/jni/alienblaster/src/shot.h b/alienblaster/project/jni/alienblaster/src/shot.h new file mode 100644 index 000000000..8175caa4d --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/shot.h @@ -0,0 +1,82 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +#ifndef SHOT_H +#define SHOT_H + +#include "SDL.h" +#include "geometry.h" +#include +#include "global.h" + +class Shot { + // time (ms) the shot may fly around + int timeToLive; + + Vector2D pos; + Vector2D vel; + + // who fired the shot + int fromWhichPlayer; + ShotTypes shotType; + + SDL_Surface *sprite; + SDL_Surface *spriteShadow; + + bool collidedWithGround; // defaultValue = false + + bool generatesSmokePuffs; + int timeToNextSmokePuff; + + public: + Shot( ShotTypes shotType, int playerNr, Vector2D position, float angle ); + + // for rockets only + bool deflectedBySonicFromPlayer1; + bool deflectedBySonicFromPlayer2; + + // checks if the shot hit a racer. if yes it expires, does its damage + // and makes a neat explosion + void moveAndCollide( int dT ); + // draws the shot + void drawShadow(SDL_Surface *screen); + void drawGroundShot(SDL_Surface *screen); + void drawAirShot(SDL_Surface *screen); + void drawGroundAirShot(SDL_Surface *screen); + + bool isExpired() { return (timeToLive <= 0); } + Vector2D getPos() { return pos; } + ShotTypes getShotType(); + + private: + + void addExplosion(); + + void moveAndCollidePlayerShot( int dT ); + void movePlayerShot( int dT ); + bool collidePlayerShot( Vector2D posOld ); + + void moveAndCollideEnemyShot( int dT ); + void moveEnemyShot( int dT ); + bool collideEnemyShot( Vector2D posOld ); + + void generateSmokePuff( int dT ); +}; + +#endif diff --git a/alienblaster/project/jni/alienblaster/src/shots.cc b/alienblaster/project/jni/alienblaster/src/shots.cc new file mode 100644 index 000000000..18e145cb2 --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/shots.cc @@ -0,0 +1,122 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +using namespace std; + +#include "shots.h" +#include "shot.h" + +Shots::Shots() {} + +Shots::~Shots() { + vector::iterator i; + for (i = shots.begin(); i != shots.end(); ++i) { + delete *i; + } +} + +void Shots::addShot(Shot *shot) { + if (shot) { + shots.push_back(shot); + } +} + +void Shots::moveAndCollide( int dT ) { + vector::iterator i; + for (i = shots.begin(); i != shots.end(); ++i) { + (*i)->moveAndCollide( dT ); + } +} + +void Shots::deleteAllShots() { + vector::iterator i; + for (i = shots.begin(); i != shots.end(); ++i) { + delete *i; + } + shots.clear(); +} + +void Shots::expireShots() { + unsigned int i = 0; + while ( i < shots.size() ) { + if ( shots[i]->isExpired() ) { + delete shots[i]; + // TODO: Performance-Optimierung, indem der letzte Schuß + // nach vorne kopiert und dann das letzte Element gelöscht wird. + // Dann wird nicht immer der Rest des Vektors kopiert. + shots.erase(shots.begin() + i); + } else { + i++; + } + } +} + +void Shots::drawShadows(SDL_Surface *screen) { + vector::iterator i; + for (i = shots.begin(); i != shots.end(); ++i) { + (*i)->drawShadow(screen); + } +} + +void Shots::drawGroundShots(SDL_Surface *screen) { + vector::iterator i; + for (i = shots.begin(); i != shots.end(); ++i) { + (*i)->drawGroundShot(screen); + } +} + +void Shots::drawAirShots(SDL_Surface *screen) { + vector::iterator i; + for (i = shots.begin(); i != shots.end(); ++i) { + (*i)->drawAirShot(screen); + } +} + +void Shots::drawGroundAirShots(SDL_Surface *screen) { + vector::iterator i; + for (i = shots.begin(); i != shots.end(); ++i) { + (*i)->drawGroundAirShot(screen); + } +} + +Shot* Shots::getNearestRocket(Vector2D position) { + vector::iterator i; + float distance = 99999.0; + Shot* rocket = NULL; + + for (i = shots.begin(); i != shots.end(); ++i) { + if ( (*i)->getShotType() == ENEMY_SHOT_TANK_ROCKET ) { + if (position.distanceTo( (*i)->getPos() ) < distance ) { + distance = position.distanceTo( (*i)->getPos() ); + rocket = (*i); + } + } + } + return rocket; +} + +bool Shots::existsRocket() { + vector::iterator i; + for (i = shots.begin(); i != shots.end(); ++i) { + if ( (*i)->getShotType() == ENEMY_SHOT_TANK_ROCKET ) { + return true; + } + } + return false; +} diff --git a/alienblaster/project/jni/alienblaster/src/shots.h b/alienblaster/project/jni/alienblaster/src/shots.h new file mode 100644 index 000000000..d8005da95 --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/shots.h @@ -0,0 +1,57 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +#ifndef SHOTS_H +#define SHOTS_H + +#include +#include "SDL.h" +#include "geometry.h" + + +class Shot; + +/* manages the shot-objects */ +class Shots { + vector shots; + + public: + Shots(); + ~Shots(); + + void addShot(Shot *shot); + // deletes shots, that timed out or hit + void expireShots(); + // deletes all shots (if a nuke is used, this will happen) + void deleteAllShots(); + + // moves the shots and checks, whether a shot hit a racer or an enemy + void moveAndCollide( int dT ); + + // draw the shots + void drawShadows(SDL_Surface *screen); + void drawAirShots(SDL_Surface *screen); + void drawGroundShots(SDL_Surface *screen); + void drawGroundAirShots(SDL_Surface *screen); + + Shot* getNearestRocket(Vector2D position); + bool existsRocket(); +}; + +#endif diff --git a/alienblaster/project/jni/alienblaster/src/smokePuff.cc b/alienblaster/project/jni/alienblaster/src/smokePuff.cc new file mode 100644 index 000000000..56fea60e5 --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/smokePuff.cc @@ -0,0 +1,71 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +using namespace std; + +#include "smokePuff.h" +#include "surfaceDB.h" +#include "global.h" + +SmokePuff::SmokePuff( Vector2D position, Vector2D velocity, SmokePuffTypes whichType ) { + + smokePuffType = whichType; + pos = position; + vel = velocity; + + sprite = surfaceDB.loadSurface( FN_SMOKE_PUFF[ smokePuffType ], + SMOKE_PUFF_ALPHA_BLENDING ); + + expired = false; + nrAnimStages = sprite->w / sprite->h; + timePerStage = LIFETIME_SMOKE_PUFF[ smokePuffType ] / nrAnimStages; + actAnimStage = 0; + timeLived = 0; + timeNextAnimStage = timePerStage; +} + +SmokePuff::~SmokePuff() {} + +void SmokePuff::update( int dT ) { + pos += vel * dT / 1000.0; + timeLived += dT; + if ( timeLived > timeNextAnimStage ) { + timeNextAnimStage += timePerStage; + actAnimStage++; + if (actAnimStage == nrAnimStages) expired = true; + } +} + +void SmokePuff::drawSmokePuff( SDL_Surface *screen ) { + if (expired) return; + + SDL_Rect dest; + dest.x = lroundf(pos.getX()) - sprite->w / (2*nrAnimStages); + dest.y = lroundf(pos.getY()) - sprite->h / 2; + dest.w = sprite->w / nrAnimStages; + dest.h = sprite->h; + + SDL_Rect src; + src.x = actAnimStage * sprite->w / nrAnimStages; + src.y = 0; + src.w = sprite->w / nrAnimStages; + src.h = sprite->h; + + SDL_BlitSurface( sprite, &src, screen, &dest ); +} diff --git a/alienblaster/project/jni/alienblaster/src/smokePuff.h b/alienblaster/project/jni/alienblaster/src/smokePuff.h new file mode 100644 index 000000000..d5395cebb --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/smokePuff.h @@ -0,0 +1,61 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +#ifndef SMOKE_PUFF_H +#define SMOKE_PUFF_H + +#include "SDL.h" +#include "geometry.h" +#include "global.h" +#include + +class SmokePuff { + + // a sprite, that contains horizontally all animationframes of the smokePuff. + // it is assumed, that every frame is quadratic. + SDL_Surface *sprite; + + // how many frames does this explosion have? + int nrAnimStages; + // which frame is now? + int actAnimStage; + // how long should one frame last (ms) + int timePerStage; + // how long is the current smokePuff already active + int timeLived; + // at what timeLived starts the next frame? + int timeNextAnimStage; + + // the explosion can be deleted + bool expired; + + Vector2D pos; + Vector2D vel; // the smokepuff moves - yeah + SmokePuffTypes smokePuffType; + + public: + SmokePuff( Vector2D position, Vector2D velocity, SmokePuffTypes whichType ); + ~SmokePuff(); + // updates the position and the counters + void update( int dT ); + void drawSmokePuff(SDL_Surface *screen); + bool isExpired() { return expired; } +}; + +#endif diff --git a/alienblaster/project/jni/alienblaster/src/smokePuffs.cc b/alienblaster/project/jni/alienblaster/src/smokePuffs.cc new file mode 100644 index 000000000..2f40fedaf --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/smokePuffs.cc @@ -0,0 +1,69 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +#include "smokePuff.h" +#include "smokePuffs.h" +#include "surfaceDB.h" +#include "global.h" + +SmokePuffs::SmokePuffs() {} + +SmokePuffs::~SmokePuffs() { + vector::iterator i; + for (i = smokePuffs.begin(); i != smokePuffs.end(); ++i) { + delete *i; + } +} + +void SmokePuffs::addSmokePuff( SmokePuff *smokePuff ) { + if ( smokePuff ) { + smokePuffs.push_back( smokePuff ); + } +} + +void SmokePuffs::addSmokePuff( Vector2D pos, Vector2D vel, SmokePuffTypes whichType ) { + SmokePuff *newSmokePuff = new SmokePuff( pos, vel, whichType ); + addSmokePuff( newSmokePuff ); +} + +void SmokePuffs::expireSmokePuffs() { + unsigned int i = 0; + while ( i < smokePuffs.size() ) { + if ( smokePuffs[i]->isExpired() ) { + delete smokePuffs[i]; + smokePuffs.erase( smokePuffs.begin() + i ); + } else { + i++; + } + } +} + +void SmokePuffs::update( int dT ) { + vector::iterator i; + for (i = smokePuffs.begin(); i != smokePuffs.end(); ++i) { + (*i)->update( dT ); + } +} + +void SmokePuffs::draw(SDL_Surface *screen) { + vector::iterator i; + for (i = smokePuffs.begin(); i != smokePuffs.end(); ++i) { + (*i)->drawSmokePuff( screen ); + } +} diff --git a/alienblaster/project/jni/alienblaster/src/smokePuffs.h b/alienblaster/project/jni/alienblaster/src/smokePuffs.h new file mode 100644 index 000000000..c9a4cdf46 --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/smokePuffs.h @@ -0,0 +1,45 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +#ifndef SMOKE_PUFFS_H +#define SMOKE_PUFFS_H + +#include "SDL.h" +#include "geometry.h" +#include + +class SmokePuff; + +class SmokePuffs { + std::vector smokePuffs; + + public: + SmokePuffs(); + ~SmokePuffs(); + + void addSmokePuff( SmokePuff *smokePuff ); + void addSmokePuff( Vector2D pos, Vector2D vel, SmokePuffTypes whichType ); + void expireSmokePuffs(); + void update( int dT ); + void draw(SDL_Surface *screen); + unsigned int getNrSmokePuffs() { return smokePuffs.size(); } +}; + + +#endif diff --git a/alienblaster/project/jni/alienblaster/src/sonic.cc b/alienblaster/project/jni/alienblaster/src/sonic.cc new file mode 100644 index 000000000..7a88db4b9 --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/sonic.cc @@ -0,0 +1,69 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +#include +#include +#include "sonic.h" +#include "global.h" +#include "surfaceDB.h" +#include "geometry.h" +#include "video.h" + +using namespace std; + +Sonic::Sonic() { + sonicBall = surfaceDB.loadSurface( FN_SONIC_EFFECT, true ); + timeStage = 0; + active = false; + waveLength = 6.0f; +} + +void Sonic::setPos( Vector2D pos1, Vector2D pos2 ) { + this->pos1 = pos1; + this->pos2 = pos2; + active = true; +} + +void Sonic::drawAtPos( SDL_Surface *screen, Vector2D pos1, Vector2D pos2 ) { + setPos( pos1, pos2 ); + draw( screen ); +} + +void Sonic::draw( SDL_Surface *screen ) { + if ( !active ) return; + timeStage += 2; + timeStage = (timeStage % (int)(waveLength + 0.5f)) + 1; + SDL_Rect rect; + rect.w = sonicBall->w; + rect.h = sonicBall->h; + Vector2D sonicIncrement = pos2 - pos1; + float dist = sonicIncrement.getLength() - waveLength; + sonicIncrement.setLength((float) timeStage); + Vector2D sonicActual = pos1; + sonicActual += sonicIncrement; + sonicIncrement.setLength(waveLength); + + while (dist >= 5) { + sonicActual += sonicIncrement; + dist -= waveLength; + rect.x = (int) sonicActual.getX() - sonicBall->w / 2; + rect.y = (int) sonicActual.getY() - sonicBall->h / 2; + SDL_BlitSurface( sonicBall, 0, screen, &rect ); + } +} diff --git a/alienblaster/project/jni/alienblaster/src/sonic.h b/alienblaster/project/jni/alienblaster/src/sonic.h new file mode 100644 index 000000000..97b2531dd --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/sonic.h @@ -0,0 +1,47 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +#ifndef _SONIC_H_ +#define _SONIC_H_ + +#include +#include "geometry.h" + +class Sonic { + public: + + Sonic(); + void setActive( bool newActivation ) { active = newActivation; }; + void setWaveLength( float wvLength ) { waveLength = wvLength; }; + void setPos( Vector2D pos1, Vector2D pos2 ); + void drawAtPos( SDL_Surface *screen, Vector2D pos1, Vector2D pos2 ); + void draw( SDL_Surface *screen ); + + + private: + + SDL_Surface *sonicBall; + bool active; + Vector2D pos1; + Vector2D pos2; + float waveLength; + Uint32 timeStage; +}; + +#endif diff --git a/alienblaster/project/jni/alienblaster/src/soundDB.cc b/alienblaster/project/jni/alienblaster/src/soundDB.cc new file mode 100644 index 000000000..0c1edb477 --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/soundDB.cc @@ -0,0 +1,59 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +using namespace std; + +#include "soundDB.h" +#include "SDL_mixer.h" + +SoundDB::SoundDB() {} + +SoundDB::~SoundDB() { + StringSoundMap::iterator pos; + // free all Mix_Chunks + for ( pos = soundDB.begin(); pos != soundDB.end(); ++pos ) { + Mix_FreeChunk( pos->second ); + } +} + +Mix_Chunk *SoundDB::loadWav( string fn ) { + Mix_Chunk *searchResult = getWav( fn ); + if ( searchResult ) { + return searchResult; + } + + // TODO: error-handling + Mix_Chunk *newSound = Mix_LoadWAV( fn.c_str() ); + soundDB[ fn ] = newSound; + return newSound; +} + +Mix_Chunk *SoundDB::getWav( string fn ) { + if ( soundDB.empty() ) { + return 0; + } else { + StringSoundMap::iterator pos = soundDB.find( fn ); + if ( pos == soundDB.end() ) { + return 0; + } else { + return pos->second; + } + } +} + diff --git a/alienblaster/project/jni/alienblaster/src/soundDB.h b/alienblaster/project/jni/alienblaster/src/soundDB.h new file mode 100644 index 000000000..1a90c88cf --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/soundDB.h @@ -0,0 +1,48 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +#ifndef SOUND_DB_HH +#define SOUND_DB_HH + +#include "SDL.h" +#include "SDL_mixer.h" +#include +#include +#include + +typedef map >StringSoundMap; + + +// TODO: freeWav mit Reference-Count + +class SoundDB { + public: + SoundDB(); + ~SoundDB(); + + Mix_Chunk *loadWav( string fn ); + + private: + StringSoundMap soundDB; + + Mix_Chunk *getWav( string fn ); +}; + + +#endif //#define SOUND_DB_HH diff --git a/alienblaster/project/jni/alienblaster/src/surfaceDB.cc b/alienblaster/project/jni/alienblaster/src/surfaceDB.cc new file mode 100644 index 000000000..8715e8e71 --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/surfaceDB.cc @@ -0,0 +1,81 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +using namespace std; + +#include "surfaceDB.h" +#include +#include + +SurfaceDB surfaceDB; + +SurfaceDB::SurfaceDB( Uint8 transparentR, + Uint8 transparentG, + Uint8 transparentB ) { + transR = transparentR; + transG = transparentG; + transB = transparentB; +} + +SurfaceDB::~SurfaceDB() { + StringSurfaceMap::iterator pos; + // free all surfaces + for ( pos = surfaceDB.begin(); pos != surfaceDB.end(); ++pos ) { + SDL_FreeSurface( pos->second ); + } +} + +SDL_Surface *SurfaceDB::loadSurface( string fn, bool alpha ) { + + SDL_Surface *searchResult = getSurface( fn ); + if ( searchResult ) { + return searchResult; + } + + // open the file for reading + ifstream inputFile ( fn.c_str(), ios::in); + if (!inputFile.good()) { + cout << "ERROR: file " << fn << " does not exist!" << endl; + exit(1); + } + + SDL_Surface *newSurface = SDL_LoadBMP( fn.c_str() ); + SDL_SetColorKey( newSurface, SDL_SRCCOLORKEY, + SDL_MapRGB(newSurface->format, transR, transG, transB) ); + if ( alpha ) { + SDL_SetAlpha( newSurface, SDL_SRCALPHA, 128 ); + } + + surfaceDB[ fn ] = newSurface; + return newSurface; +} + +SDL_Surface *SurfaceDB::getSurface( string fn ) { + if ( surfaceDB.empty() ) { + return 0; + } else { + StringSurfaceMap::iterator pos = surfaceDB.find( fn ); + if ( pos == surfaceDB.end() ) { + return 0; + } else { + return pos->second; + } + } +} + diff --git a/alienblaster/project/jni/alienblaster/src/surfaceDB.h b/alienblaster/project/jni/alienblaster/src/surfaceDB.h new file mode 100644 index 000000000..59362b6e4 --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/surfaceDB.h @@ -0,0 +1,61 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +#ifndef SURFACE_DB_HH +#define SURFACE_DB_HH + + +#include "SDL.h" + +#include +#include +#include + +typedef std::map > StringSurfaceMap; + + +class SurfaceDB; + +extern SurfaceDB surfaceDB; + +/* Framework for convenient loading and management of SDL_Surfaces. + Every surface has a transparent color (default violet). + If the requested surface was already loaded it is not loaded again, + instead the old surface is returned. + The clients of the surface may use the surface for blitting, but they must + not change (especially delete) it. +*/ +class SurfaceDB { + public: + SurfaceDB( Uint8 transparentR=255, + Uint8 transparentG=0, + Uint8 transparentB=255 ); + ~SurfaceDB(); + + SDL_Surface *loadSurface( std::string fn, bool alpha=false ); + + private: + StringSurfaceMap surfaceDB; + Uint8 transR, transG, transB; + + SDL_Surface *getSurface( std::string fn ); +}; + + +#endif //#ifndef SURFACE_DB_HH diff --git a/alienblaster/project/jni/alienblaster/src/video.cc b/alienblaster/project/jni/alienblaster/src/video.cc new file mode 100644 index 000000000..ce85894ae --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/video.cc @@ -0,0 +1,77 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +#include "video.h" +#include "SDL.h" +#include +#include "global.h" + +using namespace std; + +Video *videoserver; + +Video::Video(){ + screen = 0; +} + +Video::~Video(){ + // kill something +} + +SDL_Surface *Video::init(){ + // -------------------------------------------------- + // SDL initialisation + // ----------------------------------------------------- + fullscreen = false; + if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0) { + printf("Couldn't initialize SDL video subsystem: %s\n", SDL_GetError()); + exit(1); + } + screen = SDL_SetVideoMode( SCREEN_WIDTH, SCREEN_HEIGHT, BIT_DEPTH, SDL_DOUBLEBUF /* | SDL_FULLSCREEN */ ); + if (!screen) { + printf("Couldn't set %dx%d, %dbit video mode: %s\n", SCREEN_WIDTH, SCREEN_HEIGHT, BIT_DEPTH, SDL_GetError()); + exit(2); + } + + SDL_WM_SetCaption("AlienBlaster", "AlienBlaster"); + SDL_WM_SetIcon(SDL_LoadBMP( FN_ALIENBLASTER_ICON.c_str() ), NULL); + SDL_ShowCursor(SDL_DISABLE); + + return screen; +} + + +void Video::clearScreen() { + // clear the screen + SDL_Rect r; + r.x = 0; + r.y = 0; + r.w = screen->w; + r.h = screen->h; + SDL_FillRect(screen, &r, SDL_MapRGB(screen->format, 0, 0, 0) ); +} + +void Video::toggleFullscreen() { + if ( fullscreen ) { + screen = SDL_SetVideoMode( SCREEN_WIDTH, SCREEN_HEIGHT, BIT_DEPTH, SDL_DOUBLEBUF ); + } else { + screen = SDL_SetVideoMode( SCREEN_WIDTH, SCREEN_HEIGHT, BIT_DEPTH, SDL_DOUBLEBUF | SDL_FULLSCREEN ); + } + fullscreen = !fullscreen; +} diff --git a/alienblaster/project/jni/alienblaster/src/video.h b/alienblaster/project/jni/alienblaster/src/video.h new file mode 100644 index 000000000..126913829 --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/video.h @@ -0,0 +1,45 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +#ifndef VIDEO_H +#define VIDEO_H + +#include "SDL.h" + +class Video; + +extern Video *videoserver; + +class Video { + +private: + SDL_Surface *screen; + +public: + Video(); + ~Video(); + SDL_Surface *init(); + + bool fullscreen; + + void clearScreen(); + void toggleFullscreen(); +}; + +#endif //#ifndef VIDEO_HH diff --git a/alienblaster/project/jni/alienblaster/src/wreck.cc b/alienblaster/project/jni/alienblaster/src/wreck.cc new file mode 100644 index 000000000..8d9ba462e --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/wreck.cc @@ -0,0 +1,114 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +#include "wreck.h" +#include "surfaceDB.h" +#include "global.h" +#include "options.h" + +Wreck::Wreck(Vector2D position, WreckTypes wreckType) { + + this->wreckType = wreckType; + + pos = position; + vel = Vector2D(0, SCROLL_SPEED); + + switch (wreckType) { + case WRECK_FIGHTER: + { + string fn = LVL_WRECK_FIGHTER; + levelConf->getStr( LVL_WRECK_FIGHTER, fn); + sprite = surfaceDB.loadSurface( fn ); + break; + } + case WRECK_BOMBER: + { + string fn = LVL_WRECK_BOMBER; + levelConf->getStr( LVL_WRECK_BOMBER, fn); + sprite = surfaceDB.loadSurface( fn ); + break; + } + case WRECK_TANK: + { + string fn = LVL_WRECK_TANK; + levelConf->getStr( LVL_WRECK_TANK, fn); + sprite = surfaceDB.loadSurface( fn ); + break; + } + case WRECK_BOSS_1_BACKGROUND: + { + string fn = LVL_WRECK_BOSS_BACKGROUND; + levelConf->getStr( LVL_WRECK_BOSS_BACKGROUND, fn); + sprite = surfaceDB.loadSurface( fn ); + break; + } + case WRECK_BOSS_1_DESTROYED: + { + string fn = LVL_WRECK_BOSS_DESTROYED; + levelConf->getStr( LVL_WRECK_BOSS_DESTROYED, fn); + sprite = surfaceDB.loadSurface( fn ); + break; + } + case WRECK_BOSS_2_DESTROYED: + { + sprite = surfaceDB.loadSurface( FN_WRECK_BOSS_2_DESTROYED ); + float correlateToBackground = actBackgroundPos - truncf(actBackgroundPos); + pos = Vector2D( position.getX(), truncf(position.getY()) - correlateToBackground ); + break; + } + default: + { + string fn = LVL_WRECK_FIGHTER; + levelConf->getStr( LVL_WRECK_FIGHTER, fn); + sprite = surfaceDB.loadSurface( fn ); + break; + } + } +} + + +Wreck::~Wreck() { +} + + +void Wreck::update( int dT ) { + if ( scrollingOn ) { + pos += vel * dT / 1000.0; + } +} + + +void Wreck::draw(SDL_Surface *screen) { + SDL_Rect r; + r.x = lroundf(pos.getX()) - sprite->w / 2; + r.y = lroundf(pos.getY()) - sprite->h / 2; + r.w = sprite->w; + r.h = sprite->h; + SDL_BlitSurface( sprite, 0, screen, &r ); +} + + +bool Wreck::isExpired() { + return ( pos.getY() > SCREEN_HEIGHT ); +} + + +void Wreck::deleteWreck() { + pos.setY( SCREEN_HEIGHT + 500 ); +} diff --git a/alienblaster/project/jni/alienblaster/src/wreck.h b/alienblaster/project/jni/alienblaster/src/wreck.h new file mode 100644 index 000000000..8f4d4752e --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/wreck.h @@ -0,0 +1,48 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +#ifndef WRECK_H +#define WRECK_H + +#include "SDL.h" +#include "geometry.h" +#include +#include "global.h" + +class Wreck { + SDL_Surface *sprite; + + Vector2D pos; + Vector2D vel; + WreckTypes wreckType; + + public: + Wreck( Vector2D position, WreckTypes wreckType ); + ~Wreck(); + void update( int dT ); + void draw(SDL_Surface *screen); + bool isExpired(); + void deleteWreck(); + + Vector2D getPos() { return pos; } + Vector2D getVel() { return vel; } + WreckTypes getType() { return wreckType; } +}; + +#endif diff --git a/alienblaster/project/jni/alienblaster/src/wrecks.cc b/alienblaster/project/jni/alienblaster/src/wrecks.cc new file mode 100644 index 000000000..e67c3bc6f --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/wrecks.cc @@ -0,0 +1,74 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +#include "wrecks.h" +#include "wreck.h" + +Wrecks::Wrecks() { +} + +Wrecks::~Wrecks() { + vector::iterator i; + for (i = wrecks.begin(); i != wrecks.end(); ++i) { + delete *i; + } +} + +void Wrecks::addWreck(Wreck *wreck) { + if (wreck) { + wrecks.push_back(wreck); + } +} + +void Wrecks::expireWrecks() { + unsigned int i = 0; + while ( i < wrecks.size() ) { + if ( wrecks[i]->isExpired() ) { + delete wrecks[i]; + wrecks.erase(wrecks.begin() + i); + } else { + i++; + } + } +} + +void Wrecks::updateWrecks( int dT ) { + vector::iterator i; + for (i = wrecks.begin(); i != wrecks.end(); ++i) { + (*i)->update( dT ); + } +} + +void Wrecks::draw(SDL_Surface *screen) { + vector::iterator i; + for (i = wrecks.begin(); i != wrecks.end(); ++i) { + (*i)->draw(screen); + } +} + +void Wrecks::deleteAllWrecks() { + vector::iterator i; + for (i = wrecks.begin(); i != wrecks.end(); ++i) { + (*i)->deleteWreck(); + } +} + +Wreck *Wrecks::getWreck(unsigned int idx) { + return wrecks[idx]; +} diff --git a/alienblaster/project/jni/alienblaster/src/wrecks.h b/alienblaster/project/jni/alienblaster/src/wrecks.h new file mode 100644 index 000000000..30f1a1197 --- /dev/null +++ b/alienblaster/project/jni/alienblaster/src/wrecks.h @@ -0,0 +1,46 @@ +/*************************************************************************** + alienBlaster + Copyright (C) 2004 + Paul Grathwohl, Arne Hormann, Daniel Kuehn, Soenke Schwardt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +***************************************************************************/ +#ifndef WRECKS_H +#define WRECKS_H + +#include "SDL.h" +#include + +class Wreck; + +class Wrecks { + std::vector wrecks; + + public: + Wrecks(); + ~Wrecks(); + + void addWreck(Wreck *wreck); + void expireWrecks(); + void updateWrecks( int dT ); + void draw(SDL_Surface *screen); + void deleteAllWrecks(); + + unsigned int getNrWrecks() { return wrecks.size(); } + Wreck *getWreck(unsigned int idx); +}; + + +#endif diff --git a/alienblaster/project/jni/sdl/Android.mk b/alienblaster/project/jni/sdl/Android.mk new file mode 100644 index 000000000..7ee5e82d6 --- /dev/null +++ b/alienblaster/project/jni/sdl/Android.mk @@ -0,0 +1,41 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := sdl + +ifndef SDL_JAVA_PACKAGE_PATH +$(error Please define SDL_JAVA_PACKAGE_PATH to the path of your Java package with dots replaced with underscores, for example "com_example_SanAngeles") +endif + +LOCAL_CFLAGS := -I$(LOCAL_PATH)/include -DSDL_JAVA_PACKAGE_PATH=$(SDL_JAVA_PACKAGE_PATH) -DSDL_CURDIR_PATH=\"$(SDL_CURDIR_PATH)\" + +SDL_SRCS := \ + src/*.c \ + src/audio/*.c \ + src/cdrom/*.c \ + src/cpuinfo/*.c \ + src/events/*.c \ + src/file/*.c \ + src/joystick/*.c \ + src/stdlib/*.c \ + src/thread/*.c \ + src/timer/*.c \ + src/video/*.c \ + src/audio/dummy/*.c \ + src/video/android/*.c \ + src/joystick/dummy/*.c \ + src/cdrom/dummy/*.c \ + src/thread/pthread/*.c \ + src/timer/unix/*.c \ + src/loadso/dummy/*.c \ + +LOCAL_CPP_EXTENSION := .cpp + +# Note this simple makefile var substitution, you can find even simpler examples in different Android projects +LOCAL_SRC_FILES := $(foreach F, $(SDL_SRCS), $(addprefix $(dir $(F)),$(notdir $(wildcard $(LOCAL_PATH)/$(F))))) + +LOCAL_LDLIBS := -lGLESv1_CM -ldl -llog + +include $(BUILD_STATIC_LIBRARY) + diff --git a/alienblaster/project/jni/sdl/BUGS b/alienblaster/project/jni/sdl/BUGS new file mode 100644 index 000000000..218bf3d15 --- /dev/null +++ b/alienblaster/project/jni/sdl/BUGS @@ -0,0 +1,18 @@ + +Bugs are now managed in the SDL bug tracker, here: + + http://bugzilla.libsdl.org/ + +You may report bugs there, and search to see if a given issue has already + been reported, discussed, and maybe even fixed. + + + +You may also find help at the SDL mailing list. Subscription information: + + http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org + +Bug reports are welcome here, but we really appreciate if you use Bugzilla, as + bugs discussed on the mailing list may be forgotten or missed. + + diff --git a/alienblaster/project/jni/sdl/Borland.html b/alienblaster/project/jni/sdl/Borland.html new file mode 100644 index 000000000..eaf82099d --- /dev/null +++ b/alienblaster/project/jni/sdl/Borland.html @@ -0,0 +1,139 @@ + + + + Building SDL with Borland's C++ compilers + + + + + +

Building SDL with Borland's C++ compilers.

+ by David Snopek + and updated by Dominique + Louis ( Last updated : 30th June 2003 ).
+
+ These instructions cover how to compile SDL and its included test +programs using either Borland C++ Builder 5, 6 for Windows, + C++ Builder for Linux ( AKA Kylix 3 ) or the free Borland C++ command-line compiler.
+ +

Extract the files

+ +

Unzip the Borland.zip archive into this directory. Do not unzip + it into any other directory because the makefiles ( *.mak ) and project + files ( *.bpr ) use relative paths to refer to the SDL sources. This should + create a directory named "Borland" inside of the top level SDL source directory. +

+ +

Using Borland C++ Builder 5, 6 for Windows +

+ +

Inside of the "Borland" directory there is a "bcb6" directory that contains + a number of Builder project files. Double-click on the "libSDL.bpg" file + icon. Once Builder has started click on the "Projects" menu on +the menu-bar and go down to "Build All Projects" option.
+ This will proceed to build SDL ( with Borland's calling convention ), +SDLmain, and all the test programs. Currently, all +the test programs are dynamically linked to Sam Lantinga's +SDL.dll.

+ +

NOTE : Borland's "lib" format and Microsoft's "lib" format are incompatible. + 
+ If you wish to dynamically link to the SDL library supplied by Sam Lantinga + in each release, I have created the correct *.libs for SDL 1.2.4 and they + exist in the "/lib" directory.
+ If you would like to create the *.lib files yourself, you will need to +make use of Borland's "implib.exe" utility.
+

+ +

IMPLIB works like this:

+ +
    IMPLIB (destination lib name) (source dll)
+ +

For example,

+ +
    IMPLIB SDL.lib SDL.dll
+ +

This assumes that SDL.dll was compiled with Visual C++ or similar.
+

+ +

To learn more about the difference between Borland's and Microsoft's *.lib + format please read the article here.
+

+ +


+ NOTE :
The C++ Builder for Windows project format, is not compatible + with the Kylix 3 project format, hence the reason why they are in separate + directories.

+ +

Using the free Borland C++ command-line compiler +

+ +

The free Borland compiler can be downloaded at no charge from the Borland website + . Make sure that it is installed and properly configured.

+ +

Open an MS-DOS Prompt. Change to the "Borland\freebcc" directory under + the SDL source directory. Type "make -f SDL.mak" to build SDL and "make + -f SDLmain.mak". There are also makefiles for all of the test programs, if you wish to build them. All .exes and +DLLs are created in the "test" SDL directory. Ify ou would like to create +the DLL and all the test applications, I have thrown together a basic batchfile +called "makeall.bat" which should create everything in the right order.

+ +

Output files

+ No matter which compiler you used, three important files should have + been produced: +
    +
  • SDL.dll ( Borland format )
  • +
  • SDL.lib ( Borland format )
  • +
  • SDLmain.lib ( Borland format )
  • + +
+ Both of the *.lib files will need to be added to all the projects +that use SDL and SDL.dll must be placed some where the Windows dynamic +linker can find it (either in your project directory or on the system +path, C:\WINDOWS\SYSTEM). +

Using Borland C++ Builder for Linux ( AKA Kylix + 3 )

+ +

Inside of the "Borland" directory there is a "k3" directory that contains + a number of Builder project files. Double-click on the "libSDL.bpg" file + icon. Once Builder has started click on the "Projects" menu on +the menu-bar and go down to "Build All Projects" option. This will +proceed to build all the test programs
+ Linux users do not need *.lib files as the Shared Object is linked right + into the project ( very neat actually, Windows should do this sort of thing + as it is a lot easier for the developer ).
+ NOTE : The C++ Builder for Windows project format, is not + compatible with the Kylix 3 project format, hence the reason why they are + in separate directories.

+ +

On Mandrake 8.1 the shared objects for SDL are located in the /usr/lib + directory as libSDL_*.so and the Mesa OpenGL shared objects are located +in /usr/X11R6/lib as libGL*.so
+
+ So if your setup is different you may need to change the project file + so that they re-link to the ones on your system.
+
+ On Mandrake 8.1 the headers files are located at /usr/include/SDL/. + So if you you have not installed the development RPMs ( usually named libSDL-devel* + ) for SDL ( not included ) you may have to change the include directory + within some of the projects.
+

+ +

Known Problems

+ The only known problem is that I ( Dominique Louis ), was unable to +create the projects that rebuilt the SDL shared objects under Linux, due +to time constraints and my lack of intimate knowledge of Linux. +

Test programs

+ Some of the test programs require included media files ( *.wav; *.bmp +etc ). All the test programs are now created in the "test" directory, where +the media files are ( usually ) so they should be ready to go.
+
+
+
+ + diff --git a/alienblaster/project/jni/sdl/COPYING b/alienblaster/project/jni/sdl/COPYING new file mode 100644 index 000000000..2cba2ac74 --- /dev/null +++ b/alienblaster/project/jni/sdl/COPYING @@ -0,0 +1,458 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS diff --git a/alienblaster/project/jni/sdl/CREDITS b/alienblaster/project/jni/sdl/CREDITS new file mode 100644 index 000000000..efdcfa4d7 --- /dev/null +++ b/alienblaster/project/jni/sdl/CREDITS @@ -0,0 +1,94 @@ + +Simple DirectMedia Layer CREDITS +Thanks to everyone who made this possible, including: + +* Cliff Matthews, for giving me a reason to start this project. :) + -- Executor rocks! *grin* + +* Scott Call, for making a home for SDL on the 'Net... Thanks! :) + +* The Linux Fund, C Magazine, Educational Technology Resources Inc., + Gareth Noyce, Jesse Pavel, Keith Kitchin, Jeremy Horvath, Thomas Nicholson, + Hans-Peter Gygax, the Eternal Lands Development Team, Lars Brubaker, + and Phoenix Kokido for financial contributions + +* Gaëtan de Menten for writing the PHP and SQL behind the SDL website + +* Tim Jones for the new look of the SDL website + +* Marco Kraus for setting up SDL merchandise + +* Martin Donlon for his work on the SDL Documentation Project + +* Ryan Gordon for helping everybody out and keeping the dream alive. :) + +* IBM R&D Lab for their PS3 SPE video acceleration code + +* Mattias Engdegård, for help with the Solaris port and lots of other help + +* Max Watson, Matt Slot, and Kyle for help with the MacOS Classic port + +* Stan Shebs, for the initial Mac OS X port + +* Eric Wing, Max Horn, and Darrell Walisser for unflagging work on the Mac OS X port + +* Patrick Trainor, Jim Boucher, and Mike Gorchak for the QNX Neutrino port + +* Carsten Griwodz for the AIX port + +* Gabriele Greco, for the Amiga port + +* Patrice Mandin, for the Atari port + +* Hannu Viitala for the EPOC port + +* Marcus Mertama for the S60 port. + +* Peter Valchev for nagging me about the OpenBSD port until I got it right. :) + +* Kent B Mein, for a place to do the IRIX port + +* Ash, for a place to do the OSF/1 Alpha port + +* David Sowsy, for help with the BeOS port + +* Eugenia Loli, for endless work on porting SDL games to BeOS + +* Jon Taylor for the GGI front-end + +* Paulus Esterhazy, for the Visual C++ testing and libraries + +* Brenda Tantzen, for Metrowerks CodeWarrior on MacOS + +* Chris Nentwich, for the Hermes assembly blitters + +* Michael Vance and Jim Kutter for the X11 OpenGL support + +* Stephane Peter, for the AAlib front-end and multi-threaded timer idea. + +* Jon Atkins for SDL_image, SDL_mixer and SDL_net documentation + +* Peter Wiklund, for the 1998 winning SDL logo, + and Arto Hamara, Steven Wong, and Kent Mein for other logo entries. + +* Arne Claus, for the 2004 winning SDL logo, + and Shandy Brown, Jac, Alex Lyman, Mikkel Gjoel, #Guy, Jonas Hartmann, + Daniel Liljeberg, Ronald Sowa, DocD, Pekka Jaervinen, Patrick Avella, + Erkki Kontilla, Levon Gavalian, Hal Emerich, David Wiktorsson, + S. Schury and F. Hufsky, Ciska de Ruyver, Shredweat, Tyler Montbriand, + Martin Andersson, Merlyn Wysard, Fernando Ibanez, David Miller, + Andre Bommele, lovesby.com, Francisco Camenforte Torres, and David Igreja + for other logo entries. + +* Bob Pendleton and David Olofson for being long time contributors to + the SDL mailing list. + +* Everybody at Loki Software, Inc. for their great contributions! + + And a big hand to everyone else who gave me appreciation, advice, + and suggestions, especially the good folks on the SDL mailing list. + +THANKS! :) + + -- Sam Lantinga + diff --git a/alienblaster/project/jni/sdl/INSTALL b/alienblaster/project/jni/sdl/INSTALL new file mode 100644 index 000000000..1a30fba00 --- /dev/null +++ b/alienblaster/project/jni/sdl/INSTALL @@ -0,0 +1,23 @@ + +To compile and install SDL: + + 1. Run './configure; make; make install' + + If you are compiling for Windows using gcc, read the FAQ at: + http://www.libsdl.org/faq.php?action=listentries&category=4#42 + + If you are compiling using Visual C++ on Win32, you should read + the file VisualC.html + + 2. Look at the example programs in ./test, and check out the HTML + documentation in ./docs to see how to use the SDL library. + + 3. Join the SDL developer mailing list by sending E-mail to + sdl-request@libsdl.org + and put "subscribe" in the subject of the message. + + Or alternatively you can use the web interface: + http://www.libsdl.org/mailing-list.php + +That's it! +Sam Lantinga diff --git a/alienblaster/project/jni/sdl/Makefile.dc b/alienblaster/project/jni/sdl/Makefile.dc new file mode 100644 index 000000000..58d6e712d --- /dev/null +++ b/alienblaster/project/jni/sdl/Makefile.dc @@ -0,0 +1,111 @@ +#GL=1 + +CC = sh-elf-gcc +AR = sh-elf-ar + +ifdef GL +DEFS += -DSDL_VIDEO_OPENGL=1 +TARGET = libSDL_gl.a +else +TARGET = libSDL.a +endif + +CFLAGS=$(KOS_CFLAGS) $(DEFS) -Iinclude + +SRCS = \ + src/audio/dc/SDL_dcaudio.c \ + src/audio/dc/aica.c \ + src/audio/dummy/SDL_dummyaudio.c \ + src/audio/SDL_audio.c \ + src/audio/SDL_audiocvt.c \ + src/audio/SDL_audiodev.c \ + src/audio/SDL_mixer.c \ + src/audio/SDL_wave.c \ + src/cdrom/dc/SDL_syscdrom.c \ + src/cdrom/SDL_cdrom.c \ + src/events/SDL_active.c \ + src/events/SDL_events.c \ + src/events/SDL_expose.c \ + src/events/SDL_keyboard.c \ + src/events/SDL_mouse.c \ + src/events/SDL_quit.c \ + src/events/SDL_resize.c \ + src/file/SDL_rwops.c \ + src/joystick/dc/SDL_sysjoystick.c \ + src/joystick/SDL_joystick.c \ + src/loadso/dummy/SDL_sysloadso.c \ + src/SDL.c \ + src/SDL_error.c \ + src/SDL_fatal.c \ + src/stdlib/SDL_getenv.c \ + src/stdlib/SDL_iconv.c \ + src/stdlib/SDL_malloc.c \ + src/stdlib/SDL_qsort.c \ + src/stdlib/SDL_stdlib.c \ + src/stdlib/SDL_string.c \ + src/thread/dc/SDL_syscond.c \ + src/thread/dc/SDL_sysmutex.c \ + src/thread/dc/SDL_syssem.c \ + src/thread/dc/SDL_systhread.c \ + src/thread/SDL_thread.c \ + src/timer/dc/SDL_systimer.c \ + src/timer/SDL_timer.c \ + src/video/dc/SDL_dcevents.c \ + src/video/dc/SDL_dcvideo.c \ + src/video/dummy/SDL_nullevents.c \ + src/video/dummy/SDL_nullmouse.c \ + src/video/dummy/SDL_nullvideo.c \ + src/video/SDL_blit.c \ + src/video/SDL_blit_0.c \ + src/video/SDL_blit_1.c \ + src/video/SDL_blit_A.c \ + src/video/SDL_blit_N.c \ + src/video/SDL_bmp.c \ + src/video/SDL_cursor.c \ + src/video/SDL_gamma.c \ + src/video/SDL_pixels.c \ + src/video/SDL_RLEaccel.c \ + src/video/SDL_stretch.c \ + src/video/SDL_surface.c \ + src/video/SDL_video.c \ + src/video/SDL_yuv.c \ + src/video/SDL_yuv_sw.c \ + +OBJS = $(SRCS:.c=.o) + +TEST = \ + test/checkkeys.c \ + test/graywin.c \ + test/loopwave.c \ + test/testalpha.c \ + test/testbitmap.c \ + test/testcdrom.c \ + test/testerror.c \ + test/testgamma.c \ + test/testgl.c \ + test/testhread.c \ + test/testjoystick.c \ + test/testkeys.c \ + test/testlock.c \ + test/testoverlay.c \ + test/testpalette.c \ + test/testsem.c \ + test/testsprite.c \ + test/testtimer.c \ + test/testtypes.c \ + test/testver.c \ + test/testvidinfo.c \ + test/testwin.c \ + test/testwm.c \ + test/threadwin.c \ + test/torturethread.c \ + +$(TARGET): copy_config \ + $(OBJS) + $(AR) rcs $(TARGET) $(OBJS) + +copy_config: + @cp include/SDL_config.h.default include/SDL_config.h + +clean: + rm -f include/SDL_config.h $(OBJS) diff --git a/alienblaster/project/jni/sdl/Makefile.in b/alienblaster/project/jni/sdl/Makefile.in new file mode 100644 index 000000000..e29dc6db4 --- /dev/null +++ b/alienblaster/project/jni/sdl/Makefile.in @@ -0,0 +1,183 @@ +# Makefile to build and install the SDL library + +top_builddir = . +srcdir = @srcdir@ +objects = build +depend = build-deps +prefix = @prefix@ +exec_prefix = @exec_prefix@ +bindir = @bindir@ +libdir = @libdir@ +includedir = @includedir@ +datarootdir = @datarootdir@ +datadir = @datadir@ +mandir = @mandir@ +auxdir = @ac_aux_dir@ +distpath = $(srcdir)/.. +distdir = SDL-@SDL_VERSION@ +distfile = $(distdir).tar.gz + +@SET_MAKE@ +SHELL = @SHELL@ +CC = @CC@ +INCLUDE = @INCLUDE@ +CFLAGS = @BUILD_CFLAGS@ +EXTRA_CFLAGS = @EXTRA_CFLAGS@ +LDFLAGS = @BUILD_LDFLAGS@ +EXTRA_LDFLAGS = @EXTRA_LDFLAGS@ +LIBTOOL = @LIBTOOL@ +INSTALL = @INSTALL@ +NASM = @NASM@ @NASMFLAGS@ +AR = @AR@ +RANLIB = @RANLIB@ +WINDRES = @WINDRES@ + +TARGET = libSDL.la +SOURCES = @SOURCES@ +OBJECTS = @OBJECTS@ + +SDLMAIN_TARGET = libSDLmain.a +SDLMAIN_SOURCES = @SDLMAIN_SOURCES@ +SDLMAIN_OBJECTS = @SDLMAIN_OBJECTS@ + +DIST = acinclude autogen.sh Borland.html Borland.zip BUGS build-scripts configure configure.in COPYING CREDITS CWprojects.sea.bin docs docs.html include INSTALL Makefile.dc Makefile.minimal Makefile.in MPWmake.sea.bin README* sdl-config.in sdl.m4 sdl.pc.in SDL.qpg.in SDL.spec SDL.spec.in src test TODO VisualCE.zip VisualC.html VisualC.zip Watcom-OS2.zip Watcom-Win32.zip symbian.zip WhatsNew Xcode.tar.gz + +HDRS = SDL.h SDL_active.h SDL_audio.h SDL_byteorder.h SDL_cdrom.h SDL_cpuinfo.h SDL_endian.h SDL_error.h SDL_events.h SDL_getenv.h SDL_joystick.h SDL_keyboard.h SDL_keysym.h SDL_loadso.h SDL_main.h SDL_mouse.h SDL_mutex.h SDL_name.h SDL_opengl.h SDL_platform.h SDL_quit.h SDL_rwops.h SDL_stdinc.h SDL_syswm.h SDL_thread.h SDL_timer.h SDL_types.h SDL_version.h SDL_video.h begin_code.h close_code.h + +LT_AGE = @LT_AGE@ +LT_CURRENT = @LT_CURRENT@ +LT_RELEASE = @LT_RELEASE@ +LT_REVISION = @LT_REVISION@ +LT_LDFLAGS = -no-undefined -rpath $(DESTDIR)$(libdir) -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) + +all: $(srcdir)/configure Makefile $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET) + +$(srcdir)/configure: $(srcdir)/configure.in + @echo "Warning, configure.in is out of date" + #(cd $(srcdir) && sh autogen.sh && sh configure) + @sleep 3 + +Makefile: $(srcdir)/Makefile.in + $(SHELL) config.status $@ + +$(objects): + $(SHELL) $(auxdir)/mkinstalldirs $@ + +.PHONY: all depend install install-bin install-hdrs install-lib install-data install-man uninstall uninstall-bin uninstall-hdrs uninstall-lib uninstall-data uninstall-man clean distclean dist +depend: + @SOURCES="$(SOURCES)" INCLUDE="$(INCLUDE)" output="$(depend)" \ + $(SHELL) $(auxdir)/makedep.sh + @for src in $(SDLMAIN_SOURCES); do \ + obj=`echo $$src | sed -e 's|.*/||' -e 's|\.[^\.]*$$|.o|'`; \ + echo "\$$(objects)/$$obj: $$src" >>$(depend); \ + echo " \$$(CC) \$$(CFLAGS) \$$(EXTRA_CFLAGS) -c $$src -o \$$@" >>$(depend); \ + done + +include $(depend) + +$(objects)/$(TARGET): $(OBJECTS) + $(LIBTOOL) --mode=link $(CC) -o $@ $(OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS) + +$(objects)/$(SDLMAIN_TARGET): $(SDLMAIN_OBJECTS) + $(AR) cru $@ $(SDLMAIN_OBJECTS) + $(RANLIB) $@ + +install: all install-bin install-hdrs install-lib install-data install-man +install-bin: + $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(bindir) + $(INSTALL) -m 755 sdl-config $(DESTDIR)$(bindir)/sdl-config +install-hdrs: + $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(includedir)/SDL + for file in $(HDRS); do \ + $(INSTALL) -m 644 $(srcdir)/include/$$file $(DESTDIR)$(includedir)/SDL/$$file; \ + done + $(INSTALL) -m 644 include/SDL_config.h $(DESTDIR)$(includedir)/SDL/SDL_config.h +install-lib: $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET) + $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir) + $(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(TARGET) $(DESTDIR)$(libdir)/$(TARGET) + $(INSTALL) -m 644 $(objects)/$(SDLMAIN_TARGET) $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET) + $(RANLIB) $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET) +install-data: + $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(datadir)/aclocal + $(INSTALL) -m 644 $(srcdir)/sdl.m4 $(DESTDIR)$(datadir)/aclocal/sdl.m4 + $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)/pkgconfig + $(INSTALL) -m 644 sdl.pc $(DESTDIR)$(libdir)/pkgconfig +install-man: + $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(mandir)/man3 + for src in $(srcdir)/docs/man3/*.3; do \ + file=`echo $$src | sed -e 's|^.*/||'`; \ + $(INSTALL) -m 644 $$src $(DESTDIR)$(mandir)/man3/$$file; \ + done + +uninstall: uninstall-bin uninstall-hdrs uninstall-lib uninstall-data uninstall-man +uninstall-bin: + rm -f $(DESTDIR)$(bindir)/sdl-config +uninstall-hdrs: + for file in $(HDRS); do \ + rm -f $(DESTDIR)$(includedir)/SDL/$$file; \ + done + rm -f $(DESTDIR)$(includedir)/SDL/SDL_config.h + -rmdir $(DESTDIR)$(includedir)/SDL +uninstall-lib: + $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$(TARGET) + rm -f $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET) +uninstall-data: + rm -f $(DESTDIR)$(datadir)/aclocal/sdl.m4 + rm -f $(DESTDIR)$(libdir)/pkgconfig/sdl.pc +uninstall-man: + for src in $(srcdir)/docs/man3/*.3; do \ + file=`echo $$src | sed -e 's|^.*/||'`; \ + rm -f $(DESTDIR)$(mandir)/man3/$$file; \ + done + +clean: + rm -rf $(objects) + if test -f test/Makefile; then (cd test; $(MAKE) $@); fi + +distclean: clean + rm -f Makefile include/SDL_config.h sdl-config + rm -f SDL.qpg + rm -f config.status config.cache config.log libtool $(depend) + rm -rf $(srcdir)/autom4te* + rm -rf $(srcdir)/test/autom4te* + find $(srcdir) \( \ + -name '*~' -o \ + -name '*.bak' -o \ + -name '*.old' -o \ + -name '*.rej' -o \ + -name '*.orig' -o \ + -name '.#*' \) \ + -exec rm -f {} \; + cp $(srcdir)/include/SDL_config.h.default $(srcdir)/include/SDL_config.h + if test -f test/Makefile; then (cd test; $(MAKE) $@); fi + +dist $(distfile): + $(SHELL) $(auxdir)/mkinstalldirs $(distdir) + tar cf - $(DIST) | (cd $(distdir); tar xf -) + cp $(distdir)/include/SDL_config.h.default $(distdir)/include/SDL_config.h + rm -rf `find $(distdir) -name .svn` + rm -rf $(distdir)/test/autom4te* + find $(distdir) \( \ + -name '*~' -o \ + -name '*.bak' -o \ + -name '*.old' -o \ + -name '*.rej' -o \ + -name '*.orig' -o \ + -name '.#*' \) \ + -exec rm -f {} \; + if test -f $(distdir)/test/Makefile; then (cd $(distdir)/test && make distclean); fi + tar cvf - $(distdir) | gzip --best >$(distfile) + rm -rf $(distdir) + +rpm: $(distfile) + rpmbuild -ta $? + +# Create a SVN snapshot that people can run update on +snapshot: + svn co http://svn.libsdl.org/branches/SDL-1.2 + (cd SDL-1.2 && ./autogen.sh && rm -rf autom4te.cache) + cp SDL-1.2/include/SDL_config.h.default SDL-1.2/include/SDL_config.h + tar zcf $(HOME)/SDL-1.2.tar.gz SDL-1.2 + rm -f $(HOME)/SDL-1.2.zip + zip -r $(HOME)/SDL-1.2.zip SDL-1.2 + rm -rf SDL-1.2 diff --git a/alienblaster/project/jni/sdl/Makefile.minimal b/alienblaster/project/jni/sdl/Makefile.minimal new file mode 100644 index 000000000..4fe03e9ef --- /dev/null +++ b/alienblaster/project/jni/sdl/Makefile.minimal @@ -0,0 +1,42 @@ +# Makefile to build the SDL library + +INCLUDE = -I./include +CFLAGS = -g -O2 $(INCLUDE) +AR = ar +RANLIB = ranlib + +CONFIG_H = include/SDL_config.h +TARGET = libSDL.a +SOURCES = \ + src/*.c \ + src/audio/*.c \ + src/cdrom/*.c \ + src/cpuinfo/*.c \ + src/events/*.c \ + src/file/*.c \ + src/joystick/*.c \ + src/stdlib/*.c \ + src/thread/*.c \ + src/timer/*.c \ + src/video/*.c \ + src/audio/oss/*.c \ + src/video/fbcon/*.c \ + src/joystick/dummy/*.c \ + src/cdrom/dummy/*.c \ + src/thread/pthread/*.c \ + src/timer/unix/*.c \ + src/loadso/dummy/*.c \ + +OBJECTS = $(shell echo $(SOURCES) | sed -e 's,\.c,\.o,g') + +all: $(TARGET) + +$(TARGET): $(CONFIG_H) $(OBJECTS) + $(AR) crv $@ $^ + $(RANLIB) $@ + +$(CONFIG_H): + cp $(CONFIG_H).default $(CONFIG_H) + +clean: + rm -f $(TARGET) $(OBJECTS) diff --git a/alienblaster/project/jni/sdl/README b/alienblaster/project/jni/sdl/README new file mode 100644 index 000000000..7c0dd5890 --- /dev/null +++ b/alienblaster/project/jni/sdl/README @@ -0,0 +1,49 @@ + + Simple DirectMedia Layer + + (SDL) + + Version 1.2 + +--- +http://www.libsdl.org/ + +This is the Simple DirectMedia Layer, a general API that provides low +level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, +and 2D framebuffer across multiple platforms. + +The current version supports Linux, Windows CE/95/98/ME/XP/Vista, BeOS, +MacOS Classic, Mac OS X, FreeBSD, NetBSD, OpenBSD, BSD/OS, Solaris, IRIX, +and QNX. The code contains support for Dreamcast, Atari, AIX, OSF/Tru64, +RISC OS, SymbianOS, Nintendo DS, and OS/2, but these are not officially +supported. + +SDL is written in C, but works with C++ natively, and has bindings to +several other languages, including Ada, C#, Eiffel, Erlang, Euphoria, +Guile, Haskell, Java, Lisp, Lua, ML, Objective C, Pascal, Perl, PHP, +Pike, Pliant, Python, Ruby, and Smalltalk. + +This library is distributed under GNU LGPL version 2, which can be +found in the file "COPYING". This license allows you to use SDL +freely in commercial programs as long as you link with the dynamic +library. + +The best way to learn how to use SDL is to check out the header files in +the "include" subdirectory and the programs in the "test" subdirectory. +The header files and test programs are well commented and always up to date. +More documentation is available in HTML format in "docs/index.html", and +a documentation wiki is available online at: + http://www.libsdl.org/cgi/docwiki.cgi + +The test programs in the "test" subdirectory are in the public domain. + +Frequently asked questions are answered online: + http://www.libsdl.org/faq.php + +If you need help with the library, or just want to discuss SDL related +issues, you can join the developers mailing list: + http://www.libsdl.org/mailing-list.php + +Enjoy! + Sam Lantinga (slouken@libsdl.org) + diff --git a/alienblaster/project/jni/sdl/README-SDL.txt b/alienblaster/project/jni/sdl/README-SDL.txt new file mode 100644 index 000000000..4d36ca9dc --- /dev/null +++ b/alienblaster/project/jni/sdl/README-SDL.txt @@ -0,0 +1,13 @@ + +Please distribute this file with the SDL runtime environment: + +The Simple DirectMedia Layer (SDL for short) is a cross-platfrom library +designed to make it easy to write multi-media software, such as games and +emulators. + +The Simple DirectMedia Layer library source code is available from: +http://www.libsdl.org/ + +This library is distributed under the terms of the GNU LGPL license: +http://www.gnu.org/copyleft/lesser.html + diff --git a/alienblaster/project/jni/sdl/README.AmigaOS b/alienblaster/project/jni/sdl/README.AmigaOS new file mode 100644 index 000000000..e0d890640 --- /dev/null +++ b/alienblaster/project/jni/sdl/README.AmigaOS @@ -0,0 +1,12 @@ +The AmigaOS code has been removed from SDL, since it had been broken for a + long time and had a few bits of fairly invasive code #ifdef'd into the + SDL core. + +However, there is an OS4 version of SDL here: + http://www.rcdrummond.net/amiga/index.html + +And a MorphOS version here: + http://www.lehtoranta.net/powersdl/ + +--ryan. + diff --git a/alienblaster/project/jni/sdl/README.BeOS b/alienblaster/project/jni/sdl/README.BeOS new file mode 100644 index 000000000..ccdccf598 --- /dev/null +++ b/alienblaster/project/jni/sdl/README.BeOS @@ -0,0 +1,13 @@ + +SDL on BeOS R5 +============== + +You can build SDL on BeOS like any other GNU style package. +e.g. ./configure && make && make install +By default it is installed in /boot/develop/tools/gnupro/{bin,lib,etc.} + +Once you install SDL, you need to copy libSDL.so to /boot/home/config/lib, +so it can be found by the dynamic linker. + +Enjoy! + Sam Lantinga (slouken@libsdl.org) diff --git a/alienblaster/project/jni/sdl/README.CVS b/alienblaster/project/jni/sdl/README.CVS new file mode 100644 index 000000000..7664e9181 --- /dev/null +++ b/alienblaster/project/jni/sdl/README.CVS @@ -0,0 +1,4 @@ + +SDL is no longer hosted in a CVS repository. Please see README.SVN for +information on accessing our Subversion repository. + diff --git a/alienblaster/project/jni/sdl/README.DC b/alienblaster/project/jni/sdl/README.DC new file mode 100644 index 000000000..e2fb1d651 --- /dev/null +++ b/alienblaster/project/jni/sdl/README.DC @@ -0,0 +1,32 @@ +SDL for Dreamcast (beta2) + + BERO + berobero@users.sourceforge.net + + http://www.geocities.co.jp/Playtown/2004/ + +this work with kos-newlib +http://sourceforge.net/projects/dcquake/ + +compile +- source environ.sh (from the KOS distribution) +- make -f Makefile.dc + +compile with gl support +- install latest libgl from http://sourceforge.net/projects/dcquake/ +- uncomment GL=1 in Makefile.dc +- make -f Makefile.dc clean +- make -f Makefile.dc + +install +- copy include/*.h and libSDL.a or libSDL_gl.a for your enviroment + +changelog: + +beta2 +- OpenGL support +- Hardware page flip support + +beta +- thread, timer don't tested so much. +- not support OpenGL diff --git a/alienblaster/project/jni/sdl/README.MacOS b/alienblaster/project/jni/sdl/README.MacOS new file mode 100644 index 000000000..acfd93578 --- /dev/null +++ b/alienblaster/project/jni/sdl/README.MacOS @@ -0,0 +1,63 @@ + +============================================================================== +Using the Simple DirectMedia Layer with MacOS 7,8,9 on PPC +============================================================================== + +These instructions are for people using the Apple MPW environment: +http://developer.apple.com/tools/mpw-tools/ + +CodeWarrior projects are available in the CWprojects directory. + +============================================================================== +I. Building the Simple DirectMedia Layer libraries: + (This step isn't necessary if you have the SDL binary distribution) + + First, unpack the MPWmake.sea.hqx archive and move SDL.make into the + SDL directory. + + Start MPW + + Set the current directory within MPW to the SDL toplevel directory. + + Build "SDL" (Type Command-B and enter "SDL" in the dialog) + + If everything compiles successfully, you now have the PPC libraries + "SDL" and "SDLmain.o" in the 'lib' subdirectory. + +============================================================================== +II. Building the Simple DirectMedia Layer test programs: + + First, unpack the MPWmake.sea.hqx archive, move the new rsrc directory to + the main SDL directory, and move the makefiles in the new test subdirectory + to the SDL 'test' subdirectory. + + Start MPW + + Set the current directory within MPW to the SDL 'test' subdirectory. + + Build the programs that have an associated MPW makefile (file ending + with .make), including "testwin", "testalpha", and "graywin". + + Copy the SDL library file into the test directory, and run! + +============================================================================== +III. Building the Simple DirectMedia Layer demo programs: + + Copy one of the test program Makefiles to the demo directory + and modify it to match the sources in the demo. + +============================================================================== +IV. Enjoy! :) + + If you have a project you'd like me to know about, or want to ask questions, + go ahead and join the SDL developer's mailing list by sending e-mail to: + + sdl-request@libsdl.org + + and put "subscribe" into the subject of the message. Or alternatively you + can use the web interface: + + http://www.libsdl.org/mailman/listinfo/sdl + +============================================================================== + diff --git a/alienblaster/project/jni/sdl/README.MacOSX b/alienblaster/project/jni/sdl/README.MacOSX new file mode 100644 index 000000000..3bc421371 --- /dev/null +++ b/alienblaster/project/jni/sdl/README.MacOSX @@ -0,0 +1,186 @@ +============================================================================== +Using the Simple DirectMedia Layer with Mac OS X +============================================================================== + +These instructions are for people using Apple's Mac OS X (pronounced +"ten"). + +From the developer's point of view, OS X is a sort of hybrid Mac and +Unix system, and you have the option of using either traditional +command line tools or Apple's IDE Xcode. + +To build SDL using the command line, use the standard configure and make +process: + + ./configure + make + sudo make install + +You can also build SDL as a Universal library (a single binary for both +PowerPC and Intel architectures), on Mac OS X 10.4 and newer, by using +the fatbuild.sh script in build-scripts: + sh build-scripts/fatbuild.sh + sudo build-scripts/fatbuild.sh install +This script builds SDL with 10.2 ABI compatibility on PowerPC and 10.4 +ABI compatibility on Intel architectures. For best compatibility you +should compile your application the same way. A script which wraps +gcc to make this easy is provided in test/gcc-fat.sh + +To use the library once it's built, you essential have two possibilities: +use the traditional autoconf/automake/make method, or use Xcode. + +============================================================================== +Using the Simple DirectMedia Layer with a traditional Makefile +============================================================================== + +An existing autoconf/automake build system for your SDL app has good chances +to work almost unchanged on OS X. However, to produce a "real" Mac OS X binary +that you can distribute to users, you need to put the generated binary into a +so called "bundle", which basically is a fancy folder with a name like +"MyCoolGame.app". + +To get this build automatically, add something like the following rule to +your Makefile.am: + +bundle_contents = APP_NAME.app/Contents +APP_NAME_bundle: EXE_NAME + mkdir -p $(bundle_contents)/MacOS + mkdir -p $(bundle_contents)/Resources + echo "APPL????" > $(bundle_contents)/PkgInfo + $(INSTALL_PROGRAM) $< $(bundle_contents)/MacOS/ + +You should replace EXE_NAME with the name of the executable. APP_NAME is what +will be visible to the user in the Finder. Usually it will be the same +as EXE_NAME but capitalized. E.g. if EXE_NAME is "testgame" then APP_NAME +usually is "TestGame". You might also want to use @PACKAGE@ to use the package +name as specified in your configure.in file. + +If your project builds more than one application, you will have to do a bit +more. For each of your target applications, you need a seperate rule. + +If you want the created bundles to be installed, you may want to add this +rule to your Makefile.am: + +install-exec-hook: APP_NAME_bundle + rm -rf $(DESTDIR)$(prefix)/Applications/APP_NAME.app + mkdir -p $(DESTDIR)$(prefix)/Applications/ + cp -r $< /$(DESTDIR)$(prefix)Applications/ + +This rule takes the Bundle created by the rule from step 3 and installs them +into $(DESTDIR)$(prefix)/Applications/. + +Again, if you want to install multiple applications, you will have to augment +the make rule accordingly. + + +But beware! That is only part of the story! With the above, you end up with +a bare bone .app bundle, which is double clickable from the Finder. But +there are some more things you should do before shipping yor product... + +1) The bundle right now probably is dynamically linked against SDL. That + means that when you copy it to another computer, *it will not run*, + unless you also install SDL on that other computer. A good solution + for this dilemma is to static link against SDL. On OS X, you can + achieve that by linkinag against the libraries listed by + sdl-config --static-libs + instead of those listed by + sdl-config --libs + Depending on how exactly SDL is integrated into your build systems, the + way to achieve that varies, so I won't describe it here in detail +2) Add an 'Info.plist' to your application. That is a special XML file which + contains some meta-information about your application (like some copyright + information, the version of your app, the name of an optional icon file, + and other things). Part of that information is displayed by the Finder + when you click on the .app, or if you look at the "Get Info" window. + More information about Info.plist files can be found on Apple's homepage. + + +As a final remark, let me add that I use some of the techniques (and some +variations of them) in Exult and ScummVM; both are available in source on +the net, so feel free to take a peek at them for inspiration! + + +============================================================================== +Using the Simple DirectMedia Layer with Xcode +============================================================================== + +These instructions are for using Apple's Xcode IDE to build SDL applications. + +- First steps + +The first thing to do is to unpack the Xcode.tar.gz archive in the +top level SDL directory (where the Xcode.tar.gz archive resides). +Because Stuffit Expander will unpack the archive into a subdirectory, +you should unpack the archive manually from the command line: + cd [path_to_SDL_source] + tar zxf Xcode.tar.gz +This will create a new folder called Xcode, which you can browse +normally from the Finder. + +- Building the Framework + +The SDL Library is packaged as a framework bundle, an organized +relocatable folder heirarchy of executible code, interface headers, +and additional resources. For practical purposes, you can think of a +framework as a more user and system-friendly shared library, whose library +file behaves more or less like a standard UNIX shared library. + +To build the framework, simply open the framework project and build it. +By default, the framework bundle "SDL.framework" is installed in +/Library/Frameworks. Therefore, the testers and project stationary expect +it to be located there. However, it will function the same in any of the +following locations: + + ~/Library/Frameworks + /Local/Library/Frameworks + /System/Library/Frameworks + +- Build Options + There are two "Build Styles" (See the "Targets" tab) for SDL. + "Deployment" should be used if you aren't tweaking the SDL library. + "Development" should be used to debug SDL apps or the library itself. + +- Building the Testers + Open the SDLTest project and build away! + +- Using the Project Stationary + Copy the stationary to the indicated folders to access it from + the "New Project" and "Add target" menus. What could be easier? + +- Setting up a new project by hand + Some of you won't want to use the Stationary so I'll give some tips: + * Create a new "Cocoa Application" + * Add src/main/macosx/SDLMain.m , .h and .nib to your project + * Remove "main.c" from your project + * Remove "MainMenu.nib" from your project + * Add "$(HOME)/Library/Frameworks/SDL.framework/Headers" to include path + * Add "$(HOME)/Library/Frameworks" to the frameworks search path + * Add "-framework SDL -framework Foundation -framework AppKit" to "OTHER_LDFLAGS" + * Set the "Main Nib File" under "Application Settings" to "SDLMain.nib" + * Add your files + * Clean and build + +- Building from command line + Use pbxbuild in the same directory as your .pbproj file + +- Running your app + You can send command line args to your app by either invoking it from + the command line (in *.app/Contents/MacOS) or by entering them in the + "Executibles" panel of the target settings. + +- Implementation Notes + Some things that may be of interest about how it all works... + * Working directory + As defined in the SDL_main.m file, the working directory of your SDL app + is by default set to its parent. You may wish to change this to better + suit your needs. + * You have a Cocoa App! + Your SDL app is essentially a Cocoa application. When your app + starts up and the libraries finish loading, a Cocoa procedure is called, + which sets up the working directory and calls your main() method. + You are free to modify your Cocoa app with generally no consequence + to SDL. You cannot, however, easily change the SDL window itself. + Functionality may be added in the future to help this. + + +Known bugs are listed in the file "BUGS" diff --git a/alienblaster/project/jni/sdl/README.MiNT b/alienblaster/project/jni/sdl/README.MiNT new file mode 100644 index 000000000..eabe3eb1b --- /dev/null +++ b/alienblaster/project/jni/sdl/README.MiNT @@ -0,0 +1,250 @@ +============================================================================== +Using the Simple DirectMedia Layer on Atari +============================================================================== + + + If you want to build SDL from sources to create SDL programs on Atari: + see sections I - II. + + If you want to create SDL programs on Atari using SDL binary build, + download it from my web site (URL at end of this file). + + If you want to configure a program using SDL on Atari, + see sections IV - VI. + + +============================================================================== +I. Building the Simple DirectMedia Layer libraries: + (This step isn't necessary if you have the SDL binary distribution) + + Do the classic configure, with --disable-shared --enable-static and: + + Tos version (should run everywhere): + --disable-threads + Tos does not support threads. + + MiNT version (maybe Magic, only for multitasking OS): + --disable-pthreads --enable-pth + Mint and Magic may supports threads, so audio can be used with current + devices, like Sun audio, or disk-writing support. Like Tos, interrupt + audio without threads is more suited for Atari machines. + + Then you can make ; make install it. + +============================================================================== +II. Building the Simple DirectMedia Layer test programs: + + Do the classic configure, then make. + + Run them ! + +============================================================================== +III. Enjoy! :) + + If you have a project you'd like me to know about, or want to ask questions, + go ahead and join the SDL developer's mailing list by sending e-mail to: + + sdl-request@libsdl.org + + and put "subscribe" into the subject of the message. Or alternatively you + can use the web interface: + + http://www.libsdl.org/mailman/listinfo/sdl + +============================================================================== +IV. What is supported: + +Keyboard (GEMDOS, BIOS, GEM, Ikbd) +Mouse (XBIOS, GEM, Ikbd, /dev/mouse (non working atm, disabled)) +Video (XBIOS (Fullscreen), GEM (Windowed and Fullscreen)) +Timer (VBL vector, GNU pth library) +Joysticks and joypads (Ikbd, Hardware) +Audio (Hardware, XBIOS, GSXB, MCSN, STFA, /dev/audio if threads enabled) +Threads (Multitasking OS only via GNU pth library) +Shared object loader (using LDG library from http://ldg.atari.org/) +Audio CD (MetaDOS) +OpenGL (using Mesa offscreen rendering driver) + +- Dependent driver combinations: +Video Kbd Mouse Timer Joysticks +xbios ikbd ikbd vbl(2) ikbd +xbios gemdos xbios vbl(2) xbios +xbios bios xbios vbl(2) xbios +gem gem gem(1) vbl(2) xbios + +Audio O/S Misc +dma8 All Uses MFP Timer A interrupt +xbios TOS Uses MFP Timer A interrupt +xbios MiNT Uses MFP Timer A interrupt +xbios Magic Uses MFP Timer A interrupt +stfa All Uses MFP interrupt +mcsn TOS Uses MFP Timer A interrupt +mcsn MiNT Uses MiNT thread +mcsn Magic Disabled +gsxb All Uses GSXB callback + +Joypad driver always uses hardware access. +OpenGL driver always uses OSMesa. + +(1) GEM does not report relative mouse motion, so xbios mouse driver is used +to report this type event. +A preliminary driver for /dev/mouse device driver is present, but is disabled +till it can be used with other applications simultaneously. + +(2) If you build SDL with threads using the GNU pth library, timers are +supported via the pth library. + +============================================================================== +V. Environment variables: + +SDL_VIDEODRIVER: + Set to 'xbios' to force xbios video driver + Set to 'gem' to force gem video driver + +SDL_VIDEO_GL_DRIVER: + Set to filename to load as OpenGL library, if you use SDL_GL_LoadLibrary() + +SDL_AUDIODRIVER: + Set to 'mint_gsxb' to force Atari GSXB audio driver + Set to 'mint_mcsn' to force Atari MCSN audio driver + Set to 'mint_stfa' to force Atari STFA audio driver + Set to 'mint_xbios' to force Atari Xbios audio driver + Set to 'mint_dma8' to force Atari 8 bits DMA audio driver + Set to 'audio' to force Sun /dev/audio audio driver + Set to 'disk' to force disk-writing audio driver + +SDL_ATARI_EVENTSDRIVER + Set to 'ikbd' to force IKBD 6301 keyboard driver + Set to 'gemdos' to force gemdos keyboard driver + Set to 'bios' to force bios keyboard driver + +SDL_JOYSTICK_ATARI: + Use any of these strings in the environment variable to enable or + disable a joystick: + + 'ikbd-joy1-[on|off]' for IKBD joystick on port 1 (hardware access) + 'xbios-joy1-[on|off]' for IKBD joystick on port 1 (xbios access) + 'porta-pad-[on|off]' for joypad and/or teamtap on port A + 'porta-joy0-[on|off]' for joystick 0 on port A + 'porta-joy1-[on|off]' for joystick 1 on port A + 'porta-lp-[on|off]' for lightpen on port A + 'porta-anpad-[on|off]' for analog paddle on port A + 'portb-pad-[on|off]' for joypad and/or teamtap on port B + 'portb-joy0-[on|off]' for joystick 0 on port B + 'portb-joy1-[on|off]' for joystick 1 on port B + 'portb-anpad-[on|off]' for analog paddle on port B + + Default configuration is: + 'ikbd-joy1-on' (if IKBD events driver enabled) + 'xbios-joy1-on' (if gemdos/bios/gem events driver enabled) + 'porta-pad-on portb-pad-on' (if available on the machine) + + port[a|b]-[pad|joy?|lp|anpad]-* strings are mutually exclusives. + On such a port, you can only use a joypad OR 1 or 2 joysticks OR + a lightpen OR an analog paddle. You must disable joypad before + setting another controller. + + The second joystick port on IKBD is used by the mouse, so not usable. + Another problem with the IKBD: mouse buttons and joystick fire buttons + are wired together at the hardware level, it means: + port 0 port 0 port 1 + mouse left button = joystick fire 0 = joystick fire 1 + mouse right button = joystick fire 1 = joystick fire 0 + + Descriptions of joysticks/joypads: + - Joypads: 1 hat, 17 buttons (Atari Jaguar console-like). + - Joysticks: 1 hat, 1 button. + - Lightpen, analog paddles: 2 axis, 2 buttons. The 2 buttons are those + affected to 1 button joysticks on the same port. + +============================================================================== +VI. More informations about drivers: + +OpenGL: + The default is to use the Mesa offscreen driver (osmesa.ldg). If you want + to use an older OpenGL implementation, like mesa_gl.ldg or tiny_gl.ldg, + your program must use SDL_GL_LoadLibrary() to do so, and retrieve the + needed function pointers with SDL_LoadFunction(). In all cases, the OpenGL + context is taken care of by SDL itself, you just have to use gl* functions. + + However, there is one OpenGL call that has a different prototype in the old + implementations: glOrtho(). In the old implementations, it has 6 float as + parameters, in the standard one, it has 6 double parameters. If you want + to compile testdyngl, or any other SDL program that loads its OpenGL + library, you must change the glOrtho() prototype used in this program. In + osmesa.ldg, you can retrieve a glOrtho() with double parameters, by + searching for the function "glOrtho6d". + +Xbios video: + Video chip is detected using the _VDO cookie. + Screen enhancers are not supported, but could be if you know how to + use them. + + ST, STE, Mega ST, Mega STE: + 320x200x4 bits, shades of grey, available only for the purpose + of testing SDL. + TT: + 320x480x8 and 320x240x8 (software double-lined mode). + Falcon: + All modes supported by the current monitor (RVB or VGA). + BlowUp and Centscreen extended modes, ScreenBlaster 3 current mode. + Milan: + Experimental support + Clones and any machine with monochrome monitor: + Not supported. + +Gem video: + Automatically used if xbios not available. + + All machines: + Only the current resolution, if 8 bits or higher depth. + +IKBD keyboard, mouse and joystick driver: + Available if _MCH cookie is ST, Mega ST, STE, Mega STE, TT or Falcon. + + Hades has an IKBD, but xbios is not available for video, so IKBD + driver is disabled. + +Gemdos and bios keyboard driver: + Available on all machines. + +Mouse and joystick xbios driver: + Available on all machines (I think). + +Joypad driver: + Available if _MCH cookie is STE or Falcon. Supports teamtap. + +PTH timer driver: + Available with multitasking OS. + +VBL timer driver: + Available on all machines (I think). + +Audio drivers: + Cookies _SND, MCSN, STFA and GSXB used to detect supported audio + capabilities. + + STE, Mega STE, TT: + 8 bits DMA (hardware access) + STFA, MCSN or GSXB driver if installed + Falcon: + 8 bits DMA (hardware access) + Xbios functions + STFA, MCSN or GSXB driver if installed + Other machines: + STFA, MCSN or GSXB driver if installed + + STFA driver: + http://removers.free.fr/softs/stfa.html + GSXB driver: + http://assemsoft.atari.org/gsxb/ + MacSound driver: + http://jf.omnis.ch/software/tos/ + MagicSound driver (MCSN,GSXB compatible): + http://perso.wanadoo.fr/didierm/ + X-Sound driver (GSXB compatible): + http://www.uni-ulm.de/~s_thuth/atari/xsound_e.html + +-- +Patrice Mandin +http://pmandin.atari.org/ diff --git a/alienblaster/project/jni/sdl/README.NDS b/alienblaster/project/jni/sdl/README.NDS new file mode 100644 index 000000000..e96a9eeec --- /dev/null +++ b/alienblaster/project/jni/sdl/README.NDS @@ -0,0 +1,22 @@ +The SDL port to the Nintendo DS + +This port uses the devKitPro toolchain, available from: +http://www.devkitpro.org + +Precompiled tools for cross-compiling on Linux are available from: +http://www.libsdl.org/extras/nds/devkitPro-20070503-linux.tar.gz + +todo: +add ds console specific features/optimizations +mouse/keyboard support +dual screen support + +build with: +cp include/SDL_config_nds.h include/SDL_config.h +make -f Makefile.ds + +included is an arm9/arm7 template to allow for sound streaming support. + +Enjoy, fix the source and share :) +Troy Davis(GPF) +http://gpf.dcemu.co.uk/ diff --git a/alienblaster/project/jni/sdl/README.NanoX b/alienblaster/project/jni/sdl/README.NanoX new file mode 100644 index 000000000..8418ff332 --- /dev/null +++ b/alienblaster/project/jni/sdl/README.NanoX @@ -0,0 +1,97 @@ + ================================================================= + Patch version 0.9 of SDL(Simple DirectMedia Layer) for Nano-X API + ================================================================= + + Authors: Hsieh-Fu Tsai, clare@setabox.com + Greg Haerr, greg@censoft.com + + This patch is against SDL version 1.2.4. + It enhances previous patch 0.8 by providing direct framebuffer + access as well as dynamic hardware pixel type support, not + requiring a compile-time option setting for different framebuffer + modes. + Tested against Microwindows version 0.89pre9. + + Older Microwindows versions + =========================== + If running on a version older than Microwindows 0.89pre9, + the following items might need to be patched in Microwindows. + + 1. Patch src/nanox/client.c::GrClose() + It fixes the client side GrClose(). In the original version, + GrOpen() can only be called once. When the GrOpen() is called at + the second time, the program will terminate. In order to prevent + this situation, we need to insert "nxSocket = -1" after + "close(nxSocket)" in GrClose(). If you do not have this problem, + you may skip this step. + + 2. Patch src/nanox/clientfb.c to return absolute x,y coordinates + when using GrGetWindowFBInfo(). Copy the version 0.89pre9 + of src/nanox/clientfb.c to your system, or configure + using --disable-nanox-direct-fb. + + ============= + Quick Install + ============= + + 1. ./configure --disable-video-x11 --disable-video-fbcon \ + --enable-video-nanox \ + --with-nanox-pixel-type=[rgb/0888/888/565/555/332/pal] + 2. make clean + 3. make + 4. make install (as root) + + ============ + Nitty-gritty + ============ + + --enable-nanox-direct-fb Use direct framebuffer access + --enable-nanox-debug Show debug messages + --enable-nanox-share-memory Use shared-memory to speed up + + When running multi-threaded applications using SDL, such + as SMPEG, set THREADSAFE=Y in Microwindows' config file, + to enable GrXXX() system call critical section support. + + ============================================= + Some programs can be used to test this patch. + ============================================= + + 1. http://www.cs.berkeley.edu/~weimer/atris (a tetris-like game) + 2. http://www.libsdl.org/projects/newvox/ + 3. http://www.libsdl.org/projects/xflame/ + 4. http://www.libsdl.org/projects/optimum/ + 5. http://www.gnugeneration.com/software/loop/ + 6: http://www.lokigames.com/development/smpeg.php3 (SMPEG version 0.4.4) + + ========= + Todo List + ========= + + 1. Create hardware surface + 2. Create YUVOverlay on hardware + 3. Use OpenGL + 4. Gamma correction + 5. Hide/Change mouse pointer + 6. Better window movement control with direct fb access + 7. Palette handling in 8bpp could be improved + + ===================== + Supporting Institutes + ===================== + + Many thanks to go to Setabox Co., Ltd. and CML (Communication and + Multimedia Laboratory, http://www.cmlab.csie.ntu.edu.tw/) in the + Department of Computer Science and Information Engineering of + National Taiwan University for supporting this porting project. + + Century Embedded Technologies (http://embedded.censoft.com) + for this patch. + + =================== + Contact Information + =================== + + Welcome to give me any suggestion and to report bugs. + My e-mail address : clare@setabox.com or niky@cmlab.csie.ntu.edu.tw + or greg@censoft.com diff --git a/alienblaster/project/jni/sdl/README.OS2 b/alienblaster/project/jni/sdl/README.OS2 new file mode 100644 index 000000000..424b3739c --- /dev/null +++ b/alienblaster/project/jni/sdl/README.OS2 @@ -0,0 +1,281 @@ + +=========== +SDL on OS/2 +=========== + +Last updated on May. 17, 2006. + + +1. How to compile? +------------------ + +To compile this, you'll need the followings installed: +- The OS/2 Developer's Toolkit +- The OpenWatcom compiler + (http://www.openwatcom.org) + +First of all, you have to unzip the Watcom-OS2.zip file. This will result in a +file called "makefile" and a file called "setvars.cmd" in this folder (and some +more files...). + +Please edit the second, fourth and fifth lines of setvars.cmd file +to set the folders where the toolkit, the OW compiler and the FSLib are. +You won't need NASM yet (The Netwide Assembler), you can leave that line. +Run setvars.cmd, and you should get a shell in which you can +compile SDL. + +Check the "makefile" file. There is a line in there which determines if the +resulting SDL.DLL will be a 'debug' or a 'release' build. The 'debug' version +is full of printf()'s, so if something goes wrong, its output can help a lot +for debugging. + +Then run "wmake". +This should create the SDL12.DLL and the corresponding SDL12.LIB file here. + +To test applications, it's a good idea to use the 'debug' build of SDL, and +redirect the standard output and standard error output to files, to see what +happens internally in SDL. +(like: testsprite >stdout.txt 2>stderr.txt) + +To rebuild SDL, use the following commands in this folder: +wmake clean +wmake + + + +2. How to compile the testapps? +------------------------------- + +Once you have SDL12.DLL compiled, navigate into the 'test' folder, copy in +there the newly built SDL12.DLL, and copy in there FSLib.DLL. + +Then run "wmake" in there to compile some of the testapps. + + + +3. What is missing? +------------------- + +The following things are missing from this SDL implementation: +- MMX, SSE and 3DNOW! optimized video blitters? +- HW Video surfaces +- OpenGL support + + + +4. Special Keys / Full-Screen support +------------------------------------- + +There are two special hot-keys implemented: +- Alt+Home switches between fullscreen and windowed mode +- Alt+End simulates closing the window (can be used as a Panic key) +Only the LEFT Alt key will work. + + + +5. Joysticks on SDL/2 +--------------------- + +The Joystick detection only works for standard joysticks (2 buttons, 2 axes +and the like). Therefore, if you use a non-standard joystick, you should +specify its features in the SDL_OS2_JOYSTICK environment variable in a batch +file or CONFIG.SYS, so SDL applications can provide full capability to your +device. The syntax is: + +SET SDL_OS2_JOYSTICK=[JOYSTICK_NAME] [AXES] [BUTTONS] [HATS] [BALLS] + +So, it you have a Gravis GamePad with 4 axes, 2 buttons, 2 hats and 0 balls, +the line should be: + +SET SDL_OS2_JOYSTICK=Gravis_GamePad 4 2 2 0 + +If you want to add spaces in your joystick name, just surround it with +quotes or double-quotes: + +SET SDL_OS2_JOYSTICK='Gravis GamePad' 4 2 2 0 + +or + +SET SDL_OS2_JOYSTICK="Gravis GamePad" 4 2 2 0 + + Notive However that Balls and Hats are not supported under OS/2, and the +value will be ignored... but it is wise to define these correctly because +in the future those can be supported. + Also the number of buttons is limited to 2 when using two joysticks, +4 when using one joystick with 4 axes, 6 when using a joystick with 3 axes +and 8 when using a joystick with 2 axes. Notice however these are limitations +of the Joystick Port hardware, not OS/2. + + + +6. Proportional windows +----------------------- + +For some SDL applications it can be handy to have proportional windows, so +the windows will keep their aspect ratio when resized. +This can be achieved in two ways: + +- Before starting the given SDL application, set the + SDL_USE_PROPORTIONAL_WINDOW environment variable to something, e.g.: + + SET SDL_USE_PROPORTIONAL_WINDOW=1 + dosbox.exe + +- If you have a HOME environment variable set, then SDL will look for a file + in there called ".sdl.proportionals". If that file contains the name of the + currently running SDL executable, then that process will have proportional + windows automatically. + + Please note that this file is created automatically with default values + at the first run. + + + +7. Audio in SDL applications +---------------------------- + +Audio effects are one of the most important features in games. Creating audio +effects in sync with the game and without hickups and pauses in the audio are +very important things. + +However there are multithreaded SDL applications that have tight loops as their +main logic loop. This kills performance in OS/2, and takes too much CPU from +other threads in the same process, for example from the thread to create the +sound effects. + +For this reason, the OS/2 port of SDL can be instructed to run the audio thread +in high priority, which makes sure that there will be enough time for the +processing of the audio data. + +At default, SDL/2 runs the audio thread at ForegroundServer+0 priority. Well +written and well behaving SDL applications should work well in this mode. +For other applications, you can tell SDL/2 to run the audio thread at +TimeCritical priority by setting an env.variable before starting the SDL app: + + SET SDL_USE_TIMECRITICAL_AUDIO=1 + +Please note that this is a bit risky, because if the SDL application runs a +tight infinite loop in this thread, this will make the whole system +unresponsive, so use it with care, and only for applications that need it! + + + +8. Next steps... +---------------- + +Things to do: +- Implement missing stuffs (look for 'TODO' string in source code!) +- Finish video driver (the 'wincommon' can be a good example for missing + things like application icon and so on...) +- Enable MMX/SSE/SSE2 acceleration functions +- Rewrite CDROM support using DOS Ioctl for better support. + + + +9. Contacts +----------- + + You can contact the developers for bugs: + + Area Developer email + General (Audio/Video/System) Doodle doodle@scenergy.dfmk.hu + CDROM and Joystick Caetano daniel@caetano.eng.br + + Notice however that SDL/2 is 'in development' stage so ... if you want to help, +please, be our guest and contact us! + + + +10. Changelog of the OS/2 port +------------------------------ + +Version 1.2.10 - 2006-05-17 - Doodle + - Small modifications for v1.2.10 release + - Changed DLL name to include version info (currently SDL12.dll) + +Version 1.2 - 2006-05-01 - Doodle + - Modified makefile system to have only one makefile + - Included FSLib headers, DLL and LIB file + +Version 1.2 - 2006-02-26 - Doodle + - Updated the official SDL version with the OS/2 specific changes. + - Added support for real unicode keycode conversion. + +Version 1.2.7 - 2006-01-20 - Doodle + - Added support for selectively using timecritical priority for + audio threads by SDL_USE_TIMECRITICAL_AUDIO environment variable. + (e.g.: + SET SDL_USE_TIMECRITICAL_AUDIO=1 + dosbox.exe + ) + +Version 1.2.7 - 2005-12-22 - Doodle + - Added support for proportional SDL windows. + There are two ways to have proportional (aspect-keeping) windows for + a given SDL application: Either set the SDL_USE_PROPORTIONAL_WINDOW + environment variable to something before starting the application + (e.g.: + SET SDL_USE_PROPORTIONAL_WINDOW=1 + dosbox.exe + ) + or, if you have the HOME environment variable set, then SDL12.DLL will + create a file in that directory called .sdl.proportionals, and you can + put there the name of executable files that will be automatically made + proportional. + +Version 1.2.7 - 2005-10-14 - Doodle + - Enabled Exception handler code in FSLib to be able to restore original + desktop video mode in case the application crashes. + - Added the missing FSLib_Uninitialize() call into SDL. + (The lack of it did not cause problems, but it's cleaner this way.) + - Fixed a mouse problem in Fullscreen mode where any mouse click + re-centered the mouse. + +Version 1.2.7 - 2005-10-09 - Doodle + - Implemented window icon support + +Version 1.2.7 - 2005-10-03 - Doodle + - Reworked semaphore support again + - Tuned thread priorities + +Version 1.2.7 - 2005-10-02 - Doodle + - Added support for custom mouse pointers + - Fixed WM_CLOSE processing: give a chance to SDL app to ask user... + - Added support for MMX-accelerated audio mixers + - Other small fixes + +Version 1.2.7 - 2005-09-12 - Doodle + - Small fixes for DosBox incorporated into public release + - Fixed semaphore support (SDL_syssem.c) + - Fixed FSLib to have good clipping in scaled window mode, + and to prevent occasional desktop freezes. + +Version 1.2.7 - 2004-09-08a - Caetano + - Improved joystick support (general verifications about hardware). + - Added support up to 8 buttons in 2 axes joysticks and 6 buttons in 3 axes joysticks. + - Added support to environment variable SDL_OS2_JOYSTICK to specify a joystick. + - Improved Joystick test to handle every type of joystick and display only relevant information. + - Merged with Doodle 2004-09-08 + - Little tid up in README.OS2 + - Added explanation about SDL_OS2_JOYSTICK environment variable on README.OS2 + +Version 1.2.7 - 2004-09-07 - Caetano + - Merged with changes in headers for GCC compiling. + - Added Joystick support using basic IBM GAME$ support, allowing it to work with all joystick drivers since OS/2 2.1. + - Improved joystick detection (hacked!). OS/2 do not allow real joystick detection, so... + - Modified makefile in test to compile "testjoystick". Anyway, it's useless, since it seems to cause a lot of trouble in OS/2 (because os video routines, not Joystick support). + - Created separated Joystick test program to test only joystick functions. + - Improved joystick auto-centering. + - Improved the coordinate correction routine to use two scale factors for each axis. + +Version 1.2.7 - 2004-07-05 - Caetano + - Corrected the time returned by status in CDROM support (it was incorrect) + - Added the testcdrom.c and corrected the linking directive (it was causing an error) + +Version 1.2.7 - 2004-07-02a - Caetano + - Corrected a little problem in a comment at SDL-1.2.7\test\torturethread.c, line 18 (missing */, nested comment) + - Added CDROM support to tree (SDL-1.2.7\src\cdrom\os2\SDL_syscdrom.c) + - Modified makefile (SDL-1.2.7\src\makefiles.wat and SDL-1.2.7\watcom.mif) to build with CDROM support + - Added the "extra" SDL_types.h forgotten in 2004-07-02 version. + + diff --git a/alienblaster/project/jni/sdl/README.PS3 b/alienblaster/project/jni/sdl/README.PS3 new file mode 100644 index 000000000..c66467d39 --- /dev/null +++ b/alienblaster/project/jni/sdl/README.PS3 @@ -0,0 +1,29 @@ + +SDL on Sony Playstation3 +------------------------ + +Installation: + First, you have to install the Cell SDK + - Download the Cell SDK installer RPM and ISO images to + a temporary directory such as /tmp/cellsdk. + - Mount the image: mount -o loop CellSDK-Devel-Fedora_3.1.0.0.0.iso /tmp/cellsdk + - Install the SDK installer: rpm -ivh cell-install-3.1.0-0.0.noarch.rpm + - Install the SDK: cd /opt/cell && ./cellsdk --iso /tmp/cellsdkiso install + + You need to install the SPU-libs before installing SDL + - Go to SDL-1.2/src/video/ps3/spulibs/ + - Run make && make install + + Finally, install SDL + - Go to SDL-1.2/ and build SDL like any other GNU style package. + e.g. + - Build the configure-script with ./autogen.sh + - Configure SDL for your needs: ./configure --enable-video-ps3 ... + - Build and install it: make && make install + + +Todo: + - mouse/keyboard/controller support + +Have fun! + Dirk Herrendoerfer diff --git a/alienblaster/project/jni/sdl/README.PicoGUI b/alienblaster/project/jni/sdl/README.PicoGUI new file mode 100644 index 000000000..cdb6bedae --- /dev/null +++ b/alienblaster/project/jni/sdl/README.PicoGUI @@ -0,0 +1,50 @@ + ======================== + Using SDL with PicoGUI + ======================== + +- Originally contributed by Micah Dowty + +PicoGUI is a scalable GUI system with a unique architecture, primarily focused +on scalability to various embedded systems. You can find more information +including a FAQ at http://picogui.org + +To use the patch: + + 1. When compiling, add the "--enable-video-picogui" switch to ./configure + + 2. When running your program, ensure that the picogui driver for SDL + is in use by setting the SDL_VIDEODRIVER environment variable + to "picogui". + + 3. The program must also be linked to the C client library for PicoGUI + (libpgui.so). If the program is being compiled with a patched SDL + installed this should be done automatically. If you want to use an + existing binary with PicoGUI, you can set the LD_PRELOAD environment + variable to the path of your libpgui.so file. + +Capabilities: + + So far only basic functionality is provided on true color (linear16/24/32) + devices. Accessing a memory mapped bitmap, updating the display, and handling + mouse/keyboard input. This functionality has been tested with several + applications, including mplayer, Xine, sldroids, and Abuse. + +TODO list: + + - YUV overlays will be helpful for watching video on set top boxes or other + embedded devices that have some graphics acceleration hardware + + - Account for rotated bitmap storage in pgserver + + - Support for hiding or changing the cursor + + - The display should be centered when the SDL application is smaller + than the PicoGUI panel + + - Fullscreen or any other special modes + + - Support for indexed and grayscale modes + + - Probably much more... + +--- The End --- diff --git a/alienblaster/project/jni/sdl/README.Porting b/alienblaster/project/jni/sdl/README.Porting new file mode 100644 index 000000000..df619934f --- /dev/null +++ b/alienblaster/project/jni/sdl/README.Porting @@ -0,0 +1,56 @@ + +* Porting To A New Platform + + The first thing you have to do when porting to a new platform, is look at +include/SDL_platform.h and create an entry there for your operating system. +The standard format is __PLATFORM__, where PLATFORM is the name of the OS. +Ideally SDL_platform.h will be able to auto-detect the system it's building +on based on C preprocessor symbols. + +There are two basic ways of building SDL at the moment: + +1. The "UNIX" way: ./configure; make; make install + + If you have a GNUish system, then you might try this. Edit configure.in, + take a look at the large section labelled: + "Set up the configuration based on the target platform!" + Add a section for your platform, and then re-run autogen.sh and build! + +2. Using an IDE: + + If you're using an IDE or other non-configure build system, you'll probably + want to create a custom SDL_config.h for your platform. Edit SDL_config.h, + add a section for your platform, and create a custom SDL_config_{platform}.h, + based on SDL_config.h.minimal and SDL_config.h.in + + Add the top level include directory to the header search path, and then add + the following sources to the project: + src/*.c + src/audio/*.c + src/cdrom/*.c + src/cpuinfo/*.c + src/events/*.c + src/file/*.c + src/joystick/*.c + src/stdlib/*.c + src/thread/*.c + src/timer/*.c + src/video/*.c + src/audio/disk/*.c + src/video/dummy/*.c + src/joystick/dummy/*.c + src/cdrom/dummy/*.c + src/thread/generic/*.c + src/timer/dummy/*.c + src/loadso/dummy/*.c + + +Once you have a working library without any drivers, you can go back to each +of the major subsystems and start implementing drivers for your platform. + +If you have any questions, don't hesitate to ask on the SDL mailing list: + http://www.libsdl.org/mailing-list.php + +Enjoy! + Sam Lantinga (slouken@libsdl.org) + diff --git a/alienblaster/project/jni/sdl/README.QNX b/alienblaster/project/jni/sdl/README.QNX new file mode 100644 index 000000000..995afbec0 --- /dev/null +++ b/alienblaster/project/jni/sdl/README.QNX @@ -0,0 +1,155 @@ +README.QNX by Mike Gorchak , +Last changed at 24 Apr 2004. + +====================================================================== +Table of Contents: + +1. OpenGL. +2. Wheel and multi-button mouses. +3. CDROM handling issues. +4. Hardware video overlays. +5. Shared library building. +6. Some building issues. +7. Environment variables. + +====================================================================== +1. OpenGL: + + OpenGL works well and is stable, but fullscreen mode has not been +heavily tested yet. + If you have QNX RtP version 6.1.0 or above you must download the +Photon3D runtime from http://developers.qnx.com or install it from the +public repository or from the public CD, available with QNX. OS versi- +ons below 6.1.0 are not supported. + When creating an OpenGL context, software renderer mode is artifi- +cially selected (QSSL made acceleration only for Voodoo boards in +fullscreen mode, sorry but I don't have this board to test OpenGL - +maybe it works or maybe not :)). If you want acceleration - you can +remove one line in the source code: find the file SDL_ph_image.c and +remove the following + + OGLAttrib[OGLargc++]=PHOGL_ATTRIB_FORCE_SW; + +line in the ph_SetupOpenGLContext() function or change the argument to +PHOGL_ATTRIB_FORCE_HW or PHOGL_ATTRIB_FAVOR_HW. + +====================================================================== +2. Wheel and multi-button mouses: + + Photon emits keyboard events (key up and down) when the mouse +wheel is moved. The key_scan field appears valid, and it contains zero. +That is a basic method of detecting mouse wheel events under Photon. +It looks like a hack, but it works for me :) on various PC configura- +tions. + +I've tested it on: + +1. Genius Optical NetScroll/+ PS/2 (1 wheel) +2. A4Tech Optical GreatEye WheelMouse PS/2, model: WOP-35. (2 wheels + + 2 additional buttons). The wheel for vertical scrolling works as + usual, but the second wheel for horizontal scrolling emits two se- + quential events up or down, so it can provide faster scrolling than + the first wheel. Additional buttons don't emit any events, but it + looks like they're handled by photon in an unusual way - like click + to front, but works not with any window, looks like a fun bug-o-fe- + ature :). + +====================================================================== +3. CDROM handling issues: + + Access to CDROM can only be provided with 'root' privileges. I +can't do anything about that, /dev/cd0 has brw------- permissions and +root:root rights. + +====================================================================== +4. Hardware video overlays: + + Overlays can flicker during window movement, resizing, etc. It +happens because the photon driver updates the real window contents be- +hind the overlay, then draws the temporary chroma key color over the +window contents. It can be done without using the chroma key but that +causes the overlay to always be on top. So flickering during window +movement is preferred instead. + Double buffering code is temporarily disabled in the photon driver +code, because on my GF2-MX it can accidentally cause a buffer switch, +which causes the old frame to show. S3 Savage4 has the same problem, +but ATI Rage 128 doesn't. I think it can be fixed later. Current code +works very well, so maybe double buffering is not needed right now. + Something strange happens when you try to move the window with the +overlay beyond the left border of the screen. The overlay tries to +stay at position x=0, but when attempting to move it a bit more it +jumps to position x=-60 (on GF2-MX, on ATI Rage128 this value a bit +smaller). It's really strange, looks like the overlay doesn't like +negative coordinates. + +======================================================================= +5. Shared library building: + + A shared library can be built, but before running the autogen.sh +script you must manually delete the libtool.m4 stuff from the acinclu- +de.m4 file (it comes after the ESD detection code up to the end of the +file), because the libtool stuff in the acinclude.m4 file was very old +in SDL distribution before the version 1.2.7 and doesn't knew anything +about QNX. SDL 1.2.7 distribution contains the new libtool.m4 script, +but anyway it is broken :), Just remove it, then run "libtoolize +--force --copy", delete the file aclocal.m4 if it is exists and after +that run the autogen.sh script. SDL 1.2.8 contains fixed libtool.m4, +ltmain.sh and config.sub files, so you can just run the autogen.sh +script. + +====================================================================== +6. Some building issues: + + Feel free to not use the --disable-shared configure option if you' +ve read the above comment about 'Shared library building'. Otherwise +this option is strongly recommended, as without it the sdl-config +script will be broken. + + Run the configure script without x11 support, e.g.: + + a) for OpenGL support: + ./configure --prefix=/usr \ + --disable-video-x11 \ + --disable-shared + + b) without OpenGL support: + ./configure --prefix=/usr \ + --disable-video-x11 \ + --disable-shared \ + --disable-video-opengl + + And of course dont forget to specify --disable-debug, which is on +by default, to disable debug and enable the expensive optimizations. + + In the test directory also run the ./configure script without +x11 support, e.g.: + + ./configure --with-sdl-prefix=/usr \ + --with-sdl-exec-prefix=/usr \ + --prefix=/usr --without-x + +====================================================================== +7. Environment variables: + + Please note that the photon driver is sensible to the following +environmental variables: + + * SDL_PHOTON_FULLSCREEN_REFRESH - this environment variable controls +the refresh rate in all fullscreen modes. Be carefull !!! Photon +drivers usually do not checking the maximum refresh rate, which video +adapter or monitor supports. + + * SDL_VIDEO_WINDOW_POS - can be set in the "X,Y" format. If X and Y +coordinates are bigger than the current desktop resolution, then win- +dow positioning across virtual consoles is activated. If X and Y are +smaller than the desktop resolution then window positioning in the +current console is activated. The word "center" can be used instead of +coordinates, it produces the same behavior as SDL_VIDEO_CENTERED +environmental variable. + + * SDL_VIDEO_CENTERED - if this environmental variable exists then the +window centering is perfomed in the current virtual console. + +Notes: The SDL_VIDEO_CENTERED enviromental variable has greater pri- +ority than the SDL_VIDEO_WINDOW_POS in case if both variables are sup- +plied to the application. diff --git a/alienblaster/project/jni/sdl/README.Qtopia b/alienblaster/project/jni/sdl/README.Qtopia new file mode 100644 index 000000000..01627d1fb --- /dev/null +++ b/alienblaster/project/jni/sdl/README.Qtopia @@ -0,0 +1,84 @@ + +============================================================================== +Using the Simple DirectMedia Layer with Qtopia/OPIE +============================================================================== + +============================================================================== +I. Setting up the Qtopia development environment. + + This document will not explain how to setup the Qtopia development + environment. That is outside the scope of the document. You can read + more on this subject in this excellent howto: + + http://www.zauruszone.com/howtos/linux_compiler_setup_howto.html + +============================================================================== +II. Building the Simple DirectMedia Layer libraries using the arm + cross-compiler + + This is somewhat tricky since the name of the compiler binaries + differ from the standard. Also you should disable features not + needed. The command below works for me. Note that it's all one + line. You can also set the NM, LD etc environment variables + separately. + + NM=arm-linux-nm LD=arm-linux-ld CC=arm-linux-gcc CXX=arm-linux-g++ RANLIB=arm-linux-ranlib AR=arm-linux-ar ./configure --enable-video-qtopia --disable-video-dummy --disable-video-fbcon --disable-video-dga --disable-arts --disable-esd --disable-alsa --disable-cdrom --disable-video-x11 --disable-nasm --prefix=/opt/Qtopia/sharp/ arm-unknown-linux-gnu + + One thing to note is that the above configure will include joystick + support, even though you can't have joysticks on the Zaurus. The + reason for this is to avoid link / compile / runtime errors with + applications that have joystick support. + +============================================================================== +III. Building the Simple DirectMedia Layer test programs: + + After installing, making sure the correct sdl-config is in your + path, run configure like this: + + NM=arm-linux-nm LD=arm-linux-ld CC=arm-linux-gcc CXX=arm-linux-g++ AR=arm-linux-ar ./configure arm-unknown-linux-gnu + +============================================================================== +IV. Application porting notes + + One thing I have noticed is that applications sometimes don't exit + correctly. Their icon remains in the taskbar and they tend to + relaunch themselves automatically. I believe this problem doesn't + occur if you exit your application using the exit() method. However, + if you end main() with 'return 0;' or so, this seems to happen. + + Also note that when running in landscape mode - i.e requesting a + window that is HEIGHT pixels wide and WIDTH pixels high, where WIDTH + and HEIGHT normally is 240 and 320 - the image is blitted so that + the hardware buttons are on the left side of the display. This might + not always be desirable but such is the code today. + + +============================================================================== +V. Enjoy! :) + + If you have a project you'd like me to know about, or want to ask questions, + go ahead and join the SDL developer's mailing list by sending e-mail to: + + sdl-request@libsdl.org + + and put "subscribe" into the subject of the message. Or alternatively you + can use the web interface: + + http://www.libsdl.org/mailman/listinfo/sdl + +============================================================================== +VI. What is supported: + +Keyboard (Sharp Zaurus) +Hardware buttons +Stylus input (mouse) +Video. Allows fullscreen both in portrait mode (up to WIDTHxHEIGHT +size window) and in landscape mode (up to HEIGHTxWIDTH). + +All other SDL functionality works like a normal Linux system (threads, +audio etc). + +-- +David Hedbor +http://david.hedbor.org/ http://eongames.com/ + diff --git a/alienblaster/project/jni/sdl/README.RISCOS b/alienblaster/project/jni/sdl/README.RISCOS new file mode 100644 index 000000000..1ab85984a --- /dev/null +++ b/alienblaster/project/jni/sdl/README.RISCOS @@ -0,0 +1,130 @@ +Readme for RISC OS port of SDL +============================== + +This document last updated on 2nd Februrary 2006 + +This is a RISC OS port of the Simple Direct Media Layer (SDL) by Alan Buckley with contributions from Peter Naulls. + +Details of the SDL can be found at http://www.libsdl.org. + +The source code including the RISC OS version can be obtained from: + +http://www.libsdl.org. + +Pre built libraries and many games and applications compiled for RISC OS using this library can be downloaded from The Unix Porting Project at http://www.riscos.info/unix/. + +This is released under the LGPL see the file COPYING for details. + + +Compiling applications under RISC OS +==================================== + +Add -ISDL: for the C compiler flags if you include the files in the SDL directory. e.g. #include "SDL/SDL.h" +Add -ISDL:SDL for the C compiler flags if you include the files directly. e.g. #include "SDL/SDL.h" + +Add -LSDL: -lSDL to the link stage of compilation. + +For example, to compile the testbitmap.c sample you could use: + +gcc -ISDL:SDL -LSDL: -lSDL testbitmap.c -otestbitmap + + +RISC OS port of SDL runtime information +======================================= + +Runtime requirements +-------------------- + +This library currently needs a minimum of RISC OS 3.6. The source code for the library (and a lot of the programs built with it) also need long file names. + +To use the audio you also need 16 bit sound and to have installed the DigitalRender module by Andreas Dehmel version 0.51 available from his +web site: http://home.t-online.de/~zarquon +This is loaded when needed by UnixLib. + +Note: As most programs ported from other OSes use high resolution graphics and a memory back buffer a machine with a StrongARM processor and 1 or 2MB of VRAM (or a better machine) is recomended. + + +RISC OS runtime parameters +-------------------------- + +Several environmental variables have been defined to make porting programs easier (i.e. By setting these variable you do not need to have source code differences between OSes). + +They are all defined on an application basis. + +The used below is found as follows: +1. Use the name of the program unless it is !RunImage +2. Check the folder specification for the folder !RunImage is run from. If it is a folder name use that name, otherwise if it is an environmental variable of the form use the value of XXX. + +The variables are: + +SDL$$TaskName + +The name of the task for RISC OS. If omitted then is used for the task name, + +SDL$$BackBuffer + +Set to 1 to use a system memory back buffer for the screen in full screen mode. Some programs on other systems assume their is always a back buffer even though the SDL specification specifies this is not the case. The current RISC OS implementation uses direct writes to the screen if a hardware fullscreen is requested. + +Set to 2 to use an ARM code full word copy. This is faster than the standard back buffer, but uses aligned words only so it is possible (but unlikely) for it to corrupt the screen for 8bpp and 16bpp modes. + +Set to 3 to use a RISC OS sprite as the back buffer. This is usually the slowest for most SDL applications, however it may be useful in the future as Sprite acceleration is added to various hardware that runs RISC OS. + +SDL$$CloseAction - set the action for the close icon. Again as programs don't match the specification you can set this to 0 to remove the close icon from the main window for applications where this does not affect the program. + + +RISC OS SDL port API notes +========================== + +Current level of implementation +------------------------------- + +The following list is an overview of how much of the SDL is implemented. The areas match the main areas of the SDL. + +video - Mostly done. Doesn't cover gamma, YUV-overlay or OpenGL. +Window Manager - Mostly done. SetIcon/IconifyWindow not implemented. +Events - Mostly done. Resize and some joystick events missing. +Joystick - Currently assumes a single joystick with 4 buttons. +Audio - Done +CDROM - Not implemented. +Threads - Done +Timers - Done + +Thread support can be removed by defining DISABLE_THREADS and recompiling the library. + +SDL API notes +------------- + +This section contains additional notes on some specific commands. + +SDL_SetVideoMode + On RISC OS a fullscreen mode directly accesses the screen. This can be modified by the environmental variable (SDL$$BackBuffer) or by using the SDL_SWSURFACE flag to write to an offscreen buffer that is updated using SDL_UpdateRects. + Open GL is not supported so SDL_OPENGL and SDL_OPENGLBLIT flags fail. + SDL_RESIZEABLE and SDL_NOFRAME flags are not supported. + +SDL_SetColors + In a wimp mode the screen colours are not changed for a hardware palette instead the RISC OS sprite colour mapping is used to get the best matching colours. + +SDL_CreateCursor + Inverted colour is not supported. + +SDL_WM_ToggleFullScreen + Currently this won't work if the application starts up in Fullscreen mode. + Toggling to fullscreen will only work if the monitor is set up to support the exact screen size requested. + +SDL_EnableUNICODE + Unicode translation used here is only really accurate for 7 bit characters. + +SDL_NumJoysticks/JoystickName etc. + Hardcoded to expect only 1 joystick with 4 buttons if the Joystick module is loaded. + +SDL_GetTicks + Timer used has only a centisecond accuracy. This applies to other time related functions. + +SDL_Delay + Modified to poll keyboard/mouse during the delay on the event thread. + + +Notes on current implementation +------------------------------- + +Keyboard and mouse are polled so if too long a time is spent between a call to SDL_PumpEvents, functions that use it, or SDL_Delay events can be missed. diff --git a/alienblaster/project/jni/sdl/README.SVN b/alienblaster/project/jni/sdl/README.SVN new file mode 100644 index 000000000..65c5c427e --- /dev/null +++ b/alienblaster/project/jni/sdl/README.SVN @@ -0,0 +1,23 @@ + +The latest development version of SDL is available via Subversion. +Subversion allows you to get up-to-the-minute fixes and enhancements; +as a developer works on a source tree, you can use svn to mirror that +source tree instead of waiting for an official release. Please look +at the Subversion website ( http://subversion.tigris.org/ ) for more +information on using svn, where you can also download software for +MacOS, Windows, and Unix systems. + + svn checkout http://svn.libsdl.org/branches/SDL-1.2 + +If you are building SDL with an IDE, you will need to copy the file +include/SDL_config.h.default to include/SDL_config.h before building. + +If you are building SDL via configure, you will need to run autogen.sh +before running configure. + +There is a web interface to the subversion repository at: + http://www.libsdl.org/cgi/viewvc.cgi + +There is an RSS feed available at that URL, for those that want to +track commits in real time. + diff --git a/alienblaster/project/jni/sdl/README.Symbian b/alienblaster/project/jni/sdl/README.Symbian new file mode 100644 index 000000000..32d925a00 --- /dev/null +++ b/alienblaster/project/jni/sdl/README.Symbian @@ -0,0 +1,23 @@ +============================================================================== +Using the Simple DirectMedia Layer with S60 3.x / Symbian 9.x +============================================================================== + +These instuctions are for people developing for S60 3.x. S60 3.x +uses Symbian OS so you need S60 SDK. + +extract "symbian.zip" into this folder. + +go to symbian folder + +bldmake bldfiles +abld build + +That produces WINSCW and ARMV5 versions of sdl.dll runtime library +and sdl.lib for development. +The sdlexe.dll/sdlexe.lib and sdlmain.lib are for easy SDL S60 +integration, please see http://www.mbnet.fi/~mertama/sdl.html +for further info. + + + + diff --git a/alienblaster/project/jni/sdl/README.Watcom b/alienblaster/project/jni/sdl/README.Watcom new file mode 100644 index 000000000..2849a11c0 --- /dev/null +++ b/alienblaster/project/jni/sdl/README.Watcom @@ -0,0 +1,133 @@ + +Using SDL under Windows with the OpenWatcom compiler +==================================================== + +Prerequisites +------------- + +I have done the port under Windows XP Home with SP2 installed. Windows +2000 should also be working. I'm not so sure about ancient Windows NT, +since only DirectX 3 is available there. Building should be possible, +but running the compiled applications will probalbly fail with +SDL_VIDEODRIVER=directx. The windib driver should work, though. + +To compile and use the SDL with Open Watcom you will need the following: +- Open Watcom compiler. I used version 1.5. The environment variables + PATH, WATCOM and INCLUDE need to be set appropriately - please consult + the OpenWatcom documentation and instructions given during the + installation of the compiler. + My setup looks like this in owvars.bat: + set WATCOM=C:\watcom + set INCLUDE=%WATCOM%\h;%WATCOM%\h\nt + set PATH=%PATH%;%WATCOM%\binnt;%WATCOM%\binw +- A fairly recent DirectX SDK. The original unmodified DX8 SDK works, as + well as the minimal DirectX 7 SDK from the Allegro download site + (). +- The SDL sources from Subversion +- The file Watcom-Win32.zip (now available in Subversion) + + +Building the Library +-------------------- + +1) In the SDL base directory extract the archive Watcom-Win32.zip. This + creates a subdirectory named 'watcom'. +2) The makefile expects the environment variable DXDIR to be set to the + base directory of a DirectX SDK. I have tried a stock DX8 SDK from + Microsoft as well as the minimal DirectX 7 SDK from the Allegro + download site. + You can also edit the makefile directly and hard code your path to + the SDK on your system. + I have this in my setup: + set DXDIR=D:\devel\DX8_SDK +3) Enter the watcom directory and run + wmake sdl +4) All tests from the test directory are working and can be built by + running + wmake tests + +Notes: + + The makefile offers some options to tweak the way the library is built. + You have at your disposal the option to build a static (default) + library, or a DLL (with tgt=dll). You can also choose whether to build + a Release (default) or a Debug version (with build=debug) of the tests + and library. Please consult the usage comment at the top of the + makefile for usage instructions. + + If you specify a test target (i.e. 'wmake tests' for all tests, or + selected targets like 'wmake testgl testvidinfo testoverlay2'), the + tests are always freshly compiled and linked. This is done to + minimise hassle when switching between library versions (static vs. + DLL), because they require subtly different options. + Also, the test executables are put directly into the test directory, + so they can find their data files. The clean target of the makefile + removes the test executables and the SDL.dll file from the test + directory. + + To use the library in your own projects with Open Watcom, you can use + the way the tests are built as base of your own build environment. + + The library can also be built with the stack calling convention of the + compiler (-6s instead of -6r). + + +Test applications +----------------- + +I've tried to make all tests work. The following table gives an overview +of the current status. + + Testname Status +~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +checkkeys + +graywin + +loopwave + +testalpha + +testbitmap + +testdyngl + +testerror + +testfile + +testgamma + +testgl + +testhread + +testiconv - (all failed) +testkeys + +testlock + +testoverlay + (needs 'set SDL_VIDEODRIVER=directx') +testoverlay2 + (needs 'set SDL_VIDEODRIVER=directx') +testpalette + +testplatform + +testsem + +testsprite + +testtimer + +testver + +testvidinfo + +testwin ? (fading doesn't seem right) +testwm + +torturethread + +testcdrom + +testjoystick not tested +threadwin + +testcursor + + + +TODO +---- + +There is room for further improvement: +- Test joystick functionality. +- Investigate fading issue in 'testwin' test. +- Fix the UTF-8 support. +- Adapt the makefile/object file list to support more target systems +- Use "#pragma aux" syntax for the CPU info functions. + + +Questions and Comments +---------------------- + +Please direct any questions or comments to me: + + Happy Coding! + + Marc Peter diff --git a/alienblaster/project/jni/sdl/README.WinCE b/alienblaster/project/jni/sdl/README.WinCE new file mode 100644 index 000000000..6f8799ef8 --- /dev/null +++ b/alienblaster/project/jni/sdl/README.WinCE @@ -0,0 +1,55 @@ + +Project files for embedded Visual C++ 3.0, 4.0 and +Visual Studio 2005 can be found in VisualCE.zip + +SDL supports GAPI and WinDib output for Windows CE. + +GAPI driver supports: + +- all possible WinCE devices (Pocket PC, Smartphones, HPC) + with different orientations of video memory and resolutions. +- 4, 8 and 16 bpp devices +- special handling of 8bpp on 8bpp devices +- VGA mode, you can even switch between VGA and GAPI in runtime + (between 240x320 and 480x640 for example). On VGA devices you can + use either GAPI or VGA. +- Landscape mode and automatic rotation of buttons and stylus coordinates. + To enable landscape mode make width of video screen bigger than height. + For example: + SDL_SetVideoMode(320,240,16,SDL_FULLSCREEN) +- WM2005 +- SDL_ListModes + +NOTE: +There are several SDL features not available in the WinCE port of SDL. + +- DirectX is not yet available +- Semaphores are not available +- Joystick support is not available +- CD-ROM control is not available + +In addition, there are several features that run in "degraded" mode: + +Preprocessor Symbol Effect +=================== ================================= + +SDL_systimer.c: +USE_GETTICKCOUNT Less accurate values for SDL time functions +USE_SETTIMER Use only a single marginally accurate timer + +SDL_syswm.c: +DISABLE_ICON_SUPPORT Can't set the runtime window icon + +SDL_sysmouse.c: +USE_STATIC_CURSOR Only the arrow cursor is available + +SDL_sysevents.c: +NO_GETKEYBOARDSTATE Can't get modifier state on keyboard focus + +SDL_dibevents.c: +NO_GETKEYBOARDSTATE Very limited keycode translation + +SDL_dibvideo.c: +NO_GETDIBITS Can't distinguish between 15 bpp and 16 bpp +NO_CHANGEDISPLAYSETTINGS No fullscreen support +NO_GAMMA_SUPPORT Gamma correction not available diff --git a/alienblaster/project/jni/sdl/README.wscons b/alienblaster/project/jni/sdl/README.wscons new file mode 100644 index 000000000..349c89c99 --- /dev/null +++ b/alienblaster/project/jni/sdl/README.wscons @@ -0,0 +1,107 @@ +============================================================================== +Using the Simple DirectMedia Layer with OpenBSD/wscons +============================================================================== + +The wscons SDL driver can be used to run SDL programs on OpenBSD +without running X. So far, the driver only runs on the Sharp Zaurus, +but the driver is written to be easily extended for other machines. +The main missing pieces are blitting routines for anything but 16 bit +displays, and keycode maps for other keyboards. Also, there is no +support for hardware palettes. + +There is currently no mouse support. + +To compile SDL with support for wscons, use the +"--enable-video-wscons" option when running configure. I used the +following command line: + +./configure --disable-oss --disable-ltdl --enable-pthread-sem \ + --disable-esd --disable-arts --disable-video-aalib \ + --enable-openbsdaudio --enable-video-wscons \ + --prefix=/usr/local --sysconfdir=/etc + + +Setting the console device to use +================================= + +When starting an SDL program on a wscons console, the driver uses the +current virtual terminal (usually /dev/ttyC0). To force the driver to +use a specific terminal device, set the environment variable +SDL_WSCONSDEV: + +bash$ SDL_WSCONSDEV=/dev/ttyC1 ./some-sdl-program + +This is especially useful when starting an SDL program from a remote +login prompt (which is great for development). If you do this, and +want to use keyboard input, you should avoid having some other program +reading from the used virtual console (i.e., do not have a getty +running). + + +Rotating the display +==================== + +The display can be rotated by the wscons SDL driver. This is useful +for the Sharp Zaurus, since the display hardware is wired so that it +is correctly rotated only when the display is folded into "PDA mode." +When using the Zaurus in "normal," or "keyboard" mode, the hardware +screen is rotated 90 degrees anti-clockwise. + +To let the wscons SDL driver rotate the screen, set the environment +variable SDL_VIDEO_WSCONS_ROTATION to "CW", "CCW", or "UD", for +clockwise, counter clockwise, and upside-down rotation respectively. +"CW" makes the screen appear correct on a Sharp Zaurus SL-C3100. + +When using rotation in the driver, a "shadow" frame buffer is used to +hold the intermediary display, before blitting it to the actual +hardware frame buffer. This slows down performance a bit. + +For completeness, the rotation "NONE" can be specified to use a shadow +frame buffer without actually rotating. Unsetting +SDL_VIDEO_WSCONS_ROTATION, or setting it to '' turns off the shadow +frame buffer for maximum performance. + + +Running MAME +============ + +Since my main motivation for writing the driver was playing MAME on +the Zaurus, I'll give a few hints: + +XMame compiles just fine under OpenBSD. + +I'm not sure this is strictly necessary, but set + +MY_CPU = arm + +in makefile.unix, and + +CFLAGS.arm = -DLSB_FIRST -DALIGN_INTS -DALIGN_SHORTS + +in src/unix/unix.max + +to be sure. + +The latest XMame (0.101 at this writing) is a very large program. +Either tinker with the make files to compile a version without support +for all drivers, or, get an older version of XMame. My recommendation +would be 0.37b16. + +When running MAME, DO NOT SET SDL_VIDEO_WSCONS_ROTATION! Performace +is MUCH better without this, and it is COMPLETELY UNNECESSARY, since +MAME can rotate the picture itself while drawing, and does so MUCH +FASTER. + +Use the Xmame command line option "-ror" to rotate the picture to the +right. + + +Acknowledgments +=============== + +I studied the wsfb driver for XFree86/Xorg quite a bit before writing +this, so there ought to be some similarities. + + +-- +Staffan Ulfberg diff --git a/alienblaster/project/jni/sdl/SDL.qpg.in b/alienblaster/project/jni/sdl/SDL.qpg.in new file mode 100644 index 000000000..8e1ff8da8 --- /dev/null +++ b/alienblaster/project/jni/sdl/SDL.qpg.in @@ -0,0 +1,140 @@ + + + + + + + + + + + + + + + + QNX.ORG.RU Community + + + QNX.ORG.RU Team + Mike Gorchak + mike@malva.ua + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Library + SDL + 1 + http://qnx.org.ru/repository + 2.6 + + + + Simple DirectMedia Layer (SDL) + SDL + slouken@libsdl.org + Public + public + http://www.libsdl.org + + slouken@libsdl.org + Sam Lantinga + http://www.libsdl.org + + slouken@libsdl.org + + + This is the Simple DirectMedia Layer (SDL), a generic API that provides low level access to audio, keyboard, mouse, and display framebuffer across multiple platforms. + This is the Simple DirectMedia Layer (SDL), a generic API that provides low level access to audio, keyboard, mouse, and display framebuffer across multiple platforms. This is the libraries, include files and other resources you can use to develop and run SDL applications. + http://www.libsdl.org + + + + + @VERSION@ + Medium + Stable + + + 1 + + GNU Lesser General Public License + + + + Software Development/Libraries and Extensions/C Libraries + SDL,audio,graphics,demos,games,emulators,direct,media,layer + qnx6 + none + Photon + Console + Developer + User + + repdata://LicenseUrl/COPYING + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/alienblaster/project/jni/sdl/SDL.spec b/alienblaster/project/jni/sdl/SDL.spec new file mode 100644 index 000000000..fb505310b --- /dev/null +++ b/alienblaster/project/jni/sdl/SDL.spec @@ -0,0 +1,113 @@ +Summary: Simple DirectMedia Layer +Name: SDL +Version: 1.2.14 +Release: 1 +Source: http://www.libsdl.org/release/%{name}-%{version}.tar.gz +URL: http://www.libsdl.org/ +License: LGPL +Group: System Environment/Libraries +BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot +Prefix: %{_prefix} +%ifos linux +Provides: libSDL-1.2.so.0 +%endif + +%define __defattr %defattr(-,root,root) +%define __soext so + +%description +This is the Simple DirectMedia Layer, a generic API that provides low +level access to audio, keyboard, mouse, and display framebuffer across +multiple platforms. + +%package devel +Summary: Libraries, includes and more to develop SDL applications. +Group: Development/Libraries +Requires: %{name} = %{version} + +%description devel +This is the Simple DirectMedia Layer, a generic API that provides low +level access to audio, keyboard, mouse, and display framebuffer across +multiple platforms. + +This is the libraries, include files and other resources you can use +to develop SDL applications. + + +%prep +%setup -q + +%build +%ifos linux +CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix} --disable-video-aalib --disable-video-directfb --disable-video-ggi --disable-video-svga +%else +%configure +%endif +make + +%install +rm -rf $RPM_BUILD_ROOT +%ifos linux +make install prefix=$RPM_BUILD_ROOT%{prefix} \ + bindir=$RPM_BUILD_ROOT%{_bindir} \ + libdir=$RPM_BUILD_ROOT%{_libdir} \ + includedir=$RPM_BUILD_ROOT%{_includedir} \ + datadir=$RPM_BUILD_ROOT%{_datadir} \ + mandir=$RPM_BUILD_ROOT%{_mandir} +ln -s libSDL-1.2.so.0 $RPM_BUILD_ROOT%{_libdir}/libSDL-1.1.so.0 +%else +%makeinstall +%endif + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%{__defattr} +%doc README-SDL.txt COPYING CREDITS BUGS +%{_libdir}/lib*.%{__soext}.* + +%files devel +%{__defattr} +%doc README README-SDL.txt COPYING CREDITS BUGS WhatsNew docs.html +%doc docs/index.html docs/html +%{_bindir}/*-config +%{_libdir}/lib*.a +%{_libdir}/lib*.la +%{_libdir}/lib*.%{__soext} +%dir %{_includedir}/SDL +%{_includedir}/SDL/*.h +%{_libdir}/pkgconfig/sdl.pc +%{_datadir}/aclocal/* +%{_mandir}/man3/* + +%changelog +* Tue May 16 2006 Sam Lantinga +- Removed support for Darwin, due to build problems on ps2linux + +* Mon Jan 03 2004 Anders Bjorklund +- Added support for Darwin, updated spec file + +* Wed Jan 19 2000 Sam Lantinga +- Re-integrated spec file into SDL distribution +- 'name' and 'version' come from configure +- Some of the documentation is devel specific +- Removed SMP support from %build - it doesn't work with libtool anyway + +* Tue Jan 18 2000 Hakan Tandogan +- Hacked Mandrake sdl spec to build 1.1 + +* Sun Dec 19 1999 John Buswell +- Build Release + +* Sat Dec 18 1999 John Buswell +- Add symlink for libSDL-1.0.so.0 required by sdlbomber +- Added docs + +* Thu Dec 09 1999 Lenny Cartier +- v 1.0.0 + +* Mon Nov 1 1999 Chmouel Boudjnah +- First spec file for Mandrake distribution. + +# end of file diff --git a/alienblaster/project/jni/sdl/SDL.spec.in b/alienblaster/project/jni/sdl/SDL.spec.in new file mode 100644 index 000000000..dbda11210 --- /dev/null +++ b/alienblaster/project/jni/sdl/SDL.spec.in @@ -0,0 +1,113 @@ +Summary: Simple DirectMedia Layer +Name: SDL +Version: @SDL_VERSION@ +Release: 1 +Source: http://www.libsdl.org/release/%{name}-%{version}.tar.gz +URL: http://www.libsdl.org/ +License: LGPL +Group: System Environment/Libraries +BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot +Prefix: %{_prefix} +%ifos linux +Provides: libSDL-1.2.so.0 +%endif + +%define __defattr %defattr(-,root,root) +%define __soext so + +%description +This is the Simple DirectMedia Layer, a generic API that provides low +level access to audio, keyboard, mouse, and display framebuffer across +multiple platforms. + +%package devel +Summary: Libraries, includes and more to develop SDL applications. +Group: Development/Libraries +Requires: %{name} = %{version} + +%description devel +This is the Simple DirectMedia Layer, a generic API that provides low +level access to audio, keyboard, mouse, and display framebuffer across +multiple platforms. + +This is the libraries, include files and other resources you can use +to develop SDL applications. + + +%prep +%setup -q + +%build +%ifos linux +CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix} --disable-video-aalib --disable-video-directfb --disable-video-ggi --disable-video-svga +%else +%configure +%endif +make + +%install +rm -rf $RPM_BUILD_ROOT +%ifos linux +make install prefix=$RPM_BUILD_ROOT%{prefix} \ + bindir=$RPM_BUILD_ROOT%{_bindir} \ + libdir=$RPM_BUILD_ROOT%{_libdir} \ + includedir=$RPM_BUILD_ROOT%{_includedir} \ + datadir=$RPM_BUILD_ROOT%{_datadir} \ + mandir=$RPM_BUILD_ROOT%{_mandir} +ln -s libSDL-1.2.so.0 $RPM_BUILD_ROOT%{_libdir}/libSDL-1.1.so.0 +%else +%makeinstall +%endif + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%{__defattr} +%doc README-SDL.txt COPYING CREDITS BUGS +%{_libdir}/lib*.%{__soext}.* + +%files devel +%{__defattr} +%doc README README-SDL.txt COPYING CREDITS BUGS WhatsNew docs.html +%doc docs/index.html docs/html +%{_bindir}/*-config +%{_libdir}/lib*.a +%{_libdir}/lib*.la +%{_libdir}/lib*.%{__soext} +%dir %{_includedir}/SDL +%{_includedir}/SDL/*.h +%{_libdir}/pkgconfig/sdl.pc +%{_datadir}/aclocal/* +%{_mandir}/man3/* + +%changelog +* Tue May 16 2006 Sam Lantinga +- Removed support for Darwin, due to build problems on ps2linux + +* Mon Jan 03 2004 Anders Bjorklund +- Added support for Darwin, updated spec file + +* Wed Jan 19 2000 Sam Lantinga +- Re-integrated spec file into SDL distribution +- 'name' and 'version' come from configure +- Some of the documentation is devel specific +- Removed SMP support from %build - it doesn't work with libtool anyway + +* Tue Jan 18 2000 Hakan Tandogan +- Hacked Mandrake sdl spec to build 1.1 + +* Sun Dec 19 1999 John Buswell +- Build Release + +* Sat Dec 18 1999 John Buswell +- Add symlink for libSDL-1.0.so.0 required by sdlbomber +- Added docs + +* Thu Dec 09 1999 Lenny Cartier +- v 1.0.0 + +* Mon Nov 1 1999 Chmouel Boudjnah +- First spec file for Mandrake distribution. + +# end of file diff --git a/alienblaster/project/jni/sdl/TODO b/alienblaster/project/jni/sdl/TODO new file mode 100644 index 000000000..65bb01c17 --- /dev/null +++ b/alienblaster/project/jni/sdl/TODO @@ -0,0 +1,25 @@ + +Wish list for the 1.3 development branch: +http://bugzilla.libsdl.org/ + + * Add mousewheel events (new unified event architecture?) + * DirectInput joystick support needs to be implemented + * Be able to enumerate and select available audio and video drivers + * Fullscreen video mode support for Mac OS X + * Explicit vertical retrace wait (maybe separate from SDL_Flip?) + * Shaped windows, windows without borders + * Multiple windows, multiple display support + * SDL_INIT_EVENTTHREAD on Windows and MacOS? + * Add a timestamp to events + * Add audio input API + * Add hardware accelerated scaled blit + * Add hardware accelerated alpha blits + * Redesign blitting architecture to allow blit plugins + +In the jump from 1.2 to 1.3, we should change the SDL_Rect members to +int and evaluate all the rest of the datatypes. This is the only place +we should do it though, since the 1.2 series should not break binary +compatibility in this way. + +Requests: + * PCM and CDROM volume control (deprecated, but possible) diff --git a/alienblaster/project/jni/sdl/VisualC.html b/alienblaster/project/jni/sdl/VisualC.html new file mode 100644 index 000000000..ad2ed97a6 --- /dev/null +++ b/alienblaster/project/jni/sdl/VisualC.html @@ -0,0 +1,171 @@ + + + Using SDL with Microsoft Visual C++ + + +

+ Using SDL with Microsoft Visual C++ 5,6 and 7 +

+

+ by Lion Kimbro and additions by + James Turk +

+

+ You can either use the precompiled libraries from + the SDL Download web site , or you can build SDL yourself. +

+

+ Building SDL +

+

+ Unzip the VisualC.zip file into the directory that contains this + file (VisualC.html). +

+

+ Be certain that you unzip the zip file for your compiler into this + directory and not any other directory. If you are using WinZip, be careful to + make sure that it extracts to this folder, because it's + convenient feature of unzipping to a folder with the name of the file currently + being unzipped will get you in trouble if you use it right now. And that's all + I have to say about that. +

+

+ Now that it's unzipped, go into the VisualC + directory that is created, and double-click on the VC++ file "SDL.dsw" + ("SDL.sln"). This should open up the IDE. +

+

+ You may be prompted at this point to upgrade the workspace, should you be using + a more recent version of Visual C++. If so, allow the workspace to be upgraded. +

+

+ Build the .dll and .lib files. +

+

+ This is done by right clicking on each project in turn (Projects are listed in + the Workspace panel in the FileView tab), and selecting "Build". +

+

+ If you get an error about SDL_config.h being missing, you should + copy include/SDL_config.h.default to include/SDL_config.h and try again. +

+

+ You may get a few warnings, but you should not get any errors. You do have to + have at least the DirectX 5 SDK installed, however. The latest + version of DirectX can be downloaded or purchased on a cheap CD (my + recommendation) from Microsoft . +

+

+ Later, we will refer to the following .lib and .dll files that have just been + generated: +

+
    +
  • SDL.dll
  • +
  • SDL.lib
  • +
  • SDLmain.lib
  • +
+

+ Search for these using the Windows Find (Windows-F) utility, if you don't + already know where they should be. For those of you with a clue, look inside + the Debug or Release directories of the subdirectories of the Project folder. + (It might be easier to just use Windows Find if this sounds confusing. And + don't worry about needing a clue; we all need visits from the clue fairy + frequently.) +

+

+ Creating a Project with SDL +

+

+ Create a project as a Win32 Application. +

+

+ Create a C++ file for your project. +

+

+ Set the C runtime to "Multi-threaded DLL" in the menu: Project|Settings|C/C++ + tab|Code Generation|Runtime Library . +

+

+ Add the SDL include directory to your list of includes in the + menu: Project|Settings|C/C++ tab|Preprocessor|Additional include directories + . +
+ VC7 Specific: Instead of doing this I find it easier to + add the include and library directories to the list that VC7 keeps. Do this by + selecting Tools|Options|Projects|VC++ Directories and under the "Show + Directories For:" dropbox select "Include Files", and click the "New Directory + Icon" and add the [SDLROOT]\include directory (ex. If you installed to + c:\SDL-1.2.5\ add c:\SDL-1.2.5\include). Proceed to change the + dropbox selection to "Library Files" and add [SDLROOT]\lib. +

+

+ The "include directory" I am referring to is the include folder + within the main SDL directory (the one that this HTML file located within). +

+

+ Now we're going to use the files that we had created earlier in the Build SDL + step. +

+

+ Copy the following files into your Project directory: +

+
    +
  • SDL.dll
  • +
+

+ Add the following files to your project (It is not necessary to copy them to + your project directory): +

+
    +
  • SDL.lib
  • +
  • SDLmain.lib
  • +
+

+ (To add them to your project, right click on your project, and select "Add + files to project") +

+

Instead of adding the files to your project it is more + desireable to add them to the linker options: Project|Properties|Linker|Command + Line and type the names of the libraries to link with in the "Additional + Options:" box.  Note: This must be done for each build + configuration (eg. Release,Debug).

+

+ SDL 101, First Day of Class +

+

+ Now create the basic body of your project. The body of your program should take + the following form: +

+#include "SDL.h"
+
+int main( int argc, char* argv[] )
+{
+  // Body of the program goes here.
+  return 0;
+}
+
+ +

+

+ That's it! +

+

+ I hope that this document has helped you get through the most difficult part of + using the SDL: installing it. Suggestions for improvements to this document + should be sent to the writers of this document. +

+

+ Thanks to Paulus Esterhazy (pesterhazy@gmx.net), for the work on VC++ port. +

+

+ This document was originally called "VisualC.txt", and was written by + Sam Lantinga. +

+

+ Later, it was converted to HTML and expanded into the document that you see + today by Lion Kimbro. +

+

Minor Fixes and Visual C++ 7 Information (In Green) was added by James Turk +

+ + diff --git a/alienblaster/project/jni/sdl/WhatsNew b/alienblaster/project/jni/sdl/WhatsNew new file mode 100644 index 000000000..927fdd264 --- /dev/null +++ b/alienblaster/project/jni/sdl/WhatsNew @@ -0,0 +1,727 @@ + +This is a list of API changes in SDL's version history. + +Version 1.0: + +1.2.14: + Added cast macros for correct usage with C++: + SDL_reinterpret_cast(type, expression) + SDL_static_cast(type, expression) + + Added SDL_VIDEO_FULLSCREEN_DISPLAY as a preferred synonym for + SDL_VIDEO_FULLSCREEN_HEAD on X11. + + Added SDL_DISABLE_LOCK_KEYS environment variable to enable normal + up/down events for Caps-Lock and Num-Lock keys. + +1.2.13: + Added SDL_BUTTON_X1 and SDL_BUTTON_X2 constants. + +1.2.12: + Added SDL_VIDEO_ALLOW_SCREENSAVER to override SDL's disabling + of the screensaver on Mac OS X and X11. + +1.2.10: + If SDL_OpenAudio() is passed zero for the desired format + fields, the following environment variables will be used + to fill them in: + SDL_AUDIO_FREQUENCY + SDL_AUDIO_FORMAT + SDL_AUDIO_CHANNELS + SDL_AUDIO_SAMPLES + If an environment variable is not specified, it will be set + to a reasonable default value. + + Added support for the SDL_VIDEO_FULLSCREEN_HEAD environment + variable, currently supported on X11 Xinerama configurations. + + Added SDL_GL_SWAP_CONTROL to wait for vsync in OpenGL applications. + + Added SDL_GL_ACCELERATED_VISUAL to guarantee hardware acceleration. + + Added current_w and current_h to the SDL_VideoInfo structure, + which is set to the desktop resolution during video intialization, + and then set to the current resolution when a video mode is set. + + SDL_SetVideoMode() now accepts 0 for width or height and will use + the current video mode (or the desktop mode if no mode has been set.) + + Added SDL_GetKeyRepeat() + + Added SDL_config.h, with defaults for various build environments. + +1.2.7: + Added CPU feature detection functions to SDL_cpuinfo.h: + SDL_HasRDTSC(), SDL_HasMMX(), SDL_Has3DNow(), SDL_HasSSE(), + SDL_HasAltiVec() + Added function to create RWops from const memory: SDL_RWFromConstMem() + +1.2.6: + Added SDL_LoadObject(), SDL_LoadFunction(), and SDL_UnloadObject() + + Added SDL_GL_MULTISAMPLEBUFFERS and SDL_GL_MULTISAMPLESAMPLES for FSAA + +1.2.5: + Added SDL_BUTTON_WHEELUP (4) and SDL_BUTTON_WHEELDOWN (5) + + Added SDL_GL_STEREO for stereoscopic OpenGL contexts + +1.2.0: + Added SDL_VIDEOEXPOSE event to signal that the screen needs to + be redrawn. This is currently only delivered to OpenGL windows + on X11, though it may be delivered in the future when the video + memory is lost under DirectX. + +1.1.8: + You can pass SDL_NOFRAME to SDL_VideoMode() to create a window + that has no title bar or frame decoration. Fullscreen video + modes automatically have this flag set. + + Added a function to query the clipping rectangle for a surface: + void SDL_GetClipRect(SDL_Surface *surface, SDL_Rect *rect) + + Added a function to query the current event filter: + SDL_EventFilter SDL_GetEventFilter(void) + + If you pass -1 to SDL_ShowCursor(), it won't change the current + cursor visibility state, but will still return it. + + SDL_LockSurface() and SDL_UnlockSurface() are recursive, meaning + you can nest them as deep as you want, as long as each lock call + has a matching unlock call. The surface remains locked until the + last matching unlock call. + + Note that you may not blit to or from a locked surface. + +1.1.7: + The SDL_SetGammaRamp() and SDL_GetGammaRamp() functions now take + arrays of Uint16 values instead of Uint8 values. For the most part, + you can just take your old values and shift them up 8 bits to get + new correct values for your gamma ramps. + + You can pass SDL_RLEACCEL in flags passed to SDL_ConvertSurface() + and SDL will try to RLE accelerate colorkey and alpha blits in the + resulting surface. + +1.1.6: + Added a function to return the thread ID of a specific thread: + Uint32 SDL_GetThreadID(SDL_Thread *thread) + If 'thread' is NULL, this function returns the id for this thread. + +1.1.5: + The YUV overlay structure has been changed to use an array of + pitches and pixels representing the planes of a YUV image, to + better enable hardware acceleration. The YV12 and IYUV formats + each have three planes, corresponding to the Y, U, and V portions + of the image, while packed pixel YUV formats just have one plane. + + For palettized mode (8bpp), the screen colormap is now split in + a physical and a logical palette. The physical palette determines + what colours the screen pixels will get when displayed, and the + logical palette controls the mapping from blits to/from the screen. + A new function, SDL_SetPalette() has been added to change + logical and physical palettes separately. SDL_SetColors() works + just as before, and is equivalent to calling SDL_SetPalette() with + a flag argument of (SDL_LOGPAL|SDL_PHYSPAL). + + SDL_BlitSurface() no longer modifies the source rectangle, only the + destination rectangle. The width/height members of the destination + rectangle are ignored, only the position is used. + + The old source clipping function SDL_SetClipping() has been replaced + with a more useful function to set the destination clipping rectangle: + SDL_bool SDL_SetClipRect(SDL_Surface *surface, SDL_Rect *rect) + + Added a function to see what subsystems have been initialized: + Uint32 SDL_WasInit(Uint32 flags) + + The Big Alpha Flip: SDL now treats alpha as opacity like everybody + else, and not as transparency: + + A new cpp symbol: SDL_ALPHA_OPAQUE is defined as 255 + A new cpp symbol: SDL_ALPHA_TRANSPARENT is defined as 0 + Values between 0 and 255 vary from fully transparent to fully opaque. + + New functions: + SDL_DisplayFormatAlpha() + Returns a surface converted to a format with alpha-channel + that can be blit efficiently to the screen. (In other words, + like SDL_DisplayFormat() but the resulting surface has + an alpha channel.) This is useful for surfaces with alpha. + SDL_MapRGBA() + Works as SDL_MapRGB() but takes an additional alpha parameter. + SDL_GetRGBA() + Works as SDL_GetRGB() but also returns the alpha value + (SDL_ALPHA_OPAQUE for formats without an alpha channel) + + Both SDL_GetRGB() and SDL_GetRGBA() now always return values in + the [0..255] interval. Previously, SDL_GetRGB() would return + (0xf8, 0xfc, 0xf8) for a completely white pixel in RGB565 format. + (N.B.: This is broken for bit fields < 3 bits.) + + SDL_MapRGB() returns pixels in which the alpha channel is set opaque. + + SDL_SetAlpha() can now be used for both setting the per-surface + alpha, using the new way of thinking of alpha, and also to enable + and disable per-pixel alpha blending for surfaces with an alpha + channel: + To disable alpha blending: + SDL_SetAlpha(surface, 0, 0); + To re-enable alpha blending: + SDL_SetAlpha(surface, SDL_SRCALPHA, 0); + Surfaces with an alpha channel have blending enabled by default. + + SDL_SetAlpha() now accepts SDL_RLEACCEL as a flag, which requests + RLE acceleration of blits, just as like with SDL_SetColorKey(). + This flag can be set for both surfaces with an alpha channel + and surfaces with an alpha value set by SDL_SetAlpha(). + As always, RLE surfaces must be locked before pixel access is + allowed, and unlocked before any other SDL operations are done + on it. + + The blit semantics for surfaces with and without alpha and colorkey + have now been defined: + + RGBA->RGB: + SDL_SRCALPHA set: + alpha-blend (using alpha-channel). + SDL_SRCCOLORKEY ignored. + SDL_SRCALPHA not set: + copy RGB. + if SDL_SRCCOLORKEY set, only copy the pixels matching the + RGB values of the source colour key, ignoring alpha in the + comparison. + + RGB->RGBA: + SDL_SRCALPHA set: + alpha-blend (using the source per-surface alpha value); + set destination alpha to opaque. + SDL_SRCALPHA not set: + copy RGB, set destination alpha to opaque. + both: + if SDL_SRCCOLORKEY set, only copy the pixels matching the + source colour key. + + RGBA->RGBA: + SDL_SRCALPHA set: + alpha-blend (using the source alpha channel) the RGB values; + leave destination alpha untouched. [Note: is this correct?] + SDL_SRCCOLORKEY ignored. + SDL_SRCALPHA not set: + copy all of RGBA to the destination. + if SDL_SRCCOLORKEY set, only copy the pixels matching the + RGB values of the source colour key, ignoring alpha in the + comparison. + + RGB->RGB: + SDL_SRCALPHA set: + alpha-blend (using the source per-surface alpha value). + SDL_SRCALPHA not set: + copy RGB. + both: + if SDL_SRCCOLORKEY set, only copy the pixels matching the + source colour key. + + As a special case, blits from surfaces with per-surface alpha + value of 128 (50% transparency) are optimised and much faster + than other alpha values. This does not apply to surfaces with + alpha channels (per-pixel alpha). + + New functions for manipulating the gamma of the display have + been added: + int SDL_SetGamma(float red, float green, float blue); + int SDL_SetGammaRamp(Uint8 *red, Uint8 *green, Uint8 *blue); + int SDL_GetGammaRamp(Uint8 *red, Uint8 *green, Uint8 *blue); + Gamma ramps are tables with 256 entries which map the screen color + components into actually displayed colors. For an example of + implementing gamma correction and gamma fades, see test/testgamma.c + Gamma control is not supported on all hardware. + +1.1.4: + The size of the SDL_CDtrack structure changed from 8 to 12 bytes + as the size of the length member was extended to 32 bits. + + You can now use SDL for 2D blitting with a GL mode by passing the + SDL_OPENGLBLIT flag to SDL_SetVideoMode(). You can specify 16 or + 32 bpp, and the data in the framebuffer is put into the GL scene + when you call SDL_UpdateRects(), and the scene will be visible + when you call SDL_GL_SwapBuffers(). + + Run the "testgl" test program with the -logo command line option + to see an example of this blending of 2D and 3D in SDL. + +1.1.3: + Added SDL_FreeRW() to the API, to complement SDL_AllocRW() + + Added resizable window support - just add SDL_RESIZABLE to the + SDL_SetVideoMode() flags, and then wait for SDL_VIDEORESIZE events. + See SDL_events.h for details on the new SDL_ResizeEvent structure. + + Added condition variable support, based on mutexes and semaphores. + SDL_CreateCond() + SDL_DestroyCond() + SDL_CondSignal() + SDL_CondBroadcast() + SDL_CondWait() + SDL_CondTimedWait() + The new function prototypes are in SDL_mutex.h + + Added counting semaphore support, based on the mutex primitive. + SDL_CreateSemaphore() + SDL_DestroySemaphore() + SDL_SemWait() + SDL_SemTryWait() + SDL_SemWaitTimeout() + SDL_SemPost() + SDL_SemValue() + The new function prototypes are in SDL_mutex.h + + Added support for asynchronous blitting. To take advantage of this, + you must set the SDL_ASYNCBLIT flag when setting the video mode and + creating surfaces that you want accelerated in this way. You must + lock surfaces that have this flag set, and the lock will block until + any queued blits have completed. + + Added YUV video overlay support. + The supported YUV formats are: YV12, IYUV, YUY2, UYVY, and YVYU. + This function creates an overlay surface: + SDL_CreateYUVOverlay() + You must lock and unlock the overlay to get access to the data: + SDL_LockYUVOverlay() SDL_UnlockYUVOverlay() + You can then display the overlay: + SDL_DisplayYUVOverlay() + You must free the overlay when you are done using it: + SDL_FreeYUVOverlay() + See SDL_video.h for the full function prototypes. + + The joystick hat position constants have been changed: + Old constant New constant + ------------ ------------ + 0 SDL_HAT_CENTERED + 1 SDL_HAT_UP + 2 SDL_HAT_RIGHTUP + 3 SDL_HAT_RIGHT + 4 SDL_HAT_RIGHTDOWN + 5 SDL_HAT_DOWN + 6 SDL_HAT_LEFTDOWN + 7 SDL_HAT_LEFT + 8 SDL_HAT_LEFTUP + The new constants are bitmasks, so you can check for the + individual axes like this: + if ( hat_position & SDL_HAT_UP ) { + } + and you'll catch left-up, up, and right-up. + +1.1.2: + Added multiple timer support: + SDL_AddTimer() and SDL_RemoveTimer() + + SDL_WM_SetIcon() now respects the icon colorkey if mask is NULL. + +1.1.0: + Added initial OpenGL support. + First set GL attributes (such as RGB depth, alpha depth, etc.) + SDL_GL_SetAttribute() + Then call SDL_SetVideoMode() with the SDL_OPENGL flag. + Perform all of your normal GL drawing. + Finally swap the buffers with the new SDL function: + SDL_GL_SwapBuffers() + See the new 'testgl' test program for an example of using GL with SDL. + + You can load GL extension functions by using the function: + SDL_GL_LoadProcAddress() + + Added functions to initialize and cleanup specific SDL subsystems: + SDL_InitSubSystem() and SDL_QuitSubSystem() + + Added user-defined event type: + typedef struct { + Uint8 type; + int code; + void *data1; + void *data2; + } SDL_UserEvent; + This structure is in the "user" member of an SDL_Event. + + Added a function to push events into the event queue: + SDL_PushEvent() + + Example of using the new SDL user-defined events: + { + SDL_Event event; + + event.type = SDL_USEREVENT; + event.user.code = my_event_code; + event.user.data1 = significant_data; + event.user.data2 = 0; + SDL_PushEvent(&event); + } + + Added a function to get mouse deltas since last query: + SDL_GetRelativeMouseState() + + Added a boolean datatype to SDL_types.h: + SDL_bool = { SDL_TRUE, SDL_FALSE } + + Added a function to get the current audio status: + SDL_GetAudioState(); + It returns one of: + SDL_AUDIO_STOPPED, + SDL_AUDIO_PLAYING, + SDL_AUDIO_PAUSED + + Added an AAlib driver (ASCII Art) - by Stephane Peter. + +1.0.6: + The input grab state is reset after each call to SDL_SetVideoMode(). + The input is grabbed by default in fullscreen mode, and ungrabbed in + windowed mode. If you want to set input grab to a particular value, + you should set it after each call to SDL_SetVideoMode(). + +1.0.5: + Exposed SDL_AudioInit(), SDL_VideoInit() + Added SDL_AudioDriverName() and SDL_VideoDriverName() + + Added new window manager function: + SDL_WM_ToggleFullScreen() + This is currently implemented only on Linux + + The ALT-ENTER code has been removed - it's not appropriate for a + lib to bind keys when they aren't even emergency escape sequences. + + ALT-ENTER functionality can be implemented with the following code: + + int Handle_AltEnter(const SDL_Event *event) + { + if ( event->type == SDL_KEYDOWN ) { + if ( (event->key.keysym.sym == SDLK_RETURN) && + (event->key.keysym.mod & KMOD_ALT) ) { + SDL_WM_ToggleFullScreen(SDL_GetVideoSurface()); + return(0); + } + } + return(1); + } + SDL_SetEventFilter(Handle_AltEnter); + +1.0.3: + Under X11, if you grab the input and hide the mouse cursor, + the mouse will go into a "relative motion" mode where you + will always get relative motion events no matter how far in + each direction you move the mouse - relative motion is not + bounded by the edges of the window (though the absolute values + of the mouse positions are clamped by the size of the window). + The SVGAlib, framebuffer console, and DirectInput drivers all + have this behavior naturally, and the GDI and BWindow drivers + never go into "relative motion" mode. + +1.0.2: + Added a function to enable keyboard repeat: + SDL_EnableKeyRepeat() + + Added a function to grab the mouse and keyboard input + SDL_WM_GrabInput() + + Added a function to iconify the window. + SDL_WM_IconifyWindow() + If this function succeeds, the application will receive an event + signaling SDL_APPACTIVE event + +1.0.1: + Added constants to SDL_audio.h for 16-bit native byte ordering: + AUDIO_U16SYS, AUDIO_S16SYS + +1.0.0: + New public release + +Version 0.11: + +0.11.5: + A new function SDL_GetVideoSurface() has been added, and returns + a pointer to the current display surface. + + SDL_AllocSurface() has been renamed SDL_CreateRGBSurface(), and + a new function SDL_CreateRGBSurfaceFrom() has been added to allow + creating an SDL surface from an existing pixel data buffer. + + Added SDL_GetRGB() to the headers and documentation. + +0.11.4: + SDL_SetLibraryPath() is no longer meaningful, and has been removed. + +0.11.3: + A new flag for SDL_Init(), SDL_INIT_NOPARACHUTE, prevents SDL from + installing fatal signal handlers on operating systems that support + them. + +Version 0.9: + +0.9.15: + SDL_CreateColorCursor() has been removed. Color cursors should + be implemented as sprites, blitted by the application when the + cursor moves. To get smooth color cursor updates when the app + is busy, pass the SDL_INIT_EVENTTHREAD flag to SDL_Init(). This + allows you to handle the mouse motion in another thread from an + event filter function, but is currently only supported by Linux + and BeOS. Note that you'll have to protect the display surface + from multi-threaded access by using mutexes if you do this. + + Thread-safe surface support has been removed from SDL. + This makes blitting somewhat faster, by removing SDL_MiddleBlit(). + Code that used SDL_MiddleBlit() should use SDL_LowerBlit() instead. + You can make your surfaces thread-safe by allocating your own + mutex and making lock/unlock calls around accesses to your surface. + +0.9.14: + SDL_GetMouseState() now takes pointers to int rather than Uint16. + + If you set the SDL_WINDOWID environment variable under UNIX X11, + SDL will use that as the main window instead of creating it's own. + This is an unsupported extension to SDL, and not portable at all. + +0.9.13: + Added a function SDL_SetLibraryPath() which can be used to specify + the directory containing the SDL dynamic libraries. This is useful + for commercial applications which ship with particular versions + of the libraries, and for security on multi-user systems. + If this function is not used, the default system directories are + searched using the native dynamic object loading mechanism. + + In order to support C linkage under Visual C++, you must declare + main() without any return type: + main(int argc, char *argv[]) { + /* Do the program... */ + return(0); + } + C++ programs should also return a value if compiled under VC++. + + The blit_endian member of the SDL_VideoInfo struct has been removed. + + SDL_SymToASCII() has been replaced with SDL_GetKeyName(), so there + is now no longer any function to translate a keysym to a character. + + The SDL_keysym structure has been extended with a 'scancode' and + 'unicode' member. The 'scancode' is a hardware specific scancode + for the key that was pressed, and may be 0. The 'unicode' member + is a 16-bit UNICODE translation of the key that was pressed along + with any modifiers or compose keys that have been pressed. + If no UNICODE translation exists for the key, 'unicode' will be 0. + + Added a function SDL_EnableUNICODE() to enable/disable UNICODE + translation of character keypresses. Translation defaults off. + + To convert existing code to use the new API, change code which + uses SDL_SymToASCII() to get the keyname to use SDL_GetKeyName(), + and change code which uses it to get the ASCII value of a sym to + use the 'unicode' member of the event keysym. + +0.9.12: + There is partial support for 64-bit datatypes. I don't recommend + you use this if you have a choice, because 64-bit datatypes are not + supported on many platforms. On platforms for which it is supported, + the SDL_HAS_64BIT_TYPE C preprocessor define will be enabled, and + you can use the Uint64 and Sint64 datatypes. + + Added functions to SDL_endian.h to support 64-bit datatypes: + SDL_SwapLE64(), SDL_SwapBE64(), + SDL_ReadLE64(), SDL_ReadBE64(), SDL_WriteLE64(), SDL_WriteBE64() + + A new member "len_ratio" has been added to the SDL_AudioCVT structure, + and allows you to determine either the original buffer length or the + converted buffer length, given the other. + + A new function SDL_FreeWAV() has been added to the API to free data + allocated by SDL_LoadWAV_RW(). This is necessary under Win32 since + the gcc compiled DLL uses a different heap than VC++ compiled apps. + + SDL now has initial support for international keyboards using the + Latin character set. + If a particular mapping is desired, you can set the DEFAULT_KEYBOARD + compile-time variable, or you can set the environment variable + "SDL_KEYBOARD" to a string identifying the keyboard mapping you desire. + The valid values for these variables can be found in SDL_keyboard.c + + Full support for German and French keyboards under X11 is implemented. + +0.9.11: + The THREADED_EVENTS compile-time define has been replaced with the + SDL_INIT_EVENTTHREAD flag. If this flag is passed to SDL_Init(), + SDL will create a separate thread to perform input event handling. + If this flag is passed to SDL_Init(), and the OS doesn't support + event handling in a separate thread, SDL_Init() will fail. + Be sure to add calls to SDL_Delay() in your main thread to allow + the OS to schedule your event thread, or it may starve, leading + to slow event delivery and/or dropped events. + Currently MacOS and Win32 do not support this flag, while BeOS + and Linux do support it. I recommend that your application only + use this flag if absolutely necessary. + + The SDL thread function passed to SDL_CreateThread() now returns a + status. This status can be retrieved by passing a non-NULL pointer + as the 'status' argument to SDL_WaitThread(). + + The volume parameter to SDL_MixAudio() has been increased in range + from (0-8) to (0-128) + + SDL now has a data source abstraction which can encompass a file, + an area of memory, or any custom object you can envision. It uses + these abstractions, SDL_RWops, in the endian read/write functions, + and the built-in WAV and BMP file loaders. This means you can load + WAV chunks from memory mapped files, compressed archives, network + pipes, or anything else that has a data read abstraction. + + There are three built-in data source abstractions: + SDL_RWFromFile(), SDL_RWFromFP(), SDL_RWFromMem() + along with a generic data source allocation function: + SDL_AllocRW() + These data sources can be used like stdio file pointers with the + following convenience functions: + SDL_RWseek(), SDL_RWread(), SDL_RWwrite(), SDL_RWclose() + These functions are defined in the new header file "SDL_rwops.h" + + The endian swapping functions have been turned into macros for speed + and SDL_CalculateEndian() has been removed. SDL_endian.h now defines + SDL_BYTEORDER as either SDL_BIG_ENDIAN or SDL_LIL_ENDIAN depending on + the endianness of the host system. + + The endian read/write functions now take an SDL_RWops pointer + instead of a stdio FILE pointer, to support the new data source + abstraction. + + The SDL_*LoadWAV() functions have been replaced with a single + SDL_LoadWAV_RW() function that takes a SDL_RWops pointer as it's + first parameter, and a flag whether or not to automatically + free it as the second parameter. SDL_LoadWAV() is a macro for + backward compatibility and convenience: + SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...); + + The SDL_*LoadBMP()/SDL_*SaveBMP() functions have each been replaced + with a single function that takes a SDL_RWops pointer as it's + first parameter, and a flag whether or not to automatically + free it as the second parameter. SDL_LoadBMP() and SDL_SaveBMP() + are macros for backward compatibility and convenience: + SDL_LoadBMP_RW(SDL_RWFromFile("sample.bmp", "rb"), 1, ...); + SDL_SaveBMP_RW(SDL_RWFromFile("sample.bmp", "wb"), 1, ...); + Note that these functions use SDL_RWseek() extensively, and should + not be used on pipes or other non-seekable data sources. + +0.9.10: + The Linux SDL_SysWMInfo and SDL_SysWMMsg structures have been + extended to support multiple types of display drivers, as well as + safe access to the X11 display when THREADED_EVENTS is enabled. + The new structures are documented in the SDL_syswm.h header file. + + Thanks to John Elliott , the UK keyboard + should now work properly, as well as the "Windows" keys on US + keyboards. + + The Linux CD-ROM code now reads the CD-ROM devices from /etc/fstab + instead of trying to open each block device on the system. + The CD must be listed in /etc/fstab as using the iso9660 filesystem. + + On Linux, if you define THREADED_EVENTS at compile time, a separate + thread will be spawned to gather X events asynchronously from the + graphics updates. This hasn't been extensively tested, but it does + provide a means of handling keyboard and mouse input in a separate + thread from the graphics thread. (This is now enabled by default.) + + A special access function SDL_PeepEvents() allows you to manipulate + the event queue in a thread-safe manner, including peeking at events, + removing events of a specified type, and adding new events of arbitrary + type to the queue (use the new 'user' member of the SDL_Event type). + + If you use SDL_PeepEvents() to gather events, then the main graphics + thread needs to call SDL_PumpEvents() periodically to drive the event + loop and generate input events. This is not necessary if SDL has been + compiled with THREADED_EVENTS defined, but doesn't hurt. + + A new function SDL_ThreadID() returns the identifier associated with + the current thread. + +0.9.9: + The AUDIO_STEREO format flag has been replaced with a new 'channels' + member of the SDL_AudioSpec structure. The channels are 1 for mono + audio, and 2 for stereo audio. In the future more channels may be + supported for 3D surround sound. + + The SDL_MixAudio() function now takes an additional volume parameter, + which should be set to SDL_MIX_MAXVOLUME for compatibility with the + original function. + + The CD-ROM functions which take a 'cdrom' parameter can now be + passed NULL, and will act on the last successfully opened CD-ROM. + +0.9.8: + No changes, bugfixes only. + +0.9.7: + No changes, bugfixes only. + +0.9.6: + Added a fast rectangle fill function: SDL_FillRect() + + Addition of a useful function for getting info on the video hardware: + const SDL_VideoInfo *SDL_GetVideoInfo(void) + This function replaces SDL_GetDisplayFormat(). + + Initial support for double-buffering: + Use the SDL_DOUBLEBUF flag in SDL_SetVideoMode() + Update the screen with a new function: SDL_Flip() + + SDL_AllocSurface() takes two new flags: + SDL_SRCCOLORKEY means that the surface will be used for colorkey blits + and if the hardware supports hardware acceleration of colorkey blits + between two surfaces in video memory, to place the surface in video + memory if possible, otherwise it will be placed in system memory. + SDL_SRCALPHA means that the surface will be used for alpha blits and + if the hardware supports hardware acceleration of alpha blits between + two surfaces in video memory, to place the surface in video memory + if possible, otherwise it will be placed in system memory. + SDL_HWSURFACE now means that the surface will be created with the + same format as the display surface, since having surfaces in video + memory is only useful for fast blitting to the screen, and you can't + blit surfaces with different surface formats in video memory. + +0.9.5: + You can now pass a NULL mask to SDL_WM_SetIcon(), and it will assume + that the icon consists of the entire image. + + SDL_LowerBlit() is back -- but don't use it on the display surface. + It is exactly the same as SDL_MiddleBlit(), but doesn't check for + thread safety. + + Added SDL_FPLoadBMP(), SDL_FPSaveBMP(), SDL_FPLoadWAV(), which take + a FILE pointer instead of a file name. + + Added CD-ROM audio control API: + SDL_CDNumDrives() + SDL_CDName() + SDL_CDOpen() + SDL_CDStatus() + SDL_CDPlayTracks() + SDL_CDPlay() + SDL_CDPause() + SDL_CDResume() + SDL_CDStop() + SDL_CDEject() + SDL_CDClose() + +0.9.4: + No changes, bugfixes only. + +0.9.3: + Mouse motion event now includes relative motion information: + Sint16 event->motion.xrel, Sint16 event->motion.yrel + + X11 keyrepeat handling can be disabled by defining IGNORE_X_KEYREPEAT + (Add -DIGNORE_X_KEYREPEAT to CFLAGS line in obj/x11Makefile) + +0.9.2: + No changes, bugfixes only. + +0.9.1: + Removed SDL_MapSurface() and SDL_UnmapSurface() -- surfaces are now + automatically mapped on blit. + +0.8.0: + SDL stable release diff --git a/alienblaster/project/jni/sdl/autogen.sh b/alienblaster/project/jni/sdl/autogen.sh new file mode 100755 index 000000000..649d7b31e --- /dev/null +++ b/alienblaster/project/jni/sdl/autogen.sh @@ -0,0 +1,19 @@ +#!/bin/sh +# +echo "Generating build information using autoconf" +echo "This may take a while ..." + +# Regenerate configuration files +cat acinclude/* >aclocal.m4 +found=false +for autoconf in autoconf autoconf259 autoconf-2.59 +do if which $autoconf >/dev/null 2>&1; then $autoconf && found=true; break; fi +done +if test x$found = xfalse; then + echo "Couldn't find autoconf, aborting" + exit 1 +fi +(cd test; sh autogen.sh) + +# Run configure for this platform +echo "Now you are ready to run ./configure" diff --git a/alienblaster/project/jni/sdl/docs.html b/alienblaster/project/jni/sdl/docs.html new file mode 100644 index 000000000..66ca9235a --- /dev/null +++ b/alienblaster/project/jni/sdl/docs.html @@ -0,0 +1,629 @@ + +SDL Stable Release + + +[separator] +

+This source is stable, and is fully tested on all supported platforms.
+Please send bug reports or questions to the SDL mailing list:
+http://www.libsdl.org/mailing-list.php
+The latest stable release may be found on the + SDL website. +

+ +

API Documentation

+ +[separator] + +

SDL 1.2.14 Release Notes

+

+SDL 1.2.14 is a significant bug fix release and a recommended update. +

+ +

General Notes

+ +
+

+ Fixed flicker when resizing the SDL window +

+

+ Fixed crash in SDL_SetGammaRamp() +

+

+ Fixed freeze in SDL_memset() with 0 length when assembly code is disabled. +

+

+ Added SDL_DISABLE_LOCK_KEYS environment variable to enable normal up/down events for Caps-Lock and Num-Lock keys. +

+

+ Fixed audio quality problem when converting between 22050 Hz and 44100 Hz. +

+

+ Fixed a threading crash when a few threads are rapidly created and complete. +

+

+ Increased accuracy of alpha blending routines. +

+

+ Fixed crash loading BMP files saved with the scanlines inverted. +

+

+ Fixed mouse coordinate clamping if SDL_SetVideoMode() isn't called in response to SDL_VIDEORESIZE event. +

+

+ Added doxygen documentation for the SDL API headers. +

+
+ +

Unix Notes

+ +
+

+ Fixed potential memory corruption due to assembly bug with SDL_revcpy() +

+

+ Fixed crashes trying to detect SSE features on x86_64 architecture. +

+

+ Fixed assembly for GCC optimized 50% alpha blending blits. +

+

+ Added configure option --enable-screensaver, to allow enabling the screensaver by default. +

+

+ Use XResetScreenSaver() instead of disabling screensaver entirely. +

+

+ Removed the maximum window size limitation on X11. +

+

+ Fixed SDL_GL_SWAP_CONTROL on X11. +

+

+ Fixed setting the X11 window input hint. +

+

+ Fixed distorted X11 window icon for some visuals. +

+

+ Fixed detecting X11 libraries for dynamic loading on 64-bit Linux. +

+

+ SDL_GL_GetAttribute(SDL_GL_SWAP_CONTROL) returns the correct value with GLX_SGI_swap_control. +

+

+ Added SDL_VIDEO_FULLSCREEN_DISPLAY as a preferred synonym for SDL_VIDEO_FULLSCREEN_HEAD on X11. +

+

+ The SDL_VIDEO_FULLSCREEN_DISPLAY environment variable can be set to 0 to place fullscreen SDL windows on the first Xinerama screen. +

+

+ Added the SDL_VIDEO_FBCON_ROTATION environment variable to control output orientation on the framebuffer console. +
+ Valid values are: +

    +
  • not set - Not rotating, no shadow. +
  • "NONE" - Not rotating, but still using shadow. +
  • "CW" - Rotating screen clockwise. +
  • "UD" - Rotating screen upside down. +
  • "CCW" - Rotating screen counter clockwise. +
+

+

+ Fixed DirectFB detection on some Linux distributions. +

+

+ Added code to use the PS3 SPE processors for YUV conversion on Linux. +

+

+ Updated ALSA support to the latest stable API +

+

+ ALSA is now preferred over OSS audio. (SDL_AUDIODRIVER=dsp will restore the previous behavior.) +

+

+ Improved support for PulseAudio +

+

+ The Network Audio System support is now dynamically loaded at runtime. +

+

+ Fixed crash with the MP-8866 Dual USB Joypad on newer Linux kernels. +

+

+ Fixed crash in SDL_Quit() when a joystick has been unplugged. +

+
+ +

Windows Notes

+ +
+

+ Verified 100% compatibility with Windows 7. +

+

+ Prevent loss of OpenGL context when setting the video mode in response to a window resize event. +

+

+ Fixed video initialization with SDL_WINDOWID on Windows XP. +

+

+ Improved mouse input responsiveness for first-person-shooter games. +

+

+ IME messages are now generated for localized input. +

+

+ SDL_RWFromFile() takes a UTF-8 filename when opening a file. +

+

+ The SDL_STDIO_REDIRECT environment variable can be used to override whether SDL redirects stdio to stdout.txt and stderr.txt. +

+

+ Fixed dynamic object loading on Windows CE. +

+
+ +

Mac OS X Notes

+ +
+

+ SDL now builds on Mac OS X 10.6 (Snow Leopard). +
+ Eric Wing posted a good rundown on the numerous changes here: http://playcontrol.net/ewing/jibberjabber/big_behind-the-scenes_chang.html +

+

+ The X11 video driver is built by default. +

+

+ Fixed SDL_VIDEO_WINDOW_POS environment variable for Quartz target. +

+

+ Fixed setting the starting working directory in release builds. +

+
+ +[separator] + +

SDL 1.2.13 Release Notes

+

+SDL 1.2.13 is a minor bug fix release. +

+ +

General Notes

+ +
+

+ Fixed link error when building with Intel Compiler 10. +

+

+ Removed stray C++ comment from public headers. +

+
+ +

Unix Notes

+ +
+

+ Fixed crash in SDL_SoftStretch() on secure operating systems. +

+

+ Fixed undefined symbol on X11 implementations without UTF-8 support. +

+

+ Worked around BadAlloc error when using XVideo on the XFree86 Intel Integrated Graphics driver. +

+

+ Scan for all joysticks on Linux instead of stopping at one that was removed. +

+

+ Fixed use of sdl-config arguments in sdl.m4 +

+
+ +

Windows Notes

+ +
+

+ Fixed crash when a video driver reports higher than 32 bpp video modes. +

+

+ Fixed restoring the desktop after setting a 24-bit OpenGL video mode. +

+

+ Fixed window titles on Windows 95/98/ME. +

+

+ Added SDL_BUTTON_X1 and SDL_BUTTON_X2 constants for extended mouse buttons. +

+

+ Added support for quoted command line arguments. +

+
+ +

Mac OS X Notes

+ +
+

+ SDL now builds on Mac OS X 10.5 (Leopard). +

+

+ Fixed high frequency crash involving text input. +

+

+ Fixed beeping when the escape key is pressed and UNICODE translation is enabled. +

+

+ Improved trackpad scrolling support. +

+

+ Fixed joystick hat reporting for certain joysticks. +

+
+ +[separator] + +

SDL 1.2.12 Release Notes

+

+SDL 1.2.12 is a minor bug fix release. +

+ +

General Notes

+ +
+

+ Added support for the PulseAudio sound server: http://www.pulseaudio.org/ +

+

+ Added SDL_VIDEO_ALLOW_SCREENSAVER to override SDL's disabling of the screensaver on Mac OS X, Windows, and X11. +

+

+ Fixed buffer overrun crash when resampling audio rates. +

+

+ Fixed audio bug where converting to mono was doubling the volume. +

+

+ Fixed off-by-one error in the C implementation of SDL_revcpy() +

+

+ Fixed compiling with Sun Studio. +

+

+ Support for AmigaOS has been removed from the main SDL code. +

+

+ Support for Nokia 9210 "EPOC" driver has been removed from the main SDL code. +

+

+ Unofficial support for the S60/SymbianOS platform has been added. +

+

+ Unofficial support for the Nintendo DS platform has been added. +

+

+ Reenabled MMX assembly for YUV overlay processing (GNU C Compiler only). +

+
+ +

Unix Notes

+ +
+

+ Fixed detection of X11 DGA mouse support. +

+

+ Improved XIM support for asian character sets. +

+

+ The GFX_Display has been added to the X11 window information in SDL_syswm.h. +

+

+ Fixed PAGE_SIZE compile error in the fbcon video driver on newer Linux kernels. +

+

+ Fixed hang or crash at startup if aRts can't access the hardware. +

+

+ Fixed relative mouse mode when the cursor starts outside the X11 window. +

+

+ Fixed accidental free of stack memory in X11 mouse acceleration code. +

+

+ Closed minor memory leak in XME code. +

+

+ Fixed TEXTRELs in the library to resolve some PIC issues. +

+
+ +

Windows Notes

+ +
+

+ The GDI video driver makes better use of the palette in 8-bit modes. +

+

+ The windib driver now supports more mouse buttons with WM_XBUTTON events. +

+

+ On Windows, SDL_SetVideoMode() will re-create the window instead of failing if the multisample settings are changed. +

+

+ Added support for UTF-8 window titles on Windows. +

+

+ Fixed joystick detection on Windows. +

+

+ Improved performance with Win32 file I/O. +

+

+ Fixed HBITMAP leak in GAPI driver. +

+
+ +

Mac OS X Notes

+ +
+

+ Added support for multi-axis controllers like 3Dconnxion's SpaceNavigator on Mac OS X. +

+

+ Fixed YUV overlay crash inside Quicktime on Intel Mac OS X. +

+

+ Fixed blitting alignment in Altivec alpha blit functions. +

+

+ Keys F13, F14, and F15 are now usable on Apple keyboards under Mac OS X. +

+

+ Fixed joystick calibration code on Mac OS X. +

+

+ Fixed mouse jitter when multiple motion events are queued up in Mac OS X. +

+

+ Fixed changing the cursor in fullscreen mode on Mac OS X. +

+
+ +

Mac OS Classic Notes

+ +
+

+ Added support for gamma ramps to both toolbox and DrawSprocket video drivers. +

+
+ +

BeOS Notes

+ +
+

+ Implemented mouse grabbing and mouse relative mode on BeOS. +

+
+ +[separator] + +

SDL 1.2.11 Release Notes

+

+SDL 1.2.11 is a minor bug fix release. +

+ +

Unix Notes

+ +
+

+ Dynamic X11 loading is only enabled with gcc 4 supporting -fvisibility=hidden. This fixes crashes related to symbol collisions, and allows building on Solaris and IRIX. +

+

+ Fixed building SDL with Xinerama disabled. +

+

+ Fixed DRI OpenGL library loading, using RTLD_GLOBAL in dlopen(). +

+

+ Added pkgconfig configuration support. +

+
+ +

Windows Notes

+ +
+

+ Setting SDL_GL_SWAP_CONTROL now works with Windows OpenGL. +

+

+ The Win32 window positioning code works properly for windows with menus. +

+

+ DirectSound audio quality has been improved on certain sound cards. +

+

+ Fixed 5.1 audio channel ordering on Windows and Mac OS X. +

+

+ Plugged a couple of minor memory leaks in the windib video driver. +

+

+ Fixed type collision with stdint.h when building with gcc on Win32. +

+

+ Fixed building with the Digital Mars Compiler on Win32. +

+
+ +

Mac OS X Notes

+ +
+

+ The Quartz video driver supports 32x32 cursors on Mac OS X 10.3 and above. +

+
+ +[separator] + +

SDL 1.2.10 Release Notes

+

+SDL 1.2.10 is a major release, featuring a revamp of the build system and many API improvements and bug fixes. +

+

API enhancements

+
    +
  • + If SDL_OpenAudio() is passed zero for the desired format + fields, the following environment variables will be used + to fill them in: +
    
    +		SDL_AUDIO_FREQUENCY
    +		SDL_AUDIO_FORMAT
    +		SDL_AUDIO_CHANNELS
    +		SDL_AUDIO_SAMPLES
    +
    + If an environment variable is not specified, it will be set + to a reasonable default value. +
  • + SDL_SetVideoMode() now accepts 0 for width or height and will use + the current video mode (or the desktop mode if no mode has been set.) +
  • + Added current_w and current_h to the SDL_VideoInfo structure, + which is set to the desktop resolution during video intialization, + and then set to the current resolution when a video mode is set. +
  • + SDL_GL_LoadLibrary() will load the system default OpenGL library + if it is passed NULL as a parameter. +
  • + Added SDL_GL_SWAP_CONTROL to wait for vsync in OpenGL applications. +
  • + Added SDL_GL_ACCELERATED_VISUAL to guarantee hardware acceleration. +
  • + SDL_WM_SetCaption() now officially takes UTF-8 title and icon strings, and displays international characters on supported platforms. +
  • + Added SDL_GetKeyRepeat() to query the key repeat settings. +
  • + Added the "dummy" audio driver, which can be used to emulate audio + output without a sound card. +
  • + Added SDL_config.h, with defaults for various build environments. +
+ +

General Notes

+ +
+

+ The SDL website now has an RSS feed! +

+ The SDL development source code is now managed with Subversion. +

+ SDL now uses the Bugzilla bug tracking system, hosted by icculus.org. +

+ SDL is licensed under version 2.1 of the GNU Lesser General Public License. +

+ The entire build system has been revamped to make it much more portable, including versions of C library functions to make it possible to run SDL on a minimal embedded environment. See README.Porting in the SDL source distribution for information on how to port SDL to a new platform. +

+ SDL_opengl.h has been updated with the latest glext.h from http://oss.sgi.com/projects/ogl-sample/registry/ +

+ Alex Volkov contributed highly optimized RGB <-> RGBA blitters. +

+ +

Unix Notes

+ +
+

+ The X11 libraries are dynamically loaded at runtime by default. This allows the distributed version of SDL to run on systems without X11 libraries installed. +

+ The XiG XME extension code is now included in the X11 video driver by default. +

+ XRandR support for video mode switching has been added to the X11 driver, but is disabled because of undesired interactions with window managers. You can enable this by setting the environment variable SDL_VIDEO_X11_XRANDR to 1. +

+ Xinerama multi-head displays are properly handled now, and the SDL_VIDEO_FULLSCREEN_HEAD environment variable can be used to select the screen used for fullscreen video modes. Note that changing the video modes only works on screen 0. +

+ XVidMode video modes are now sorted so they maintain the refresh rates specified in the X11 configuration file. +

+ SDL windows are no longer transparent in X11 compositing systems like XGL. +

+ The mouse is properly released by the X11 video driver if the fullscreen window loses focus. +

+ The X11 input driver now uses XIM to handle international input. +

+ The screensaver and DPMS monitor blanking are disabled while SDL games are running under the X11 and DGA video drivers. This behavior will be formalized and selectable in SDL 1.3. +

+ Fixed a bug preventing stereo OpenGL contexts from being selected on the X11 driver. +

+ The DGA video driver now waits for pending blits involving surfaces before they are freed. This prevents display oddities when using SDL_DisplayFormat() to convert many images. +

+ The framebuffer console video driver now has a parser for /etc/fb.modes for improved video mode handling. +

+ The framebuffer console video driver now allows asynchronous VT switching, and restores the full contents of the screen when switched back. +

+ The framebuffer console now uses CTRL-ALT-FN to switch virtual terminals, to avoid collisions with application key bindings. +

+ The framebuffer console input driver correctly sets IMPS/2 mode for wheel mice. It also properly detects when gpm is in IMPS/2 protocol mode, or passing raw protocol from an IMPS/2 mouse. +

+ The SVGAlib video driver now has support for banked (non-linear) video modes. +

+ A video driver for OpenBSD on the Sharp Zaurus has been contributed by Staffan Ulfberg. See the file README.wscons in the SDL source distribution for details. +

+ Many patches have been incorporated from *BSD ports. +

+ +

Windows Notes

+ +
+

+ The "windib" video driver is the default now, to prevent problems with certain laptops, 64-bit Windows, and Windows Vista. The DirectX driver is still available, and can be selected by setting the environment variable SDL_VIDEODRIVER to "directx". +

+ SDL has been ported to 64-bit Windows. +

+ Dmitry Yakimov contributed a GAPI video driver for Windows CE. +

+ The default fullscreen refresh rate has been increased to match the desktop refresh rate, when using equivalent resolutions. A full API for querying and selecting refresh rates is planned for SDL 1.3. +

+ Dialog boxes are now shown when SDL is in windowed OpenGL mode. +

+ The SDL window is recreated when necessary to maintain OpenGL context attributes, when switching between windowed and fullscreen modes. +

+ An SDL_VIDEORESIZE event is properly sent when the SDL window is maximized and restored. +

+ Window positions are retained when switching between fullscreen and windowed modes. +

+ ToUnicode() is used, when available, for improved handling of international keyboard input. +

+ The PrtScrn is now treated normally with both key down and key up events. +

+ Pressing ALT-F4 now delivers an SDL_QUIT event to SDL applications. +

+ Joystick names are now correct for joysticks which have been unplugged and then plugged back in since booting. +

+ An MCI error when playing the last track on a CD-ROM has been fixed. +

+ OpenWatcom projects for building SDL have been provided by Marc Peter. +

+ +

Mac OS X Notes

+ +
+

+ SDL now supports building Universal binaries, both through Xcode projects and when using configure/make. See README.MacOSX in the SDL source archive for details. +

+ The X11 video driver with GLX support can be built on Mac OS X, if the X11 development SDK is installed. +

+ Transitions between fullscreen resolutions and windowed mode now use a much faster asynchronous fade to hide desktop flicker. +

+ Icons set with SDL_WM_SetIcon() now have the proper colors on Intel Macs. +

+ +

OS/2 Notes

+ +
+

+ Projects for building SDL on OS/2 with OpenWatcom have been contributed by Doodle. See the file README.OS2 in the SDL source distribution for details. +

+ +[separator] + + + diff --git a/alienblaster/project/jni/sdl/include/SDL.h b/alienblaster/project/jni/sdl/include/SDL.h new file mode 100644 index 000000000..119ed7ff1 --- /dev/null +++ b/alienblaster/project/jni/sdl/include/SDL.h @@ -0,0 +1,101 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL.h + * Main include header for the SDL library + */ + +#ifndef _SDL_H +#define _SDL_H + +#include "SDL_main.h" +#include "SDL_stdinc.h" +#include "SDL_audio.h" +#include "SDL_cdrom.h" +#include "SDL_cpuinfo.h" +#include "SDL_endian.h" +#include "SDL_error.h" +#include "SDL_events.h" +#include "SDL_loadso.h" +#include "SDL_mutex.h" +#include "SDL_rwops.h" +#include "SDL_thread.h" +#include "SDL_timer.h" +#include "SDL_video.h" +#include "SDL_version.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** @file SDL.h + * @note As of version 0.5, SDL is loaded dynamically into the application + */ + +/** @name SDL_INIT Flags + * These are the flags which may be passed to SDL_Init() -- you should + * specify the subsystems which you will be using in your application. + */ +/*@{*/ +#define SDL_INIT_TIMER 0x00000001 +#define SDL_INIT_AUDIO 0x00000010 +#define SDL_INIT_VIDEO 0x00000020 +#define SDL_INIT_CDROM 0x00000100 +#define SDL_INIT_JOYSTICK 0x00000200 +#define SDL_INIT_NOPARACHUTE 0x00100000 /**< Don't catch fatal signals */ +#define SDL_INIT_EVENTTHREAD 0x01000000 /**< Not supported on all OS's */ +#define SDL_INIT_EVERYTHING 0x0000FFFF +/*@}*/ + +/** This function loads the SDL dynamically linked library and initializes + * the subsystems specified by 'flags' (and those satisfying dependencies) + * Unless the SDL_INIT_NOPARACHUTE flag is set, it will install cleanup + * signal handlers for some commonly ignored fatal signals (like SIGSEGV) + */ +extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags); + +/** This function initializes specific SDL subsystems */ +extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags); + +/** This function cleans up specific SDL subsystems */ +extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags); + +/** This function returns mask of the specified subsystems which have + * been initialized. + * If 'flags' is 0, it returns a mask of all initialized subsystems. + */ +extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags); + +/** This function cleans up all initialized subsystems and unloads the + * dynamically linked library. You should call it upon all exit conditions. + */ +extern DECLSPEC void SDLCALL SDL_Quit(void); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_H */ diff --git a/alienblaster/project/jni/sdl/include/SDL_active.h b/alienblaster/project/jni/sdl/include/SDL_active.h new file mode 100644 index 000000000..0ae92f2d5 --- /dev/null +++ b/alienblaster/project/jni/sdl/include/SDL_active.h @@ -0,0 +1,63 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * @file SDL_active.h + * Include file for SDL application focus event handling + */ + +#ifndef _SDL_active_h +#define _SDL_active_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** @name The available application states */ +/*@{*/ +#define SDL_APPMOUSEFOCUS 0x01 /**< The app has mouse coverage */ +#define SDL_APPINPUTFOCUS 0x02 /**< The app has input focus */ +#define SDL_APPACTIVE 0x04 /**< The application is active */ +/*@}*/ + +/* Function prototypes */ +/** + * This function returns the current state of the application, which is a + * bitwise combination of SDL_APPMOUSEFOCUS, SDL_APPINPUTFOCUS, and + * SDL_APPACTIVE. If SDL_APPACTIVE is set, then the user is able to + * see your application, otherwise it has been iconified or disabled. + */ +extern DECLSPEC Uint8 SDLCALL SDL_GetAppState(void); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_active_h */ diff --git a/alienblaster/project/jni/sdl/include/SDL_audio.h b/alienblaster/project/jni/sdl/include/SDL_audio.h new file mode 100644 index 000000000..3a8e7fa8b --- /dev/null +++ b/alienblaster/project/jni/sdl/include/SDL_audio.h @@ -0,0 +1,284 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * @file SDL_audio.h + * Access to the raw audio mixing buffer for the SDL library + */ + +#ifndef _SDL_audio_h +#define _SDL_audio_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_endian.h" +#include "SDL_mutex.h" +#include "SDL_thread.h" +#include "SDL_rwops.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * When filling in the desired audio spec structure, + * - 'desired->freq' should be the desired audio frequency in samples-per-second. + * - 'desired->format' should be the desired audio format. + * - 'desired->samples' is the desired size of the audio buffer, in samples. + * This number should be a power of two, and may be adjusted by the audio + * driver to a value more suitable for the hardware. Good values seem to + * range between 512 and 8096 inclusive, depending on the application and + * CPU speed. Smaller values yield faster response time, but can lead + * to underflow if the application is doing heavy processing and cannot + * fill the audio buffer in time. A stereo sample consists of both right + * and left channels in LR ordering. + * Note that the number of samples is directly related to time by the + * following formula: ms = (samples*1000)/freq + * - 'desired->size' is the size in bytes of the audio buffer, and is + * calculated by SDL_OpenAudio(). + * - 'desired->silence' is the value used to set the buffer to silence, + * and is calculated by SDL_OpenAudio(). + * - 'desired->callback' should be set to a function that will be called + * when the audio device is ready for more data. It is passed a pointer + * to the audio buffer, and the length in bytes of the audio buffer. + * This function usually runs in a separate thread, and so you should + * protect data structures that it accesses by calling SDL_LockAudio() + * and SDL_UnlockAudio() in your code. + * - 'desired->userdata' is passed as the first parameter to your callback + * function. + * + * @note The calculated values in this structure are calculated by SDL_OpenAudio() + * + */ +typedef struct SDL_AudioSpec { + int freq; /**< DSP frequency -- samples per second */ + Uint16 format; /**< Audio data format */ + Uint8 channels; /**< Number of channels: 1 mono, 2 stereo */ + Uint8 silence; /**< Audio buffer silence value (calculated) */ + Uint16 samples; /**< Audio buffer size in samples (power of 2) */ + Uint16 padding; /**< Necessary for some compile environments */ + Uint32 size; /**< Audio buffer size in bytes (calculated) */ + /** + * This function is called when the audio device needs more data. + * + * @param[out] stream A pointer to the audio data buffer + * @param[in] len The length of the audio buffer in bytes. + * + * Once the callback returns, the buffer will no longer be valid. + * Stereo samples are stored in a LRLRLR ordering. + */ + void (SDLCALL *callback)(void *userdata, Uint8 *stream, int len); + void *userdata; +} SDL_AudioSpec; + +/** + * @name Audio format flags + * defaults to LSB byte order + */ +/*@{*/ +#define AUDIO_U8 0x0008 /**< Unsigned 8-bit samples */ +#define AUDIO_S8 0x8008 /**< Signed 8-bit samples */ +#define AUDIO_U16LSB 0x0010 /**< Unsigned 16-bit samples */ +#define AUDIO_S16LSB 0x8010 /**< Signed 16-bit samples */ +#define AUDIO_U16MSB 0x1010 /**< As above, but big-endian byte order */ +#define AUDIO_S16MSB 0x9010 /**< As above, but big-endian byte order */ +#define AUDIO_U16 AUDIO_U16LSB +#define AUDIO_S16 AUDIO_S16LSB + +/** + * @name Native audio byte ordering + */ +/*@{*/ +#if SDL_BYTEORDER == SDL_LIL_ENDIAN +#define AUDIO_U16SYS AUDIO_U16LSB +#define AUDIO_S16SYS AUDIO_S16LSB +#else +#define AUDIO_U16SYS AUDIO_U16MSB +#define AUDIO_S16SYS AUDIO_S16MSB +#endif +/*@}*/ + +/*@}*/ + + +/** A structure to hold a set of audio conversion filters and buffers */ +typedef struct SDL_AudioCVT { + int needed; /**< Set to 1 if conversion possible */ + Uint16 src_format; /**< Source audio format */ + Uint16 dst_format; /**< Target audio format */ + double rate_incr; /**< Rate conversion increment */ + Uint8 *buf; /**< Buffer to hold entire audio data */ + int len; /**< Length of original audio buffer */ + int len_cvt; /**< Length of converted audio buffer */ + int len_mult; /**< buffer must be len*len_mult big */ + double len_ratio; /**< Given len, final size is len*len_ratio */ + void (SDLCALL *filters[10])(struct SDL_AudioCVT *cvt, Uint16 format); + int filter_index; /**< Current audio conversion function */ +} SDL_AudioCVT; + + +/* Function prototypes */ + +/** + * @name Audio Init and Quit + * These functions are used internally, and should not be used unless you + * have a specific need to specify the audio driver you want to use. + * You should normally use SDL_Init() or SDL_InitSubSystem(). + */ +/*@{*/ +extern DECLSPEC int SDLCALL SDL_AudioInit(const char *driver_name); +extern DECLSPEC void SDLCALL SDL_AudioQuit(void); +/*@}*/ + +/** + * This function fills the given character buffer with the name of the + * current audio driver, and returns a pointer to it if the audio driver has + * been initialized. It returns NULL if no driver has been initialized. + */ +extern DECLSPEC char * SDLCALL SDL_AudioDriverName(char *namebuf, int maxlen); + +/** + * This function opens the audio device with the desired parameters, and + * returns 0 if successful, placing the actual hardware parameters in the + * structure pointed to by 'obtained'. If 'obtained' is NULL, the audio + * data passed to the callback function will be guaranteed to be in the + * requested format, and will be automatically converted to the hardware + * audio format if necessary. This function returns -1 if it failed + * to open the audio device, or couldn't set up the audio thread. + * + * The audio device starts out playing silence when it's opened, and should + * be enabled for playing by calling SDL_PauseAudio(0) when you are ready + * for your audio callback function to be called. Since the audio driver + * may modify the requested size of the audio buffer, you should allocate + * any local mixing buffers after you open the audio device. + * + * @sa SDL_AudioSpec + */ +extern DECLSPEC int SDLCALL SDL_OpenAudio(SDL_AudioSpec *desired, SDL_AudioSpec *obtained); + +typedef enum { + SDL_AUDIO_STOPPED = 0, + SDL_AUDIO_PLAYING, + SDL_AUDIO_PAUSED +} SDL_audiostatus; + +/** Get the current audio state */ +extern DECLSPEC SDL_audiostatus SDLCALL SDL_GetAudioStatus(void); + +/** + * This function pauses and unpauses the audio callback processing. + * It should be called with a parameter of 0 after opening the audio + * device to start playing sound. This is so you can safely initialize + * data for your callback function after opening the audio device. + * Silence will be written to the audio device during the pause. + */ +extern DECLSPEC void SDLCALL SDL_PauseAudio(int pause_on); + +/** + * This function loads a WAVE from the data source, automatically freeing + * that source if 'freesrc' is non-zero. For example, to load a WAVE file, + * you could do: + * @code SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...); @endcode + * + * If this function succeeds, it returns the given SDL_AudioSpec, + * filled with the audio data format of the wave data, and sets + * 'audio_buf' to a malloc()'d buffer containing the audio data, + * and sets 'audio_len' to the length of that audio buffer, in bytes. + * You need to free the audio buffer with SDL_FreeWAV() when you are + * done with it. + * + * This function returns NULL and sets the SDL error message if the + * wave file cannot be opened, uses an unknown data format, or is + * corrupt. Currently raw and MS-ADPCM WAVE files are supported. + */ +extern DECLSPEC SDL_AudioSpec * SDLCALL SDL_LoadWAV_RW(SDL_RWops *src, int freesrc, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len); + +/** Compatibility convenience function -- loads a WAV from a file */ +#define SDL_LoadWAV(file, spec, audio_buf, audio_len) \ + SDL_LoadWAV_RW(SDL_RWFromFile(file, "rb"),1, spec,audio_buf,audio_len) + +/** + * This function frees data previously allocated with SDL_LoadWAV_RW() + */ +extern DECLSPEC void SDLCALL SDL_FreeWAV(Uint8 *audio_buf); + +/** + * This function takes a source format and rate and a destination format + * and rate, and initializes the 'cvt' structure with information needed + * by SDL_ConvertAudio() to convert a buffer of audio data from one format + * to the other. + * + * @return This function returns 0, or -1 if there was an error. + */ +extern DECLSPEC int SDLCALL SDL_BuildAudioCVT(SDL_AudioCVT *cvt, + Uint16 src_format, Uint8 src_channels, int src_rate, + Uint16 dst_format, Uint8 dst_channels, int dst_rate); + +/** + * Once you have initialized the 'cvt' structure using SDL_BuildAudioCVT(), + * created an audio buffer cvt->buf, and filled it with cvt->len bytes of + * audio data in the source format, this function will convert it in-place + * to the desired format. + * The data conversion may expand the size of the audio data, so the buffer + * cvt->buf should be allocated after the cvt structure is initialized by + * SDL_BuildAudioCVT(), and should be cvt->len*cvt->len_mult bytes long. + */ +extern DECLSPEC int SDLCALL SDL_ConvertAudio(SDL_AudioCVT *cvt); + + +#define SDL_MIX_MAXVOLUME 128 +/** + * This takes two audio buffers of the playing audio format and mixes + * them, performing addition, volume adjustment, and overflow clipping. + * The volume ranges from 0 - 128, and should be set to SDL_MIX_MAXVOLUME + * for full audio volume. Note this does not change hardware volume. + * This is provided for convenience -- you can mix your own audio data. + */ +extern DECLSPEC void SDLCALL SDL_MixAudio(Uint8 *dst, const Uint8 *src, Uint32 len, int volume); + +/** + * @name Audio Locks + * The lock manipulated by these functions protects the callback function. + * During a LockAudio/UnlockAudio pair, you can be guaranteed that the + * callback function is not running. Do not call these from the callback + * function or you will cause deadlock. + */ +/*@{*/ +extern DECLSPEC void SDLCALL SDL_LockAudio(void); +extern DECLSPEC void SDLCALL SDL_UnlockAudio(void); +/*@}*/ + +/** + * This function shuts down audio processing and closes the audio device. + */ +extern DECLSPEC void SDLCALL SDL_CloseAudio(void); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_audio_h */ diff --git a/alienblaster/project/jni/sdl/include/SDL_byteorder.h b/alienblaster/project/jni/sdl/include/SDL_byteorder.h new file mode 100644 index 000000000..9b93cd69a --- /dev/null +++ b/alienblaster/project/jni/sdl/include/SDL_byteorder.h @@ -0,0 +1,29 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * @file SDL_byteorder.h + * @deprecated Use SDL_endian.h instead + */ + +/* DEPRECATED */ +#include "SDL_endian.h" diff --git a/alienblaster/project/jni/sdl/include/SDL_cdrom.h b/alienblaster/project/jni/sdl/include/SDL_cdrom.h new file mode 100644 index 000000000..fff5cfa15 --- /dev/null +++ b/alienblaster/project/jni/sdl/include/SDL_cdrom.h @@ -0,0 +1,202 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * @file SDL_cdrom.h + * This is the CD-audio control API for Simple DirectMedia Layer + */ + +#ifndef _SDL_cdrom_h +#define _SDL_cdrom_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @file SDL_cdrom.h + * In order to use these functions, SDL_Init() must have been called + * with the SDL_INIT_CDROM flag. This causes SDL to scan the system + * for CD-ROM drives, and load appropriate drivers. + */ + +/** The maximum number of CD-ROM tracks on a disk */ +#define SDL_MAX_TRACKS 99 + +/** @name Track Types + * The types of CD-ROM track possible + */ +/*@{*/ +#define SDL_AUDIO_TRACK 0x00 +#define SDL_DATA_TRACK 0x04 +/*@}*/ + +/** The possible states which a CD-ROM drive can be in. */ +typedef enum { + CD_TRAYEMPTY, + CD_STOPPED, + CD_PLAYING, + CD_PAUSED, + CD_ERROR = -1 +} CDstatus; + +/** Given a status, returns true if there's a disk in the drive */ +#define CD_INDRIVE(status) ((int)(status) > 0) + +typedef struct SDL_CDtrack { + Uint8 id; /**< Track number */ + Uint8 type; /**< Data or audio track */ + Uint16 unused; + Uint32 length; /**< Length, in frames, of this track */ + Uint32 offset; /**< Offset, in frames, from start of disk */ +} SDL_CDtrack; + +/** This structure is only current as of the last call to SDL_CDStatus() */ +typedef struct SDL_CD { + int id; /**< Private drive identifier */ + CDstatus status; /**< Current drive status */ + + /** The rest of this structure is only valid if there's a CD in drive */ + /*@{*/ + int numtracks; /**< Number of tracks on disk */ + int cur_track; /**< Current track position */ + int cur_frame; /**< Current frame offset within current track */ + SDL_CDtrack track[SDL_MAX_TRACKS+1]; + /*@}*/ +} SDL_CD; + +/** @name Frames / MSF Conversion Functions + * Conversion functions from frames to Minute/Second/Frames and vice versa + */ +/*@{*/ +#define CD_FPS 75 +#define FRAMES_TO_MSF(f, M,S,F) { \ + int value = f; \ + *(F) = value%CD_FPS; \ + value /= CD_FPS; \ + *(S) = value%60; \ + value /= 60; \ + *(M) = value; \ +} +#define MSF_TO_FRAMES(M, S, F) ((M)*60*CD_FPS+(S)*CD_FPS+(F)) +/*@}*/ + +/* CD-audio API functions: */ + +/** + * Returns the number of CD-ROM drives on the system, or -1 if + * SDL_Init() has not been called with the SDL_INIT_CDROM flag. + */ +extern DECLSPEC int SDLCALL SDL_CDNumDrives(void); + +/** + * Returns a human-readable, system-dependent identifier for the CD-ROM. + * Example: + * - "/dev/cdrom" + * - "E:" + * - "/dev/disk/ide/1/master" + */ +extern DECLSPEC const char * SDLCALL SDL_CDName(int drive); + +/** + * Opens a CD-ROM drive for access. It returns a drive handle on success, + * or NULL if the drive was invalid or busy. This newly opened CD-ROM + * becomes the default CD used when other CD functions are passed a NULL + * CD-ROM handle. + * Drives are numbered starting with 0. Drive 0 is the system default CD-ROM. + */ +extern DECLSPEC SDL_CD * SDLCALL SDL_CDOpen(int drive); + +/** + * This function returns the current status of the given drive. + * If the drive has a CD in it, the table of contents of the CD and current + * play position of the CD will be stored in the SDL_CD structure. + */ +extern DECLSPEC CDstatus SDLCALL SDL_CDStatus(SDL_CD *cdrom); + +/** + * Play the given CD starting at 'start_track' and 'start_frame' for 'ntracks' + * tracks and 'nframes' frames. If both 'ntrack' and 'nframe' are 0, play + * until the end of the CD. This function will skip data tracks. + * This function should only be called after calling SDL_CDStatus() to + * get track information about the CD. + * For example: + * @code + * // Play entire CD: + * if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) + * SDL_CDPlayTracks(cdrom, 0, 0, 0, 0); + * // Play last track: + * if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) { + * SDL_CDPlayTracks(cdrom, cdrom->numtracks-1, 0, 0, 0); + * } + * // Play first and second track and 10 seconds of third track: + * if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) + * SDL_CDPlayTracks(cdrom, 0, 0, 2, 10); + * @endcode + * + * @return This function returns 0, or -1 if there was an error. + */ +extern DECLSPEC int SDLCALL SDL_CDPlayTracks(SDL_CD *cdrom, + int start_track, int start_frame, int ntracks, int nframes); + +/** + * Play the given CD starting at 'start' frame for 'length' frames. + * @return It returns 0, or -1 if there was an error. + */ +extern DECLSPEC int SDLCALL SDL_CDPlay(SDL_CD *cdrom, int start, int length); + +/** Pause play + * @return returns 0, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_CDPause(SDL_CD *cdrom); + +/** Resume play + * @return returns 0, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_CDResume(SDL_CD *cdrom); + +/** Stop play + * @return returns 0, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_CDStop(SDL_CD *cdrom); + +/** Eject CD-ROM + * @return returns 0, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_CDEject(SDL_CD *cdrom); + +/** Closes the handle for the CD-ROM drive */ +extern DECLSPEC void SDLCALL SDL_CDClose(SDL_CD *cdrom); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_video_h */ diff --git a/alienblaster/project/jni/sdl/include/SDL_config.h b/alienblaster/project/jni/sdl/include/SDL_config.h new file mode 100644 index 000000000..ce02af211 --- /dev/null +++ b/alienblaster/project/jni/sdl/include/SDL_config.h @@ -0,0 +1,47 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_config_h +#define _SDL_config_h + +#include "SDL_platform.h" + +/* Add any platform that doesn't build using the configure system */ +#if defined(__DREAMCAST__) +#include "SDL_config_dreamcast.h" +#elif defined(__MACOS__) +#include "SDL_config_macos.h" +#elif defined(__MACOSX__) +#include "SDL_config_macosx.h" +#elif defined(__SYMBIAN32__) +#include "SDL_config_symbian.h" /* must be before win32! */ +#elif defined(__WIN32__) +#include "SDL_config_win32.h" +#elif defined(__OS2__) +#include "SDL_config_os2.h" +#elif defined(ANDROID) +#include "SDL_config_android.h" +#else +#include "SDL_config_minimal.h" +#endif /* platform config */ + +#endif /* _SDL_config_h */ diff --git a/alienblaster/project/jni/sdl/include/SDL_config.h.default b/alienblaster/project/jni/sdl/include/SDL_config.h.default new file mode 100644 index 000000000..a50810169 --- /dev/null +++ b/alienblaster/project/jni/sdl/include/SDL_config.h.default @@ -0,0 +1,45 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_config_h +#define _SDL_config_h + +#include "SDL_platform.h" + +/* Add any platform that doesn't build using the configure system */ +#if defined(__DREAMCAST__) +#include "SDL_config_dreamcast.h" +#elif defined(__MACOS__) +#include "SDL_config_macos.h" +#elif defined(__MACOSX__) +#include "SDL_config_macosx.h" +#elif defined(__SYMBIAN32__) +#include "SDL_config_symbian.h" /* must be before win32! */ +#elif defined(__WIN32__) +#include "SDL_config_win32.h" +#elif defined(__OS2__) +#include "SDL_config_os2.h" +#else +#include "SDL_config_minimal.h" +#endif /* platform config */ + +#endif /* _SDL_config_h */ diff --git a/alienblaster/project/jni/sdl/include/SDL_config.h.in b/alienblaster/project/jni/sdl/include/SDL_config.h.in new file mode 100644 index 000000000..58593ca2a --- /dev/null +++ b/alienblaster/project/jni/sdl/include/SDL_config.h.in @@ -0,0 +1,310 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_config_h +#define _SDL_config_h + +/* This is a set of defines to configure the SDL features */ + +/* General platform specific identifiers */ +#include "SDL_platform.h" + +/* Make sure that this isn't included by Visual C++ */ +#ifdef _MSC_VER +#error You should copy include/SDL_config.h.default to include/SDL_config.h +#endif + +/* C language features */ +#undef const +#undef inline +#undef volatile + +/* C datatypes */ +#undef size_t +#undef int8_t +#undef uint8_t +#undef int16_t +#undef uint16_t +#undef int32_t +#undef uint32_t +#undef int64_t +#undef uint64_t +#undef uintptr_t +#undef SDL_HAS_64BIT_TYPE + +/* Endianness */ +#undef SDL_BYTEORDER + +/* Comment this if you want to build without any C library requirements */ +#undef HAVE_LIBC +#if HAVE_LIBC + +/* Useful headers */ +#undef HAVE_ALLOCA_H +#undef HAVE_SYS_TYPES_H +#undef HAVE_STDIO_H +#undef STDC_HEADERS +#undef HAVE_STDLIB_H +#undef HAVE_STDARG_H +#undef HAVE_MALLOC_H +#undef HAVE_MEMORY_H +#undef HAVE_STRING_H +#undef HAVE_STRINGS_H +#undef HAVE_INTTYPES_H +#undef HAVE_STDINT_H +#undef HAVE_CTYPE_H +#undef HAVE_MATH_H +#undef HAVE_ICONV_H +#undef HAVE_SIGNAL_H +#undef HAVE_ALTIVEC_H + +/* C library functions */ +#undef HAVE_MALLOC +#undef HAVE_CALLOC +#undef HAVE_REALLOC +#undef HAVE_FREE +#undef HAVE_ALLOCA +#ifndef _WIN32 /* Don't use C runtime versions of these on Windows */ +#undef HAVE_GETENV +#undef HAVE_PUTENV +#undef HAVE_UNSETENV +#endif +#undef HAVE_QSORT +#undef HAVE_ABS +#undef HAVE_BCOPY +#undef HAVE_MEMSET +#undef HAVE_MEMCPY +#undef HAVE_MEMMOVE +#undef HAVE_MEMCMP +#undef HAVE_STRLEN +#undef HAVE_STRLCPY +#undef HAVE_STRLCAT +#undef HAVE_STRDUP +#undef HAVE__STRREV +#undef HAVE__STRUPR +#undef HAVE__STRLWR +#undef HAVE_INDEX +#undef HAVE_RINDEX +#undef HAVE_STRCHR +#undef HAVE_STRRCHR +#undef HAVE_STRSTR +#undef HAVE_ITOA +#undef HAVE__LTOA +#undef HAVE__UITOA +#undef HAVE__ULTOA +#undef HAVE_STRTOL +#undef HAVE_STRTOUL +#undef HAVE__I64TOA +#undef HAVE__UI64TOA +#undef HAVE_STRTOLL +#undef HAVE_STRTOULL +#undef HAVE_STRTOD +#undef HAVE_ATOI +#undef HAVE_ATOF +#undef HAVE_STRCMP +#undef HAVE_STRNCMP +#undef HAVE__STRICMP +#undef HAVE_STRCASECMP +#undef HAVE__STRNICMP +#undef HAVE_STRNCASECMP +#undef HAVE_SSCANF +#undef HAVE_SNPRINTF +#undef HAVE_VSNPRINTF +#undef HAVE_ICONV +#undef HAVE_SIGACTION +#undef HAVE_SETJMP +#undef HAVE_NANOSLEEP +#undef HAVE_CLOCK_GETTIME +#undef HAVE_GETPAGESIZE +#undef HAVE_MPROTECT + +#else +/* We may need some replacement for stdarg.h here */ +#include +#endif /* HAVE_LIBC */ + +/* Allow disabling of core subsystems */ +#undef SDL_AUDIO_DISABLED +#undef SDL_CDROM_DISABLED +#undef SDL_CPUINFO_DISABLED +#undef SDL_EVENTS_DISABLED +#undef SDL_FILE_DISABLED +#undef SDL_JOYSTICK_DISABLED +#undef SDL_LOADSO_DISABLED +#undef SDL_THREADS_DISABLED +#undef SDL_TIMERS_DISABLED +#undef SDL_VIDEO_DISABLED + +/* Enable various audio drivers */ +#undef SDL_AUDIO_DRIVER_ALSA +#undef SDL_AUDIO_DRIVER_ALSA_DYNAMIC +#undef SDL_AUDIO_DRIVER_ARTS +#undef SDL_AUDIO_DRIVER_ARTS_DYNAMIC +#undef SDL_AUDIO_DRIVER_BAUDIO +#undef SDL_AUDIO_DRIVER_BSD +#undef SDL_AUDIO_DRIVER_COREAUDIO +#undef SDL_AUDIO_DRIVER_DART +#undef SDL_AUDIO_DRIVER_DC +#undef SDL_AUDIO_DRIVER_DISK +#undef SDL_AUDIO_DRIVER_DUMMY +#undef SDL_AUDIO_DRIVER_DMEDIA +#undef SDL_AUDIO_DRIVER_DSOUND +#undef SDL_AUDIO_DRIVER_PULSE +#undef SDL_AUDIO_DRIVER_PULSE_DYNAMIC +#undef SDL_AUDIO_DRIVER_ESD +#undef SDL_AUDIO_DRIVER_ESD_DYNAMIC +#undef SDL_AUDIO_DRIVER_MINT +#undef SDL_AUDIO_DRIVER_MMEAUDIO +#undef SDL_AUDIO_DRIVER_NAS +#undef SDL_AUDIO_DRIVER_NAS_DYNAMIC +#undef SDL_AUDIO_DRIVER_OSS +#undef SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H +#undef SDL_AUDIO_DRIVER_PAUD +#undef SDL_AUDIO_DRIVER_QNXNTO +#undef SDL_AUDIO_DRIVER_SNDMGR +#undef SDL_AUDIO_DRIVER_SUNAUDIO +#undef SDL_AUDIO_DRIVER_WAVEOUT + +/* Enable various cdrom drivers */ +#undef SDL_CDROM_AIX +#undef SDL_CDROM_BEOS +#undef SDL_CDROM_BSDI +#undef SDL_CDROM_DC +#undef SDL_CDROM_DUMMY +#undef SDL_CDROM_FREEBSD +#undef SDL_CDROM_LINUX +#undef SDL_CDROM_MACOS +#undef SDL_CDROM_MACOSX +#undef SDL_CDROM_MINT +#undef SDL_CDROM_OPENBSD +#undef SDL_CDROM_OS2 +#undef SDL_CDROM_OSF +#undef SDL_CDROM_QNX +#undef SDL_CDROM_WIN32 + +/* Enable various input drivers */ +#undef SDL_INPUT_LINUXEV +#undef SDL_INPUT_TSLIB +#undef SDL_JOYSTICK_BEOS +#undef SDL_JOYSTICK_DC +#undef SDL_JOYSTICK_DUMMY +#undef SDL_JOYSTICK_IOKIT +#undef SDL_JOYSTICK_LINUX +#undef SDL_JOYSTICK_MACOS +#undef SDL_JOYSTICK_MINT +#undef SDL_JOYSTICK_OS2 +#undef SDL_JOYSTICK_RISCOS +#undef SDL_JOYSTICK_WINMM +#undef SDL_JOYSTICK_USBHID +#undef SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H + +/* Enable various shared object loading systems */ +#undef SDL_LOADSO_BEOS +#undef SDL_LOADSO_DLCOMPAT +#undef SDL_LOADSO_DLOPEN +#undef SDL_LOADSO_DUMMY +#undef SDL_LOADSO_LDG +#undef SDL_LOADSO_MACOS +#undef SDL_LOADSO_OS2 +#undef SDL_LOADSO_WIN32 + +/* Enable various threading systems */ +#undef SDL_THREAD_BEOS +#undef SDL_THREAD_DC +#undef SDL_THREAD_OS2 +#undef SDL_THREAD_PTH +#undef SDL_THREAD_PTHREAD +#undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX +#undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP +#undef SDL_THREAD_SPROC +#undef SDL_THREAD_WIN32 + +/* Enable various timer systems */ +#undef SDL_TIMER_BEOS +#undef SDL_TIMER_DC +#undef SDL_TIMER_DUMMY +#undef SDL_TIMER_MACOS +#undef SDL_TIMER_MINT +#undef SDL_TIMER_OS2 +#undef SDL_TIMER_RISCOS +#undef SDL_TIMER_UNIX +#undef SDL_TIMER_WIN32 +#undef SDL_TIMER_WINCE + +/* Enable various video drivers */ +#undef SDL_VIDEO_DRIVER_AALIB +#undef SDL_VIDEO_DRIVER_BWINDOW +#undef SDL_VIDEO_DRIVER_CACA +#undef SDL_VIDEO_DRIVER_DC +#undef SDL_VIDEO_DRIVER_DDRAW +#undef SDL_VIDEO_DRIVER_DGA +#undef SDL_VIDEO_DRIVER_DIRECTFB +#undef SDL_VIDEO_DRIVER_DRAWSPROCKET +#undef SDL_VIDEO_DRIVER_DUMMY +#undef SDL_VIDEO_DRIVER_FBCON +#undef SDL_VIDEO_DRIVER_GAPI +#undef SDL_VIDEO_DRIVER_GEM +#undef SDL_VIDEO_DRIVER_GGI +#undef SDL_VIDEO_DRIVER_IPOD +#undef SDL_VIDEO_DRIVER_NANOX +#undef SDL_VIDEO_DRIVER_OS2FS +#undef SDL_VIDEO_DRIVER_PHOTON +#undef SDL_VIDEO_DRIVER_PICOGUI +#undef SDL_VIDEO_DRIVER_PS2GS +#undef SDL_VIDEO_DRIVER_PS3 +#undef SDL_VIDEO_DRIVER_QTOPIA +#undef SDL_VIDEO_DRIVER_QUARTZ +#undef SDL_VIDEO_DRIVER_RISCOS +#undef SDL_VIDEO_DRIVER_SVGALIB +#undef SDL_VIDEO_DRIVER_TOOLBOX +#undef SDL_VIDEO_DRIVER_VGL +#undef SDL_VIDEO_DRIVER_WINDIB +#undef SDL_VIDEO_DRIVER_WSCONS +#undef SDL_VIDEO_DRIVER_X11 +#undef SDL_VIDEO_DRIVER_X11_DGAMOUSE +#undef SDL_VIDEO_DRIVER_X11_DYNAMIC +#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT +#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR +#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER +#undef SDL_VIDEO_DRIVER_X11_VIDMODE +#undef SDL_VIDEO_DRIVER_X11_XINERAMA +#undef SDL_VIDEO_DRIVER_X11_XME +#undef SDL_VIDEO_DRIVER_X11_XRANDR +#undef SDL_VIDEO_DRIVER_X11_XV +#undef SDL_VIDEO_DRIVER_XBIOS + +/* Enable OpenGL support */ +#undef SDL_VIDEO_OPENGL +#undef SDL_VIDEO_OPENGL_GLX +#undef SDL_VIDEO_OPENGL_WGL +#undef SDL_VIDEO_OPENGL_OSMESA +#undef SDL_VIDEO_OPENGL_OSMESA_DYNAMIC + +/* Disable screensaver */ +#undef SDL_VIDEO_DISABLE_SCREENSAVER + +/* Enable assembly routines */ +#undef SDL_ASSEMBLY_ROUTINES +#undef SDL_HERMES_BLITTERS +#undef SDL_ALTIVEC_BLITTERS + +#endif /* _SDL_config_h */ diff --git a/alienblaster/project/jni/sdl/include/SDL_config_android.h b/alienblaster/project/jni/sdl/include/SDL_config_android.h new file mode 100644 index 000000000..82c4652ef --- /dev/null +++ b/alienblaster/project/jni/sdl/include/SDL_config_android.h @@ -0,0 +1,53 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_config_minimal_h +#define _SDL_config_minimal_h + +#include "SDL_platform.h" + +/* This is the minimal configuration that can be used to build SDL */ + +#include +#include + + +#define SDL_AUDIO_DRIVER_DUMMY 1 + +#define SDL_CDROM_DISABLED 1 + +#define SDL_JOYSTICK_DISABLED 1 + +#define SDL_LOADSO_DISABLED 1 + +#define SDL_THREAD_PTHREAD 1 +#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1 + +#define SDL_TIMER_UNIX 1 + +#define SDL_VIDEO_DRIVER_ANDROID 1 + +#define HAVE_STDIO_H 1 + +#define NO_SDL_GLEXT 1 + +#endif /* _SDL_config_minimal_h */ diff --git a/alienblaster/project/jni/sdl/include/SDL_config_dreamcast.h b/alienblaster/project/jni/sdl/include/SDL_config_dreamcast.h new file mode 100644 index 000000000..07c2f0815 --- /dev/null +++ b/alienblaster/project/jni/sdl/include/SDL_config_dreamcast.h @@ -0,0 +1,106 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_config_dreamcast_h +#define _SDL_config_dreamcast_h + +#include "SDL_platform.h" + +/* This is a set of defines to configure the SDL features */ + +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef signed short int16_t; +typedef unsigned short uint16_t; +typedef signed int int32_t; +typedef unsigned int uint32_t; +typedef signed long long int64_t; +typedef unsigned long long uint64_t; +typedef unsigned long uintptr_t; +#define SDL_HAS_64BIT_TYPE 1 + +/* Useful headers */ +#define HAVE_SYS_TYPES_H 1 +#define HAVE_STDIO_H 1 +#define STDC_HEADERS 1 +#define HAVE_STRING_H 1 +#define HAVE_CTYPE_H 1 + +/* C library functions */ +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_GETENV 1 +#define HAVE_PUTENV 1 +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +#define HAVE_BCOPY 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE_STRDUP 1 +#define HAVE_INDEX 1 +#define HAVE_RINDEX 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE_STRICMP 1 +#define HAVE_STRCASECMP 1 +#define HAVE_SSCANF 1 +#define HAVE_SNPRINTF 1 +#define HAVE_VSNPRINTF 1 + +/* Enable various audio drivers */ +#define SDL_AUDIO_DRIVER_DC 1 +#define SDL_AUDIO_DRIVER_DISK 1 +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable various cdrom drivers */ +#define SDL_CDROM_DC 1 + +/* Enable various input drivers */ +#define SDL_JOYSTICK_DC 1 + +/* Enable various shared object loading systems */ +#define SDL_LOADSO_DUMMY 1 + +/* Enable various threading systems */ +#define SDL_THREAD_DC 1 + +/* Enable various timer systems */ +#define SDL_TIMER_DC 1 + +/* Enable various video drivers */ +#define SDL_VIDEO_DRIVER_DC 1 +#define SDL_VIDEO_DRIVER_DUMMY 1 + +#endif /* _SDL_config_dreamcast_h */ diff --git a/alienblaster/project/jni/sdl/include/SDL_config_macos.h b/alienblaster/project/jni/sdl/include/SDL_config_macos.h new file mode 100644 index 000000000..4ba5c22c3 --- /dev/null +++ b/alienblaster/project/jni/sdl/include/SDL_config_macos.h @@ -0,0 +1,112 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_config_macos_h +#define _SDL_config_macos_h + +#include "SDL_platform.h" + +/* This is a set of defines to configure the SDL features */ + +#include + +typedef SInt8 int8_t; +typedef UInt8 uint8_t; +typedef SInt16 int16_t; +typedef UInt16 uint16_t; +typedef SInt32 int32_t; +typedef UInt32 uint32_t; +typedef SInt64 int64_t; +typedef UInt64 uint64_t; +typedef unsigned long uintptr_t; + +#define SDL_HAS_64BIT_TYPE 1 + +/* Useful headers */ +#define HAVE_STDIO_H 1 +#define STDC_HEADERS 1 +#define HAVE_STRING_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_MATH_H 1 +#define HAVE_SIGNAL_H 1 + +/* C library functions */ +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_ABS 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_ITOA 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE_SSCANF 1 + +/* Enable various audio drivers */ +#define SDL_AUDIO_DRIVER_SNDMGR 1 +#define SDL_AUDIO_DRIVER_DISK 1 +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable various cdrom drivers */ +#if TARGET_API_MAC_CARBON +#define SDL_CDROM_DUMMY 1 +#else +#define SDL_CDROM_MACOS 1 +#endif + +/* Enable various input drivers */ +#if TARGET_API_MAC_CARBON +#define SDL_JOYSTICK_DUMMY 1 +#else +#define SDL_JOYSTICK_MACOS 1 +#endif + +/* Enable various shared object loading systems */ +#define SDL_LOADSO_MACOS 1 + +/* Enable various threading systems */ +#define SDL_THREADS_DISABLED 1 + +/* Enable various timer systems */ +#define SDL_TIMER_MACOS 1 + +/* Enable various video drivers */ +#define SDL_VIDEO_DRIVER_DUMMY 1 +#define SDL_VIDEO_DRIVER_DRAWSPROCKET 1 +#define SDL_VIDEO_DRIVER_TOOLBOX 1 + +/* Enable OpenGL support */ +#define SDL_VIDEO_OPENGL 1 + +#endif /* _SDL_config_macos_h */ diff --git a/alienblaster/project/jni/sdl/include/SDL_config_macosx.h b/alienblaster/project/jni/sdl/include/SDL_config_macosx.h new file mode 100644 index 000000000..295b87245 --- /dev/null +++ b/alienblaster/project/jni/sdl/include/SDL_config_macosx.h @@ -0,0 +1,150 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_config_macosx_h +#define _SDL_config_macosx_h + +#include "SDL_platform.h" + +/* This gets us MAC_OS_X_VERSION_MIN_REQUIRED... */ +#include + +/* This is a set of defines to configure the SDL features */ + +#define SDL_HAS_64BIT_TYPE 1 + +/* Useful headers */ +/* If we specified an SDK or have a post-PowerPC chip, then alloca.h exists. */ +#if ( (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (!defined(__POWERPC__)) ) +#define HAVE_ALLOCA_H 1 +#endif +#define HAVE_SYS_TYPES_H 1 +#define HAVE_STDIO_H 1 +#define STDC_HEADERS 1 +#define HAVE_STRING_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_MATH_H 1 +#define HAVE_SIGNAL_H 1 + +/* C library functions */ +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_GETENV 1 +#define HAVE_PUTENV 1 +#define HAVE_UNSETENV 1 +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +#define HAVE_BCOPY 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE_STRLCPY 1 +#define HAVE_STRLCAT 1 +#define HAVE_STRDUP 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOULL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE_STRCASECMP 1 +#define HAVE_STRNCASECMP 1 +#define HAVE_SSCANF 1 +#define HAVE_SNPRINTF 1 +#define HAVE_VSNPRINTF 1 +#define HAVE_SIGACTION 1 +#define HAVE_SETJMP 1 +#define HAVE_NANOSLEEP 1 + +/* Enable various audio drivers */ +#define SDL_AUDIO_DRIVER_COREAUDIO 1 +#define SDL_AUDIO_DRIVER_DISK 1 +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable various cdrom drivers */ +#define SDL_CDROM_MACOSX 1 + +/* Enable various input drivers */ +#define SDL_JOYSTICK_IOKIT 1 + +/* Enable various shared object loading systems */ +#ifdef __ppc__ +/* For Mac OS X 10.2 compatibility */ +#define SDL_LOADSO_DLCOMPAT 1 +#else +#define SDL_LOADSO_DLOPEN 1 +#endif + +/* Enable various threading systems */ +#define SDL_THREAD_PTHREAD 1 +#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1 + +/* Enable various timer systems */ +#define SDL_TIMER_UNIX 1 + +/* Enable various video drivers */ +#define SDL_VIDEO_DRIVER_DUMMY 1 +#if ((defined TARGET_API_MAC_CARBON) && (TARGET_API_MAC_CARBON)) +#define SDL_VIDEO_DRIVER_TOOLBOX 1 +#else +#define SDL_VIDEO_DRIVER_QUARTZ 1 +#endif +#define SDL_VIDEO_DRIVER_DGA 1 +#define SDL_VIDEO_DRIVER_X11 1 +#define SDL_VIDEO_DRIVER_X11_DGAMOUSE 1 +#define SDL_VIDEO_DRIVER_X11_DYNAMIC "/usr/X11R6/lib/libX11.6.dylib" +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "/usr/X11R6/lib/libXext.6.dylib" +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "/usr/X11R6/lib/libXrandr.2.dylib" +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER "/usr/X11R6/lib/libXrender.1.dylib" +#define SDL_VIDEO_DRIVER_X11_VIDMODE 1 +#define SDL_VIDEO_DRIVER_X11_XINERAMA 1 +#define SDL_VIDEO_DRIVER_X11_XME 1 +#define SDL_VIDEO_DRIVER_X11_XRANDR 1 +#define SDL_VIDEO_DRIVER_X11_XV 1 + +/* Enable OpenGL support */ +#define SDL_VIDEO_OPENGL 1 +#define SDL_VIDEO_OPENGL_GLX 1 + +/* Disable screensaver */ +#define SDL_VIDEO_DISABLE_SCREENSAVER 1 + +/* Enable assembly routines */ +#define SDL_ASSEMBLY_ROUTINES 1 +#ifdef __ppc__ +#define SDL_ALTIVEC_BLITTERS 1 +#endif + +#endif /* _SDL_config_macosx_h */ diff --git a/alienblaster/project/jni/sdl/include/SDL_config_minimal.h b/alienblaster/project/jni/sdl/include/SDL_config_minimal.h new file mode 100644 index 000000000..fe57be5f4 --- /dev/null +++ b/alienblaster/project/jni/sdl/include/SDL_config_minimal.h @@ -0,0 +1,61 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_config_minimal_h +#define _SDL_config_minimal_h + +#include "SDL_platform.h" + +/* This is the minimal configuration that can be used to build SDL */ + +#include +#include + +/* +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef signed short int16_t; +typedef unsigned short uint16_t; +typedef signed int int32_t; +typedef unsigned int uint32_t; +typedef unsigned int size_t; +typedef unsigned long uintptr_t; +*/ + +#define SDL_AUDIO_DRIVER_DUMMY 1 + +#define SDL_CDROM_DISABLED 1 + +#define SDL_JOYSTICK_DISABLED 1 + +#define SDL_LOADSO_DISABLED 1 + +#define SDL_THREAD_PTHREAD 1 +#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1 + +#define SDL_TIMER_UNIX 1 + +#define SDL_VIDEO_DRIVER_ANDROID 1 + +#define HAVE_STDIO_H 1 + +#endif /* _SDL_config_minimal_h */ diff --git a/alienblaster/project/jni/sdl/include/SDL_config_nds.h b/alienblaster/project/jni/sdl/include/SDL_config_nds.h new file mode 100644 index 000000000..4ac60a504 --- /dev/null +++ b/alienblaster/project/jni/sdl/include/SDL_config_nds.h @@ -0,0 +1,115 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_config_nds_h +#define _SDL_config_nds_h + +#include "SDL_platform.h" + +/* This is a set of defines to configure the SDL features */ + +/* General platform specific identifiers */ +#include "SDL_platform.h" + +/* C datatypes */ +#define SDL_HAS_64BIT_TYPE 1 + +/* Endianness */ +#define SDL_BYTEORDER 1234 + +/* Useful headers */ +#define HAVE_ALLOCA_H 1 +#define HAVE_SYS_TYPES_H 1 +#define HAVE_STDIO_H 1 +#define STDC_HEADERS 1 +#define HAVE_STDLIB_H 1 +#define HAVE_STDARG_H 1 +#define HAVE_MALLOC_H 1 +#define HAVE_STRING_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_MATH_H 1 +#define HAVE_ICONV_H 1 +#define HAVE_SIGNAL_H 1 + +/* C library functions */ +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_GETENV 1 +#define HAVE_PUTENV 1 +#define HAVE_UNSETENV 1 +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +#define HAVE_BCOPY 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_STRLEN 1 +#define HAVE_STRLCPY 1 +#define HAVE_STRLCAT 1 +#define HAVE_STRDUP 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOULL 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE_STRCASECMP 1 +#define HAVE_STRNCASECMP 1 +#define HAVE_SSCANF 1 +#define HAVE_SNPRINTF 1 +#define HAVE_VSNPRINTF 1 +#define HAVE_SETJMP 1 + +/* Enable various audio drivers */ +#define SDL_AUDIO_DRIVER_NDS 1 +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable the stub cdrom driver (src/cdrom/dummy/\*.c) */ +#define SDL_CDROM_DISABLED 1 + +/* Enable various input drivers */ +#define SDL_JOYSTICK_NDS 1 + +/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */ +#define SDL_LOADSO_DISABLED 1 + +/* Enable the stub thread support (src/thread/generic/\*.c) */ +#define SDL_THREADS_DISABLED 1 + +/* Enable various timer systems */ +#define SDL_TIMER_NDS 1 + +/* Enable various video drivers */ +#define SDL_VIDEO_DRIVER_NDS 1 +#define SDL_VIDEO_DRIVER_DUMMY 1 + +#endif /* _SDL_config_nds_h */ diff --git a/alienblaster/project/jni/sdl/include/SDL_config_os2.h b/alienblaster/project/jni/sdl/include/SDL_config_os2.h new file mode 100644 index 000000000..bb40df001 --- /dev/null +++ b/alienblaster/project/jni/sdl/include/SDL_config_os2.h @@ -0,0 +1,141 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_config_os2_h +#define _SDL_config_os2_h + +#include "SDL_platform.h" + +/* This is a set of defines to configure the SDL features */ + +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef signed short int16_t; +typedef unsigned short uint16_t; +typedef signed int int32_t; +typedef unsigned int uint32_t; +typedef unsigned int size_t; +typedef unsigned long uintptr_t; +typedef signed long long int64_t; +typedef unsigned long long uint64_t; + +#define SDL_HAS_64BIT_TYPE 1 + +/* Use Watcom's LIBC */ +#define HAVE_LIBC 1 + +/* Useful headers */ +#define HAVE_SYS_TYPES_H 1 +#define HAVE_STDIO_H 1 +#define STDC_HEADERS 1 +#define HAVE_STDLIB_H 1 +#define HAVE_STDARG_H 1 +#define HAVE_MALLOC_H 1 +#define HAVE_MEMORY_H 1 +#define HAVE_STRING_H 1 +#define HAVE_STRINGS_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_MATH_H 1 +#define HAVE_SIGNAL_H 1 + +/* C library functions */ +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_GETENV 1 +#define HAVE_PUTENV 1 +#define HAVE_UNSETENV 1 +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +#define HAVE_BCOPY 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE_STRLCPY 1 +#define HAVE_STRLCAT 1 +#define HAVE_STRDUP 1 +#define HAVE__STRREV 1 +#define HAVE__STRUPR 1 +#define HAVE__STRLWR 1 +#define HAVE_INDEX 1 +#define HAVE_RINDEX 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_ITOA 1 +#define HAVE__LTOA 1 +#define HAVE__UITOA 1 +#define HAVE__ULTOA 1 +#define HAVE_STRTOL 1 +#define HAVE__I64TOA 1 +#define HAVE__UI64TOA 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE_STRICMP 1 +#define HAVE_STRCASECMP 1 +#define HAVE_SSCANF 1 +#define HAVE_SNPRINTF 1 +#define HAVE_VSNPRINTF 1 +#define HAVE_SETJMP 1 +#define HAVE_CLOCK_GETTIME 1 + +/* Enable various audio drivers */ +#define SDL_AUDIO_DRIVER_DART 1 +#define SDL_AUDIO_DRIVER_DISK 1 +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable various cdrom drivers */ +#define SDL_CDROM_OS2 1 + +/* Enable various input drivers */ +#define SDL_JOYSTICK_OS2 1 + +/* Enable various shared object loading systems */ +#define SDL_LOADSO_OS2 1 + +/* Enable various threading systems */ +#define SDL_THREAD_OS2 1 + +/* Enable various timer systems */ +#define SDL_TIMER_OS2 1 + +/* Enable various video drivers */ +#define SDL_VIDEO_DRIVER_DUMMY 1 +#define SDL_VIDEO_DRIVER_OS2FS 1 + +/* Enable OpenGL support */ +/* Nothing here yet for OS/2... :( */ + +/* Enable assembly routines where available */ +#define SDL_ASSEMBLY_ROUTINES 1 + +#endif /* _SDL_config_os2_h */ diff --git a/alienblaster/project/jni/sdl/include/SDL_config_symbian.h b/alienblaster/project/jni/sdl/include/SDL_config_symbian.h new file mode 100644 index 000000000..53527b232 --- /dev/null +++ b/alienblaster/project/jni/sdl/include/SDL_config_symbian.h @@ -0,0 +1,146 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/* + +Symbian version Markus Mertama + +*/ + + +#ifndef _SDL_CONFIG_SYMBIAN_H +#define _SDL_CONFIG_SYMBIAN_H + +#include "SDL_platform.h" + +/* This is the minimal configuration that can be used to build SDL */ + + +#include +#include + + +#ifdef __GCCE__ +#define SYMBIAN32_GCCE +#endif + +#ifndef _SIZE_T_DEFINED +typedef unsigned int size_t; +#endif + +#ifndef _INTPTR_T_DECLARED +typedef unsigned int uintptr_t; +#endif + +#ifndef _INT8_T_DECLARED +typedef signed char int8_t; +#endif + +#ifndef _UINT8_T_DECLARED +typedef unsigned char uint8_t; +#endif + +#ifndef _INT16_T_DECLARED +typedef signed short int16_t; +#endif + +#ifndef _UINT16_T_DECLARED +typedef unsigned short uint16_t; +#endif + +#ifndef _INT32_T_DECLARED +typedef signed int int32_t; +#endif + +#ifndef _UINT32_T_DECLARED +typedef unsigned int uint32_t; +#endif + +#ifndef _INT64_T_DECLARED +typedef signed long long int64_t; +#endif + +#ifndef _UINT64_T_DECLARED +typedef unsigned long long uint64_t; +#endif + +#define SDL_AUDIO_DRIVER_EPOCAUDIO 1 + + +/* Enable the stub cdrom driver (src/cdrom/dummy/\*.c) */ +#define SDL_CDROM_DISABLED 1 + +/* Enable the stub joystick driver (src/joystick/dummy/\*.c) */ +#define SDL_JOYSTICK_DISABLED 1 + +/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */ +#define SDL_LOADSO_DISABLED 1 + +#define SDL_THREAD_SYMBIAN 1 + +#define SDL_VIDEO_DRIVER_EPOC 1 + +#define SDL_VIDEO_OPENGL 0 + +#define SDL_HAS_64BIT_TYPE 1 + +#define HAVE_LIBC 1 +#define HAVE_STDIO_H 1 +#define STDC_HEADERS 1 +#define HAVE_STRING_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_MATH_H 1 + +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +/*#define HAVE_ALLOCA 1*/ +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE__STRUPR 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_ITOA 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +/*#define HAVE__STRICMP 1*/ +#define HAVE__STRNICMP 1 +#define HAVE_SSCANF 1 +#define HAVE_STDARG_H 1 +#define HAVE_STDDEF_H 1 + + + +#endif /* _SDL_CONFIG_SYMBIAN_H */ diff --git a/alienblaster/project/jni/sdl/include/SDL_config_win32.h b/alienblaster/project/jni/sdl/include/SDL_config_win32.h new file mode 100644 index 000000000..6d019a8d9 --- /dev/null +++ b/alienblaster/project/jni/sdl/include/SDL_config_win32.h @@ -0,0 +1,183 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_config_win32_h +#define _SDL_config_win32_h + +#include "SDL_platform.h" + +/* This is a set of defines to configure the SDL features */ + +#if defined(__GNUC__) || defined(__DMC__) +#define HAVE_STDINT_H 1 +#elif defined(_MSC_VER) +typedef signed __int8 int8_t; +typedef unsigned __int8 uint8_t; +typedef signed __int16 int16_t; +typedef unsigned __int16 uint16_t; +typedef signed __int32 int32_t; +typedef unsigned __int32 uint32_t; +typedef signed __int64 int64_t; +typedef unsigned __int64 uint64_t; +#ifndef _UINTPTR_T_DEFINED +#ifdef _WIN64 +typedef unsigned __int64 uintptr_t; +#else +typedef unsigned int uintptr_t; +#endif +#define _UINTPTR_T_DEFINED +#endif +/* Older Visual C++ headers don't have the Win64-compatible typedefs... */ +#if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR))) +#define DWORD_PTR DWORD +#endif +#if ((_MSC_VER <= 1200) && (!defined(LONG_PTR))) +#define LONG_PTR LONG +#endif +#else /* !__GNUC__ && !_MSC_VER */ +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef signed short int16_t; +typedef unsigned short uint16_t; +typedef signed int int32_t; +typedef unsigned int uint32_t; +typedef signed long long int64_t; +typedef unsigned long long uint64_t; +#ifndef _SIZE_T_DEFINED_ +#define _SIZE_T_DEFINED_ +typedef unsigned int size_t; +#endif +typedef unsigned int uintptr_t; +#endif /* __GNUC__ || _MSC_VER */ +#define SDL_HAS_64BIT_TYPE 1 + +/* Enabled for SDL 1.2 (binary compatibility) */ +#define HAVE_LIBC 1 +#ifdef HAVE_LIBC +/* Useful headers */ +#define HAVE_STDIO_H 1 +#define STDC_HEADERS 1 +#define HAVE_STRING_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_MATH_H 1 +#ifndef _WIN32_WCE +#define HAVE_SIGNAL_H 1 +#endif + +/* C library functions */ +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE__STRREV 1 +#define HAVE__STRUPR 1 +#define HAVE__STRLWR 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_ITOA 1 +#define HAVE__LTOA 1 +#define HAVE__ULTOA 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE__STRICMP 1 +#define HAVE__STRNICMP 1 +#define HAVE_SSCANF 1 +#else +#define HAVE_STDARG_H 1 +#define HAVE_STDDEF_H 1 +#endif + +/* Enable various audio drivers */ +#ifndef _WIN32_WCE +#define SDL_AUDIO_DRIVER_DSOUND 1 +#endif +#define SDL_AUDIO_DRIVER_WAVEOUT 1 +#define SDL_AUDIO_DRIVER_DISK 1 +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable various cdrom drivers */ +#ifdef _WIN32_WCE +#define SDL_CDROM_DISABLED 1 +#else +#define SDL_CDROM_WIN32 1 +#endif + +/* Enable various input drivers */ +#ifdef _WIN32_WCE +#define SDL_JOYSTICK_DISABLED 1 +#else +#define SDL_JOYSTICK_WINMM 1 +#endif + +/* Enable various shared object loading systems */ +#define SDL_LOADSO_WIN32 1 + +/* Enable various threading systems */ +#define SDL_THREAD_WIN32 1 + +/* Enable various timer systems */ +#ifdef _WIN32_WCE +#define SDL_TIMER_WINCE 1 +#else +#define SDL_TIMER_WIN32 1 +#endif + +/* Enable various video drivers */ +#ifdef _WIN32_WCE +#define SDL_VIDEO_DRIVER_GAPI 1 +#endif +#ifndef _WIN32_WCE +#define SDL_VIDEO_DRIVER_DDRAW 1 +#endif +#define SDL_VIDEO_DRIVER_DUMMY 1 +#define SDL_VIDEO_DRIVER_WINDIB 1 + +/* Enable OpenGL support */ +#ifndef _WIN32_WCE +#define SDL_VIDEO_OPENGL 1 +#define SDL_VIDEO_OPENGL_WGL 1 +#endif + +/* Disable screensaver */ +#define SDL_VIDEO_DISABLE_SCREENSAVER 1 + +/* Enable assembly routines (Win64 doesn't have inline asm) */ +#ifndef _WIN64 +#define SDL_ASSEMBLY_ROUTINES 1 +#endif + +#endif /* _SDL_config_win32_h */ diff --git a/alienblaster/project/jni/sdl/include/SDL_copying.h b/alienblaster/project/jni/sdl/include/SDL_copying.h new file mode 100644 index 000000000..1bd6b84cd --- /dev/null +++ b/alienblaster/project/jni/sdl/include/SDL_copying.h @@ -0,0 +1,22 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + diff --git a/alienblaster/project/jni/sdl/include/SDL_cpuinfo.h b/alienblaster/project/jni/sdl/include/SDL_cpuinfo.h new file mode 100644 index 000000000..f4be8e032 --- /dev/null +++ b/alienblaster/project/jni/sdl/include/SDL_cpuinfo.h @@ -0,0 +1,69 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * @file SDL_cpuinfo.h + * CPU feature detection for SDL + */ + +#ifndef _SDL_cpuinfo_h +#define _SDL_cpuinfo_h + +#include "SDL_stdinc.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** This function returns true if the CPU has the RDTSC instruction */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasRDTSC(void); + +/** This function returns true if the CPU has MMX features */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void); + +/** This function returns true if the CPU has MMX Ext. features */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasMMXExt(void); + +/** This function returns true if the CPU has 3DNow features */ +extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNow(void); + +/** This function returns true if the CPU has 3DNow! Ext. features */ +extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNowExt(void); + +/** This function returns true if the CPU has SSE features */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void); + +/** This function returns true if the CPU has SSE2 features */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void); + +/** This function returns true if the CPU has AltiVec features */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(void); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_cpuinfo_h */ diff --git a/alienblaster/project/jni/sdl/include/SDL_endian.h b/alienblaster/project/jni/sdl/include/SDL_endian.h new file mode 100644 index 000000000..f7a2e2f8c --- /dev/null +++ b/alienblaster/project/jni/sdl/include/SDL_endian.h @@ -0,0 +1,209 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * @file SDL_endian.h + * Functions for reading and writing endian-specific values + */ + +#ifndef _SDL_endian_h +#define _SDL_endian_h + +#include "SDL_stdinc.h" + +/** @name SDL_ENDIANs + * The two types of endianness + */ +/*@{*/ +#define SDL_LIL_ENDIAN 1234 +#define SDL_BIG_ENDIAN 4321 +/*@}*/ + +#ifndef SDL_BYTEORDER /* Not defined in SDL_config.h? */ +#if defined(__hppa__) || \ + defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \ + (defined(__MIPS__) && defined(__MISPEB__)) || \ + defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC) || \ + defined(__sparc__) +#define SDL_BYTEORDER SDL_BIG_ENDIAN +#else +#define SDL_BYTEORDER SDL_LIL_ENDIAN +#endif +#endif /* !SDL_BYTEORDER */ + + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @name SDL_Swap Functions + * Use inline functions for compilers that support them, and static + * functions for those that do not. Because these functions become + * static for compilers that do not support inline functions, this + * header should only be included in files that actually use them. + */ +/*@{*/ +#if defined(__GNUC__) && defined(__i386__) && \ + !(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */) +static __inline__ Uint16 SDL_Swap16(Uint16 x) +{ + __asm__("xchgb %b0,%h0" : "=q" (x) : "0" (x)); + return x; +} +#elif defined(__GNUC__) && defined(__x86_64__) +static __inline__ Uint16 SDL_Swap16(Uint16 x) +{ + __asm__("xchgb %b0,%h0" : "=Q" (x) : "0" (x)); + return x; +} +#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__)) +static __inline__ Uint16 SDL_Swap16(Uint16 x) +{ + Uint16 result; + + __asm__("rlwimi %0,%2,8,16,23" : "=&r" (result) : "0" (x >> 8), "r" (x)); + return result; +} +#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) +static __inline__ Uint16 SDL_Swap16(Uint16 x) +{ + __asm__("rorw #8,%0" : "=d" (x) : "0" (x) : "cc"); + return x; +} +#else +static __inline__ Uint16 SDL_Swap16(Uint16 x) { + return((x<<8)|(x>>8)); +} +#endif + +#if defined(__GNUC__) && defined(__i386__) && \ + !(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */) +static __inline__ Uint32 SDL_Swap32(Uint32 x) +{ + __asm__("bswap %0" : "=r" (x) : "0" (x)); + return x; +} +#elif defined(__GNUC__) && defined(__x86_64__) +static __inline__ Uint32 SDL_Swap32(Uint32 x) +{ + __asm__("bswapl %0" : "=r" (x) : "0" (x)); + return x; +} +#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__)) +static __inline__ Uint32 SDL_Swap32(Uint32 x) +{ + Uint32 result; + + __asm__("rlwimi %0,%2,24,16,23" : "=&r" (result) : "0" (x>>24), "r" (x)); + __asm__("rlwimi %0,%2,8,8,15" : "=&r" (result) : "0" (result), "r" (x)); + __asm__("rlwimi %0,%2,24,0,7" : "=&r" (result) : "0" (result), "r" (x)); + return result; +} +#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) +static __inline__ Uint32 SDL_Swap32(Uint32 x) +{ + __asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0" : "=d" (x) : "0" (x) : "cc"); + return x; +} +#else +static __inline__ Uint32 SDL_Swap32(Uint32 x) { + return((x<<24)|((x<<8)&0x00FF0000)|((x>>8)&0x0000FF00)|(x>>24)); +} +#endif + +#ifdef SDL_HAS_64BIT_TYPE +#if defined(__GNUC__) && defined(__i386__) && \ + !(__GNUC__ == 2 && __GNUC_MINOR__ <= 95 /* broken gcc version */) +static __inline__ Uint64 SDL_Swap64(Uint64 x) +{ + union { + struct { Uint32 a,b; } s; + Uint64 u; + } v; + v.u = x; + __asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1" + : "=r" (v.s.a), "=r" (v.s.b) + : "0" (v.s.a), "1" (v.s.b)); + return v.u; +} +#elif defined(__GNUC__) && defined(__x86_64__) +static __inline__ Uint64 SDL_Swap64(Uint64 x) +{ + __asm__("bswapq %0" : "=r" (x) : "0" (x)); + return x; +} +#else +static __inline__ Uint64 SDL_Swap64(Uint64 x) +{ + Uint32 hi, lo; + + /* Separate into high and low 32-bit values and swap them */ + lo = SDL_static_cast(Uint32, x & 0xFFFFFFFF); + x >>= 32; + hi = SDL_static_cast(Uint32, x & 0xFFFFFFFF); + x = SDL_Swap32(lo); + x <<= 32; + x |= SDL_Swap32(hi); + return(x); +} +#endif +#else +/* This is mainly to keep compilers from complaining in SDL code. + * If there is no real 64-bit datatype, then compilers will complain about + * the fake 64-bit datatype that SDL provides when it compiles user code. + */ +#define SDL_Swap64(X) (X) +#endif /* SDL_HAS_64BIT_TYPE */ +/*@}*/ + +/** + * @name SDL_SwapLE and SDL_SwapBE Functions + * Byteswap item from the specified endianness to the native endianness + */ +/*@{*/ +#if SDL_BYTEORDER == SDL_LIL_ENDIAN +#define SDL_SwapLE16(X) (X) +#define SDL_SwapLE32(X) (X) +#define SDL_SwapLE64(X) (X) +#define SDL_SwapBE16(X) SDL_Swap16(X) +#define SDL_SwapBE32(X) SDL_Swap32(X) +#define SDL_SwapBE64(X) SDL_Swap64(X) +#else +#define SDL_SwapLE16(X) SDL_Swap16(X) +#define SDL_SwapLE32(X) SDL_Swap32(X) +#define SDL_SwapLE64(X) SDL_Swap64(X) +#define SDL_SwapBE16(X) (X) +#define SDL_SwapBE32(X) (X) +#define SDL_SwapBE64(X) (X) +#endif +/*@}*/ + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_endian_h */ diff --git a/alienblaster/project/jni/sdl/include/SDL_error.h b/alienblaster/project/jni/sdl/include/SDL_error.h new file mode 100644 index 000000000..b103703a5 --- /dev/null +++ b/alienblaster/project/jni/sdl/include/SDL_error.h @@ -0,0 +1,72 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * @file SDL_error.h + * Simple error message routines for SDL + */ + +#ifndef _SDL_error_h +#define _SDL_error_h + +#include "SDL_stdinc.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @name Public functions + */ +/*@{*/ +extern DECLSPEC void SDLCALL SDL_SetError(const char *fmt, ...); +extern DECLSPEC char * SDLCALL SDL_GetError(void); +extern DECLSPEC void SDLCALL SDL_ClearError(void); +/*@}*/ + +/** + * @name Private functions + * @internal Private error message function - used internally + */ +/*@{*/ +#define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM) +#define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED) +typedef enum { + SDL_ENOMEM, + SDL_EFREAD, + SDL_EFWRITE, + SDL_EFSEEK, + SDL_UNSUPPORTED, + SDL_LASTERROR +} SDL_errorcode; +extern DECLSPEC void SDLCALL SDL_Error(SDL_errorcode code); +/*@}*/ + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_error_h */ diff --git a/alienblaster/project/jni/sdl/include/SDL_events.h b/alienblaster/project/jni/sdl/include/SDL_events.h new file mode 100644 index 000000000..c94a30c9c --- /dev/null +++ b/alienblaster/project/jni/sdl/include/SDL_events.h @@ -0,0 +1,356 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * @file SDL_events.h + * Include file for SDL event handling + */ + +#ifndef _SDL_events_h +#define _SDL_events_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_active.h" +#include "SDL_keyboard.h" +#include "SDL_mouse.h" +#include "SDL_joystick.h" +#include "SDL_quit.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** @name General keyboard/mouse state definitions */ +/*@{*/ +#define SDL_RELEASED 0 +#define SDL_PRESSED 1 +/*@}*/ + +/** Event enumerations */ +typedef enum { + SDL_NOEVENT = 0, /**< Unused (do not remove) */ + SDL_ACTIVEEVENT, /**< Application loses/gains visibility */ + SDL_KEYDOWN, /**< Keys pressed */ + SDL_KEYUP, /**< Keys released */ + SDL_MOUSEMOTION, /**< Mouse moved */ + SDL_MOUSEBUTTONDOWN, /**< Mouse button pressed */ + SDL_MOUSEBUTTONUP, /**< Mouse button released */ + SDL_JOYAXISMOTION, /**< Joystick axis motion */ + SDL_JOYBALLMOTION, /**< Joystick trackball motion */ + SDL_JOYHATMOTION, /**< Joystick hat position change */ + SDL_JOYBUTTONDOWN, /**< Joystick button pressed */ + SDL_JOYBUTTONUP, /**< Joystick button released */ + SDL_QUIT, /**< User-requested quit */ + SDL_SYSWMEVENT, /**< System specific event */ + SDL_EVENT_RESERVEDA, /**< Reserved for future use.. */ + SDL_EVENT_RESERVEDB, /**< Reserved for future use.. */ + SDL_VIDEORESIZE, /**< User resized video mode */ + SDL_VIDEOEXPOSE, /**< Screen needs to be redrawn */ + SDL_EVENT_RESERVED2, /**< Reserved for future use.. */ + SDL_EVENT_RESERVED3, /**< Reserved for future use.. */ + SDL_EVENT_RESERVED4, /**< Reserved for future use.. */ + SDL_EVENT_RESERVED5, /**< Reserved for future use.. */ + SDL_EVENT_RESERVED6, /**< Reserved for future use.. */ + SDL_EVENT_RESERVED7, /**< Reserved for future use.. */ + /** Events SDL_USEREVENT through SDL_MAXEVENTS-1 are for your use */ + SDL_USEREVENT = 24, + /** This last event is only for bounding internal arrays + * It is the number of bits in the event mask datatype -- Uint32 + */ + SDL_NUMEVENTS = 32 +} SDL_EventType; + +/** @name Predefined event masks */ +/*@{*/ +#define SDL_EVENTMASK(X) (1<<(X)) +typedef enum { + SDL_ACTIVEEVENTMASK = SDL_EVENTMASK(SDL_ACTIVEEVENT), + SDL_KEYDOWNMASK = SDL_EVENTMASK(SDL_KEYDOWN), + SDL_KEYUPMASK = SDL_EVENTMASK(SDL_KEYUP), + SDL_KEYEVENTMASK = SDL_EVENTMASK(SDL_KEYDOWN)| + SDL_EVENTMASK(SDL_KEYUP), + SDL_MOUSEMOTIONMASK = SDL_EVENTMASK(SDL_MOUSEMOTION), + SDL_MOUSEBUTTONDOWNMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN), + SDL_MOUSEBUTTONUPMASK = SDL_EVENTMASK(SDL_MOUSEBUTTONUP), + SDL_MOUSEEVENTMASK = SDL_EVENTMASK(SDL_MOUSEMOTION)| + SDL_EVENTMASK(SDL_MOUSEBUTTONDOWN)| + SDL_EVENTMASK(SDL_MOUSEBUTTONUP), + SDL_JOYAXISMOTIONMASK = SDL_EVENTMASK(SDL_JOYAXISMOTION), + SDL_JOYBALLMOTIONMASK = SDL_EVENTMASK(SDL_JOYBALLMOTION), + SDL_JOYHATMOTIONMASK = SDL_EVENTMASK(SDL_JOYHATMOTION), + SDL_JOYBUTTONDOWNMASK = SDL_EVENTMASK(SDL_JOYBUTTONDOWN), + SDL_JOYBUTTONUPMASK = SDL_EVENTMASK(SDL_JOYBUTTONUP), + SDL_JOYEVENTMASK = SDL_EVENTMASK(SDL_JOYAXISMOTION)| + SDL_EVENTMASK(SDL_JOYBALLMOTION)| + SDL_EVENTMASK(SDL_JOYHATMOTION)| + SDL_EVENTMASK(SDL_JOYBUTTONDOWN)| + SDL_EVENTMASK(SDL_JOYBUTTONUP), + SDL_VIDEORESIZEMASK = SDL_EVENTMASK(SDL_VIDEORESIZE), + SDL_VIDEOEXPOSEMASK = SDL_EVENTMASK(SDL_VIDEOEXPOSE), + SDL_QUITMASK = SDL_EVENTMASK(SDL_QUIT), + SDL_SYSWMEVENTMASK = SDL_EVENTMASK(SDL_SYSWMEVENT) +} SDL_EventMask ; +#define SDL_ALLEVENTS 0xFFFFFFFF +/*@}*/ + +/** Application visibility event structure */ +typedef struct SDL_ActiveEvent { + Uint8 type; /**< SDL_ACTIVEEVENT */ + Uint8 gain; /**< Whether given states were gained or lost (1/0) */ + Uint8 state; /**< A mask of the focus states */ +} SDL_ActiveEvent; + +/** Keyboard event structure */ +typedef struct SDL_KeyboardEvent { + Uint8 type; /**< SDL_KEYDOWN or SDL_KEYUP */ + Uint8 which; /**< The keyboard device index */ + Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */ + SDL_keysym keysym; +} SDL_KeyboardEvent; + +/** Mouse motion event structure */ +typedef struct SDL_MouseMotionEvent { + Uint8 type; /**< SDL_MOUSEMOTION */ + Uint8 which; /**< The mouse device index */ + Uint8 state; /**< The current button state */ + Uint16 x, y; /**< The X/Y coordinates of the mouse */ + Sint16 xrel; /**< The relative motion in the X direction */ + Sint16 yrel; /**< The relative motion in the Y direction */ +} SDL_MouseMotionEvent; + +/** Mouse button event structure */ +typedef struct SDL_MouseButtonEvent { + Uint8 type; /**< SDL_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP */ + Uint8 which; /**< The mouse device index */ + Uint8 button; /**< The mouse button index */ + Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */ + Uint16 x, y; /**< The X/Y coordinates of the mouse at press time */ +} SDL_MouseButtonEvent; + +/** Joystick axis motion event structure */ +typedef struct SDL_JoyAxisEvent { + Uint8 type; /**< SDL_JOYAXISMOTION */ + Uint8 which; /**< The joystick device index */ + Uint8 axis; /**< The joystick axis index */ + Sint16 value; /**< The axis value (range: -32768 to 32767) */ +} SDL_JoyAxisEvent; + +/** Joystick trackball motion event structure */ +typedef struct SDL_JoyBallEvent { + Uint8 type; /**< SDL_JOYBALLMOTION */ + Uint8 which; /**< The joystick device index */ + Uint8 ball; /**< The joystick trackball index */ + Sint16 xrel; /**< The relative motion in the X direction */ + Sint16 yrel; /**< The relative motion in the Y direction */ +} SDL_JoyBallEvent; + +/** Joystick hat position change event structure */ +typedef struct SDL_JoyHatEvent { + Uint8 type; /**< SDL_JOYHATMOTION */ + Uint8 which; /**< The joystick device index */ + Uint8 hat; /**< The joystick hat index */ + Uint8 value; /**< The hat position value: + * SDL_HAT_LEFTUP SDL_HAT_UP SDL_HAT_RIGHTUP + * SDL_HAT_LEFT SDL_HAT_CENTERED SDL_HAT_RIGHT + * SDL_HAT_LEFTDOWN SDL_HAT_DOWN SDL_HAT_RIGHTDOWN + * Note that zero means the POV is centered. + */ +} SDL_JoyHatEvent; + +/** Joystick button event structure */ +typedef struct SDL_JoyButtonEvent { + Uint8 type; /**< SDL_JOYBUTTONDOWN or SDL_JOYBUTTONUP */ + Uint8 which; /**< The joystick device index */ + Uint8 button; /**< The joystick button index */ + Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */ +} SDL_JoyButtonEvent; + +/** The "window resized" event + * When you get this event, you are responsible for setting a new video + * mode with the new width and height. + */ +typedef struct SDL_ResizeEvent { + Uint8 type; /**< SDL_VIDEORESIZE */ + int w; /**< New width */ + int h; /**< New height */ +} SDL_ResizeEvent; + +/** The "screen redraw" event */ +typedef struct SDL_ExposeEvent { + Uint8 type; /**< SDL_VIDEOEXPOSE */ +} SDL_ExposeEvent; + +/** The "quit requested" event */ +typedef struct SDL_QuitEvent { + Uint8 type; /**< SDL_QUIT */ +} SDL_QuitEvent; + +/** A user-defined event type */ +typedef struct SDL_UserEvent { + Uint8 type; /**< SDL_USEREVENT through SDL_NUMEVENTS-1 */ + int code; /**< User defined event code */ + void *data1; /**< User defined data pointer */ + void *data2; /**< User defined data pointer */ +} SDL_UserEvent; + +/** If you want to use this event, you should include SDL_syswm.h */ +struct SDL_SysWMmsg; +typedef struct SDL_SysWMmsg SDL_SysWMmsg; +typedef struct SDL_SysWMEvent { + Uint8 type; + SDL_SysWMmsg *msg; +} SDL_SysWMEvent; + +/** General event structure */ +typedef union SDL_Event { + Uint8 type; + SDL_ActiveEvent active; + SDL_KeyboardEvent key; + SDL_MouseMotionEvent motion; + SDL_MouseButtonEvent button; + SDL_JoyAxisEvent jaxis; + SDL_JoyBallEvent jball; + SDL_JoyHatEvent jhat; + SDL_JoyButtonEvent jbutton; + SDL_ResizeEvent resize; + SDL_ExposeEvent expose; + SDL_QuitEvent quit; + SDL_UserEvent user; + SDL_SysWMEvent syswm; +} SDL_Event; + + +/* Function prototypes */ + +/** Pumps the event loop, gathering events from the input devices. + * This function updates the event queue and internal input device state. + * This should only be run in the thread that sets the video mode. + */ +extern DECLSPEC void SDLCALL SDL_PumpEvents(void); + +typedef enum { + SDL_ADDEVENT, + SDL_PEEKEVENT, + SDL_GETEVENT +} SDL_eventaction; + +/** + * Checks the event queue for messages and optionally returns them. + * + * If 'action' is SDL_ADDEVENT, up to 'numevents' events will be added to + * the back of the event queue. + * If 'action' is SDL_PEEKEVENT, up to 'numevents' events at the front + * of the event queue, matching 'mask', will be returned and will not + * be removed from the queue. + * If 'action' is SDL_GETEVENT, up to 'numevents' events at the front + * of the event queue, matching 'mask', will be returned and will be + * removed from the queue. + * + * @return + * This function returns the number of events actually stored, or -1 + * if there was an error. + * + * This function is thread-safe. + */ +extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event *events, int numevents, + SDL_eventaction action, Uint32 mask); + +/** Polls for currently pending events, and returns 1 if there are any pending + * events, or 0 if there are none available. If 'event' is not NULL, the next + * event is removed from the queue and stored in that area. + */ +extern DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event *event); + +/** Waits indefinitely for the next available event, returning 1, or 0 if there + * was an error while waiting for events. If 'event' is not NULL, the next + * event is removed from the queue and stored in that area. + */ +extern DECLSPEC int SDLCALL SDL_WaitEvent(SDL_Event *event); + +/** Add an event to the event queue. + * This function returns 0 on success, or -1 if the event queue was full + * or there was some other error. + */ +extern DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event *event); + +/** @name Event Filtering */ +/*@{*/ +typedef int (SDLCALL *SDL_EventFilter)(const SDL_Event *event); +/** + * This function sets up a filter to process all events before they + * change internal state and are posted to the internal event queue. + * + * The filter is protypted as: + * @code typedef int (SDLCALL *SDL_EventFilter)(const SDL_Event *event); @endcode + * + * If the filter returns 1, then the event will be added to the internal queue. + * If it returns 0, then the event will be dropped from the queue, but the + * internal state will still be updated. This allows selective filtering of + * dynamically arriving events. + * + * @warning Be very careful of what you do in the event filter function, as + * it may run in a different thread! + * + * There is one caveat when dealing with the SDL_QUITEVENT event type. The + * event filter is only called when the window manager desires to close the + * application window. If the event filter returns 1, then the window will + * be closed, otherwise the window will remain open if possible. + * If the quit event is generated by an interrupt signal, it will bypass the + * internal queue and be delivered to the application at the next event poll. + */ +extern DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter); + +/** + * Return the current event filter - can be used to "chain" filters. + * If there is no event filter set, this function returns NULL. + */ +extern DECLSPEC SDL_EventFilter SDLCALL SDL_GetEventFilter(void); +/*@}*/ + +/** @name Event State */ +/*@{*/ +#define SDL_QUERY -1 +#define SDL_IGNORE 0 +#define SDL_DISABLE 0 +#define SDL_ENABLE 1 +/*@}*/ + +/** +* This function allows you to set the state of processing certain events. +* If 'state' is set to SDL_IGNORE, that event will be automatically dropped +* from the event queue and will not event be filtered. +* If 'state' is set to SDL_ENABLE, that event will be processed normally. +* If 'state' is set to SDL_QUERY, SDL_EventState() will return the +* current processing state of the specified event. +*/ +extern DECLSPEC Uint8 SDLCALL SDL_EventState(Uint8 type, int state); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_events_h */ diff --git a/alienblaster/project/jni/sdl/include/SDL_getenv.h b/alienblaster/project/jni/sdl/include/SDL_getenv.h new file mode 100644 index 000000000..253ad88cc --- /dev/null +++ b/alienblaster/project/jni/sdl/include/SDL_getenv.h @@ -0,0 +1,28 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_getenv.h + * @deprecated Use SDL_stdinc.h instead + */ + +/* DEPRECATED */ +#include "SDL_stdinc.h" diff --git a/alienblaster/project/jni/sdl/include/SDL_joystick.h b/alienblaster/project/jni/sdl/include/SDL_joystick.h new file mode 100644 index 000000000..d5135c3d5 --- /dev/null +++ b/alienblaster/project/jni/sdl/include/SDL_joystick.h @@ -0,0 +1,187 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_joystick.h + * Include file for SDL joystick event handling + */ + +#ifndef _SDL_joystick_h +#define _SDL_joystick_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** @file SDL_joystick.h + * @note In order to use these functions, SDL_Init() must have been called + * with the SDL_INIT_JOYSTICK flag. This causes SDL to scan the system + * for joysticks, and load appropriate drivers. + */ + +/** The joystick structure used to identify an SDL joystick */ +struct _SDL_Joystick; +typedef struct _SDL_Joystick SDL_Joystick; + +/* Function prototypes */ +/** + * Count the number of joysticks attached to the system + */ +extern DECLSPEC int SDLCALL SDL_NumJoysticks(void); + +/** + * Get the implementation dependent name of a joystick. + * + * This can be called before any joysticks are opened. + * If no name can be found, this function returns NULL. + */ +extern DECLSPEC const char * SDLCALL SDL_JoystickName(int device_index); + +/** + * Open a joystick for use. + * + * @param[in] device_index + * The index passed as an argument refers to + * the N'th joystick on the system. This index is the value which will + * identify this joystick in future joystick events. + * + * @return This function returns a joystick identifier, or NULL if an error occurred. + */ +extern DECLSPEC SDL_Joystick * SDLCALL SDL_JoystickOpen(int device_index); + +/** + * Returns 1 if the joystick has been opened, or 0 if it has not. + */ +extern DECLSPEC int SDLCALL SDL_JoystickOpened(int device_index); + +/** + * Get the device index of an opened joystick. + */ +extern DECLSPEC int SDLCALL SDL_JoystickIndex(SDL_Joystick *joystick); + +/** + * Get the number of general axis controls on a joystick + */ +extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick *joystick); + +/** + * Get the number of trackballs on a joystick + * + * Joystick trackballs have only relative motion events associated + * with them and their state cannot be polled. + */ +extern DECLSPEC int SDLCALL SDL_JoystickNumBalls(SDL_Joystick *joystick); + +/** + * Get the number of POV hats on a joystick + */ +extern DECLSPEC int SDLCALL SDL_JoystickNumHats(SDL_Joystick *joystick); + +/** + * Get the number of buttons on a joystick + */ +extern DECLSPEC int SDLCALL SDL_JoystickNumButtons(SDL_Joystick *joystick); + +/** + * Update the current state of the open joysticks. + * + * This is called automatically by the event loop if any joystick + * events are enabled. + */ +extern DECLSPEC void SDLCALL SDL_JoystickUpdate(void); + +/** + * Enable/disable joystick event polling. + * + * If joystick events are disabled, you must call SDL_JoystickUpdate() + * yourself and check the state of the joystick when you want joystick + * information. + * + * @param[in] state The state can be one of SDL_QUERY, SDL_ENABLE or SDL_IGNORE. + */ +extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state); + +/** + * Get the current state of an axis control on a joystick + * + * @param[in] axis The axis indices start at index 0. + * + * @return The state is a value ranging from -32768 to 32767. + */ +extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick *joystick, int axis); + +/** + * @name Hat Positions + * The return value of SDL_JoystickGetHat() is one of the following positions: + */ +/*@{*/ +#define SDL_HAT_CENTERED 0x00 +#define SDL_HAT_UP 0x01 +#define SDL_HAT_RIGHT 0x02 +#define SDL_HAT_DOWN 0x04 +#define SDL_HAT_LEFT 0x08 +#define SDL_HAT_RIGHTUP (SDL_HAT_RIGHT|SDL_HAT_UP) +#define SDL_HAT_RIGHTDOWN (SDL_HAT_RIGHT|SDL_HAT_DOWN) +#define SDL_HAT_LEFTUP (SDL_HAT_LEFT|SDL_HAT_UP) +#define SDL_HAT_LEFTDOWN (SDL_HAT_LEFT|SDL_HAT_DOWN) +/*@}*/ + +/** + * Get the current state of a POV hat on a joystick + * + * @param[in] hat The hat indices start at index 0. + */ +extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick *joystick, int hat); + +/** + * Get the ball axis change since the last poll + * + * @param[in] ball The ball indices start at index 0. + * + * @return This returns 0, or -1 if you passed it invalid parameters. + */ +extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick *joystick, int ball, int *dx, int *dy); + +/** + * Get the current state of a button on a joystick + * + * @param[in] button The button indices start at index 0. + */ +extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick *joystick, int button); + +/** + * Close a joystick previously opened with SDL_JoystickOpen() + */ +extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick *joystick); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_joystick_h */ diff --git a/alienblaster/project/jni/sdl/include/SDL_keyboard.h b/alienblaster/project/jni/sdl/include/SDL_keyboard.h new file mode 100644 index 000000000..7b59d24e5 --- /dev/null +++ b/alienblaster/project/jni/sdl/include/SDL_keyboard.h @@ -0,0 +1,135 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_keyboard.h + * Include file for SDL keyboard event handling + */ + +#ifndef _SDL_keyboard_h +#define _SDL_keyboard_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_keysym.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** Keysym structure + * + * - The scancode is hardware dependent, and should not be used by general + * applications. If no hardware scancode is available, it will be 0. + * + * - The 'unicode' translated character is only available when character + * translation is enabled by the SDL_EnableUNICODE() API. If non-zero, + * this is a UNICODE character corresponding to the keypress. If the + * high 9 bits of the character are 0, then this maps to the equivalent + * ASCII character: + * @code + * char ch; + * if ( (keysym.unicode & 0xFF80) == 0 ) { + * ch = keysym.unicode & 0x7F; + * } else { + * An international character.. + * } + * @endcode + */ +typedef struct SDL_keysym { + Uint8 scancode; /**< hardware specific scancode */ + SDLKey sym; /**< SDL virtual keysym */ + SDLMod mod; /**< current key modifiers */ + Uint16 unicode; /**< translated character */ +} SDL_keysym; + +/** This is the mask which refers to all hotkey bindings */ +#define SDL_ALL_HOTKEYS 0xFFFFFFFF + +/* Function prototypes */ +/** + * Enable/Disable UNICODE translation of keyboard input. + * + * This translation has some overhead, so translation defaults off. + * + * @param[in] enable + * If 'enable' is 1, translation is enabled. + * If 'enable' is 0, translation is disabled. + * If 'enable' is -1, the translation state is not changed. + * + * @return It returns the previous state of keyboard translation. + */ +extern DECLSPEC int SDLCALL SDL_EnableUNICODE(int enable); + +#define SDL_DEFAULT_REPEAT_DELAY 500 +#define SDL_DEFAULT_REPEAT_INTERVAL 30 +/** + * Enable/Disable keyboard repeat. Keyboard repeat defaults to off. + * + * @param[in] delay + * 'delay' is the initial delay in ms between the time when a key is + * pressed, and keyboard repeat begins. + * + * @param[in] interval + * 'interval' is the time in ms between keyboard repeat events. + * + * If 'delay' is set to 0, keyboard repeat is disabled. + */ +extern DECLSPEC int SDLCALL SDL_EnableKeyRepeat(int delay, int interval); +extern DECLSPEC void SDLCALL SDL_GetKeyRepeat(int *delay, int *interval); + +/** + * Get a snapshot of the current state of the keyboard. + * Returns an array of keystates, indexed by the SDLK_* syms. + * Usage: + * @code + * Uint8 *keystate = SDL_GetKeyState(NULL); + * if ( keystate[SDLK_RETURN] ) //... \ is pressed. + * @endcode + */ +extern DECLSPEC Uint8 * SDLCALL SDL_GetKeyState(int *numkeys); + +/** + * Get the current key modifier state + */ +extern DECLSPEC SDLMod SDLCALL SDL_GetModState(void); + +/** + * Set the current key modifier state. + * This does not change the keyboard state, only the key modifier flags. + */ +extern DECLSPEC void SDLCALL SDL_SetModState(SDLMod modstate); + +/** + * Get the name of an SDL virtual keysym + */ +extern DECLSPEC char * SDLCALL SDL_GetKeyName(SDLKey key); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_keyboard_h */ diff --git a/alienblaster/project/jni/sdl/include/SDL_keysym.h b/alienblaster/project/jni/sdl/include/SDL_keysym.h new file mode 100644 index 000000000..90101286e --- /dev/null +++ b/alienblaster/project/jni/sdl/include/SDL_keysym.h @@ -0,0 +1,326 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_keysym_h +#define _SDL_keysym_h + +/** What we really want is a mapping of every raw key on the keyboard. + * To support international keyboards, we use the range 0xA1 - 0xFF + * as international virtual keycodes. We'll follow in the footsteps of X11... + * @brief The names of the keys + */ +typedef enum { + /** @name ASCII mapped keysyms + * The keyboard syms have been cleverly chosen to map to ASCII + */ + /*@{*/ + SDLK_UNKNOWN = 0, + SDLK_FIRST = 0, + SDLK_BACKSPACE = 8, + SDLK_TAB = 9, + SDLK_CLEAR = 12, + SDLK_RETURN = 13, + SDLK_PAUSE = 19, + SDLK_ESCAPE = 27, + SDLK_SPACE = 32, + SDLK_EXCLAIM = 33, + SDLK_QUOTEDBL = 34, + SDLK_HASH = 35, + SDLK_DOLLAR = 36, + SDLK_AMPERSAND = 38, + SDLK_QUOTE = 39, + SDLK_LEFTPAREN = 40, + SDLK_RIGHTPAREN = 41, + SDLK_ASTERISK = 42, + SDLK_PLUS = 43, + SDLK_COMMA = 44, + SDLK_MINUS = 45, + SDLK_PERIOD = 46, + SDLK_SLASH = 47, + SDLK_0 = 48, + SDLK_1 = 49, + SDLK_2 = 50, + SDLK_3 = 51, + SDLK_4 = 52, + SDLK_5 = 53, + SDLK_6 = 54, + SDLK_7 = 55, + SDLK_8 = 56, + SDLK_9 = 57, + SDLK_COLON = 58, + SDLK_SEMICOLON = 59, + SDLK_LESS = 60, + SDLK_EQUALS = 61, + SDLK_GREATER = 62, + SDLK_QUESTION = 63, + SDLK_AT = 64, + /* + Skip uppercase letters + */ + SDLK_LEFTBRACKET = 91, + SDLK_BACKSLASH = 92, + SDLK_RIGHTBRACKET = 93, + SDLK_CARET = 94, + SDLK_UNDERSCORE = 95, + SDLK_BACKQUOTE = 96, + SDLK_a = 97, + SDLK_b = 98, + SDLK_c = 99, + SDLK_d = 100, + SDLK_e = 101, + SDLK_f = 102, + SDLK_g = 103, + SDLK_h = 104, + SDLK_i = 105, + SDLK_j = 106, + SDLK_k = 107, + SDLK_l = 108, + SDLK_m = 109, + SDLK_n = 110, + SDLK_o = 111, + SDLK_p = 112, + SDLK_q = 113, + SDLK_r = 114, + SDLK_s = 115, + SDLK_t = 116, + SDLK_u = 117, + SDLK_v = 118, + SDLK_w = 119, + SDLK_x = 120, + SDLK_y = 121, + SDLK_z = 122, + SDLK_DELETE = 127, + /* End of ASCII mapped keysyms */ + /*@}*/ + + /** @name International keyboard syms */ + /*@{*/ + SDLK_WORLD_0 = 160, /* 0xA0 */ + SDLK_WORLD_1 = 161, + SDLK_WORLD_2 = 162, + SDLK_WORLD_3 = 163, + SDLK_WORLD_4 = 164, + SDLK_WORLD_5 = 165, + SDLK_WORLD_6 = 166, + SDLK_WORLD_7 = 167, + SDLK_WORLD_8 = 168, + SDLK_WORLD_9 = 169, + SDLK_WORLD_10 = 170, + SDLK_WORLD_11 = 171, + SDLK_WORLD_12 = 172, + SDLK_WORLD_13 = 173, + SDLK_WORLD_14 = 174, + SDLK_WORLD_15 = 175, + SDLK_WORLD_16 = 176, + SDLK_WORLD_17 = 177, + SDLK_WORLD_18 = 178, + SDLK_WORLD_19 = 179, + SDLK_WORLD_20 = 180, + SDLK_WORLD_21 = 181, + SDLK_WORLD_22 = 182, + SDLK_WORLD_23 = 183, + SDLK_WORLD_24 = 184, + SDLK_WORLD_25 = 185, + SDLK_WORLD_26 = 186, + SDLK_WORLD_27 = 187, + SDLK_WORLD_28 = 188, + SDLK_WORLD_29 = 189, + SDLK_WORLD_30 = 190, + SDLK_WORLD_31 = 191, + SDLK_WORLD_32 = 192, + SDLK_WORLD_33 = 193, + SDLK_WORLD_34 = 194, + SDLK_WORLD_35 = 195, + SDLK_WORLD_36 = 196, + SDLK_WORLD_37 = 197, + SDLK_WORLD_38 = 198, + SDLK_WORLD_39 = 199, + SDLK_WORLD_40 = 200, + SDLK_WORLD_41 = 201, + SDLK_WORLD_42 = 202, + SDLK_WORLD_43 = 203, + SDLK_WORLD_44 = 204, + SDLK_WORLD_45 = 205, + SDLK_WORLD_46 = 206, + SDLK_WORLD_47 = 207, + SDLK_WORLD_48 = 208, + SDLK_WORLD_49 = 209, + SDLK_WORLD_50 = 210, + SDLK_WORLD_51 = 211, + SDLK_WORLD_52 = 212, + SDLK_WORLD_53 = 213, + SDLK_WORLD_54 = 214, + SDLK_WORLD_55 = 215, + SDLK_WORLD_56 = 216, + SDLK_WORLD_57 = 217, + SDLK_WORLD_58 = 218, + SDLK_WORLD_59 = 219, + SDLK_WORLD_60 = 220, + SDLK_WORLD_61 = 221, + SDLK_WORLD_62 = 222, + SDLK_WORLD_63 = 223, + SDLK_WORLD_64 = 224, + SDLK_WORLD_65 = 225, + SDLK_WORLD_66 = 226, + SDLK_WORLD_67 = 227, + SDLK_WORLD_68 = 228, + SDLK_WORLD_69 = 229, + SDLK_WORLD_70 = 230, + SDLK_WORLD_71 = 231, + SDLK_WORLD_72 = 232, + SDLK_WORLD_73 = 233, + SDLK_WORLD_74 = 234, + SDLK_WORLD_75 = 235, + SDLK_WORLD_76 = 236, + SDLK_WORLD_77 = 237, + SDLK_WORLD_78 = 238, + SDLK_WORLD_79 = 239, + SDLK_WORLD_80 = 240, + SDLK_WORLD_81 = 241, + SDLK_WORLD_82 = 242, + SDLK_WORLD_83 = 243, + SDLK_WORLD_84 = 244, + SDLK_WORLD_85 = 245, + SDLK_WORLD_86 = 246, + SDLK_WORLD_87 = 247, + SDLK_WORLD_88 = 248, + SDLK_WORLD_89 = 249, + SDLK_WORLD_90 = 250, + SDLK_WORLD_91 = 251, + SDLK_WORLD_92 = 252, + SDLK_WORLD_93 = 253, + SDLK_WORLD_94 = 254, + SDLK_WORLD_95 = 255, /* 0xFF */ + /*@}*/ + + /** @name Numeric keypad */ + /*@{*/ + SDLK_KP0 = 256, + SDLK_KP1 = 257, + SDLK_KP2 = 258, + SDLK_KP3 = 259, + SDLK_KP4 = 260, + SDLK_KP5 = 261, + SDLK_KP6 = 262, + SDLK_KP7 = 263, + SDLK_KP8 = 264, + SDLK_KP9 = 265, + SDLK_KP_PERIOD = 266, + SDLK_KP_DIVIDE = 267, + SDLK_KP_MULTIPLY = 268, + SDLK_KP_MINUS = 269, + SDLK_KP_PLUS = 270, + SDLK_KP_ENTER = 271, + SDLK_KP_EQUALS = 272, + /*@}*/ + + /** @name Arrows + Home/End pad */ + /*@{*/ + SDLK_UP = 273, + SDLK_DOWN = 274, + SDLK_RIGHT = 275, + SDLK_LEFT = 276, + SDLK_INSERT = 277, + SDLK_HOME = 278, + SDLK_END = 279, + SDLK_PAGEUP = 280, + SDLK_PAGEDOWN = 281, + /*@}*/ + + /** @name Function keys */ + /*@{*/ + SDLK_F1 = 282, + SDLK_F2 = 283, + SDLK_F3 = 284, + SDLK_F4 = 285, + SDLK_F5 = 286, + SDLK_F6 = 287, + SDLK_F7 = 288, + SDLK_F8 = 289, + SDLK_F9 = 290, + SDLK_F10 = 291, + SDLK_F11 = 292, + SDLK_F12 = 293, + SDLK_F13 = 294, + SDLK_F14 = 295, + SDLK_F15 = 296, + /*@}*/ + + /** @name Key state modifier keys */ + /*@{*/ + SDLK_NUMLOCK = 300, + SDLK_CAPSLOCK = 301, + SDLK_SCROLLOCK = 302, + SDLK_RSHIFT = 303, + SDLK_LSHIFT = 304, + SDLK_RCTRL = 305, + SDLK_LCTRL = 306, + SDLK_RALT = 307, + SDLK_LALT = 308, + SDLK_RMETA = 309, + SDLK_LMETA = 310, + SDLK_LSUPER = 311, /**< Left "Windows" key */ + SDLK_RSUPER = 312, /**< Right "Windows" key */ + SDLK_MODE = 313, /**< "Alt Gr" key */ + SDLK_COMPOSE = 314, /**< Multi-key compose key */ + /*@}*/ + + /** @name Miscellaneous function keys */ + /*@{*/ + SDLK_HELP = 315, + SDLK_PRINT = 316, + SDLK_SYSREQ = 317, + SDLK_BREAK = 318, + SDLK_MENU = 319, + SDLK_POWER = 320, /**< Power Macintosh power key */ + SDLK_EURO = 321, /**< Some european keyboards */ + SDLK_UNDO = 322, /**< Atari keyboard has Undo */ + /*@}*/ + + /* Add any other keys here */ + + SDLK_LAST +} SDLKey; + +/** Enumeration of valid key mods (possibly OR'd together) */ +typedef enum { + KMOD_NONE = 0x0000, + KMOD_LSHIFT= 0x0001, + KMOD_RSHIFT= 0x0002, + KMOD_LCTRL = 0x0040, + KMOD_RCTRL = 0x0080, + KMOD_LALT = 0x0100, + KMOD_RALT = 0x0200, + KMOD_LMETA = 0x0400, + KMOD_RMETA = 0x0800, + KMOD_NUM = 0x1000, + KMOD_CAPS = 0x2000, + KMOD_MODE = 0x4000, + KMOD_RESERVED = 0x8000 +} SDLMod; + +#define KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL) +#define KMOD_SHIFT (KMOD_LSHIFT|KMOD_RSHIFT) +#define KMOD_ALT (KMOD_LALT|KMOD_RALT) +#define KMOD_META (KMOD_LMETA|KMOD_RMETA) + +#endif /* _SDL_keysym_h */ diff --git a/alienblaster/project/jni/sdl/include/SDL_loadso.h b/alienblaster/project/jni/sdl/include/SDL_loadso.h new file mode 100644 index 000000000..45a17f9f4 --- /dev/null +++ b/alienblaster/project/jni/sdl/include/SDL_loadso.h @@ -0,0 +1,78 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_loadso.h + * System dependent library loading routines + */ + +/** @file SDL_loadso.h + * Some things to keep in mind: + * - These functions only work on C function names. Other languages may + * have name mangling and intrinsic language support that varies from + * compiler to compiler. + * - Make sure you declare your function pointers with the same calling + * convention as the actual library function. Your code will crash + * mysteriously if you do not do this. + * - Avoid namespace collisions. If you load a symbol from the library, + * it is not defined whether or not it goes into the global symbol + * namespace for the application. If it does and it conflicts with + * symbols in your code or other shared libraries, you will not get + * the results you expect. :) + */ + + +#ifndef _SDL_loadso_h +#define _SDL_loadso_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * This function dynamically loads a shared object and returns a pointer + * to the object handle (or NULL if there was an error). + * The 'sofile' parameter is a system dependent name of the object file. + */ +extern DECLSPEC void * SDLCALL SDL_LoadObject(const char *sofile); + +/** + * Given an object handle, this function looks up the address of the + * named function in the shared object and returns it. This address + * is no longer valid after calling SDL_UnloadObject(). + */ +extern DECLSPEC void * SDLCALL SDL_LoadFunction(void *handle, const char *name); + +/** Unload a shared object from memory */ +extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_loadso_h */ diff --git a/alienblaster/project/jni/sdl/include/SDL_main.h b/alienblaster/project/jni/sdl/include/SDL_main.h new file mode 100644 index 000000000..b7f6b2c82 --- /dev/null +++ b/alienblaster/project/jni/sdl/include/SDL_main.h @@ -0,0 +1,106 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_main_h +#define _SDL_main_h + +#include "SDL_stdinc.h" + +/** @file SDL_main.h + * Redefine main() on Win32 and MacOS so that it is called by winmain.c + */ + +#if defined(__WIN32__) || \ + (defined(__MWERKS__) && !defined(__BEOS__)) || \ + defined(__MACOS__) || defined(__MACOSX__) || \ + defined(__SYMBIAN32__) || defined(QWS) + +#ifdef __cplusplus +#define C_LINKAGE "C" +#else +#define C_LINKAGE +#endif /* __cplusplus */ + +/** The application's main() function must be called with C linkage, + * and should be declared like this: + * @code + * #ifdef __cplusplus + * extern "C" + * #endif + * int main(int argc, char *argv[]) + * { + * } + * @endcode + */ +#define main SDL_main + +/** The prototype for the application's main() function */ +extern C_LINKAGE int SDL_main(int argc, char *argv[]); + + +/** @name From the SDL library code -- needed for registering the app on Win32 */ +/*@{*/ +#ifdef __WIN32__ + +#include "begin_code.h" +#ifdef __cplusplus +extern "C" { +#endif + +/** This should be called from your WinMain() function, if any */ +extern DECLSPEC void SDLCALL SDL_SetModuleHandle(void *hInst); +/** This can also be called, but is no longer necessary */ +extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style, void *hInst); +/** This can also be called, but is no longer necessary (SDL_Quit calls it) */ +extern DECLSPEC void SDLCALL SDL_UnregisterApp(void); +#ifdef __cplusplus +} +#endif +#include "close_code.h" +#endif +/*@}*/ + +/** @name From the SDL library code -- needed for registering QuickDraw on MacOS */ +/*@{*/ +#if defined(__MACOS__) + +#include "begin_code.h" +#ifdef __cplusplus +extern "C" { +#endif + +/** Forward declaration so we don't need to include QuickDraw.h */ +struct QDGlobals; + +/** This should be called from your main() function, if any */ +extern DECLSPEC void SDLCALL SDL_InitQuickDraw(struct QDGlobals *the_qd); + +#ifdef __cplusplus +} +#endif +#include "close_code.h" +#endif +/*@}*/ + +#endif /* Need to redefine main()? */ + +#endif /* _SDL_main_h */ diff --git a/alienblaster/project/jni/sdl/include/SDL_mouse.h b/alienblaster/project/jni/sdl/include/SDL_mouse.h new file mode 100644 index 000000000..a573f04ee --- /dev/null +++ b/alienblaster/project/jni/sdl/include/SDL_mouse.h @@ -0,0 +1,143 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_mouse.h + * Include file for SDL mouse event handling + */ + +#ifndef _SDL_mouse_h +#define _SDL_mouse_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_video.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct WMcursor WMcursor; /**< Implementation dependent */ +typedef struct SDL_Cursor { + SDL_Rect area; /**< The area of the mouse cursor */ + Sint16 hot_x, hot_y; /**< The "tip" of the cursor */ + Uint8 *data; /**< B/W cursor data */ + Uint8 *mask; /**< B/W cursor mask */ + Uint8 *save[2]; /**< Place to save cursor area */ + WMcursor *wm_cursor; /**< Window-manager cursor */ +} SDL_Cursor; + +/* Function prototypes */ +/** + * Retrieve the current state of the mouse. + * The current button state is returned as a button bitmask, which can + * be tested using the SDL_BUTTON(X) macros, and x and y are set to the + * current mouse cursor position. You can pass NULL for either x or y. + */ +extern DECLSPEC Uint8 SDLCALL SDL_GetMouseState(int *x, int *y); + +/** + * Retrieve the current state of the mouse. + * The current button state is returned as a button bitmask, which can + * be tested using the SDL_BUTTON(X) macros, and x and y are set to the + * mouse deltas since the last call to SDL_GetRelativeMouseState(). + */ +extern DECLSPEC Uint8 SDLCALL SDL_GetRelativeMouseState(int *x, int *y); + +/** + * Set the position of the mouse cursor (generates a mouse motion event) + */ +extern DECLSPEC void SDLCALL SDL_WarpMouse(Uint16 x, Uint16 y); + +/** + * Create a cursor using the specified data and mask (in MSB format). + * The cursor width must be a multiple of 8 bits. + * + * The cursor is created in black and white according to the following: + * data mask resulting pixel on screen + * 0 1 White + * 1 1 Black + * 0 0 Transparent + * 1 0 Inverted color if possible, black if not. + * + * Cursors created with this function must be freed with SDL_FreeCursor(). + */ +extern DECLSPEC SDL_Cursor * SDLCALL SDL_CreateCursor + (Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y); + +/** + * Set the currently active cursor to the specified one. + * If the cursor is currently visible, the change will be immediately + * represented on the display. + */ +extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor *cursor); + +/** + * Returns the currently active cursor. + */ +extern DECLSPEC SDL_Cursor * SDLCALL SDL_GetCursor(void); + +/** + * Deallocates a cursor created with SDL_CreateCursor(). + */ +extern DECLSPEC void SDLCALL SDL_FreeCursor(SDL_Cursor *cursor); + +/** + * Toggle whether or not the cursor is shown on the screen. + * The cursor start off displayed, but can be turned off. + * SDL_ShowCursor() returns 1 if the cursor was being displayed + * before the call, or 0 if it was not. You can query the current + * state by passing a 'toggle' value of -1. + */ +extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle); + +/*@{*/ +/** Used as a mask when testing buttons in buttonstate + * Button 1: Left mouse button + * Button 2: Middle mouse button + * Button 3: Right mouse button + * Button 4: Mouse wheel up (may also be a real button) + * Button 5: Mouse wheel down (may also be a real button) + */ +#define SDL_BUTTON(X) (1 << ((X)-1)) +#define SDL_BUTTON_LEFT 1 +#define SDL_BUTTON_MIDDLE 2 +#define SDL_BUTTON_RIGHT 3 +#define SDL_BUTTON_WHEELUP 4 +#define SDL_BUTTON_WHEELDOWN 5 +#define SDL_BUTTON_X1 6 +#define SDL_BUTTON_X2 7 +#define SDL_BUTTON_LMASK SDL_BUTTON(SDL_BUTTON_LEFT) +#define SDL_BUTTON_MMASK SDL_BUTTON(SDL_BUTTON_MIDDLE) +#define SDL_BUTTON_RMASK SDL_BUTTON(SDL_BUTTON_RIGHT) +#define SDL_BUTTON_X1MASK SDL_BUTTON(SDL_BUTTON_X1) +#define SDL_BUTTON_X2MASK SDL_BUTTON(SDL_BUTTON_X2) +/*@}*/ + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_mouse_h */ diff --git a/alienblaster/project/jni/sdl/include/SDL_mutex.h b/alienblaster/project/jni/sdl/include/SDL_mutex.h new file mode 100644 index 000000000..920971dfa --- /dev/null +++ b/alienblaster/project/jni/sdl/include/SDL_mutex.h @@ -0,0 +1,177 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_mutex_h +#define _SDL_mutex_h + +/** @file SDL_mutex.h + * Functions to provide thread synchronization primitives + * + * @note These are independent of the other SDL routines. + */ + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** Synchronization functions which can time out return this value + * if they time out. + */ +#define SDL_MUTEX_TIMEDOUT 1 + +/** This is the timeout value which corresponds to never time out */ +#define SDL_MUTEX_MAXWAIT (~(Uint32)0) + + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** @name Mutex functions */ /*@{*/ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/** The SDL mutex structure, defined in SDL_mutex.c */ +struct SDL_mutex; +typedef struct SDL_mutex SDL_mutex; + +/** Create a mutex, initialized unlocked */ +extern DECLSPEC SDL_mutex * SDLCALL SDL_CreateMutex(void); + +#define SDL_LockMutex(m) SDL_mutexP(m) +/** Lock the mutex + * @return 0, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_mutexP(SDL_mutex *mutex); + +#define SDL_UnlockMutex(m) SDL_mutexV(m) +/** Unlock the mutex + * @return 0, or -1 on error + * + * It is an error to unlock a mutex that has not been locked by + * the current thread, and doing so results in undefined behavior. + */ +extern DECLSPEC int SDLCALL SDL_mutexV(SDL_mutex *mutex); + +/** Destroy a mutex */ +extern DECLSPEC void SDLCALL SDL_DestroyMutex(SDL_mutex *mutex); + +/*@}*/ + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** @name Semaphore functions */ /*@{*/ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/** The SDL semaphore structure, defined in SDL_sem.c */ +struct SDL_semaphore; +typedef struct SDL_semaphore SDL_sem; + +/** Create a semaphore, initialized with value, returns NULL on failure. */ +extern DECLSPEC SDL_sem * SDLCALL SDL_CreateSemaphore(Uint32 initial_value); + +/** Destroy a semaphore */ +extern DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_sem *sem); + +/** + * This function suspends the calling thread until the semaphore pointed + * to by sem has a positive count. It then atomically decreases the semaphore + * count. + */ +extern DECLSPEC int SDLCALL SDL_SemWait(SDL_sem *sem); + +/** Non-blocking variant of SDL_SemWait(). + * @return 0 if the wait succeeds, + * SDL_MUTEX_TIMEDOUT if the wait would block, and -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_SemTryWait(SDL_sem *sem); + +/** Variant of SDL_SemWait() with a timeout in milliseconds, returns 0 if + * the wait succeeds, SDL_MUTEX_TIMEDOUT if the wait does not succeed in + * the allotted time, and -1 on error. + * + * On some platforms this function is implemented by looping with a delay + * of 1 ms, and so should be avoided if possible. + */ +extern DECLSPEC int SDLCALL SDL_SemWaitTimeout(SDL_sem *sem, Uint32 ms); + +/** Atomically increases the semaphore's count (not blocking). + * @return 0, or -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_SemPost(SDL_sem *sem); + +/** Returns the current count of the semaphore */ +extern DECLSPEC Uint32 SDLCALL SDL_SemValue(SDL_sem *sem); + +/*@}*/ + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** @name Condition_variable_functions */ /*@{*/ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/*@{*/ +/** The SDL condition variable structure, defined in SDL_cond.c */ +struct SDL_cond; +typedef struct SDL_cond SDL_cond; +/*@}*/ + +/** Create a condition variable */ +extern DECLSPEC SDL_cond * SDLCALL SDL_CreateCond(void); + +/** Destroy a condition variable */ +extern DECLSPEC void SDLCALL SDL_DestroyCond(SDL_cond *cond); + +/** Restart one of the threads that are waiting on the condition variable, + * @return 0 or -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_CondSignal(SDL_cond *cond); + +/** Restart all threads that are waiting on the condition variable, + * @return 0 or -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_CondBroadcast(SDL_cond *cond); + +/** Wait on the condition variable, unlocking the provided mutex. + * The mutex must be locked before entering this function! + * The mutex is re-locked once the condition variable is signaled. + * @return 0 when it is signaled, or -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_CondWait(SDL_cond *cond, SDL_mutex *mut); + +/** Waits for at most 'ms' milliseconds, and returns 0 if the condition + * variable is signaled, SDL_MUTEX_TIMEDOUT if the condition is not + * signaled in the allotted time, and -1 on error. + * On some platforms this function is implemented by looping with a delay + * of 1 ms, and so should be avoided if possible. + */ +extern DECLSPEC int SDLCALL SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms); + +/*@}*/ + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_mutex_h */ + diff --git a/alienblaster/project/jni/sdl/include/SDL_name.h b/alienblaster/project/jni/sdl/include/SDL_name.h new file mode 100644 index 000000000..511619af5 --- /dev/null +++ b/alienblaster/project/jni/sdl/include/SDL_name.h @@ -0,0 +1,11 @@ + +#ifndef _SDLname_h_ +#define _SDLname_h_ + +#if defined(__STDC__) || defined(__cplusplus) +#define NeedFunctionPrototypes 1 +#endif + +#define SDL_NAME(X) SDL_##X + +#endif /* _SDLname_h_ */ diff --git a/alienblaster/project/jni/sdl/include/SDL_opengl.h b/alienblaster/project/jni/sdl/include/SDL_opengl.h new file mode 100644 index 000000000..667bb3f54 --- /dev/null +++ b/alienblaster/project/jni/sdl/include/SDL_opengl.h @@ -0,0 +1,6559 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_opengl.h + * This is a simple file to encapsulate the OpenGL API headers + */ + +#include "SDL_config.h" + +#ifdef __WIN32__ +#define WIN32_LEAN_AND_MEAN +#ifndef NOMINMAX +#define NOMINMAX /* Don't defined min() and max() */ +#endif +#include +#endif +#ifndef NO_SDL_GLEXT +#define __glext_h_ /* Don't let gl.h include glext.h */ +#endif +#if defined(__MACOSX__) +#include /* Header File For The OpenGL Library */ +#include /* Header File For The GLU Library */ +#elif defined(__MACOS__) +#include /* Header File For The OpenGL Library */ +#include /* Header File For The GLU Library */ +#elif defined(ANDROID) +#include /* Header File For The OpenGL Library */ +#include /* No GLU on Android */ +#else +#include /* Header File For The OpenGL Library */ +#include /* Header File For The GLU Library */ +#endif +#ifndef NO_SDL_GLEXT +#undef __glext_h_ +#endif + +/** @name GLext.h + * This file taken from "GLext.h" from the Jeff Molofee OpenGL tutorials. + * It is included here because glext.h is not available on some systems. + * If you don't want this version included, simply define "NO_SDL_GLEXT" + */ +/*@{*/ +#ifndef NO_SDL_GLEXT +#if !defined(__glext_h_) && !defined(GL_GLEXT_LEGACY) +#define __glext_h_ + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** License Applicability. Except to the extent portions of this file are +** made subject to an alternative license as permitted in the SGI Free +** Software License B, Version 1.1 (the "License"), the contents of this +** file are subject only to the provisions of the License. You may not use +** this file except in compliance with the License. You may obtain a copy +** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 +** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: +** +** http://oss.sgi.com/projects/FreeB +** +** Note that, as provided in the License, the Software is distributed on an +** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS +** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND +** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A +** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. +** +** Original Code. The Original Code is: OpenGL Sample Implementation, +** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, +** Inc. The Original Code is Copyright (c) 1991-2004 Silicon Graphics, Inc. +** Copyright in any portions created by third parties is as indicated +** elsewhere herein. All Rights Reserved. +** +** Additional Notice Provisions: This software was created using the +** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has +** not been independently verified as being compliant with the OpenGL(R) +** version 1.2.1 Specification. +*/ + +#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) +#define WIN32_LEAN_AND_MEAN 1 +#include +#endif + +#ifndef APIENTRY +#define APIENTRY +#endif +#ifndef APIENTRYP +#define APIENTRYP APIENTRY * +#endif +#ifndef GLAPI +#define GLAPI extern +#endif + +/*************************************************************/ + +/* Header file version number, required by OpenGL ABI for Linux */ +/* glext.h last updated 2005/06/20 */ +/* Current version at http://oss.sgi.com/projects/ogl-sample/registry/ */ +#define GL_GLEXT_VERSION 29 + +#ifndef GL_VERSION_1_2 +#define GL_UNSIGNED_BYTE_3_3_2 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2 0x8036 +#define GL_RESCALE_NORMAL 0x803A +#define GL_TEXTURE_BINDING_3D 0x806A +#define GL_PACK_SKIP_IMAGES 0x806B +#define GL_PACK_IMAGE_HEIGHT 0x806C +#define GL_UNPACK_SKIP_IMAGES 0x806D +#define GL_UNPACK_IMAGE_HEIGHT 0x806E +#define GL_TEXTURE_3D 0x806F +#define GL_PROXY_TEXTURE_3D 0x8070 +#define GL_TEXTURE_DEPTH 0x8071 +#define GL_TEXTURE_WRAP_R 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE 0x8073 +#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 +#define GL_UNSIGNED_SHORT_5_6_5 0x8363 +#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 +#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 +#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 +#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 +#define GL_BGR 0x80E0 +#define GL_BGRA 0x80E1 +#define GL_MAX_ELEMENTS_VERTICES 0x80E8 +#define GL_MAX_ELEMENTS_INDICES 0x80E9 +#define GL_CLAMP_TO_EDGE 0x812F +#define GL_TEXTURE_MIN_LOD 0x813A +#define GL_TEXTURE_MAX_LOD 0x813B +#define GL_TEXTURE_BASE_LEVEL 0x813C +#define GL_TEXTURE_MAX_LEVEL 0x813D +#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 +#define GL_SINGLE_COLOR 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR 0x81FA +#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 +#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 +#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_ALIASED_POINT_SIZE_RANGE 0x846D +#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E +#endif + +#ifndef GL_ARB_imaging +#define GL_CONSTANT_COLOR 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 +#define GL_CONSTANT_ALPHA 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 +#define GL_BLEND_COLOR 0x8005 +#define GL_FUNC_ADD 0x8006 +#define GL_MIN 0x8007 +#define GL_MAX 0x8008 +#define GL_BLEND_EQUATION 0x8009 +#define GL_FUNC_SUBTRACT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT 0x800B +#define GL_CONVOLUTION_1D 0x8010 +#define GL_CONVOLUTION_2D 0x8011 +#define GL_SEPARABLE_2D 0x8012 +#define GL_CONVOLUTION_BORDER_MODE 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS 0x8015 +#define GL_REDUCE 0x8016 +#define GL_CONVOLUTION_FORMAT 0x8017 +#define GL_CONVOLUTION_WIDTH 0x8018 +#define GL_CONVOLUTION_HEIGHT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 +#define GL_HISTOGRAM 0x8024 +#define GL_PROXY_HISTOGRAM 0x8025 +#define GL_HISTOGRAM_WIDTH 0x8026 +#define GL_HISTOGRAM_FORMAT 0x8027 +#define GL_HISTOGRAM_RED_SIZE 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C +#define GL_HISTOGRAM_SINK 0x802D +#define GL_MINMAX 0x802E +#define GL_MINMAX_FORMAT 0x802F +#define GL_MINMAX_SINK 0x8030 +#define GL_TABLE_TOO_LARGE 0x8031 +#define GL_COLOR_MATRIX 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB +#define GL_COLOR_TABLE 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 +#define GL_PROXY_COLOR_TABLE 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 +#define GL_COLOR_TABLE_SCALE 0x80D6 +#define GL_COLOR_TABLE_BIAS 0x80D7 +#define GL_COLOR_TABLE_FORMAT 0x80D8 +#define GL_COLOR_TABLE_WIDTH 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF +#define GL_CONSTANT_BORDER 0x8151 +#define GL_REPLICATE_BORDER 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR 0x8154 +#endif + +#ifndef GL_VERSION_1_3 +#define GL_TEXTURE0 0x84C0 +#define GL_TEXTURE1 0x84C1 +#define GL_TEXTURE2 0x84C2 +#define GL_TEXTURE3 0x84C3 +#define GL_TEXTURE4 0x84C4 +#define GL_TEXTURE5 0x84C5 +#define GL_TEXTURE6 0x84C6 +#define GL_TEXTURE7 0x84C7 +#define GL_TEXTURE8 0x84C8 +#define GL_TEXTURE9 0x84C9 +#define GL_TEXTURE10 0x84CA +#define GL_TEXTURE11 0x84CB +#define GL_TEXTURE12 0x84CC +#define GL_TEXTURE13 0x84CD +#define GL_TEXTURE14 0x84CE +#define GL_TEXTURE15 0x84CF +#define GL_TEXTURE16 0x84D0 +#define GL_TEXTURE17 0x84D1 +#define GL_TEXTURE18 0x84D2 +#define GL_TEXTURE19 0x84D3 +#define GL_TEXTURE20 0x84D4 +#define GL_TEXTURE21 0x84D5 +#define GL_TEXTURE22 0x84D6 +#define GL_TEXTURE23 0x84D7 +#define GL_TEXTURE24 0x84D8 +#define GL_TEXTURE25 0x84D9 +#define GL_TEXTURE26 0x84DA +#define GL_TEXTURE27 0x84DB +#define GL_TEXTURE28 0x84DC +#define GL_TEXTURE29 0x84DD +#define GL_TEXTURE30 0x84DE +#define GL_TEXTURE31 0x84DF +#define GL_ACTIVE_TEXTURE 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 +#define GL_MAX_TEXTURE_UNITS 0x84E2 +#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 +#define GL_MULTISAMPLE 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE 0x809F +#define GL_SAMPLE_COVERAGE 0x80A0 +#define GL_SAMPLE_BUFFERS 0x80A8 +#define GL_SAMPLES 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT 0x80AB +#define GL_MULTISAMPLE_BIT 0x20000000 +#define GL_NORMAL_MAP 0x8511 +#define GL_REFLECTION_MAP 0x8512 +#define GL_TEXTURE_CUBE_MAP 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C +#define GL_COMPRESSED_ALPHA 0x84E9 +#define GL_COMPRESSED_LUMINANCE 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB +#define GL_COMPRESSED_INTENSITY 0x84EC +#define GL_COMPRESSED_RGB 0x84ED +#define GL_COMPRESSED_RGBA 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 +#define GL_TEXTURE_COMPRESSED 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 +#define GL_CLAMP_TO_BORDER 0x812D +#define GL_COMBINE 0x8570 +#define GL_COMBINE_RGB 0x8571 +#define GL_COMBINE_ALPHA 0x8572 +#define GL_SOURCE0_RGB 0x8580 +#define GL_SOURCE1_RGB 0x8581 +#define GL_SOURCE2_RGB 0x8582 +#define GL_SOURCE0_ALPHA 0x8588 +#define GL_SOURCE1_ALPHA 0x8589 +#define GL_SOURCE2_ALPHA 0x858A +#define GL_OPERAND0_RGB 0x8590 +#define GL_OPERAND1_RGB 0x8591 +#define GL_OPERAND2_RGB 0x8592 +#define GL_OPERAND0_ALPHA 0x8598 +#define GL_OPERAND1_ALPHA 0x8599 +#define GL_OPERAND2_ALPHA 0x859A +#define GL_RGB_SCALE 0x8573 +#define GL_ADD_SIGNED 0x8574 +#define GL_INTERPOLATE 0x8575 +#define GL_SUBTRACT 0x84E7 +#define GL_CONSTANT 0x8576 +#define GL_PRIMARY_COLOR 0x8577 +#define GL_PREVIOUS 0x8578 +#define GL_DOT3_RGB 0x86AE +#define GL_DOT3_RGBA 0x86AF +#endif + +#ifndef GL_VERSION_1_4 +#define GL_BLEND_DST_RGB 0x80C8 +#define GL_BLEND_SRC_RGB 0x80C9 +#define GL_BLEND_DST_ALPHA 0x80CA +#define GL_BLEND_SRC_ALPHA 0x80CB +#define GL_POINT_SIZE_MIN 0x8126 +#define GL_POINT_SIZE_MAX 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 +#define GL_POINT_DISTANCE_ATTENUATION 0x8129 +#define GL_GENERATE_MIPMAP 0x8191 +#define GL_GENERATE_MIPMAP_HINT 0x8192 +#define GL_DEPTH_COMPONENT16 0x81A5 +#define GL_DEPTH_COMPONENT24 0x81A6 +#define GL_DEPTH_COMPONENT32 0x81A7 +#define GL_MIRRORED_REPEAT 0x8370 +#define GL_FOG_COORDINATE_SOURCE 0x8450 +#define GL_FOG_COORDINATE 0x8451 +#define GL_FRAGMENT_DEPTH 0x8452 +#define GL_CURRENT_FOG_COORDINATE 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456 +#define GL_FOG_COORDINATE_ARRAY 0x8457 +#define GL_COLOR_SUM 0x8458 +#define GL_CURRENT_SECONDARY_COLOR 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D +#define GL_SECONDARY_COLOR_ARRAY 0x845E +#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD +#define GL_TEXTURE_FILTER_CONTROL 0x8500 +#define GL_TEXTURE_LOD_BIAS 0x8501 +#define GL_INCR_WRAP 0x8507 +#define GL_DECR_WRAP 0x8508 +#define GL_TEXTURE_DEPTH_SIZE 0x884A +#define GL_DEPTH_TEXTURE_MODE 0x884B +#define GL_TEXTURE_COMPARE_MODE 0x884C +#define GL_TEXTURE_COMPARE_FUNC 0x884D +#define GL_COMPARE_R_TO_TEXTURE 0x884E +#endif + +#ifndef GL_VERSION_1_5 +#define GL_BUFFER_SIZE 0x8764 +#define GL_BUFFER_USAGE 0x8765 +#define GL_QUERY_COUNTER_BITS 0x8864 +#define GL_CURRENT_QUERY 0x8865 +#define GL_QUERY_RESULT 0x8866 +#define GL_QUERY_RESULT_AVAILABLE 0x8867 +#define GL_ARRAY_BUFFER 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER 0x8893 +#define GL_ARRAY_BUFFER_BINDING 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 +#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F +#define GL_READ_ONLY 0x88B8 +#define GL_WRITE_ONLY 0x88B9 +#define GL_READ_WRITE 0x88BA +#define GL_BUFFER_ACCESS 0x88BB +#define GL_BUFFER_MAPPED 0x88BC +#define GL_BUFFER_MAP_POINTER 0x88BD +#define GL_STREAM_DRAW 0x88E0 +#define GL_STREAM_READ 0x88E1 +#define GL_STREAM_COPY 0x88E2 +#define GL_STATIC_DRAW 0x88E4 +#define GL_STATIC_READ 0x88E5 +#define GL_STATIC_COPY 0x88E6 +#define GL_DYNAMIC_DRAW 0x88E8 +#define GL_DYNAMIC_READ 0x88E9 +#define GL_DYNAMIC_COPY 0x88EA +#define GL_SAMPLES_PASSED 0x8914 +#define GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE +#define GL_FOG_COORD GL_FOG_COORDINATE +#define GL_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE +#define GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE +#define GL_FOG_COORD_ARRAY_STRIDE GL_FOG_COORDINATE_ARRAY_STRIDE +#define GL_FOG_COORD_ARRAY_POINTER GL_FOG_COORDINATE_ARRAY_POINTER +#define GL_FOG_COORD_ARRAY GL_FOG_COORDINATE_ARRAY +#define GL_FOG_COORD_ARRAY_BUFFER_BINDING GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING +#define GL_SRC0_RGB GL_SOURCE0_RGB +#define GL_SRC1_RGB GL_SOURCE1_RGB +#define GL_SRC2_RGB GL_SOURCE2_RGB +#define GL_SRC0_ALPHA GL_SOURCE0_ALPHA +#define GL_SRC1_ALPHA GL_SOURCE1_ALPHA +#define GL_SRC2_ALPHA GL_SOURCE2_ALPHA +#endif + +#ifndef GL_VERSION_2_0 +#define GL_BLEND_EQUATION_RGB GL_BLEND_EQUATION +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 +#define GL_CURRENT_VERTEX_ATTRIB 0x8626 +#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 +#define GL_STENCIL_BACK_FUNC 0x8800 +#define GL_STENCIL_BACK_FAIL 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 +#define GL_MAX_DRAW_BUFFERS 0x8824 +#define GL_DRAW_BUFFER0 0x8825 +#define GL_DRAW_BUFFER1 0x8826 +#define GL_DRAW_BUFFER2 0x8827 +#define GL_DRAW_BUFFER3 0x8828 +#define GL_DRAW_BUFFER4 0x8829 +#define GL_DRAW_BUFFER5 0x882A +#define GL_DRAW_BUFFER6 0x882B +#define GL_DRAW_BUFFER7 0x882C +#define GL_DRAW_BUFFER8 0x882D +#define GL_DRAW_BUFFER9 0x882E +#define GL_DRAW_BUFFER10 0x882F +#define GL_DRAW_BUFFER11 0x8830 +#define GL_DRAW_BUFFER12 0x8831 +#define GL_DRAW_BUFFER13 0x8832 +#define GL_DRAW_BUFFER14 0x8833 +#define GL_DRAW_BUFFER15 0x8834 +#define GL_BLEND_EQUATION_ALPHA 0x883D +#define GL_POINT_SPRITE 0x8861 +#define GL_COORD_REPLACE 0x8862 +#define GL_MAX_VERTEX_ATTRIBS 0x8869 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A +#define GL_MAX_TEXTURE_COORDS 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 +#define GL_FRAGMENT_SHADER 0x8B30 +#define GL_VERTEX_SHADER 0x8B31 +#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49 +#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A +#define GL_MAX_VARYING_FLOATS 0x8B4B +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D +#define GL_SHADER_TYPE 0x8B4F +#define GL_FLOAT_VEC2 0x8B50 +#define GL_FLOAT_VEC3 0x8B51 +#define GL_FLOAT_VEC4 0x8B52 +#define GL_INT_VEC2 0x8B53 +#define GL_INT_VEC3 0x8B54 +#define GL_INT_VEC4 0x8B55 +#define GL_BOOL 0x8B56 +#define GL_BOOL_VEC2 0x8B57 +#define GL_BOOL_VEC3 0x8B58 +#define GL_BOOL_VEC4 0x8B59 +#define GL_FLOAT_MAT2 0x8B5A +#define GL_FLOAT_MAT3 0x8B5B +#define GL_FLOAT_MAT4 0x8B5C +#define GL_SAMPLER_1D 0x8B5D +#define GL_SAMPLER_2D 0x8B5E +#define GL_SAMPLER_3D 0x8B5F +#define GL_SAMPLER_CUBE 0x8B60 +#define GL_SAMPLER_1D_SHADOW 0x8B61 +#define GL_SAMPLER_2D_SHADOW 0x8B62 +#define GL_DELETE_STATUS 0x8B80 +#define GL_COMPILE_STATUS 0x8B81 +#define GL_LINK_STATUS 0x8B82 +#define GL_VALIDATE_STATUS 0x8B83 +#define GL_INFO_LOG_LENGTH 0x8B84 +#define GL_ATTACHED_SHADERS 0x8B85 +#define GL_ACTIVE_UNIFORMS 0x8B86 +#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 +#define GL_SHADER_SOURCE_LENGTH 0x8B88 +#define GL_ACTIVE_ATTRIBUTES 0x8B89 +#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B +#define GL_SHADING_LANGUAGE_VERSION 0x8B8C +#define GL_CURRENT_PROGRAM 0x8B8D +#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0 +#define GL_LOWER_LEFT 0x8CA1 +#define GL_UPPER_LEFT 0x8CA2 +#define GL_STENCIL_BACK_REF 0x8CA3 +#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 +#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 +#endif + +#ifndef GL_ARB_multitexture +#define GL_TEXTURE0_ARB 0x84C0 +#define GL_TEXTURE1_ARB 0x84C1 +#define GL_TEXTURE2_ARB 0x84C2 +#define GL_TEXTURE3_ARB 0x84C3 +#define GL_TEXTURE4_ARB 0x84C4 +#define GL_TEXTURE5_ARB 0x84C5 +#define GL_TEXTURE6_ARB 0x84C6 +#define GL_TEXTURE7_ARB 0x84C7 +#define GL_TEXTURE8_ARB 0x84C8 +#define GL_TEXTURE9_ARB 0x84C9 +#define GL_TEXTURE10_ARB 0x84CA +#define GL_TEXTURE11_ARB 0x84CB +#define GL_TEXTURE12_ARB 0x84CC +#define GL_TEXTURE13_ARB 0x84CD +#define GL_TEXTURE14_ARB 0x84CE +#define GL_TEXTURE15_ARB 0x84CF +#define GL_TEXTURE16_ARB 0x84D0 +#define GL_TEXTURE17_ARB 0x84D1 +#define GL_TEXTURE18_ARB 0x84D2 +#define GL_TEXTURE19_ARB 0x84D3 +#define GL_TEXTURE20_ARB 0x84D4 +#define GL_TEXTURE21_ARB 0x84D5 +#define GL_TEXTURE22_ARB 0x84D6 +#define GL_TEXTURE23_ARB 0x84D7 +#define GL_TEXTURE24_ARB 0x84D8 +#define GL_TEXTURE25_ARB 0x84D9 +#define GL_TEXTURE26_ARB 0x84DA +#define GL_TEXTURE27_ARB 0x84DB +#define GL_TEXTURE28_ARB 0x84DC +#define GL_TEXTURE29_ARB 0x84DD +#define GL_TEXTURE30_ARB 0x84DE +#define GL_TEXTURE31_ARB 0x84DF +#define GL_ACTIVE_TEXTURE_ARB 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 +#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 +#endif + +#ifndef GL_ARB_transpose_matrix +#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 +#endif + +#ifndef GL_ARB_multisample +#define GL_MULTISAMPLE_ARB 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F +#define GL_SAMPLE_COVERAGE_ARB 0x80A0 +#define GL_SAMPLE_BUFFERS_ARB 0x80A8 +#define GL_SAMPLES_ARB 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB +#define GL_MULTISAMPLE_BIT_ARB 0x20000000 +#endif + +#ifndef GL_ARB_texture_env_add +#endif + +#ifndef GL_ARB_texture_cube_map +#define GL_NORMAL_MAP_ARB 0x8511 +#define GL_REFLECTION_MAP_ARB 0x8512 +#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C +#endif + +#ifndef GL_ARB_texture_compression +#define GL_COMPRESSED_ALPHA_ARB 0x84E9 +#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB +#define GL_COMPRESSED_INTENSITY_ARB 0x84EC +#define GL_COMPRESSED_RGB_ARB 0x84ED +#define GL_COMPRESSED_RGBA_ARB 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 +#define GL_TEXTURE_COMPRESSED_ARB 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 +#endif + +#ifndef GL_ARB_texture_border_clamp +#define GL_CLAMP_TO_BORDER_ARB 0x812D +#endif + +#ifndef GL_ARB_point_parameters +#define GL_POINT_SIZE_MIN_ARB 0x8126 +#define GL_POINT_SIZE_MAX_ARB 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128 +#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129 +#endif + +#ifndef GL_ARB_vertex_blend +#define GL_MAX_VERTEX_UNITS_ARB 0x86A4 +#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5 +#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6 +#define GL_VERTEX_BLEND_ARB 0x86A7 +#define GL_CURRENT_WEIGHT_ARB 0x86A8 +#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9 +#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA +#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB +#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC +#define GL_WEIGHT_ARRAY_ARB 0x86AD +#define GL_MODELVIEW0_ARB 0x1700 +#define GL_MODELVIEW1_ARB 0x850A +#define GL_MODELVIEW2_ARB 0x8722 +#define GL_MODELVIEW3_ARB 0x8723 +#define GL_MODELVIEW4_ARB 0x8724 +#define GL_MODELVIEW5_ARB 0x8725 +#define GL_MODELVIEW6_ARB 0x8726 +#define GL_MODELVIEW7_ARB 0x8727 +#define GL_MODELVIEW8_ARB 0x8728 +#define GL_MODELVIEW9_ARB 0x8729 +#define GL_MODELVIEW10_ARB 0x872A +#define GL_MODELVIEW11_ARB 0x872B +#define GL_MODELVIEW12_ARB 0x872C +#define GL_MODELVIEW13_ARB 0x872D +#define GL_MODELVIEW14_ARB 0x872E +#define GL_MODELVIEW15_ARB 0x872F +#define GL_MODELVIEW16_ARB 0x8730 +#define GL_MODELVIEW17_ARB 0x8731 +#define GL_MODELVIEW18_ARB 0x8732 +#define GL_MODELVIEW19_ARB 0x8733 +#define GL_MODELVIEW20_ARB 0x8734 +#define GL_MODELVIEW21_ARB 0x8735 +#define GL_MODELVIEW22_ARB 0x8736 +#define GL_MODELVIEW23_ARB 0x8737 +#define GL_MODELVIEW24_ARB 0x8738 +#define GL_MODELVIEW25_ARB 0x8739 +#define GL_MODELVIEW26_ARB 0x873A +#define GL_MODELVIEW27_ARB 0x873B +#define GL_MODELVIEW28_ARB 0x873C +#define GL_MODELVIEW29_ARB 0x873D +#define GL_MODELVIEW30_ARB 0x873E +#define GL_MODELVIEW31_ARB 0x873F +#endif + +#ifndef GL_ARB_matrix_palette +#define GL_MATRIX_PALETTE_ARB 0x8840 +#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841 +#define GL_MAX_PALETTE_MATRICES_ARB 0x8842 +#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843 +#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844 +#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845 +#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846 +#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847 +#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848 +#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849 +#endif + +#ifndef GL_ARB_texture_env_combine +#define GL_COMBINE_ARB 0x8570 +#define GL_COMBINE_RGB_ARB 0x8571 +#define GL_COMBINE_ALPHA_ARB 0x8572 +#define GL_SOURCE0_RGB_ARB 0x8580 +#define GL_SOURCE1_RGB_ARB 0x8581 +#define GL_SOURCE2_RGB_ARB 0x8582 +#define GL_SOURCE0_ALPHA_ARB 0x8588 +#define GL_SOURCE1_ALPHA_ARB 0x8589 +#define GL_SOURCE2_ALPHA_ARB 0x858A +#define GL_OPERAND0_RGB_ARB 0x8590 +#define GL_OPERAND1_RGB_ARB 0x8591 +#define GL_OPERAND2_RGB_ARB 0x8592 +#define GL_OPERAND0_ALPHA_ARB 0x8598 +#define GL_OPERAND1_ALPHA_ARB 0x8599 +#define GL_OPERAND2_ALPHA_ARB 0x859A +#define GL_RGB_SCALE_ARB 0x8573 +#define GL_ADD_SIGNED_ARB 0x8574 +#define GL_INTERPOLATE_ARB 0x8575 +#define GL_SUBTRACT_ARB 0x84E7 +#define GL_CONSTANT_ARB 0x8576 +#define GL_PRIMARY_COLOR_ARB 0x8577 +#define GL_PREVIOUS_ARB 0x8578 +#endif + +#ifndef GL_ARB_texture_env_crossbar +#endif + +#ifndef GL_ARB_texture_env_dot3 +#define GL_DOT3_RGB_ARB 0x86AE +#define GL_DOT3_RGBA_ARB 0x86AF +#endif + +#ifndef GL_ARB_texture_mirrored_repeat +#define GL_MIRRORED_REPEAT_ARB 0x8370 +#endif + +#ifndef GL_ARB_depth_texture +#define GL_DEPTH_COMPONENT16_ARB 0x81A5 +#define GL_DEPTH_COMPONENT24_ARB 0x81A6 +#define GL_DEPTH_COMPONENT32_ARB 0x81A7 +#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A +#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B +#endif + +#ifndef GL_ARB_shadow +#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C +#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D +#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E +#endif + +#ifndef GL_ARB_shadow_ambient +#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF +#endif + +#ifndef GL_ARB_window_pos +#endif + +#ifndef GL_ARB_vertex_program +#define GL_COLOR_SUM_ARB 0x8458 +#define GL_VERTEX_PROGRAM_ARB 0x8620 +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625 +#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626 +#define GL_PROGRAM_LENGTH_ARB 0x8627 +#define GL_PROGRAM_STRING_ARB 0x8628 +#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E +#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F +#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640 +#define GL_CURRENT_MATRIX_ARB 0x8641 +#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645 +#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B +#define GL_PROGRAM_BINDING_ARB 0x8677 +#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A +#define GL_PROGRAM_ERROR_STRING_ARB 0x8874 +#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875 +#define GL_PROGRAM_FORMAT_ARB 0x8876 +#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0 +#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1 +#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2 +#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3 +#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4 +#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5 +#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6 +#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7 +#define GL_PROGRAM_PARAMETERS_ARB 0x88A8 +#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9 +#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA +#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB +#define GL_PROGRAM_ATTRIBS_ARB 0x88AC +#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD +#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE +#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF +#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0 +#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1 +#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2 +#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3 +#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4 +#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5 +#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6 +#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7 +#define GL_MATRIX0_ARB 0x88C0 +#define GL_MATRIX1_ARB 0x88C1 +#define GL_MATRIX2_ARB 0x88C2 +#define GL_MATRIX3_ARB 0x88C3 +#define GL_MATRIX4_ARB 0x88C4 +#define GL_MATRIX5_ARB 0x88C5 +#define GL_MATRIX6_ARB 0x88C6 +#define GL_MATRIX7_ARB 0x88C7 +#define GL_MATRIX8_ARB 0x88C8 +#define GL_MATRIX9_ARB 0x88C9 +#define GL_MATRIX10_ARB 0x88CA +#define GL_MATRIX11_ARB 0x88CB +#define GL_MATRIX12_ARB 0x88CC +#define GL_MATRIX13_ARB 0x88CD +#define GL_MATRIX14_ARB 0x88CE +#define GL_MATRIX15_ARB 0x88CF +#define GL_MATRIX16_ARB 0x88D0 +#define GL_MATRIX17_ARB 0x88D1 +#define GL_MATRIX18_ARB 0x88D2 +#define GL_MATRIX19_ARB 0x88D3 +#define GL_MATRIX20_ARB 0x88D4 +#define GL_MATRIX21_ARB 0x88D5 +#define GL_MATRIX22_ARB 0x88D6 +#define GL_MATRIX23_ARB 0x88D7 +#define GL_MATRIX24_ARB 0x88D8 +#define GL_MATRIX25_ARB 0x88D9 +#define GL_MATRIX26_ARB 0x88DA +#define GL_MATRIX27_ARB 0x88DB +#define GL_MATRIX28_ARB 0x88DC +#define GL_MATRIX29_ARB 0x88DD +#define GL_MATRIX30_ARB 0x88DE +#define GL_MATRIX31_ARB 0x88DF +#endif + +#ifndef GL_ARB_fragment_program +#define GL_FRAGMENT_PROGRAM_ARB 0x8804 +#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805 +#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806 +#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807 +#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808 +#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809 +#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A +#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B +#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C +#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D +#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E +#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F +#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810 +#define GL_MAX_TEXTURE_COORDS_ARB 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872 +#endif + +#ifndef GL_ARB_vertex_buffer_object +#define GL_BUFFER_SIZE_ARB 0x8764 +#define GL_BUFFER_USAGE_ARB 0x8765 +#define GL_ARRAY_BUFFER_ARB 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893 +#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895 +#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F +#define GL_READ_ONLY_ARB 0x88B8 +#define GL_WRITE_ONLY_ARB 0x88B9 +#define GL_READ_WRITE_ARB 0x88BA +#define GL_BUFFER_ACCESS_ARB 0x88BB +#define GL_BUFFER_MAPPED_ARB 0x88BC +#define GL_BUFFER_MAP_POINTER_ARB 0x88BD +#define GL_STREAM_DRAW_ARB 0x88E0 +#define GL_STREAM_READ_ARB 0x88E1 +#define GL_STREAM_COPY_ARB 0x88E2 +#define GL_STATIC_DRAW_ARB 0x88E4 +#define GL_STATIC_READ_ARB 0x88E5 +#define GL_STATIC_COPY_ARB 0x88E6 +#define GL_DYNAMIC_DRAW_ARB 0x88E8 +#define GL_DYNAMIC_READ_ARB 0x88E9 +#define GL_DYNAMIC_COPY_ARB 0x88EA +#endif + +#ifndef GL_ARB_occlusion_query +#define GL_QUERY_COUNTER_BITS_ARB 0x8864 +#define GL_CURRENT_QUERY_ARB 0x8865 +#define GL_QUERY_RESULT_ARB 0x8866 +#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867 +#define GL_SAMPLES_PASSED_ARB 0x8914 +#endif + +#ifndef GL_ARB_shader_objects +#define GL_PROGRAM_OBJECT_ARB 0x8B40 +#define GL_SHADER_OBJECT_ARB 0x8B48 +#define GL_OBJECT_TYPE_ARB 0x8B4E +#define GL_OBJECT_SUBTYPE_ARB 0x8B4F +#define GL_FLOAT_VEC2_ARB 0x8B50 +#define GL_FLOAT_VEC3_ARB 0x8B51 +#define GL_FLOAT_VEC4_ARB 0x8B52 +#define GL_INT_VEC2_ARB 0x8B53 +#define GL_INT_VEC3_ARB 0x8B54 +#define GL_INT_VEC4_ARB 0x8B55 +#define GL_BOOL_ARB 0x8B56 +#define GL_BOOL_VEC2_ARB 0x8B57 +#define GL_BOOL_VEC3_ARB 0x8B58 +#define GL_BOOL_VEC4_ARB 0x8B59 +#define GL_FLOAT_MAT2_ARB 0x8B5A +#define GL_FLOAT_MAT3_ARB 0x8B5B +#define GL_FLOAT_MAT4_ARB 0x8B5C +#define GL_SAMPLER_1D_ARB 0x8B5D +#define GL_SAMPLER_2D_ARB 0x8B5E +#define GL_SAMPLER_3D_ARB 0x8B5F +#define GL_SAMPLER_CUBE_ARB 0x8B60 +#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61 +#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62 +#define GL_SAMPLER_2D_RECT_ARB 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 +#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80 +#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81 +#define GL_OBJECT_LINK_STATUS_ARB 0x8B82 +#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83 +#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84 +#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85 +#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86 +#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87 +#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88 +#endif + +#ifndef GL_ARB_vertex_shader +#define GL_VERTEX_SHADER_ARB 0x8B31 +#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A +#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D +#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89 +#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A +#endif + +#ifndef GL_ARB_fragment_shader +#define GL_FRAGMENT_SHADER_ARB 0x8B30 +#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49 +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B +#endif + +#ifndef GL_ARB_shading_language_100 +#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C +#endif + +#ifndef GL_ARB_texture_non_power_of_two +#endif + +#ifndef GL_ARB_point_sprite +#define GL_POINT_SPRITE_ARB 0x8861 +#define GL_COORD_REPLACE_ARB 0x8862 +#endif + +#ifndef GL_ARB_fragment_program_shadow +#endif + +#ifndef GL_ARB_draw_buffers +#define GL_MAX_DRAW_BUFFERS_ARB 0x8824 +#define GL_DRAW_BUFFER0_ARB 0x8825 +#define GL_DRAW_BUFFER1_ARB 0x8826 +#define GL_DRAW_BUFFER2_ARB 0x8827 +#define GL_DRAW_BUFFER3_ARB 0x8828 +#define GL_DRAW_BUFFER4_ARB 0x8829 +#define GL_DRAW_BUFFER5_ARB 0x882A +#define GL_DRAW_BUFFER6_ARB 0x882B +#define GL_DRAW_BUFFER7_ARB 0x882C +#define GL_DRAW_BUFFER8_ARB 0x882D +#define GL_DRAW_BUFFER9_ARB 0x882E +#define GL_DRAW_BUFFER10_ARB 0x882F +#define GL_DRAW_BUFFER11_ARB 0x8830 +#define GL_DRAW_BUFFER12_ARB 0x8831 +#define GL_DRAW_BUFFER13_ARB 0x8832 +#define GL_DRAW_BUFFER14_ARB 0x8833 +#define GL_DRAW_BUFFER15_ARB 0x8834 +#endif + +#ifndef GL_ARB_texture_rectangle +#define GL_TEXTURE_RECTANGLE_ARB 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8 +#endif + +#ifndef GL_ARB_color_buffer_float +#define GL_RGBA_FLOAT_MODE_ARB 0x8820 +#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A +#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B +#define GL_CLAMP_READ_COLOR_ARB 0x891C +#define GL_FIXED_ONLY_ARB 0x891D +#endif + +#ifndef GL_ARB_half_float_pixel +#define GL_HALF_FLOAT_ARB 0x140B +#endif + +#ifndef GL_ARB_texture_float +#define GL_TEXTURE_RED_TYPE_ARB 0x8C10 +#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11 +#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12 +#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13 +#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14 +#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15 +#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16 +#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17 +#define GL_RGBA32F_ARB 0x8814 +#define GL_RGB32F_ARB 0x8815 +#define GL_ALPHA32F_ARB 0x8816 +#define GL_INTENSITY32F_ARB 0x8817 +#define GL_LUMINANCE32F_ARB 0x8818 +#define GL_LUMINANCE_ALPHA32F_ARB 0x8819 +#define GL_RGBA16F_ARB 0x881A +#define GL_RGB16F_ARB 0x881B +#define GL_ALPHA16F_ARB 0x881C +#define GL_INTENSITY16F_ARB 0x881D +#define GL_LUMINANCE16F_ARB 0x881E +#define GL_LUMINANCE_ALPHA16F_ARB 0x881F +#endif + +#ifndef GL_ARB_pixel_buffer_object +#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB +#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF +#endif + +#ifndef GL_EXT_abgr +#define GL_ABGR_EXT 0x8000 +#endif + +#ifndef GL_EXT_blend_color +#define GL_CONSTANT_COLOR_EXT 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 +#define GL_CONSTANT_ALPHA_EXT 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 +#define GL_BLEND_COLOR_EXT 0x8005 +#endif + +#ifndef GL_EXT_polygon_offset +#define GL_POLYGON_OFFSET_EXT 0x8037 +#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 +#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 +#endif + +#ifndef GL_EXT_texture +#define GL_ALPHA4_EXT 0x803B +#define GL_ALPHA8_EXT 0x803C +#define GL_ALPHA12_EXT 0x803D +#define GL_ALPHA16_EXT 0x803E +#define GL_LUMINANCE4_EXT 0x803F +#define GL_LUMINANCE8_EXT 0x8040 +#define GL_LUMINANCE12_EXT 0x8041 +#define GL_LUMINANCE16_EXT 0x8042 +#define GL_LUMINANCE4_ALPHA4_EXT 0x8043 +#define GL_LUMINANCE6_ALPHA2_EXT 0x8044 +#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 +#define GL_LUMINANCE12_ALPHA4_EXT 0x8046 +#define GL_LUMINANCE12_ALPHA12_EXT 0x8047 +#define GL_LUMINANCE16_ALPHA16_EXT 0x8048 +#define GL_INTENSITY_EXT 0x8049 +#define GL_INTENSITY4_EXT 0x804A +#define GL_INTENSITY8_EXT 0x804B +#define GL_INTENSITY12_EXT 0x804C +#define GL_INTENSITY16_EXT 0x804D +#define GL_RGB2_EXT 0x804E +#define GL_RGB4_EXT 0x804F +#define GL_RGB5_EXT 0x8050 +#define GL_RGB8_EXT 0x8051 +#define GL_RGB10_EXT 0x8052 +#define GL_RGB12_EXT 0x8053 +#define GL_RGB16_EXT 0x8054 +#define GL_RGBA2_EXT 0x8055 +#define GL_RGBA4_EXT 0x8056 +#define GL_RGB5_A1_EXT 0x8057 +#define GL_RGBA8_EXT 0x8058 +#define GL_RGB10_A2_EXT 0x8059 +#define GL_RGBA12_EXT 0x805A +#define GL_RGBA16_EXT 0x805B +#define GL_TEXTURE_RED_SIZE_EXT 0x805C +#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D +#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E +#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F +#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060 +#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061 +#define GL_REPLACE_EXT 0x8062 +#define GL_PROXY_TEXTURE_1D_EXT 0x8063 +#define GL_PROXY_TEXTURE_2D_EXT 0x8064 +#define GL_TEXTURE_TOO_LARGE_EXT 0x8065 +#endif + +#ifndef GL_EXT_texture3D +#define GL_PACK_SKIP_IMAGES_EXT 0x806B +#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C +#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D +#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E +#define GL_TEXTURE_3D_EXT 0x806F +#define GL_PROXY_TEXTURE_3D_EXT 0x8070 +#define GL_TEXTURE_DEPTH_EXT 0x8071 +#define GL_TEXTURE_WRAP_R_EXT 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 +#endif + +#ifndef GL_SGIS_texture_filter4 +#define GL_FILTER4_SGIS 0x8146 +#define GL_TEXTURE_FILTER4_SIZE_SGIS 0x8147 +#endif + +#ifndef GL_EXT_subtexture +#endif + +#ifndef GL_EXT_copy_texture +#endif + +#ifndef GL_EXT_histogram +#define GL_HISTOGRAM_EXT 0x8024 +#define GL_PROXY_HISTOGRAM_EXT 0x8025 +#define GL_HISTOGRAM_WIDTH_EXT 0x8026 +#define GL_HISTOGRAM_FORMAT_EXT 0x8027 +#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C +#define GL_HISTOGRAM_SINK_EXT 0x802D +#define GL_MINMAX_EXT 0x802E +#define GL_MINMAX_FORMAT_EXT 0x802F +#define GL_MINMAX_SINK_EXT 0x8030 +#define GL_TABLE_TOO_LARGE_EXT 0x8031 +#endif + +#ifndef GL_EXT_convolution +#define GL_CONVOLUTION_1D_EXT 0x8010 +#define GL_CONVOLUTION_2D_EXT 0x8011 +#define GL_SEPARABLE_2D_EXT 0x8012 +#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015 +#define GL_REDUCE_EXT 0x8016 +#define GL_CONVOLUTION_FORMAT_EXT 0x8017 +#define GL_CONVOLUTION_WIDTH_EXT 0x8018 +#define GL_CONVOLUTION_HEIGHT_EXT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 +#endif + +#ifndef GL_SGI_color_matrix +#define GL_COLOR_MATRIX_SGI 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB +#endif + +#ifndef GL_SGI_color_table +#define GL_COLOR_TABLE_SGI 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2 +#define GL_PROXY_COLOR_TABLE_SGI 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5 +#define GL_COLOR_TABLE_SCALE_SGI 0x80D6 +#define GL_COLOR_TABLE_BIAS_SGI 0x80D7 +#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8 +#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF +#endif + +#ifndef GL_SGIS_pixel_texture +#define GL_PIXEL_TEXTURE_SGIS 0x8353 +#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354 +#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355 +#define GL_PIXEL_GROUP_COLOR_SGIS 0x8356 +#endif + +#ifndef GL_SGIX_pixel_texture +#define GL_PIXEL_TEX_GEN_SGIX 0x8139 +#define GL_PIXEL_TEX_GEN_MODE_SGIX 0x832B +#endif + +#ifndef GL_SGIS_texture4D +#define GL_PACK_SKIP_VOLUMES_SGIS 0x8130 +#define GL_PACK_IMAGE_DEPTH_SGIS 0x8131 +#define GL_UNPACK_SKIP_VOLUMES_SGIS 0x8132 +#define GL_UNPACK_IMAGE_DEPTH_SGIS 0x8133 +#define GL_TEXTURE_4D_SGIS 0x8134 +#define GL_PROXY_TEXTURE_4D_SGIS 0x8135 +#define GL_TEXTURE_4DSIZE_SGIS 0x8136 +#define GL_TEXTURE_WRAP_Q_SGIS 0x8137 +#define GL_MAX_4D_TEXTURE_SIZE_SGIS 0x8138 +#define GL_TEXTURE_4D_BINDING_SGIS 0x814F +#endif + +#ifndef GL_SGI_texture_color_table +#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC +#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD +#endif + +#ifndef GL_EXT_cmyka +#define GL_CMYK_EXT 0x800C +#define GL_CMYKA_EXT 0x800D +#define GL_PACK_CMYK_HINT_EXT 0x800E +#define GL_UNPACK_CMYK_HINT_EXT 0x800F +#endif + +#ifndef GL_EXT_texture_object +#define GL_TEXTURE_PRIORITY_EXT 0x8066 +#define GL_TEXTURE_RESIDENT_EXT 0x8067 +#define GL_TEXTURE_1D_BINDING_EXT 0x8068 +#define GL_TEXTURE_2D_BINDING_EXT 0x8069 +#define GL_TEXTURE_3D_BINDING_EXT 0x806A +#endif + +#ifndef GL_SGIS_detail_texture +#define GL_DETAIL_TEXTURE_2D_SGIS 0x8095 +#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096 +#define GL_LINEAR_DETAIL_SGIS 0x8097 +#define GL_LINEAR_DETAIL_ALPHA_SGIS 0x8098 +#define GL_LINEAR_DETAIL_COLOR_SGIS 0x8099 +#define GL_DETAIL_TEXTURE_LEVEL_SGIS 0x809A +#define GL_DETAIL_TEXTURE_MODE_SGIS 0x809B +#define GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS 0x809C +#endif + +#ifndef GL_SGIS_sharpen_texture +#define GL_LINEAR_SHARPEN_SGIS 0x80AD +#define GL_LINEAR_SHARPEN_ALPHA_SGIS 0x80AE +#define GL_LINEAR_SHARPEN_COLOR_SGIS 0x80AF +#define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0 +#endif + +#ifndef GL_EXT_packed_pixels +#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036 +#endif + +#ifndef GL_SGIS_texture_lod +#define GL_TEXTURE_MIN_LOD_SGIS 0x813A +#define GL_TEXTURE_MAX_LOD_SGIS 0x813B +#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C +#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D +#endif + +#ifndef GL_SGIS_multisample +#define GL_MULTISAMPLE_SGIS 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F +#define GL_SAMPLE_MASK_SGIS 0x80A0 +#define GL_1PASS_SGIS 0x80A1 +#define GL_2PASS_0_SGIS 0x80A2 +#define GL_2PASS_1_SGIS 0x80A3 +#define GL_4PASS_0_SGIS 0x80A4 +#define GL_4PASS_1_SGIS 0x80A5 +#define GL_4PASS_2_SGIS 0x80A6 +#define GL_4PASS_3_SGIS 0x80A7 +#define GL_SAMPLE_BUFFERS_SGIS 0x80A8 +#define GL_SAMPLES_SGIS 0x80A9 +#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA +#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB +#define GL_SAMPLE_PATTERN_SGIS 0x80AC +#endif + +#ifndef GL_EXT_rescale_normal +#define GL_RESCALE_NORMAL_EXT 0x803A +#endif + +#ifndef GL_EXT_vertex_array +#define GL_VERTEX_ARRAY_EXT 0x8074 +#define GL_NORMAL_ARRAY_EXT 0x8075 +#define GL_COLOR_ARRAY_EXT 0x8076 +#define GL_INDEX_ARRAY_EXT 0x8077 +#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 +#define GL_EDGE_FLAG_ARRAY_EXT 0x8079 +#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A +#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B +#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C +#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D +#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E +#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F +#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 +#define GL_COLOR_ARRAY_SIZE_EXT 0x8081 +#define GL_COLOR_ARRAY_TYPE_EXT 0x8082 +#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 +#define GL_COLOR_ARRAY_COUNT_EXT 0x8084 +#define GL_INDEX_ARRAY_TYPE_EXT 0x8085 +#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 +#define GL_INDEX_ARRAY_COUNT_EXT 0x8087 +#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A +#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B +#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C +#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D +#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E +#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F +#define GL_COLOR_ARRAY_POINTER_EXT 0x8090 +#define GL_INDEX_ARRAY_POINTER_EXT 0x8091 +#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 +#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 +#endif + +#ifndef GL_EXT_misc_attribute +#endif + +#ifndef GL_SGIS_generate_mipmap +#define GL_GENERATE_MIPMAP_SGIS 0x8191 +#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 +#endif + +#ifndef GL_SGIX_clipmap +#define GL_LINEAR_CLIPMAP_LINEAR_SGIX 0x8170 +#define GL_TEXTURE_CLIPMAP_CENTER_SGIX 0x8171 +#define GL_TEXTURE_CLIPMAP_FRAME_SGIX 0x8172 +#define GL_TEXTURE_CLIPMAP_OFFSET_SGIX 0x8173 +#define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174 +#define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175 +#define GL_TEXTURE_CLIPMAP_DEPTH_SGIX 0x8176 +#define GL_MAX_CLIPMAP_DEPTH_SGIX 0x8177 +#define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178 +#define GL_NEAREST_CLIPMAP_NEAREST_SGIX 0x844D +#define GL_NEAREST_CLIPMAP_LINEAR_SGIX 0x844E +#define GL_LINEAR_CLIPMAP_NEAREST_SGIX 0x844F +#endif + +#ifndef GL_SGIX_shadow +#define GL_TEXTURE_COMPARE_SGIX 0x819A +#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B +#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C +#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D +#endif + +#ifndef GL_SGIS_texture_edge_clamp +#define GL_CLAMP_TO_EDGE_SGIS 0x812F +#endif + +#ifndef GL_SGIS_texture_border_clamp +#define GL_CLAMP_TO_BORDER_SGIS 0x812D +#endif + +#ifndef GL_EXT_blend_minmax +#define GL_FUNC_ADD_EXT 0x8006 +#define GL_MIN_EXT 0x8007 +#define GL_MAX_EXT 0x8008 +#define GL_BLEND_EQUATION_EXT 0x8009 +#endif + +#ifndef GL_EXT_blend_subtract +#define GL_FUNC_SUBTRACT_EXT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B +#endif + +#ifndef GL_EXT_blend_logic_op +#endif + +#ifndef GL_SGIX_interlace +#define GL_INTERLACE_SGIX 0x8094 +#endif + +#ifndef GL_SGIX_pixel_tiles +#define GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX 0x813E +#define GL_PIXEL_TILE_CACHE_INCREMENT_SGIX 0x813F +#define GL_PIXEL_TILE_WIDTH_SGIX 0x8140 +#define GL_PIXEL_TILE_HEIGHT_SGIX 0x8141 +#define GL_PIXEL_TILE_GRID_WIDTH_SGIX 0x8142 +#define GL_PIXEL_TILE_GRID_HEIGHT_SGIX 0x8143 +#define GL_PIXEL_TILE_GRID_DEPTH_SGIX 0x8144 +#define GL_PIXEL_TILE_CACHE_SIZE_SGIX 0x8145 +#endif + +#ifndef GL_SGIS_texture_select +#define GL_DUAL_ALPHA4_SGIS 0x8110 +#define GL_DUAL_ALPHA8_SGIS 0x8111 +#define GL_DUAL_ALPHA12_SGIS 0x8112 +#define GL_DUAL_ALPHA16_SGIS 0x8113 +#define GL_DUAL_LUMINANCE4_SGIS 0x8114 +#define GL_DUAL_LUMINANCE8_SGIS 0x8115 +#define GL_DUAL_LUMINANCE12_SGIS 0x8116 +#define GL_DUAL_LUMINANCE16_SGIS 0x8117 +#define GL_DUAL_INTENSITY4_SGIS 0x8118 +#define GL_DUAL_INTENSITY8_SGIS 0x8119 +#define GL_DUAL_INTENSITY12_SGIS 0x811A +#define GL_DUAL_INTENSITY16_SGIS 0x811B +#define GL_DUAL_LUMINANCE_ALPHA4_SGIS 0x811C +#define GL_DUAL_LUMINANCE_ALPHA8_SGIS 0x811D +#define GL_QUAD_ALPHA4_SGIS 0x811E +#define GL_QUAD_ALPHA8_SGIS 0x811F +#define GL_QUAD_LUMINANCE4_SGIS 0x8120 +#define GL_QUAD_LUMINANCE8_SGIS 0x8121 +#define GL_QUAD_INTENSITY4_SGIS 0x8122 +#define GL_QUAD_INTENSITY8_SGIS 0x8123 +#define GL_DUAL_TEXTURE_SELECT_SGIS 0x8124 +#define GL_QUAD_TEXTURE_SELECT_SGIS 0x8125 +#endif + +#ifndef GL_SGIX_sprite +#define GL_SPRITE_SGIX 0x8148 +#define GL_SPRITE_MODE_SGIX 0x8149 +#define GL_SPRITE_AXIS_SGIX 0x814A +#define GL_SPRITE_TRANSLATION_SGIX 0x814B +#define GL_SPRITE_AXIAL_SGIX 0x814C +#define GL_SPRITE_OBJECT_ALIGNED_SGIX 0x814D +#define GL_SPRITE_EYE_ALIGNED_SGIX 0x814E +#endif + +#ifndef GL_SGIX_texture_multi_buffer +#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E +#endif + +#ifndef GL_EXT_point_parameters +#define GL_POINT_SIZE_MIN_EXT 0x8126 +#define GL_POINT_SIZE_MAX_EXT 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 +#define GL_DISTANCE_ATTENUATION_EXT 0x8129 +#endif + +#ifndef GL_SGIS_point_parameters +#define GL_POINT_SIZE_MIN_SGIS 0x8126 +#define GL_POINT_SIZE_MAX_SGIS 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128 +#define GL_DISTANCE_ATTENUATION_SGIS 0x8129 +#endif + +#ifndef GL_SGIX_instruments +#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180 +#define GL_INSTRUMENT_MEASUREMENTS_SGIX 0x8181 +#endif + +#ifndef GL_SGIX_texture_scale_bias +#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179 +#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A +#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B +#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C +#endif + +#ifndef GL_SGIX_framezoom +#define GL_FRAMEZOOM_SGIX 0x818B +#define GL_FRAMEZOOM_FACTOR_SGIX 0x818C +#define GL_MAX_FRAMEZOOM_FACTOR_SGIX 0x818D +#endif + +#ifndef GL_SGIX_tag_sample_buffer +#endif + +#ifndef GL_FfdMaskSGIX +#define GL_TEXTURE_DEFORMATION_BIT_SGIX 0x00000001 +#define GL_GEOMETRY_DEFORMATION_BIT_SGIX 0x00000002 +#endif + +#ifndef GL_SGIX_polynomial_ffd +#define GL_GEOMETRY_DEFORMATION_SGIX 0x8194 +#define GL_TEXTURE_DEFORMATION_SGIX 0x8195 +#define GL_DEFORMATIONS_MASK_SGIX 0x8196 +#define GL_MAX_DEFORMATION_ORDER_SGIX 0x8197 +#endif + +#ifndef GL_SGIX_reference_plane +#define GL_REFERENCE_PLANE_SGIX 0x817D +#define GL_REFERENCE_PLANE_EQUATION_SGIX 0x817E +#endif + +#ifndef GL_SGIX_flush_raster +#endif + +#ifndef GL_SGIX_depth_texture +#define GL_DEPTH_COMPONENT16_SGIX 0x81A5 +#define GL_DEPTH_COMPONENT24_SGIX 0x81A6 +#define GL_DEPTH_COMPONENT32_SGIX 0x81A7 +#endif + +#ifndef GL_SGIS_fog_function +#define GL_FOG_FUNC_SGIS 0x812A +#define GL_FOG_FUNC_POINTS_SGIS 0x812B +#define GL_MAX_FOG_FUNC_POINTS_SGIS 0x812C +#endif + +#ifndef GL_SGIX_fog_offset +#define GL_FOG_OFFSET_SGIX 0x8198 +#define GL_FOG_OFFSET_VALUE_SGIX 0x8199 +#endif + +#ifndef GL_HP_image_transform +#define GL_IMAGE_SCALE_X_HP 0x8155 +#define GL_IMAGE_SCALE_Y_HP 0x8156 +#define GL_IMAGE_TRANSLATE_X_HP 0x8157 +#define GL_IMAGE_TRANSLATE_Y_HP 0x8158 +#define GL_IMAGE_ROTATE_ANGLE_HP 0x8159 +#define GL_IMAGE_ROTATE_ORIGIN_X_HP 0x815A +#define GL_IMAGE_ROTATE_ORIGIN_Y_HP 0x815B +#define GL_IMAGE_MAG_FILTER_HP 0x815C +#define GL_IMAGE_MIN_FILTER_HP 0x815D +#define GL_IMAGE_CUBIC_WEIGHT_HP 0x815E +#define GL_CUBIC_HP 0x815F +#define GL_AVERAGE_HP 0x8160 +#define GL_IMAGE_TRANSFORM_2D_HP 0x8161 +#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162 +#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163 +#endif + +#ifndef GL_HP_convolution_border_modes +#define GL_IGNORE_BORDER_HP 0x8150 +#define GL_CONSTANT_BORDER_HP 0x8151 +#define GL_REPLICATE_BORDER_HP 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR_HP 0x8154 +#endif + +#ifndef GL_INGR_palette_buffer +#endif + +#ifndef GL_SGIX_texture_add_env +#define GL_TEXTURE_ENV_BIAS_SGIX 0x80BE +#endif + +#ifndef GL_EXT_color_subtable +#endif + +#ifndef GL_PGI_vertex_hints +#define GL_VERTEX_DATA_HINT_PGI 0x1A22A +#define GL_VERTEX_CONSISTENT_HINT_PGI 0x1A22B +#define GL_MATERIAL_SIDE_HINT_PGI 0x1A22C +#define GL_MAX_VERTEX_HINT_PGI 0x1A22D +#define GL_COLOR3_BIT_PGI 0x00010000 +#define GL_COLOR4_BIT_PGI 0x00020000 +#define GL_EDGEFLAG_BIT_PGI 0x00040000 +#define GL_INDEX_BIT_PGI 0x00080000 +#define GL_MAT_AMBIENT_BIT_PGI 0x00100000 +#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000 +#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000 +#define GL_MAT_EMISSION_BIT_PGI 0x00800000 +#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000 +#define GL_MAT_SHININESS_BIT_PGI 0x02000000 +#define GL_MAT_SPECULAR_BIT_PGI 0x04000000 +#define GL_NORMAL_BIT_PGI 0x08000000 +#define GL_TEXCOORD1_BIT_PGI 0x10000000 +#define GL_TEXCOORD2_BIT_PGI 0x20000000 +#define GL_TEXCOORD3_BIT_PGI 0x40000000 +#define GL_TEXCOORD4_BIT_PGI 0x80000000 +#define GL_VERTEX23_BIT_PGI 0x00000004 +#define GL_VERTEX4_BIT_PGI 0x00000008 +#endif + +#ifndef GL_PGI_misc_hints +#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 0x1A1F8 +#define GL_CONSERVE_MEMORY_HINT_PGI 0x1A1FD +#define GL_RECLAIM_MEMORY_HINT_PGI 0x1A1FE +#define GL_NATIVE_GRAPHICS_HANDLE_PGI 0x1A202 +#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 0x1A203 +#define GL_NATIVE_GRAPHICS_END_HINT_PGI 0x1A204 +#define GL_ALWAYS_FAST_HINT_PGI 0x1A20C +#define GL_ALWAYS_SOFT_HINT_PGI 0x1A20D +#define GL_ALLOW_DRAW_OBJ_HINT_PGI 0x1A20E +#define GL_ALLOW_DRAW_WIN_HINT_PGI 0x1A20F +#define GL_ALLOW_DRAW_FRG_HINT_PGI 0x1A210 +#define GL_ALLOW_DRAW_MEM_HINT_PGI 0x1A211 +#define GL_STRICT_DEPTHFUNC_HINT_PGI 0x1A216 +#define GL_STRICT_LIGHTING_HINT_PGI 0x1A217 +#define GL_STRICT_SCISSOR_HINT_PGI 0x1A218 +#define GL_FULL_STIPPLE_HINT_PGI 0x1A219 +#define GL_CLIP_NEAR_HINT_PGI 0x1A220 +#define GL_CLIP_FAR_HINT_PGI 0x1A221 +#define GL_WIDE_LINE_HINT_PGI 0x1A222 +#define GL_BACK_NORMALS_HINT_PGI 0x1A223 +#endif + +#ifndef GL_EXT_paletted_texture +#define GL_COLOR_INDEX1_EXT 0x80E2 +#define GL_COLOR_INDEX2_EXT 0x80E3 +#define GL_COLOR_INDEX4_EXT 0x80E4 +#define GL_COLOR_INDEX8_EXT 0x80E5 +#define GL_COLOR_INDEX12_EXT 0x80E6 +#define GL_COLOR_INDEX16_EXT 0x80E7 +#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED +#endif + +#ifndef GL_EXT_clip_volume_hint +#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0 +#endif + +#ifndef GL_SGIX_list_priority +#define GL_LIST_PRIORITY_SGIX 0x8182 +#endif + +#ifndef GL_SGIX_ir_instrument1 +#define GL_IR_INSTRUMENT1_SGIX 0x817F +#endif + +#ifndef GL_SGIX_calligraphic_fragment +#define GL_CALLIGRAPHIC_FRAGMENT_SGIX 0x8183 +#endif + +#ifndef GL_SGIX_texture_lod_bias +#define GL_TEXTURE_LOD_BIAS_S_SGIX 0x818E +#define GL_TEXTURE_LOD_BIAS_T_SGIX 0x818F +#define GL_TEXTURE_LOD_BIAS_R_SGIX 0x8190 +#endif + +#ifndef GL_SGIX_shadow_ambient +#define GL_SHADOW_AMBIENT_SGIX 0x80BF +#endif + +#ifndef GL_EXT_index_texture +#endif + +#ifndef GL_EXT_index_material +#define GL_INDEX_MATERIAL_EXT 0x81B8 +#define GL_INDEX_MATERIAL_PARAMETER_EXT 0x81B9 +#define GL_INDEX_MATERIAL_FACE_EXT 0x81BA +#endif + +#ifndef GL_EXT_index_func +#define GL_INDEX_TEST_EXT 0x81B5 +#define GL_INDEX_TEST_FUNC_EXT 0x81B6 +#define GL_INDEX_TEST_REF_EXT 0x81B7 +#endif + +#ifndef GL_EXT_index_array_formats +#define GL_IUI_V2F_EXT 0x81AD +#define GL_IUI_V3F_EXT 0x81AE +#define GL_IUI_N3F_V2F_EXT 0x81AF +#define GL_IUI_N3F_V3F_EXT 0x81B0 +#define GL_T2F_IUI_V2F_EXT 0x81B1 +#define GL_T2F_IUI_V3F_EXT 0x81B2 +#define GL_T2F_IUI_N3F_V2F_EXT 0x81B3 +#define GL_T2F_IUI_N3F_V3F_EXT 0x81B4 +#endif + +#ifndef GL_EXT_compiled_vertex_array +#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8 +#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9 +#endif + +#ifndef GL_EXT_cull_vertex +#define GL_CULL_VERTEX_EXT 0x81AA +#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB +#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC +#endif + +#ifndef GL_SGIX_ycrcb +#define GL_YCRCB_422_SGIX 0x81BB +#define GL_YCRCB_444_SGIX 0x81BC +#endif + +#ifndef GL_SGIX_fragment_lighting +#define GL_FRAGMENT_LIGHTING_SGIX 0x8400 +#define GL_FRAGMENT_COLOR_MATERIAL_SGIX 0x8401 +#define GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX 0x8402 +#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX 0x8403 +#define GL_MAX_FRAGMENT_LIGHTS_SGIX 0x8404 +#define GL_MAX_ACTIVE_LIGHTS_SGIX 0x8405 +#define GL_CURRENT_RASTER_NORMAL_SGIX 0x8406 +#define GL_LIGHT_ENV_MODE_SGIX 0x8407 +#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX 0x8408 +#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX 0x8409 +#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX 0x840A +#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX 0x840B +#define GL_FRAGMENT_LIGHT0_SGIX 0x840C +#define GL_FRAGMENT_LIGHT1_SGIX 0x840D +#define GL_FRAGMENT_LIGHT2_SGIX 0x840E +#define GL_FRAGMENT_LIGHT3_SGIX 0x840F +#define GL_FRAGMENT_LIGHT4_SGIX 0x8410 +#define GL_FRAGMENT_LIGHT5_SGIX 0x8411 +#define GL_FRAGMENT_LIGHT6_SGIX 0x8412 +#define GL_FRAGMENT_LIGHT7_SGIX 0x8413 +#endif + +#ifndef GL_IBM_rasterpos_clip +#define GL_RASTER_POSITION_UNCLIPPED_IBM 0x19262 +#endif + +#ifndef GL_HP_texture_lighting +#define GL_TEXTURE_LIGHTING_MODE_HP 0x8167 +#define GL_TEXTURE_POST_SPECULAR_HP 0x8168 +#define GL_TEXTURE_PRE_SPECULAR_HP 0x8169 +#endif + +#ifndef GL_EXT_draw_range_elements +#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 +#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 +#endif + +#ifndef GL_WIN_phong_shading +#define GL_PHONG_WIN 0x80EA +#define GL_PHONG_HINT_WIN 0x80EB +#endif + +#ifndef GL_WIN_specular_fog +#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC +#endif + +#ifndef GL_EXT_light_texture +#define GL_FRAGMENT_MATERIAL_EXT 0x8349 +#define GL_FRAGMENT_NORMAL_EXT 0x834A +#define GL_FRAGMENT_COLOR_EXT 0x834C +#define GL_ATTENUATION_EXT 0x834D +#define GL_SHADOW_ATTENUATION_EXT 0x834E +#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F +#define GL_TEXTURE_LIGHT_EXT 0x8350 +#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351 +#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352 +/* reuse GL_FRAGMENT_DEPTH_EXT */ +#endif + +#ifndef GL_SGIX_blend_alpha_minmax +#define GL_ALPHA_MIN_SGIX 0x8320 +#define GL_ALPHA_MAX_SGIX 0x8321 +#endif + +#ifndef GL_SGIX_impact_pixel_texture +#define GL_PIXEL_TEX_GEN_Q_CEILING_SGIX 0x8184 +#define GL_PIXEL_TEX_GEN_Q_ROUND_SGIX 0x8185 +#define GL_PIXEL_TEX_GEN_Q_FLOOR_SGIX 0x8186 +#define GL_PIXEL_TEX_GEN_ALPHA_REPLACE_SGIX 0x8187 +#define GL_PIXEL_TEX_GEN_ALPHA_NO_REPLACE_SGIX 0x8188 +#define GL_PIXEL_TEX_GEN_ALPHA_LS_SGIX 0x8189 +#define GL_PIXEL_TEX_GEN_ALPHA_MS_SGIX 0x818A +#endif + +#ifndef GL_EXT_bgra +#define GL_BGR_EXT 0x80E0 +#define GL_BGRA_EXT 0x80E1 +#endif + +#ifndef GL_SGIX_async +#define GL_ASYNC_MARKER_SGIX 0x8329 +#endif + +#ifndef GL_SGIX_async_pixel +#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C +#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D +#define GL_ASYNC_READ_PIXELS_SGIX 0x835E +#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F +#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360 +#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361 +#endif + +#ifndef GL_SGIX_async_histogram +#define GL_ASYNC_HISTOGRAM_SGIX 0x832C +#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D +#endif + +#ifndef GL_INTEL_texture_scissor +#endif + +#ifndef GL_INTEL_parallel_arrays +#define GL_PARALLEL_ARRAYS_INTEL 0x83F4 +#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5 +#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6 +#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7 +#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8 +#endif + +#ifndef GL_HP_occlusion_test +#define GL_OCCLUSION_TEST_HP 0x8165 +#define GL_OCCLUSION_TEST_RESULT_HP 0x8166 +#endif + +#ifndef GL_EXT_pixel_transform +#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330 +#define GL_PIXEL_MAG_FILTER_EXT 0x8331 +#define GL_PIXEL_MIN_FILTER_EXT 0x8332 +#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333 +#define GL_CUBIC_EXT 0x8334 +#define GL_AVERAGE_EXT 0x8335 +#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336 +#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337 +#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338 +#endif + +#ifndef GL_EXT_pixel_transform_color_table +#endif + +#ifndef GL_EXT_shared_texture_palette +#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB +#endif + +#ifndef GL_EXT_separate_specular_color +#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 +#define GL_SINGLE_COLOR_EXT 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA +#endif + +#ifndef GL_EXT_secondary_color +#define GL_COLOR_SUM_EXT 0x8458 +#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D +#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E +#endif + +#ifndef GL_EXT_texture_perturb_normal +#define GL_PERTURB_EXT 0x85AE +#define GL_TEXTURE_NORMAL_EXT 0x85AF +#endif + +#ifndef GL_EXT_multi_draw_arrays +#endif + +#ifndef GL_EXT_fog_coord +#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450 +#define GL_FOG_COORDINATE_EXT 0x8451 +#define GL_FRAGMENT_DEPTH_EXT 0x8452 +#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 +#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457 +#endif + +#ifndef GL_REND_screen_coordinates +#define GL_SCREEN_COORDINATES_REND 0x8490 +#define GL_INVERTED_SCREEN_W_REND 0x8491 +#endif + +#ifndef GL_EXT_coordinate_frame +#define GL_TANGENT_ARRAY_EXT 0x8439 +#define GL_BINORMAL_ARRAY_EXT 0x843A +#define GL_CURRENT_TANGENT_EXT 0x843B +#define GL_CURRENT_BINORMAL_EXT 0x843C +#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E +#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F +#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440 +#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441 +#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442 +#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443 +#define GL_MAP1_TANGENT_EXT 0x8444 +#define GL_MAP2_TANGENT_EXT 0x8445 +#define GL_MAP1_BINORMAL_EXT 0x8446 +#define GL_MAP2_BINORMAL_EXT 0x8447 +#endif + +#ifndef GL_EXT_texture_env_combine +#define GL_COMBINE_EXT 0x8570 +#define GL_COMBINE_RGB_EXT 0x8571 +#define GL_COMBINE_ALPHA_EXT 0x8572 +#define GL_RGB_SCALE_EXT 0x8573 +#define GL_ADD_SIGNED_EXT 0x8574 +#define GL_INTERPOLATE_EXT 0x8575 +#define GL_CONSTANT_EXT 0x8576 +#define GL_PRIMARY_COLOR_EXT 0x8577 +#define GL_PREVIOUS_EXT 0x8578 +#define GL_SOURCE0_RGB_EXT 0x8580 +#define GL_SOURCE1_RGB_EXT 0x8581 +#define GL_SOURCE2_RGB_EXT 0x8582 +#define GL_SOURCE0_ALPHA_EXT 0x8588 +#define GL_SOURCE1_ALPHA_EXT 0x8589 +#define GL_SOURCE2_ALPHA_EXT 0x858A +#define GL_OPERAND0_RGB_EXT 0x8590 +#define GL_OPERAND1_RGB_EXT 0x8591 +#define GL_OPERAND2_RGB_EXT 0x8592 +#define GL_OPERAND0_ALPHA_EXT 0x8598 +#define GL_OPERAND1_ALPHA_EXT 0x8599 +#define GL_OPERAND2_ALPHA_EXT 0x859A +#endif + +#ifndef GL_APPLE_specular_vector +#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0 +#endif + +#ifndef GL_APPLE_transform_hint +#define GL_TRANSFORM_HINT_APPLE 0x85B1 +#endif + +#ifndef GL_SGIX_fog_scale +#define GL_FOG_SCALE_SGIX 0x81FC +#define GL_FOG_SCALE_VALUE_SGIX 0x81FD +#endif + +#ifndef GL_SUNX_constant_data +#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5 +#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6 +#endif + +#ifndef GL_SUN_global_alpha +#define GL_GLOBAL_ALPHA_SUN 0x81D9 +#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA +#endif + +#ifndef GL_SUN_triangle_list +#define GL_RESTART_SUN 0x0001 +#define GL_REPLACE_MIDDLE_SUN 0x0002 +#define GL_REPLACE_OLDEST_SUN 0x0003 +#define GL_TRIANGLE_LIST_SUN 0x81D7 +#define GL_REPLACEMENT_CODE_SUN 0x81D8 +#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0 +#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1 +#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2 +#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3 +#define GL_R1UI_V3F_SUN 0x85C4 +#define GL_R1UI_C4UB_V3F_SUN 0x85C5 +#define GL_R1UI_C3F_V3F_SUN 0x85C6 +#define GL_R1UI_N3F_V3F_SUN 0x85C7 +#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8 +#define GL_R1UI_T2F_V3F_SUN 0x85C9 +#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA +#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB +#endif + +#ifndef GL_SUN_vertex +#endif + +#ifndef GL_EXT_blend_func_separate +#define GL_BLEND_DST_RGB_EXT 0x80C8 +#define GL_BLEND_SRC_RGB_EXT 0x80C9 +#define GL_BLEND_DST_ALPHA_EXT 0x80CA +#define GL_BLEND_SRC_ALPHA_EXT 0x80CB +#endif + +#ifndef GL_INGR_color_clamp +#define GL_RED_MIN_CLAMP_INGR 0x8560 +#define GL_GREEN_MIN_CLAMP_INGR 0x8561 +#define GL_BLUE_MIN_CLAMP_INGR 0x8562 +#define GL_ALPHA_MIN_CLAMP_INGR 0x8563 +#define GL_RED_MAX_CLAMP_INGR 0x8564 +#define GL_GREEN_MAX_CLAMP_INGR 0x8565 +#define GL_BLUE_MAX_CLAMP_INGR 0x8566 +#define GL_ALPHA_MAX_CLAMP_INGR 0x8567 +#endif + +#ifndef GL_INGR_interlace_read +#define GL_INTERLACE_READ_INGR 0x8568 +#endif + +#ifndef GL_EXT_stencil_wrap +#define GL_INCR_WRAP_EXT 0x8507 +#define GL_DECR_WRAP_EXT 0x8508 +#endif + +#ifndef GL_EXT_422_pixels +#define GL_422_EXT 0x80CC +#define GL_422_REV_EXT 0x80CD +#define GL_422_AVERAGE_EXT 0x80CE +#define GL_422_REV_AVERAGE_EXT 0x80CF +#endif + +#ifndef GL_NV_texgen_reflection +#define GL_NORMAL_MAP_NV 0x8511 +#define GL_REFLECTION_MAP_NV 0x8512 +#endif + +#ifndef GL_EXT_texture_cube_map +#define GL_NORMAL_MAP_EXT 0x8511 +#define GL_REFLECTION_MAP_EXT 0x8512 +#define GL_TEXTURE_CUBE_MAP_EXT 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C +#endif + +#ifndef GL_SUN_convolution_border_modes +#define GL_WRAP_BORDER_SUN 0x81D4 +#endif + +#ifndef GL_EXT_texture_env_add +#endif + +#ifndef GL_EXT_texture_lod_bias +#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD +#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 +#define GL_TEXTURE_LOD_BIAS_EXT 0x8501 +#endif + +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE +#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF +#endif + +#ifndef GL_EXT_vertex_weighting +#define GL_MODELVIEW0_STACK_DEPTH_EXT GL_MODELVIEW_STACK_DEPTH +#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 +#define GL_MODELVIEW0_MATRIX_EXT GL_MODELVIEW_MATRIX +#define GL_MODELVIEW1_MATRIX_EXT 0x8506 +#define GL_VERTEX_WEIGHTING_EXT 0x8509 +#define GL_MODELVIEW0_EXT GL_MODELVIEW +#define GL_MODELVIEW1_EXT 0x850A +#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B +#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C +#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D +#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E +#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F +#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 +#endif + +#ifndef GL_NV_light_max_exponent +#define GL_MAX_SHININESS_NV 0x8504 +#define GL_MAX_SPOT_EXPONENT_NV 0x8505 +#endif + +#ifndef GL_NV_vertex_array_range +#define GL_VERTEX_ARRAY_RANGE_NV 0x851D +#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E +#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F +#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520 +#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521 +#endif + +#ifndef GL_NV_register_combiners +#define GL_REGISTER_COMBINERS_NV 0x8522 +#define GL_VARIABLE_A_NV 0x8523 +#define GL_VARIABLE_B_NV 0x8524 +#define GL_VARIABLE_C_NV 0x8525 +#define GL_VARIABLE_D_NV 0x8526 +#define GL_VARIABLE_E_NV 0x8527 +#define GL_VARIABLE_F_NV 0x8528 +#define GL_VARIABLE_G_NV 0x8529 +#define GL_CONSTANT_COLOR0_NV 0x852A +#define GL_CONSTANT_COLOR1_NV 0x852B +#define GL_PRIMARY_COLOR_NV 0x852C +#define GL_SECONDARY_COLOR_NV 0x852D +#define GL_SPARE0_NV 0x852E +#define GL_SPARE1_NV 0x852F +#define GL_DISCARD_NV 0x8530 +#define GL_E_TIMES_F_NV 0x8531 +#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532 +#define GL_UNSIGNED_IDENTITY_NV 0x8536 +#define GL_UNSIGNED_INVERT_NV 0x8537 +#define GL_EXPAND_NORMAL_NV 0x8538 +#define GL_EXPAND_NEGATE_NV 0x8539 +#define GL_HALF_BIAS_NORMAL_NV 0x853A +#define GL_HALF_BIAS_NEGATE_NV 0x853B +#define GL_SIGNED_IDENTITY_NV 0x853C +#define GL_SIGNED_NEGATE_NV 0x853D +#define GL_SCALE_BY_TWO_NV 0x853E +#define GL_SCALE_BY_FOUR_NV 0x853F +#define GL_SCALE_BY_ONE_HALF_NV 0x8540 +#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541 +#define GL_COMBINER_INPUT_NV 0x8542 +#define GL_COMBINER_MAPPING_NV 0x8543 +#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544 +#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545 +#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546 +#define GL_COMBINER_MUX_SUM_NV 0x8547 +#define GL_COMBINER_SCALE_NV 0x8548 +#define GL_COMBINER_BIAS_NV 0x8549 +#define GL_COMBINER_AB_OUTPUT_NV 0x854A +#define GL_COMBINER_CD_OUTPUT_NV 0x854B +#define GL_COMBINER_SUM_OUTPUT_NV 0x854C +#define GL_MAX_GENERAL_COMBINERS_NV 0x854D +#define GL_NUM_GENERAL_COMBINERS_NV 0x854E +#define GL_COLOR_SUM_CLAMP_NV 0x854F +#define GL_COMBINER0_NV 0x8550 +#define GL_COMBINER1_NV 0x8551 +#define GL_COMBINER2_NV 0x8552 +#define GL_COMBINER3_NV 0x8553 +#define GL_COMBINER4_NV 0x8554 +#define GL_COMBINER5_NV 0x8555 +#define GL_COMBINER6_NV 0x8556 +#define GL_COMBINER7_NV 0x8557 +/* reuse GL_TEXTURE0_ARB */ +/* reuse GL_TEXTURE1_ARB */ +/* reuse GL_ZERO */ +/* reuse GL_NONE */ +/* reuse GL_FOG */ +#endif + +#ifndef GL_NV_fog_distance +#define GL_FOG_DISTANCE_MODE_NV 0x855A +#define GL_EYE_RADIAL_NV 0x855B +#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C +/* reuse GL_EYE_PLANE */ +#endif + +#ifndef GL_NV_texgen_emboss +#define GL_EMBOSS_LIGHT_NV 0x855D +#define GL_EMBOSS_CONSTANT_NV 0x855E +#define GL_EMBOSS_MAP_NV 0x855F +#endif + +#ifndef GL_NV_blend_square +#endif + +#ifndef GL_NV_texture_env_combine4 +#define GL_COMBINE4_NV 0x8503 +#define GL_SOURCE3_RGB_NV 0x8583 +#define GL_SOURCE3_ALPHA_NV 0x858B +#define GL_OPERAND3_RGB_NV 0x8593 +#define GL_OPERAND3_ALPHA_NV 0x859B +#endif + +#ifndef GL_MESA_resize_buffers +#endif + +#ifndef GL_MESA_window_pos +#endif + +#ifndef GL_EXT_texture_compression_s3tc +#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 +#endif + +#ifndef GL_IBM_cull_vertex +#define GL_CULL_VERTEX_IBM 103050 +#endif + +#ifndef GL_IBM_multimode_draw_arrays +#endif + +#ifndef GL_IBM_vertex_array_lists +#define GL_VERTEX_ARRAY_LIST_IBM 103070 +#define GL_NORMAL_ARRAY_LIST_IBM 103071 +#define GL_COLOR_ARRAY_LIST_IBM 103072 +#define GL_INDEX_ARRAY_LIST_IBM 103073 +#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074 +#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075 +#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076 +#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077 +#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080 +#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081 +#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082 +#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083 +#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084 +#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085 +#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086 +#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087 +#endif + +#ifndef GL_SGIX_subsample +#define GL_PACK_SUBSAMPLE_RATE_SGIX 0x85A0 +#define GL_UNPACK_SUBSAMPLE_RATE_SGIX 0x85A1 +#define GL_PIXEL_SUBSAMPLE_4444_SGIX 0x85A2 +#define GL_PIXEL_SUBSAMPLE_2424_SGIX 0x85A3 +#define GL_PIXEL_SUBSAMPLE_4242_SGIX 0x85A4 +#endif + +#ifndef GL_SGIX_ycrcb_subsample +#endif + +#ifndef GL_SGIX_ycrcba +#define GL_YCRCB_SGIX 0x8318 +#define GL_YCRCBA_SGIX 0x8319 +#endif + +#ifndef GL_SGI_depth_pass_instrument +#define GL_DEPTH_PASS_INSTRUMENT_SGIX 0x8310 +#define GL_DEPTH_PASS_INSTRUMENT_COUNTERS_SGIX 0x8311 +#define GL_DEPTH_PASS_INSTRUMENT_MAX_SGIX 0x8312 +#endif + +#ifndef GL_3DFX_texture_compression_FXT1 +#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0 +#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 +#endif + +#ifndef GL_3DFX_multisample +#define GL_MULTISAMPLE_3DFX 0x86B2 +#define GL_SAMPLE_BUFFERS_3DFX 0x86B3 +#define GL_SAMPLES_3DFX 0x86B4 +#define GL_MULTISAMPLE_BIT_3DFX 0x20000000 +#endif + +#ifndef GL_3DFX_tbuffer +#endif + +#ifndef GL_EXT_multisample +#define GL_MULTISAMPLE_EXT 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F +#define GL_SAMPLE_MASK_EXT 0x80A0 +#define GL_1PASS_EXT 0x80A1 +#define GL_2PASS_0_EXT 0x80A2 +#define GL_2PASS_1_EXT 0x80A3 +#define GL_4PASS_0_EXT 0x80A4 +#define GL_4PASS_1_EXT 0x80A5 +#define GL_4PASS_2_EXT 0x80A6 +#define GL_4PASS_3_EXT 0x80A7 +#define GL_SAMPLE_BUFFERS_EXT 0x80A8 +#define GL_SAMPLES_EXT 0x80A9 +#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA +#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB +#define GL_SAMPLE_PATTERN_EXT 0x80AC +#define GL_MULTISAMPLE_BIT_EXT 0x20000000 +#endif + +#ifndef GL_SGIX_vertex_preclip +#define GL_VERTEX_PRECLIP_SGIX 0x83EE +#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF +#endif + +#ifndef GL_SGIX_convolution_accuracy +#define GL_CONVOLUTION_HINT_SGIX 0x8316 +#endif + +#ifndef GL_SGIX_resample +#define GL_PACK_RESAMPLE_SGIX 0x842C +#define GL_UNPACK_RESAMPLE_SGIX 0x842D +#define GL_RESAMPLE_REPLICATE_SGIX 0x842E +#define GL_RESAMPLE_ZERO_FILL_SGIX 0x842F +#define GL_RESAMPLE_DECIMATE_SGIX 0x8430 +#endif + +#ifndef GL_SGIS_point_line_texgen +#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0 +#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1 +#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2 +#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3 +#define GL_EYE_POINT_SGIS 0x81F4 +#define GL_OBJECT_POINT_SGIS 0x81F5 +#define GL_EYE_LINE_SGIS 0x81F6 +#define GL_OBJECT_LINE_SGIS 0x81F7 +#endif + +#ifndef GL_SGIS_texture_color_mask +#define GL_TEXTURE_COLOR_WRITEMASK_SGIS 0x81EF +#endif + +#ifndef GL_EXT_texture_env_dot3 +#define GL_DOT3_RGB_EXT 0x8740 +#define GL_DOT3_RGBA_EXT 0x8741 +#endif + +#ifndef GL_ATI_texture_mirror_once +#define GL_MIRROR_CLAMP_ATI 0x8742 +#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743 +#endif + +#ifndef GL_NV_fence +#define GL_ALL_COMPLETED_NV 0x84F2 +#define GL_FENCE_STATUS_NV 0x84F3 +#define GL_FENCE_CONDITION_NV 0x84F4 +#endif + +#ifndef GL_IBM_texture_mirrored_repeat +#define GL_MIRRORED_REPEAT_IBM 0x8370 +#endif + +#ifndef GL_NV_evaluators +#define GL_EVAL_2D_NV 0x86C0 +#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1 +#define GL_MAP_TESSELLATION_NV 0x86C2 +#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3 +#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4 +#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5 +#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6 +#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7 +#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8 +#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9 +#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA +#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB +#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC +#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD +#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE +#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF +#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0 +#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1 +#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2 +#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3 +#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4 +#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5 +#define GL_MAX_MAP_TESSELLATION_NV 0x86D6 +#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7 +#endif + +#ifndef GL_NV_packed_depth_stencil +#define GL_DEPTH_STENCIL_NV 0x84F9 +#define GL_UNSIGNED_INT_24_8_NV 0x84FA +#endif + +#ifndef GL_NV_register_combiners2 +#define GL_PER_STAGE_CONSTANTS_NV 0x8535 +#endif + +#ifndef GL_NV_texture_compression_vtc +#endif + +#ifndef GL_NV_texture_rectangle +#define GL_TEXTURE_RECTANGLE_NV 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8 +#endif + +#ifndef GL_NV_texture_shader +#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C +#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D +#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E +#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9 +#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA +#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB +#define GL_DSDT_MAG_INTENSITY_NV 0x86DC +#define GL_SHADER_CONSISTENT_NV 0x86DD +#define GL_TEXTURE_SHADER_NV 0x86DE +#define GL_SHADER_OPERATION_NV 0x86DF +#define GL_CULL_MODES_NV 0x86E0 +#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1 +#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2 +#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3 +#define GL_OFFSET_TEXTURE_2D_MATRIX_NV GL_OFFSET_TEXTURE_MATRIX_NV +#define GL_OFFSET_TEXTURE_2D_SCALE_NV GL_OFFSET_TEXTURE_SCALE_NV +#define GL_OFFSET_TEXTURE_2D_BIAS_NV GL_OFFSET_TEXTURE_BIAS_NV +#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4 +#define GL_CONST_EYE_NV 0x86E5 +#define GL_PASS_THROUGH_NV 0x86E6 +#define GL_CULL_FRAGMENT_NV 0x86E7 +#define GL_OFFSET_TEXTURE_2D_NV 0x86E8 +#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9 +#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA +#define GL_DOT_PRODUCT_NV 0x86EC +#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED +#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE +#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0 +#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1 +#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2 +#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3 +#define GL_HILO_NV 0x86F4 +#define GL_DSDT_NV 0x86F5 +#define GL_DSDT_MAG_NV 0x86F6 +#define GL_DSDT_MAG_VIB_NV 0x86F7 +#define GL_HILO16_NV 0x86F8 +#define GL_SIGNED_HILO_NV 0x86F9 +#define GL_SIGNED_HILO16_NV 0x86FA +#define GL_SIGNED_RGBA_NV 0x86FB +#define GL_SIGNED_RGBA8_NV 0x86FC +#define GL_SIGNED_RGB_NV 0x86FE +#define GL_SIGNED_RGB8_NV 0x86FF +#define GL_SIGNED_LUMINANCE_NV 0x8701 +#define GL_SIGNED_LUMINANCE8_NV 0x8702 +#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 +#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 +#define GL_SIGNED_ALPHA_NV 0x8705 +#define GL_SIGNED_ALPHA8_NV 0x8706 +#define GL_SIGNED_INTENSITY_NV 0x8707 +#define GL_SIGNED_INTENSITY8_NV 0x8708 +#define GL_DSDT8_NV 0x8709 +#define GL_DSDT8_MAG8_NV 0x870A +#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B +#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C +#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D +#define GL_HI_SCALE_NV 0x870E +#define GL_LO_SCALE_NV 0x870F +#define GL_DS_SCALE_NV 0x8710 +#define GL_DT_SCALE_NV 0x8711 +#define GL_MAGNITUDE_SCALE_NV 0x8712 +#define GL_VIBRANCE_SCALE_NV 0x8713 +#define GL_HI_BIAS_NV 0x8714 +#define GL_LO_BIAS_NV 0x8715 +#define GL_DS_BIAS_NV 0x8716 +#define GL_DT_BIAS_NV 0x8717 +#define GL_MAGNITUDE_BIAS_NV 0x8718 +#define GL_VIBRANCE_BIAS_NV 0x8719 +#define GL_TEXTURE_BORDER_VALUES_NV 0x871A +#define GL_TEXTURE_HI_SIZE_NV 0x871B +#define GL_TEXTURE_LO_SIZE_NV 0x871C +#define GL_TEXTURE_DS_SIZE_NV 0x871D +#define GL_TEXTURE_DT_SIZE_NV 0x871E +#define GL_TEXTURE_MAG_SIZE_NV 0x871F +#endif + +#ifndef GL_NV_texture_shader2 +#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF +#endif + +#ifndef GL_NV_vertex_array_range2 +#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533 +#endif + +#ifndef GL_NV_vertex_program +#define GL_VERTEX_PROGRAM_NV 0x8620 +#define GL_VERTEX_STATE_PROGRAM_NV 0x8621 +#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623 +#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624 +#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625 +#define GL_CURRENT_ATTRIB_NV 0x8626 +#define GL_PROGRAM_LENGTH_NV 0x8627 +#define GL_PROGRAM_STRING_NV 0x8628 +#define GL_MODELVIEW_PROJECTION_NV 0x8629 +#define GL_IDENTITY_NV 0x862A +#define GL_INVERSE_NV 0x862B +#define GL_TRANSPOSE_NV 0x862C +#define GL_INVERSE_TRANSPOSE_NV 0x862D +#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E +#define GL_MAX_TRACK_MATRICES_NV 0x862F +#define GL_MATRIX0_NV 0x8630 +#define GL_MATRIX1_NV 0x8631 +#define GL_MATRIX2_NV 0x8632 +#define GL_MATRIX3_NV 0x8633 +#define GL_MATRIX4_NV 0x8634 +#define GL_MATRIX5_NV 0x8635 +#define GL_MATRIX6_NV 0x8636 +#define GL_MATRIX7_NV 0x8637 +#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640 +#define GL_CURRENT_MATRIX_NV 0x8641 +#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643 +#define GL_PROGRAM_PARAMETER_NV 0x8644 +#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645 +#define GL_PROGRAM_TARGET_NV 0x8646 +#define GL_PROGRAM_RESIDENT_NV 0x8647 +#define GL_TRACK_MATRIX_NV 0x8648 +#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649 +#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A +#define GL_PROGRAM_ERROR_POSITION_NV 0x864B +#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650 +#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651 +#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652 +#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653 +#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654 +#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655 +#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656 +#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657 +#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658 +#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659 +#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A +#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B +#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C +#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D +#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E +#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F +#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660 +#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661 +#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662 +#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663 +#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664 +#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665 +#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666 +#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667 +#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668 +#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669 +#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A +#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B +#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C +#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D +#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E +#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F +#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670 +#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671 +#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672 +#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673 +#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674 +#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675 +#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676 +#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677 +#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678 +#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679 +#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A +#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B +#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C +#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D +#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E +#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F +#endif + +#ifndef GL_SGIX_texture_coordinate_clamp +#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369 +#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A +#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B +#endif + +#ifndef GL_SGIX_scalebias_hint +#define GL_SCALEBIAS_HINT_SGIX 0x8322 +#endif + +#ifndef GL_OML_interlace +#define GL_INTERLACE_OML 0x8980 +#define GL_INTERLACE_READ_OML 0x8981 +#endif + +#ifndef GL_OML_subsample +#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982 +#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983 +#endif + +#ifndef GL_OML_resample +#define GL_PACK_RESAMPLE_OML 0x8984 +#define GL_UNPACK_RESAMPLE_OML 0x8985 +#define GL_RESAMPLE_REPLICATE_OML 0x8986 +#define GL_RESAMPLE_ZERO_FILL_OML 0x8987 +#define GL_RESAMPLE_AVERAGE_OML 0x8988 +#define GL_RESAMPLE_DECIMATE_OML 0x8989 +#endif + +#ifndef GL_NV_copy_depth_to_color +#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E +#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F +#endif + +#ifndef GL_ATI_envmap_bumpmap +#define GL_BUMP_ROT_MATRIX_ATI 0x8775 +#define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776 +#define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777 +#define GL_BUMP_TEX_UNITS_ATI 0x8778 +#define GL_DUDV_ATI 0x8779 +#define GL_DU8DV8_ATI 0x877A +#define GL_BUMP_ENVMAP_ATI 0x877B +#define GL_BUMP_TARGET_ATI 0x877C +#endif + +#ifndef GL_ATI_fragment_shader +#define GL_FRAGMENT_SHADER_ATI 0x8920 +#define GL_REG_0_ATI 0x8921 +#define GL_REG_1_ATI 0x8922 +#define GL_REG_2_ATI 0x8923 +#define GL_REG_3_ATI 0x8924 +#define GL_REG_4_ATI 0x8925 +#define GL_REG_5_ATI 0x8926 +#define GL_REG_6_ATI 0x8927 +#define GL_REG_7_ATI 0x8928 +#define GL_REG_8_ATI 0x8929 +#define GL_REG_9_ATI 0x892A +#define GL_REG_10_ATI 0x892B +#define GL_REG_11_ATI 0x892C +#define GL_REG_12_ATI 0x892D +#define GL_REG_13_ATI 0x892E +#define GL_REG_14_ATI 0x892F +#define GL_REG_15_ATI 0x8930 +#define GL_REG_16_ATI 0x8931 +#define GL_REG_17_ATI 0x8932 +#define GL_REG_18_ATI 0x8933 +#define GL_REG_19_ATI 0x8934 +#define GL_REG_20_ATI 0x8935 +#define GL_REG_21_ATI 0x8936 +#define GL_REG_22_ATI 0x8937 +#define GL_REG_23_ATI 0x8938 +#define GL_REG_24_ATI 0x8939 +#define GL_REG_25_ATI 0x893A +#define GL_REG_26_ATI 0x893B +#define GL_REG_27_ATI 0x893C +#define GL_REG_28_ATI 0x893D +#define GL_REG_29_ATI 0x893E +#define GL_REG_30_ATI 0x893F +#define GL_REG_31_ATI 0x8940 +#define GL_CON_0_ATI 0x8941 +#define GL_CON_1_ATI 0x8942 +#define GL_CON_2_ATI 0x8943 +#define GL_CON_3_ATI 0x8944 +#define GL_CON_4_ATI 0x8945 +#define GL_CON_5_ATI 0x8946 +#define GL_CON_6_ATI 0x8947 +#define GL_CON_7_ATI 0x8948 +#define GL_CON_8_ATI 0x8949 +#define GL_CON_9_ATI 0x894A +#define GL_CON_10_ATI 0x894B +#define GL_CON_11_ATI 0x894C +#define GL_CON_12_ATI 0x894D +#define GL_CON_13_ATI 0x894E +#define GL_CON_14_ATI 0x894F +#define GL_CON_15_ATI 0x8950 +#define GL_CON_16_ATI 0x8951 +#define GL_CON_17_ATI 0x8952 +#define GL_CON_18_ATI 0x8953 +#define GL_CON_19_ATI 0x8954 +#define GL_CON_20_ATI 0x8955 +#define GL_CON_21_ATI 0x8956 +#define GL_CON_22_ATI 0x8957 +#define GL_CON_23_ATI 0x8958 +#define GL_CON_24_ATI 0x8959 +#define GL_CON_25_ATI 0x895A +#define GL_CON_26_ATI 0x895B +#define GL_CON_27_ATI 0x895C +#define GL_CON_28_ATI 0x895D +#define GL_CON_29_ATI 0x895E +#define GL_CON_30_ATI 0x895F +#define GL_CON_31_ATI 0x8960 +#define GL_MOV_ATI 0x8961 +#define GL_ADD_ATI 0x8963 +#define GL_MUL_ATI 0x8964 +#define GL_SUB_ATI 0x8965 +#define GL_DOT3_ATI 0x8966 +#define GL_DOT4_ATI 0x8967 +#define GL_MAD_ATI 0x8968 +#define GL_LERP_ATI 0x8969 +#define GL_CND_ATI 0x896A +#define GL_CND0_ATI 0x896B +#define GL_DOT2_ADD_ATI 0x896C +#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D +#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E +#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F +#define GL_NUM_PASSES_ATI 0x8970 +#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971 +#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972 +#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973 +#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974 +#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975 +#define GL_SWIZZLE_STR_ATI 0x8976 +#define GL_SWIZZLE_STQ_ATI 0x8977 +#define GL_SWIZZLE_STR_DR_ATI 0x8978 +#define GL_SWIZZLE_STQ_DQ_ATI 0x8979 +#define GL_SWIZZLE_STRQ_ATI 0x897A +#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B +#define GL_RED_BIT_ATI 0x00000001 +#define GL_GREEN_BIT_ATI 0x00000002 +#define GL_BLUE_BIT_ATI 0x00000004 +#define GL_2X_BIT_ATI 0x00000001 +#define GL_4X_BIT_ATI 0x00000002 +#define GL_8X_BIT_ATI 0x00000004 +#define GL_HALF_BIT_ATI 0x00000008 +#define GL_QUARTER_BIT_ATI 0x00000010 +#define GL_EIGHTH_BIT_ATI 0x00000020 +#define GL_SATURATE_BIT_ATI 0x00000040 +#define GL_COMP_BIT_ATI 0x00000002 +#define GL_NEGATE_BIT_ATI 0x00000004 +#define GL_BIAS_BIT_ATI 0x00000008 +#endif + +#ifndef GL_ATI_pn_triangles +#define GL_PN_TRIANGLES_ATI 0x87F0 +#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1 +#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2 +#define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3 +#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4 +#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5 +#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6 +#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7 +#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8 +#endif + +#ifndef GL_ATI_vertex_array_object +#define GL_STATIC_ATI 0x8760 +#define GL_DYNAMIC_ATI 0x8761 +#define GL_PRESERVE_ATI 0x8762 +#define GL_DISCARD_ATI 0x8763 +#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764 +#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765 +#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766 +#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767 +#endif + +#ifndef GL_EXT_vertex_shader +#define GL_VERTEX_SHADER_EXT 0x8780 +#define GL_VERTEX_SHADER_BINDING_EXT 0x8781 +#define GL_OP_INDEX_EXT 0x8782 +#define GL_OP_NEGATE_EXT 0x8783 +#define GL_OP_DOT3_EXT 0x8784 +#define GL_OP_DOT4_EXT 0x8785 +#define GL_OP_MUL_EXT 0x8786 +#define GL_OP_ADD_EXT 0x8787 +#define GL_OP_MADD_EXT 0x8788 +#define GL_OP_FRAC_EXT 0x8789 +#define GL_OP_MAX_EXT 0x878A +#define GL_OP_MIN_EXT 0x878B +#define GL_OP_SET_GE_EXT 0x878C +#define GL_OP_SET_LT_EXT 0x878D +#define GL_OP_CLAMP_EXT 0x878E +#define GL_OP_FLOOR_EXT 0x878F +#define GL_OP_ROUND_EXT 0x8790 +#define GL_OP_EXP_BASE_2_EXT 0x8791 +#define GL_OP_LOG_BASE_2_EXT 0x8792 +#define GL_OP_POWER_EXT 0x8793 +#define GL_OP_RECIP_EXT 0x8794 +#define GL_OP_RECIP_SQRT_EXT 0x8795 +#define GL_OP_SUB_EXT 0x8796 +#define GL_OP_CROSS_PRODUCT_EXT 0x8797 +#define GL_OP_MULTIPLY_MATRIX_EXT 0x8798 +#define GL_OP_MOV_EXT 0x8799 +#define GL_OUTPUT_VERTEX_EXT 0x879A +#define GL_OUTPUT_COLOR0_EXT 0x879B +#define GL_OUTPUT_COLOR1_EXT 0x879C +#define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D +#define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E +#define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F +#define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0 +#define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1 +#define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2 +#define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3 +#define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4 +#define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5 +#define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6 +#define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7 +#define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8 +#define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9 +#define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA +#define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB +#define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC +#define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD +#define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE +#define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF +#define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0 +#define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1 +#define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2 +#define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3 +#define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4 +#define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5 +#define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6 +#define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7 +#define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8 +#define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9 +#define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA +#define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB +#define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC +#define GL_OUTPUT_FOG_EXT 0x87BD +#define GL_SCALAR_EXT 0x87BE +#define GL_VECTOR_EXT 0x87BF +#define GL_MATRIX_EXT 0x87C0 +#define GL_VARIANT_EXT 0x87C1 +#define GL_INVARIANT_EXT 0x87C2 +#define GL_LOCAL_CONSTANT_EXT 0x87C3 +#define GL_LOCAL_EXT 0x87C4 +#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5 +#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6 +#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7 +#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8 +#define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9 +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CC +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CD +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE +#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF +#define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0 +#define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1 +#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2 +#define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3 +#define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4 +#define GL_X_EXT 0x87D5 +#define GL_Y_EXT 0x87D6 +#define GL_Z_EXT 0x87D7 +#define GL_W_EXT 0x87D8 +#define GL_NEGATIVE_X_EXT 0x87D9 +#define GL_NEGATIVE_Y_EXT 0x87DA +#define GL_NEGATIVE_Z_EXT 0x87DB +#define GL_NEGATIVE_W_EXT 0x87DC +#define GL_ZERO_EXT 0x87DD +#define GL_ONE_EXT 0x87DE +#define GL_NEGATIVE_ONE_EXT 0x87DF +#define GL_NORMALIZED_RANGE_EXT 0x87E0 +#define GL_FULL_RANGE_EXT 0x87E1 +#define GL_CURRENT_VERTEX_EXT 0x87E2 +#define GL_MVP_MATRIX_EXT 0x87E3 +#define GL_VARIANT_VALUE_EXT 0x87E4 +#define GL_VARIANT_DATATYPE_EXT 0x87E5 +#define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6 +#define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7 +#define GL_VARIANT_ARRAY_EXT 0x87E8 +#define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9 +#define GL_INVARIANT_VALUE_EXT 0x87EA +#define GL_INVARIANT_DATATYPE_EXT 0x87EB +#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC +#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED +#endif + +#ifndef GL_ATI_vertex_streams +#define GL_MAX_VERTEX_STREAMS_ATI 0x876B +#define GL_VERTEX_STREAM0_ATI 0x876C +#define GL_VERTEX_STREAM1_ATI 0x876D +#define GL_VERTEX_STREAM2_ATI 0x876E +#define GL_VERTEX_STREAM3_ATI 0x876F +#define GL_VERTEX_STREAM4_ATI 0x8770 +#define GL_VERTEX_STREAM5_ATI 0x8771 +#define GL_VERTEX_STREAM6_ATI 0x8772 +#define GL_VERTEX_STREAM7_ATI 0x8773 +#define GL_VERTEX_SOURCE_ATI 0x8774 +#endif + +#ifndef GL_ATI_element_array +#define GL_ELEMENT_ARRAY_ATI 0x8768 +#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769 +#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A +#endif + +#ifndef GL_SUN_mesh_array +#define GL_QUAD_MESH_SUN 0x8614 +#define GL_TRIANGLE_MESH_SUN 0x8615 +#endif + +#ifndef GL_SUN_slice_accum +#define GL_SLICE_ACCUM_SUN 0x85CC +#endif + +#ifndef GL_NV_multisample_filter_hint +#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534 +#endif + +#ifndef GL_NV_depth_clamp +#define GL_DEPTH_CLAMP_NV 0x864F +#endif + +#ifndef GL_NV_occlusion_query +#define GL_PIXEL_COUNTER_BITS_NV 0x8864 +#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865 +#define GL_PIXEL_COUNT_NV 0x8866 +#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867 +#endif + +#ifndef GL_NV_point_sprite +#define GL_POINT_SPRITE_NV 0x8861 +#define GL_COORD_REPLACE_NV 0x8862 +#define GL_POINT_SPRITE_R_MODE_NV 0x8863 +#endif + +#ifndef GL_NV_texture_shader3 +#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850 +#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851 +#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852 +#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853 +#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854 +#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855 +#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856 +#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857 +#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858 +#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859 +#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A +#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B +#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C +#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D +#define GL_HILO8_NV 0x885E +#define GL_SIGNED_HILO8_NV 0x885F +#define GL_FORCE_BLUE_TO_ONE_NV 0x8860 +#endif + +#ifndef GL_NV_vertex_program1_1 +#endif + +#ifndef GL_EXT_shadow_funcs +#endif + +#ifndef GL_EXT_stencil_two_side +#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910 +#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911 +#endif + +#ifndef GL_ATI_text_fragment_shader +#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200 +#endif + +#ifndef GL_APPLE_client_storage +#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2 +#endif + +#ifndef GL_APPLE_element_array +#define GL_ELEMENT_ARRAY_APPLE 0x8768 +#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8769 +#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x876A +#endif + +#ifndef GL_APPLE_fence +#define GL_DRAW_PIXELS_APPLE 0x8A0A +#define GL_FENCE_APPLE 0x8A0B +#endif + +#ifndef GL_APPLE_vertex_array_object +#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5 +#endif + +#ifndef GL_APPLE_vertex_array_range +#define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D +#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E +#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F +#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521 +#define GL_STORAGE_CACHED_APPLE 0x85BE +#define GL_STORAGE_SHARED_APPLE 0x85BF +#endif + +#ifndef GL_APPLE_ycbcr_422 +#define GL_YCBCR_422_APPLE 0x85B9 +#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA +#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB +#endif + +#ifndef GL_S3_s3tc +#define GL_RGB_S3TC 0x83A0 +#define GL_RGB4_S3TC 0x83A1 +#define GL_RGBA_S3TC 0x83A2 +#define GL_RGBA4_S3TC 0x83A3 +#endif + +#ifndef GL_ATI_draw_buffers +#define GL_MAX_DRAW_BUFFERS_ATI 0x8824 +#define GL_DRAW_BUFFER0_ATI 0x8825 +#define GL_DRAW_BUFFER1_ATI 0x8826 +#define GL_DRAW_BUFFER2_ATI 0x8827 +#define GL_DRAW_BUFFER3_ATI 0x8828 +#define GL_DRAW_BUFFER4_ATI 0x8829 +#define GL_DRAW_BUFFER5_ATI 0x882A +#define GL_DRAW_BUFFER6_ATI 0x882B +#define GL_DRAW_BUFFER7_ATI 0x882C +#define GL_DRAW_BUFFER8_ATI 0x882D +#define GL_DRAW_BUFFER9_ATI 0x882E +#define GL_DRAW_BUFFER10_ATI 0x882F +#define GL_DRAW_BUFFER11_ATI 0x8830 +#define GL_DRAW_BUFFER12_ATI 0x8831 +#define GL_DRAW_BUFFER13_ATI 0x8832 +#define GL_DRAW_BUFFER14_ATI 0x8833 +#define GL_DRAW_BUFFER15_ATI 0x8834 +#endif + +#ifndef GL_ATI_pixel_format_float +#define GL_TYPE_RGBA_FLOAT_ATI 0x8820 +#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835 +#endif + +#ifndef GL_ATI_texture_env_combine3 +#define GL_MODULATE_ADD_ATI 0x8744 +#define GL_MODULATE_SIGNED_ADD_ATI 0x8745 +#define GL_MODULATE_SUBTRACT_ATI 0x8746 +#endif + +#ifndef GL_ATI_texture_float +#define GL_RGBA_FLOAT32_ATI 0x8814 +#define GL_RGB_FLOAT32_ATI 0x8815 +#define GL_ALPHA_FLOAT32_ATI 0x8816 +#define GL_INTENSITY_FLOAT32_ATI 0x8817 +#define GL_LUMINANCE_FLOAT32_ATI 0x8818 +#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819 +#define GL_RGBA_FLOAT16_ATI 0x881A +#define GL_RGB_FLOAT16_ATI 0x881B +#define GL_ALPHA_FLOAT16_ATI 0x881C +#define GL_INTENSITY_FLOAT16_ATI 0x881D +#define GL_LUMINANCE_FLOAT16_ATI 0x881E +#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F +#endif + +#ifndef GL_NV_float_buffer +#define GL_FLOAT_R_NV 0x8880 +#define GL_FLOAT_RG_NV 0x8881 +#define GL_FLOAT_RGB_NV 0x8882 +#define GL_FLOAT_RGBA_NV 0x8883 +#define GL_FLOAT_R16_NV 0x8884 +#define GL_FLOAT_R32_NV 0x8885 +#define GL_FLOAT_RG16_NV 0x8886 +#define GL_FLOAT_RG32_NV 0x8887 +#define GL_FLOAT_RGB16_NV 0x8888 +#define GL_FLOAT_RGB32_NV 0x8889 +#define GL_FLOAT_RGBA16_NV 0x888A +#define GL_FLOAT_RGBA32_NV 0x888B +#define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C +#define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D +#define GL_FLOAT_RGBA_MODE_NV 0x888E +#endif + +#ifndef GL_NV_fragment_program +#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868 +#define GL_FRAGMENT_PROGRAM_NV 0x8870 +#define GL_MAX_TEXTURE_COORDS_NV 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872 +#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873 +#define GL_PROGRAM_ERROR_STRING_NV 0x8874 +#endif + +#ifndef GL_NV_half_float +#define GL_HALF_FLOAT_NV 0x140B +#endif + +#ifndef GL_NV_pixel_data_range +#define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878 +#define GL_READ_PIXEL_DATA_RANGE_NV 0x8879 +#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A +#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B +#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C +#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D +#endif + +#ifndef GL_NV_primitive_restart +#define GL_PRIMITIVE_RESTART_NV 0x8558 +#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559 +#endif + +#ifndef GL_NV_texture_expand_normal +#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F +#endif + +#ifndef GL_NV_vertex_program2 +#endif + +#ifndef GL_ATI_map_object_buffer +#endif + +#ifndef GL_ATI_separate_stencil +#define GL_STENCIL_BACK_FUNC_ATI 0x8800 +#define GL_STENCIL_BACK_FAIL_ATI 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803 +#endif + +#ifndef GL_ATI_vertex_attrib_array_object +#endif + +#ifndef GL_OES_read_format +#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B +#endif + +#ifndef GL_EXT_depth_bounds_test +#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890 +#define GL_DEPTH_BOUNDS_EXT 0x8891 +#endif + +#ifndef GL_EXT_texture_mirror_clamp +#define GL_MIRROR_CLAMP_EXT 0x8742 +#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743 +#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912 +#endif + +#ifndef GL_EXT_blend_equation_separate +#define GL_BLEND_EQUATION_RGB_EXT GL_BLEND_EQUATION +#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D +#endif + +#ifndef GL_MESA_pack_invert +#define GL_PACK_INVERT_MESA 0x8758 +#endif + +#ifndef GL_MESA_ycbcr_texture +#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA +#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB +#define GL_YCBCR_MESA 0x8757 +#endif + +#ifndef GL_EXT_pixel_buffer_object +#define GL_PIXEL_PACK_BUFFER_EXT 0x88EB +#define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF +#endif + +#ifndef GL_NV_fragment_program_option +#endif + +#ifndef GL_NV_fragment_program2 +#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 +#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 +#define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6 +#define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7 +#define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8 +#endif + +#ifndef GL_NV_vertex_program2_option +/* reuse GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ +/* reuse GL_MAX_PROGRAM_CALL_DEPTH_NV */ +#endif + +#ifndef GL_NV_vertex_program3 +/* reuse GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */ +#endif + +#ifndef GL_EXT_framebuffer_object +#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 +#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 +#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6 +#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4 +#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT 0x8CD8 +#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 +#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA +#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB +#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC +#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD +#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF +#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 +#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 +#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 +#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 +#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 +#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 +#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 +#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 +#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 +#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 +#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA +#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB +#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC +#define GL_COLOR_ATTACHMENT13_EXT 0x8CED +#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE +#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF +#define GL_DEPTH_ATTACHMENT_EXT 0x8D00 +#define GL_STENCIL_ATTACHMENT_EXT 0x8D20 +#define GL_FRAMEBUFFER_EXT 0x8D40 +#define GL_RENDERBUFFER_EXT 0x8D41 +#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42 +#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 +#define GL_STENCIL_INDEX1_EXT 0x8D46 +#define GL_STENCIL_INDEX4_EXT 0x8D47 +#define GL_STENCIL_INDEX8_EXT 0x8D48 +#define GL_STENCIL_INDEX16_EXT 0x8D49 +#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55 +#endif + +#ifndef GL_GREMEDY_string_marker +#endif + + +/*************************************************************/ + +#include +#ifndef GL_VERSION_2_0 +/* GL type for program/shader text */ +typedef char GLchar; /* native character */ +#endif + +#ifndef GL_VERSION_1_5 +/* GL types for handling large vertex buffer objects */ +typedef ptrdiff_t GLintptr; +typedef ptrdiff_t GLsizeiptr; +#endif + +#ifndef GL_ARB_vertex_buffer_object +/* GL types for handling large vertex buffer objects */ +typedef ptrdiff_t GLintptrARB; +typedef ptrdiff_t GLsizeiptrARB; +#endif + +#ifndef GL_ARB_shader_objects +/* GL types for handling shader object handles and program/shader text */ +typedef char GLcharARB; /* native character */ +typedef unsigned int GLhandleARB; /* shader object handle */ +#endif + +/* GL types for "half" precision (s10e5) float data in host memory */ +#ifndef GL_ARB_half_float_pixel +typedef unsigned short GLhalfARB; +#endif + +#ifndef GL_NV_half_float +typedef unsigned short GLhalfNV; +#endif + +#ifndef GL_VERSION_1_2 +#define GL_VERSION_1_2 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendColor (GLclampf, GLclampf, GLclampf, GLclampf); +GLAPI void APIENTRY glBlendEquation (GLenum); +GLAPI void APIENTRY glDrawRangeElements (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *); +GLAPI void APIENTRY glColorTable (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glColorTableParameterfv (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glColorTableParameteriv (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glCopyColorTable (GLenum, GLenum, GLint, GLint, GLsizei); +GLAPI void APIENTRY glGetColorTable (GLenum, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetColorTableParameterfv (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetColorTableParameteriv (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glColorSubTable (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glCopyColorSubTable (GLenum, GLsizei, GLint, GLint, GLsizei); +GLAPI void APIENTRY glConvolutionFilter1D (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glConvolutionFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glConvolutionParameterf (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glConvolutionParameterfv (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glConvolutionParameteri (GLenum, GLenum, GLint); +GLAPI void APIENTRY glConvolutionParameteriv (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glCopyConvolutionFilter1D (GLenum, GLenum, GLint, GLint, GLsizei); +GLAPI void APIENTRY glCopyConvolutionFilter2D (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei); +GLAPI void APIENTRY glGetConvolutionFilter (GLenum, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetConvolutionParameterfv (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetConvolutionParameteriv (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetSeparableFilter (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *); +GLAPI void APIENTRY glSeparableFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *); +GLAPI void APIENTRY glGetHistogram (GLenum, GLboolean, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetHistogramParameterfv (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetHistogramParameteriv (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetMinmax (GLenum, GLboolean, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetMinmaxParameterfv (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetMinmaxParameteriv (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glHistogram (GLenum, GLsizei, GLenum, GLboolean); +GLAPI void APIENTRY glMinmax (GLenum, GLenum, GLboolean); +GLAPI void APIENTRY glResetHistogram (GLenum); +GLAPI void APIENTRY glResetMinmax (GLenum); +GLAPI void APIENTRY glTexImage3D (GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glCopyTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC) (GLenum target); +typedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target); +typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +#endif + +#ifndef GL_VERSION_1_3 +#define GL_VERSION_1_3 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glActiveTexture (GLenum); +GLAPI void APIENTRY glClientActiveTexture (GLenum); +GLAPI void APIENTRY glMultiTexCoord1d (GLenum, GLdouble); +GLAPI void APIENTRY glMultiTexCoord1dv (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord1f (GLenum, GLfloat); +GLAPI void APIENTRY glMultiTexCoord1fv (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord1i (GLenum, GLint); +GLAPI void APIENTRY glMultiTexCoord1iv (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord1s (GLenum, GLshort); +GLAPI void APIENTRY glMultiTexCoord1sv (GLenum, const GLshort *); +GLAPI void APIENTRY glMultiTexCoord2d (GLenum, GLdouble, GLdouble); +GLAPI void APIENTRY glMultiTexCoord2dv (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord2f (GLenum, GLfloat, GLfloat); +GLAPI void APIENTRY glMultiTexCoord2fv (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord2i (GLenum, GLint, GLint); +GLAPI void APIENTRY glMultiTexCoord2iv (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord2s (GLenum, GLshort, GLshort); +GLAPI void APIENTRY glMultiTexCoord2sv (GLenum, const GLshort *); +GLAPI void APIENTRY glMultiTexCoord3d (GLenum, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glMultiTexCoord3dv (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord3f (GLenum, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glMultiTexCoord3fv (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord3i (GLenum, GLint, GLint, GLint); +GLAPI void APIENTRY glMultiTexCoord3iv (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord3s (GLenum, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glMultiTexCoord3sv (GLenum, const GLshort *); +GLAPI void APIENTRY glMultiTexCoord4d (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glMultiTexCoord4dv (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord4f (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glMultiTexCoord4fv (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord4i (GLenum, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glMultiTexCoord4iv (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord4s (GLenum, GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glMultiTexCoord4sv (GLenum, const GLshort *); +GLAPI void APIENTRY glLoadTransposeMatrixf (const GLfloat *); +GLAPI void APIENTRY glLoadTransposeMatrixd (const GLdouble *); +GLAPI void APIENTRY glMultTransposeMatrixf (const GLfloat *); +GLAPI void APIENTRY glMultTransposeMatrixd (const GLdouble *); +GLAPI void APIENTRY glSampleCoverage (GLclampf, GLboolean); +GLAPI void APIENTRY glCompressedTexImage3D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexImage2D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexImage1D (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glGetCompressedTexImage (GLenum, GLint, GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m); +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m); +typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img); +#endif + +#ifndef GL_VERSION_1_4 +#define GL_VERSION_1_4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendFuncSeparate (GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glFogCoordf (GLfloat); +GLAPI void APIENTRY glFogCoordfv (const GLfloat *); +GLAPI void APIENTRY glFogCoordd (GLdouble); +GLAPI void APIENTRY glFogCoorddv (const GLdouble *); +GLAPI void APIENTRY glFogCoordPointer (GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glMultiDrawArrays (GLenum, GLint *, GLsizei *, GLsizei); +GLAPI void APIENTRY glMultiDrawElements (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei); +GLAPI void APIENTRY glPointParameterf (GLenum, GLfloat); +GLAPI void APIENTRY glPointParameterfv (GLenum, const GLfloat *); +GLAPI void APIENTRY glPointParameteri (GLenum, GLint); +GLAPI void APIENTRY glPointParameteriv (GLenum, const GLint *); +GLAPI void APIENTRY glSecondaryColor3b (GLbyte, GLbyte, GLbyte); +GLAPI void APIENTRY glSecondaryColor3bv (const GLbyte *); +GLAPI void APIENTRY glSecondaryColor3d (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glSecondaryColor3dv (const GLdouble *); +GLAPI void APIENTRY glSecondaryColor3f (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glSecondaryColor3fv (const GLfloat *); +GLAPI void APIENTRY glSecondaryColor3i (GLint, GLint, GLint); +GLAPI void APIENTRY glSecondaryColor3iv (const GLint *); +GLAPI void APIENTRY glSecondaryColor3s (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glSecondaryColor3sv (const GLshort *); +GLAPI void APIENTRY glSecondaryColor3ub (GLubyte, GLubyte, GLubyte); +GLAPI void APIENTRY glSecondaryColor3ubv (const GLubyte *); +GLAPI void APIENTRY glSecondaryColor3ui (GLuint, GLuint, GLuint); +GLAPI void APIENTRY glSecondaryColor3uiv (const GLuint *); +GLAPI void APIENTRY glSecondaryColor3us (GLushort, GLushort, GLushort); +GLAPI void APIENTRY glSecondaryColor3usv (const GLushort *); +GLAPI void APIENTRY glSecondaryColorPointer (GLint, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glWindowPos2d (GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos2dv (const GLdouble *); +GLAPI void APIENTRY glWindowPos2f (GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos2fv (const GLfloat *); +GLAPI void APIENTRY glWindowPos2i (GLint, GLint); +GLAPI void APIENTRY glWindowPos2iv (const GLint *); +GLAPI void APIENTRY glWindowPos2s (GLshort, GLshort); +GLAPI void APIENTRY glWindowPos2sv (const GLshort *); +GLAPI void APIENTRY glWindowPos3d (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos3dv (const GLdouble *); +GLAPI void APIENTRY glWindowPos3f (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos3fv (const GLfloat *); +GLAPI void APIENTRY glWindowPos3i (GLint, GLint, GLint); +GLAPI void APIENTRY glWindowPos3iv (const GLint *); +GLAPI void APIENTRY glWindowPos3s (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glWindowPos3sv (const GLshort *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +typedef void (APIENTRYP PFNGLFOGCOORDFPROC) (GLfloat coord); +typedef void (APIENTRYP PFNGLFOGCOORDFVPROC) (const GLfloat *coord); +typedef void (APIENTRYP PFNGLFOGCOORDDPROC) (GLdouble coord); +typedef void (APIENTRYP PFNGLFOGCOORDDVPROC) (const GLdouble *coord); +typedef void (APIENTRYP PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLWINDOWPOS2DVPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLWINDOWPOS2FVPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2IPROC) (GLint x, GLint y); +typedef void (APIENTRYP PFNGLWINDOWPOS2IVPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLWINDOWPOS2SVPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLWINDOWPOS3DVPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLWINDOWPOS3FVPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLWINDOWPOS3IVPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLWINDOWPOS3SVPROC) (const GLshort *v); +#endif + +#ifndef GL_VERSION_1_5 +#define GL_VERSION_1_5 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenQueries (GLsizei, GLuint *); +GLAPI void APIENTRY glDeleteQueries (GLsizei, const GLuint *); +GLAPI GLboolean APIENTRY glIsQuery (GLuint); +GLAPI void APIENTRY glBeginQuery (GLenum, GLuint); +GLAPI void APIENTRY glEndQuery (GLenum); +GLAPI void APIENTRY glGetQueryiv (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetQueryObjectiv (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetQueryObjectuiv (GLuint, GLenum, GLuint *); +GLAPI void APIENTRY glBindBuffer (GLenum, GLuint); +GLAPI void APIENTRY glDeleteBuffers (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenBuffers (GLsizei, GLuint *); +GLAPI GLboolean APIENTRY glIsBuffer (GLuint); +GLAPI void APIENTRY glBufferData (GLenum, GLsizeiptr, const GLvoid *, GLenum); +GLAPI void APIENTRY glBufferSubData (GLenum, GLintptr, GLsizeiptr, const GLvoid *); +GLAPI void APIENTRY glGetBufferSubData (GLenum, GLintptr, GLsizeiptr, GLvoid *); +GLAPI GLvoid* APIENTRY glMapBuffer (GLenum, GLenum); +GLAPI GLboolean APIENTRY glUnmapBuffer (GLenum); +GLAPI void APIENTRY glGetBufferParameteriv (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetBufferPointerv (GLenum, GLenum, GLvoid* *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGENQUERIESPROC) (GLsizei n, GLuint *ids); +typedef void (APIENTRYP PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISQUERYPROC) (GLuint id); +typedef void (APIENTRYP PFNGLBEGINQUERYPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLENDQUERYPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer); +typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers); +typedef void (APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers); +typedef GLboolean (APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage); +typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data); +typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data); +typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERPROC) (GLenum target, GLenum access); +typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid* *params); +#endif + +#ifndef GL_VERSION_2_0 +#define GL_VERSION_2_0 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendEquationSeparate (GLenum, GLenum); +GLAPI void APIENTRY glDrawBuffers (GLsizei, const GLenum *); +GLAPI void APIENTRY glStencilOpSeparate (GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glStencilFuncSeparate (GLenum, GLenum, GLint, GLuint); +GLAPI void APIENTRY glStencilMaskSeparate (GLenum, GLuint); +GLAPI void APIENTRY glAttachShader (GLuint, GLuint); +GLAPI void APIENTRY glBindAttribLocation (GLuint, GLuint, const GLchar *); +GLAPI void APIENTRY glCompileShader (GLuint); +GLAPI GLuint APIENTRY glCreateProgram (void); +GLAPI GLuint APIENTRY glCreateShader (GLenum); +GLAPI void APIENTRY glDeleteProgram (GLuint); +GLAPI void APIENTRY glDeleteShader (GLuint); +GLAPI void APIENTRY glDetachShader (GLuint, GLuint); +GLAPI void APIENTRY glDisableVertexAttribArray (GLuint); +GLAPI void APIENTRY glEnableVertexAttribArray (GLuint); +GLAPI void APIENTRY glGetActiveAttrib (GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *); +GLAPI void APIENTRY glGetActiveUniform (GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *); +GLAPI void APIENTRY glGetAttachedShaders (GLuint, GLsizei, GLsizei *, GLuint *); +GLAPI GLint APIENTRY glGetAttribLocation (GLuint, const GLchar *); +GLAPI void APIENTRY glGetProgramiv (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetProgramInfoLog (GLuint, GLsizei, GLsizei *, GLchar *); +GLAPI void APIENTRY glGetShaderiv (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetShaderInfoLog (GLuint, GLsizei, GLsizei *, GLchar *); +GLAPI void APIENTRY glGetShaderSource (GLuint, GLsizei, GLsizei *, GLchar *); +GLAPI GLint APIENTRY glGetUniformLocation (GLuint, const GLchar *); +GLAPI void APIENTRY glGetUniformfv (GLuint, GLint, GLfloat *); +GLAPI void APIENTRY glGetUniformiv (GLuint, GLint, GLint *); +GLAPI void APIENTRY glGetVertexAttribdv (GLuint, GLenum, GLdouble *); +GLAPI void APIENTRY glGetVertexAttribfv (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetVertexAttribiv (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetVertexAttribPointerv (GLuint, GLenum, GLvoid* *); +GLAPI GLboolean APIENTRY glIsProgram (GLuint); +GLAPI GLboolean APIENTRY glIsShader (GLuint); +GLAPI void APIENTRY glLinkProgram (GLuint); +GLAPI void APIENTRY glShaderSource (GLuint, GLsizei, const GLchar* *, const GLint *); +GLAPI void APIENTRY glUseProgram (GLuint); +GLAPI void APIENTRY glUniform1f (GLint, GLfloat); +GLAPI void APIENTRY glUniform2f (GLint, GLfloat, GLfloat); +GLAPI void APIENTRY glUniform3f (GLint, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glUniform4f (GLint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glUniform1i (GLint, GLint); +GLAPI void APIENTRY glUniform2i (GLint, GLint, GLint); +GLAPI void APIENTRY glUniform3i (GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glUniform4i (GLint, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glUniform1fv (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform2fv (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform3fv (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform4fv (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform1iv (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniform2iv (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniform3iv (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniform4iv (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniformMatrix2fv (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glUniformMatrix3fv (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glUniformMatrix4fv (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glValidateProgram (GLuint); +GLAPI void APIENTRY glVertexAttrib1d (GLuint, GLdouble); +GLAPI void APIENTRY glVertexAttrib1dv (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib1f (GLuint, GLfloat); +GLAPI void APIENTRY glVertexAttrib1fv (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib1s (GLuint, GLshort); +GLAPI void APIENTRY glVertexAttrib1sv (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib2d (GLuint, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib2dv (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib2f (GLuint, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib2fv (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib2s (GLuint, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib2sv (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib3d (GLuint, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib3dv (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib3f (GLuint, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib3fv (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib3s (GLuint, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib3sv (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4Nbv (GLuint, const GLbyte *); +GLAPI void APIENTRY glVertexAttrib4Niv (GLuint, const GLint *); +GLAPI void APIENTRY glVertexAttrib4Nsv (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4Nub (GLuint, GLubyte, GLubyte, GLubyte, GLubyte); +GLAPI void APIENTRY glVertexAttrib4Nubv (GLuint, const GLubyte *); +GLAPI void APIENTRY glVertexAttrib4Nuiv (GLuint, const GLuint *); +GLAPI void APIENTRY glVertexAttrib4Nusv (GLuint, const GLushort *); +GLAPI void APIENTRY glVertexAttrib4bv (GLuint, const GLbyte *); +GLAPI void APIENTRY glVertexAttrib4d (GLuint, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib4dv (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib4f (GLuint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib4fv (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib4iv (GLuint, const GLint *); +GLAPI void APIENTRY glVertexAttrib4s (GLuint, GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib4sv (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4ubv (GLuint, const GLubyte *); +GLAPI void APIENTRY glVertexAttrib4uiv (GLuint, const GLuint *); +GLAPI void APIENTRY glVertexAttrib4usv (GLuint, const GLushort *); +GLAPI void APIENTRY glVertexAttribPointer (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha); +typedef void (APIENTRYP PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum *bufs); +typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +typedef void (APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask); +typedef void (APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader); +typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name); +typedef void (APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader); +typedef GLuint (APIENTRYP PFNGLCREATEPROGRAMPROC) (void); +typedef GLuint (APIENTRYP PFNGLCREATESHADERPROC) (GLenum type); +typedef void (APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program); +typedef void (APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader); +typedef void (APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader); +typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index); +typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index); +typedef void (APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +typedef void (APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj); +typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +typedef void (APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +typedef void (APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); +typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params); +typedef void (APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVPROC) (GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, GLvoid* *pointer); +typedef GLboolean (APIENTRYP PFNGLISPROGRAMPROC) (GLuint program); +typedef GLboolean (APIENTRYP PFNGLISSHADERPROC) (GLuint shader); +typedef void (APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program); +typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar* *string, const GLint *length); +typedef void (APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program); +typedef void (APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0); +typedef void (APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1); +typedef void (APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0); +typedef void (APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1); +typedef void (APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2); +typedef void (APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_ARB_multitexture +#define GL_ARB_multitexture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glActiveTextureARB (GLenum); +GLAPI void APIENTRY glClientActiveTextureARB (GLenum); +GLAPI void APIENTRY glMultiTexCoord1dARB (GLenum, GLdouble); +GLAPI void APIENTRY glMultiTexCoord1dvARB (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord1fARB (GLenum, GLfloat); +GLAPI void APIENTRY glMultiTexCoord1fvARB (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord1iARB (GLenum, GLint); +GLAPI void APIENTRY glMultiTexCoord1ivARB (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord1sARB (GLenum, GLshort); +GLAPI void APIENTRY glMultiTexCoord1svARB (GLenum, const GLshort *); +GLAPI void APIENTRY glMultiTexCoord2dARB (GLenum, GLdouble, GLdouble); +GLAPI void APIENTRY glMultiTexCoord2dvARB (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord2fARB (GLenum, GLfloat, GLfloat); +GLAPI void APIENTRY glMultiTexCoord2fvARB (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord2iARB (GLenum, GLint, GLint); +GLAPI void APIENTRY glMultiTexCoord2ivARB (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord2sARB (GLenum, GLshort, GLshort); +GLAPI void APIENTRY glMultiTexCoord2svARB (GLenum, const GLshort *); +GLAPI void APIENTRY glMultiTexCoord3dARB (GLenum, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glMultiTexCoord3dvARB (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord3fARB (GLenum, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glMultiTexCoord3fvARB (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord3iARB (GLenum, GLint, GLint, GLint); +GLAPI void APIENTRY glMultiTexCoord3ivARB (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord3sARB (GLenum, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glMultiTexCoord3svARB (GLenum, const GLshort *); +GLAPI void APIENTRY glMultiTexCoord4dARB (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glMultiTexCoord4dvARB (GLenum, const GLdouble *); +GLAPI void APIENTRY glMultiTexCoord4fARB (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glMultiTexCoord4fvARB (GLenum, const GLfloat *); +GLAPI void APIENTRY glMultiTexCoord4iARB (GLenum, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glMultiTexCoord4ivARB (GLenum, const GLint *); +GLAPI void APIENTRY glMultiTexCoord4sARB (GLenum, GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glMultiTexCoord4svARB (GLenum, const GLshort *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); +#endif + +#ifndef GL_ARB_transpose_matrix +#define GL_ARB_transpose_matrix 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glLoadTransposeMatrixfARB (const GLfloat *); +GLAPI void APIENTRY glLoadTransposeMatrixdARB (const GLdouble *); +GLAPI void APIENTRY glMultTransposeMatrixfARB (const GLfloat *); +GLAPI void APIENTRY glMultTransposeMatrixdARB (const GLdouble *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); +#endif + +#ifndef GL_ARB_multisample +#define GL_ARB_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSampleCoverageARB (GLclampf, GLboolean); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert); +#endif + +#ifndef GL_ARB_texture_env_add +#define GL_ARB_texture_env_add 1 +#endif + +#ifndef GL_ARB_texture_cube_map +#define GL_ARB_texture_cube_map 1 +#endif + +#ifndef GL_ARB_texture_compression +#define GL_ARB_texture_compression 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCompressedTexImage3DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexImage2DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexImage1DARB (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexSubImage3DARB (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexSubImage2DARB (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCompressedTexSubImage1DARB (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum, GLint, GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, GLvoid *img); +#endif + +#ifndef GL_ARB_texture_border_clamp +#define GL_ARB_texture_border_clamp 1 +#endif + +#ifndef GL_ARB_point_parameters +#define GL_ARB_point_parameters 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameterfARB (GLenum, GLfloat); +GLAPI void APIENTRY glPointParameterfvARB (GLenum, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat *params); +#endif + +#ifndef GL_ARB_vertex_blend +#define GL_ARB_vertex_blend 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glWeightbvARB (GLint, const GLbyte *); +GLAPI void APIENTRY glWeightsvARB (GLint, const GLshort *); +GLAPI void APIENTRY glWeightivARB (GLint, const GLint *); +GLAPI void APIENTRY glWeightfvARB (GLint, const GLfloat *); +GLAPI void APIENTRY glWeightdvARB (GLint, const GLdouble *); +GLAPI void APIENTRY glWeightubvARB (GLint, const GLubyte *); +GLAPI void APIENTRY glWeightusvARB (GLint, const GLushort *); +GLAPI void APIENTRY glWeightuivARB (GLint, const GLuint *); +GLAPI void APIENTRY glWeightPointerARB (GLint, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glVertexBlendARB (GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLWEIGHTBVARBPROC) (GLint size, const GLbyte *weights); +typedef void (APIENTRYP PFNGLWEIGHTSVARBPROC) (GLint size, const GLshort *weights); +typedef void (APIENTRYP PFNGLWEIGHTIVARBPROC) (GLint size, const GLint *weights); +typedef void (APIENTRYP PFNGLWEIGHTFVARBPROC) (GLint size, const GLfloat *weights); +typedef void (APIENTRYP PFNGLWEIGHTDVARBPROC) (GLint size, const GLdouble *weights); +typedef void (APIENTRYP PFNGLWEIGHTUBVARBPROC) (GLint size, const GLubyte *weights); +typedef void (APIENTRYP PFNGLWEIGHTUSVARBPROC) (GLint size, const GLushort *weights); +typedef void (APIENTRYP PFNGLWEIGHTUIVARBPROC) (GLint size, const GLuint *weights); +typedef void (APIENTRYP PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLVERTEXBLENDARBPROC) (GLint count); +#endif + +#ifndef GL_ARB_matrix_palette +#define GL_ARB_matrix_palette 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCurrentPaletteMatrixARB (GLint); +GLAPI void APIENTRY glMatrixIndexubvARB (GLint, const GLubyte *); +GLAPI void APIENTRY glMatrixIndexusvARB (GLint, const GLushort *); +GLAPI void APIENTRY glMatrixIndexuivARB (GLint, const GLuint *); +GLAPI void APIENTRY glMatrixIndexPointerARB (GLint, GLenum, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index); +typedef void (APIENTRYP PFNGLMATRIXINDEXUBVARBPROC) (GLint size, const GLubyte *indices); +typedef void (APIENTRYP PFNGLMATRIXINDEXUSVARBPROC) (GLint size, const GLushort *indices); +typedef void (APIENTRYP PFNGLMATRIXINDEXUIVARBPROC) (GLint size, const GLuint *indices); +typedef void (APIENTRYP PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_ARB_texture_env_combine +#define GL_ARB_texture_env_combine 1 +#endif + +#ifndef GL_ARB_texture_env_crossbar +#define GL_ARB_texture_env_crossbar 1 +#endif + +#ifndef GL_ARB_texture_env_dot3 +#define GL_ARB_texture_env_dot3 1 +#endif + +#ifndef GL_ARB_texture_mirrored_repeat +#define GL_ARB_texture_mirrored_repeat 1 +#endif + +#ifndef GL_ARB_depth_texture +#define GL_ARB_depth_texture 1 +#endif + +#ifndef GL_ARB_shadow +#define GL_ARB_shadow 1 +#endif + +#ifndef GL_ARB_shadow_ambient +#define GL_ARB_shadow_ambient 1 +#endif + +#ifndef GL_ARB_window_pos +#define GL_ARB_window_pos 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glWindowPos2dARB (GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos2dvARB (const GLdouble *); +GLAPI void APIENTRY glWindowPos2fARB (GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos2fvARB (const GLfloat *); +GLAPI void APIENTRY glWindowPos2iARB (GLint, GLint); +GLAPI void APIENTRY glWindowPos2ivARB (const GLint *); +GLAPI void APIENTRY glWindowPos2sARB (GLshort, GLshort); +GLAPI void APIENTRY glWindowPos2svARB (const GLshort *); +GLAPI void APIENTRY glWindowPos3dARB (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos3dvARB (const GLdouble *); +GLAPI void APIENTRY glWindowPos3fARB (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos3fvARB (const GLfloat *); +GLAPI void APIENTRY glWindowPos3iARB (GLint, GLint, GLint); +GLAPI void APIENTRY glWindowPos3ivARB (const GLint *); +GLAPI void APIENTRY glWindowPos3sARB (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glWindowPos3svARB (const GLshort *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLWINDOWPOS2DVARBPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLWINDOWPOS2FVARBPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y); +typedef void (APIENTRYP PFNGLWINDOWPOS2IVARBPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLWINDOWPOS2SVARBPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLWINDOWPOS3DVARBPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLWINDOWPOS3FVARBPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLWINDOWPOS3IVARBPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLWINDOWPOS3SVARBPROC) (const GLshort *v); +#endif + +#ifndef GL_ARB_vertex_program +#define GL_ARB_vertex_program 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttrib1dARB (GLuint, GLdouble); +GLAPI void APIENTRY glVertexAttrib1dvARB (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib1fARB (GLuint, GLfloat); +GLAPI void APIENTRY glVertexAttrib1fvARB (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib1sARB (GLuint, GLshort); +GLAPI void APIENTRY glVertexAttrib1svARB (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib2dARB (GLuint, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib2dvARB (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib2fARB (GLuint, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib2fvARB (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib2sARB (GLuint, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib2svARB (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib3dARB (GLuint, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib3dvARB (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib3fARB (GLuint, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib3fvARB (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib3sARB (GLuint, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib3svARB (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4NbvARB (GLuint, const GLbyte *); +GLAPI void APIENTRY glVertexAttrib4NivARB (GLuint, const GLint *); +GLAPI void APIENTRY glVertexAttrib4NsvARB (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4NubARB (GLuint, GLubyte, GLubyte, GLubyte, GLubyte); +GLAPI void APIENTRY glVertexAttrib4NubvARB (GLuint, const GLubyte *); +GLAPI void APIENTRY glVertexAttrib4NuivARB (GLuint, const GLuint *); +GLAPI void APIENTRY glVertexAttrib4NusvARB (GLuint, const GLushort *); +GLAPI void APIENTRY glVertexAttrib4bvARB (GLuint, const GLbyte *); +GLAPI void APIENTRY glVertexAttrib4dARB (GLuint, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib4dvARB (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib4fARB (GLuint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib4fvARB (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib4ivARB (GLuint, const GLint *); +GLAPI void APIENTRY glVertexAttrib4sARB (GLuint, GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib4svARB (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4ubvARB (GLuint, const GLubyte *); +GLAPI void APIENTRY glVertexAttrib4uivARB (GLuint, const GLuint *); +GLAPI void APIENTRY glVertexAttrib4usvARB (GLuint, const GLushort *); +GLAPI void APIENTRY glVertexAttribPointerARB (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *); +GLAPI void APIENTRY glEnableVertexAttribArrayARB (GLuint); +GLAPI void APIENTRY glDisableVertexAttribArrayARB (GLuint); +GLAPI void APIENTRY glProgramStringARB (GLenum, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glBindProgramARB (GLenum, GLuint); +GLAPI void APIENTRY glDeleteProgramsARB (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenProgramsARB (GLsizei, GLuint *); +GLAPI void APIENTRY glProgramEnvParameter4dARB (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glProgramEnvParameter4dvARB (GLenum, GLuint, const GLdouble *); +GLAPI void APIENTRY glProgramEnvParameter4fARB (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glProgramEnvParameter4fvARB (GLenum, GLuint, const GLfloat *); +GLAPI void APIENTRY glProgramLocalParameter4dARB (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glProgramLocalParameter4dvARB (GLenum, GLuint, const GLdouble *); +GLAPI void APIENTRY glProgramLocalParameter4fARB (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glProgramLocalParameter4fvARB (GLenum, GLuint, const GLfloat *); +GLAPI void APIENTRY glGetProgramEnvParameterdvARB (GLenum, GLuint, GLdouble *); +GLAPI void APIENTRY glGetProgramEnvParameterfvARB (GLenum, GLuint, GLfloat *); +GLAPI void APIENTRY glGetProgramLocalParameterdvARB (GLenum, GLuint, GLdouble *); +GLAPI void APIENTRY glGetProgramLocalParameterfvARB (GLenum, GLuint, GLfloat *); +GLAPI void APIENTRY glGetProgramivARB (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetProgramStringARB (GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetVertexAttribdvARB (GLuint, GLenum, GLdouble *); +GLAPI void APIENTRY glGetVertexAttribfvARB (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetVertexAttribivARB (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetVertexAttribPointervARB (GLuint, GLenum, GLvoid* *); +GLAPI GLboolean APIENTRY glIsProgramARB (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); +typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); +typedef void (APIENTRYP PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const GLvoid *string); +typedef void (APIENTRYP PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program); +typedef void (APIENTRYP PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint *programs); +typedef void (APIENTRYP PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint *programs); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params); +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params); +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, GLvoid *string); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, GLvoid* *pointer); +typedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC) (GLuint program); +#endif + +#ifndef GL_ARB_fragment_program +#define GL_ARB_fragment_program 1 +/* All ARB_fragment_program entry points are shared with ARB_vertex_program. */ +#endif + +#ifndef GL_ARB_vertex_buffer_object +#define GL_ARB_vertex_buffer_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindBufferARB (GLenum, GLuint); +GLAPI void APIENTRY glDeleteBuffersARB (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenBuffersARB (GLsizei, GLuint *); +GLAPI GLboolean APIENTRY glIsBufferARB (GLuint); +GLAPI void APIENTRY glBufferDataARB (GLenum, GLsizeiptrARB, const GLvoid *, GLenum); +GLAPI void APIENTRY glBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, const GLvoid *); +GLAPI void APIENTRY glGetBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, GLvoid *); +GLAPI GLvoid* APIENTRY glMapBufferARB (GLenum, GLenum); +GLAPI GLboolean APIENTRY glUnmapBufferARB (GLenum); +GLAPI void APIENTRY glGetBufferParameterivARB (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetBufferPointervARB (GLenum, GLenum, GLvoid* *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer); +typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint *buffers); +typedef void (APIENTRYP PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint *buffers); +typedef GLboolean (APIENTRYP PFNGLISBUFFERARBPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage); +typedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data); +typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data); +typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access); +typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERARBPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid* *params); +#endif + +#ifndef GL_ARB_occlusion_query +#define GL_ARB_occlusion_query 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenQueriesARB (GLsizei, GLuint *); +GLAPI void APIENTRY glDeleteQueriesARB (GLsizei, const GLuint *); +GLAPI GLboolean APIENTRY glIsQueryARB (GLuint); +GLAPI void APIENTRY glBeginQueryARB (GLenum, GLuint); +GLAPI void APIENTRY glEndQueryARB (GLenum); +GLAPI void APIENTRY glGetQueryivARB (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetQueryObjectivARB (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetQueryObjectuivARB (GLuint, GLenum, GLuint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint *ids); +typedef void (APIENTRYP PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISQUERYARBPROC) (GLuint id); +typedef void (APIENTRYP PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLENDQUERYARBPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint *params); +#endif + +#ifndef GL_ARB_shader_objects +#define GL_ARB_shader_objects 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDeleteObjectARB (GLhandleARB); +GLAPI GLhandleARB APIENTRY glGetHandleARB (GLenum); +GLAPI void APIENTRY glDetachObjectARB (GLhandleARB, GLhandleARB); +GLAPI GLhandleARB APIENTRY glCreateShaderObjectARB (GLenum); +GLAPI void APIENTRY glShaderSourceARB (GLhandleARB, GLsizei, const GLcharARB* *, const GLint *); +GLAPI void APIENTRY glCompileShaderARB (GLhandleARB); +GLAPI GLhandleARB APIENTRY glCreateProgramObjectARB (void); +GLAPI void APIENTRY glAttachObjectARB (GLhandleARB, GLhandleARB); +GLAPI void APIENTRY glLinkProgramARB (GLhandleARB); +GLAPI void APIENTRY glUseProgramObjectARB (GLhandleARB); +GLAPI void APIENTRY glValidateProgramARB (GLhandleARB); +GLAPI void APIENTRY glUniform1fARB (GLint, GLfloat); +GLAPI void APIENTRY glUniform2fARB (GLint, GLfloat, GLfloat); +GLAPI void APIENTRY glUniform3fARB (GLint, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glUniform4fARB (GLint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glUniform1iARB (GLint, GLint); +GLAPI void APIENTRY glUniform2iARB (GLint, GLint, GLint); +GLAPI void APIENTRY glUniform3iARB (GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glUniform4iARB (GLint, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glUniform1fvARB (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform2fvARB (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform3fvARB (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform4fvARB (GLint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glUniform1ivARB (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniform2ivARB (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniform3ivARB (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniform4ivARB (GLint, GLsizei, const GLint *); +GLAPI void APIENTRY glUniformMatrix2fvARB (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glUniformMatrix3fvARB (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glUniformMatrix4fvARB (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glGetObjectParameterfvARB (GLhandleARB, GLenum, GLfloat *); +GLAPI void APIENTRY glGetObjectParameterivARB (GLhandleARB, GLenum, GLint *); +GLAPI void APIENTRY glGetInfoLogARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *); +GLAPI void APIENTRY glGetAttachedObjectsARB (GLhandleARB, GLsizei, GLsizei *, GLhandleARB *); +GLAPI GLint APIENTRY glGetUniformLocationARB (GLhandleARB, const GLcharARB *); +GLAPI void APIENTRY glGetActiveUniformARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *); +GLAPI void APIENTRY glGetUniformfvARB (GLhandleARB, GLint, GLfloat *); +GLAPI void APIENTRY glGetUniformivARB (GLhandleARB, GLint, GLint *); +GLAPI void APIENTRY glGetShaderSourceARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj); +typedef GLhandleARB (APIENTRYP PFNGLGETHANDLEARBPROC) (GLenum pname); +typedef void (APIENTRYP PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj); +typedef GLhandleARB (APIENTRYP PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType); +typedef void (APIENTRYP PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB* *string, const GLint *length); +typedef void (APIENTRYP PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj); +typedef GLhandleARB (APIENTRYP PFNGLCREATEPROGRAMOBJECTARBPROC) (void); +typedef void (APIENTRYP PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj); +typedef void (APIENTRYP PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj); +typedef void (APIENTRYP PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj); +typedef void (APIENTRYP PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj); +typedef void (APIENTRYP PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0); +typedef void (APIENTRYP PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1); +typedef void (APIENTRYP PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (APIENTRYP PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (APIENTRYP PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0); +typedef void (APIENTRYP PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1); +typedef void (APIENTRYP PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2); +typedef void (APIENTRYP PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (APIENTRYP PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog); +typedef void (APIENTRYP PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj); +typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); +typedef void (APIENTRYP PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat *params); +typedef void (APIENTRYP PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint *params); +typedef void (APIENTRYP PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source); +#endif + +#ifndef GL_ARB_vertex_shader +#define GL_ARB_vertex_shader 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindAttribLocationARB (GLhandleARB, GLuint, const GLcharARB *); +GLAPI void APIENTRY glGetActiveAttribARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *); +GLAPI GLint APIENTRY glGetAttribLocationARB (GLhandleARB, const GLcharARB *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB *name); +typedef void (APIENTRYP PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); +typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name); +#endif + +#ifndef GL_ARB_fragment_shader +#define GL_ARB_fragment_shader 1 +#endif + +#ifndef GL_ARB_shading_language_100 +#define GL_ARB_shading_language_100 1 +#endif + +#ifndef GL_ARB_texture_non_power_of_two +#define GL_ARB_texture_non_power_of_two 1 +#endif + +#ifndef GL_ARB_point_sprite +#define GL_ARB_point_sprite 1 +#endif + +#ifndef GL_ARB_fragment_program_shadow +#define GL_ARB_fragment_program_shadow 1 +#endif + +#ifndef GL_ARB_draw_buffers +#define GL_ARB_draw_buffers 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawBuffersARB (GLsizei, const GLenum *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum *bufs); +#endif + +#ifndef GL_ARB_texture_rectangle +#define GL_ARB_texture_rectangle 1 +#endif + +#ifndef GL_ARB_color_buffer_float +#define GL_ARB_color_buffer_float 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glClampColorARB (GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp); +#endif + +#ifndef GL_ARB_half_float_pixel +#define GL_ARB_half_float_pixel 1 +#endif + +#ifndef GL_ARB_texture_float +#define GL_ARB_texture_float 1 +#endif + +#ifndef GL_ARB_pixel_buffer_object +#define GL_ARB_pixel_buffer_object 1 +#endif + +#ifndef GL_EXT_abgr +#define GL_EXT_abgr 1 +#endif + +#ifndef GL_EXT_blend_color +#define GL_EXT_blend_color 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendColorEXT (GLclampf, GLclampf, GLclampf, GLclampf); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +#endif + +#ifndef GL_EXT_polygon_offset +#define GL_EXT_polygon_offset 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPolygonOffsetEXT (GLfloat, GLfloat); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias); +#endif + +#ifndef GL_EXT_texture +#define GL_EXT_texture 1 +#endif + +#ifndef GL_EXT_texture3D +#define GL_EXT_texture3D 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexImage3DEXT (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +#endif + +#ifndef GL_SGIS_texture_filter4 +#define GL_SGIS_texture_filter4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetTexFilterFuncSGIS (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glTexFilterFuncSGIS (GLenum, GLenum, GLsizei, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat *weights); +typedef void (APIENTRYP PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights); +#endif + +#ifndef GL_EXT_subtexture +#define GL_EXT_subtexture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexSubImage1DEXT (GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +#endif + +#ifndef GL_EXT_copy_texture +#define GL_EXT_copy_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCopyTexImage1DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint); +GLAPI void APIENTRY glCopyTexImage2DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint); +GLAPI void APIENTRY glCopyTexSubImage1DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei); +GLAPI void APIENTRY glCopyTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); +GLAPI void APIENTRY glCopyTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +#endif + +#ifndef GL_EXT_histogram +#define GL_EXT_histogram 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetHistogramEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetHistogramParameterfvEXT (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetHistogramParameterivEXT (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetMinmaxEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetMinmaxParameterfvEXT (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetMinmaxParameterivEXT (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glHistogramEXT (GLenum, GLsizei, GLenum, GLboolean); +GLAPI void APIENTRY glMinmaxEXT (GLenum, GLenum, GLboolean); +GLAPI void APIENTRY glResetHistogramEXT (GLenum); +GLAPI void APIENTRY glResetMinmaxEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLRESETHISTOGRAMEXTPROC) (GLenum target); +typedef void (APIENTRYP PFNGLRESETMINMAXEXTPROC) (GLenum target); +#endif + +#ifndef GL_EXT_convolution +#define GL_EXT_convolution 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glConvolutionFilter1DEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glConvolutionFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glConvolutionParameterfEXT (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glConvolutionParameterfvEXT (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glConvolutionParameteriEXT (GLenum, GLenum, GLint); +GLAPI void APIENTRY glConvolutionParameterivEXT (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glCopyConvolutionFilter1DEXT (GLenum, GLenum, GLint, GLint, GLsizei); +GLAPI void APIENTRY glCopyConvolutionFilter2DEXT (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei); +GLAPI void APIENTRY glGetConvolutionFilterEXT (GLenum, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetConvolutionParameterfvEXT (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetConvolutionParameterivEXT (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetSeparableFilterEXT (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *); +GLAPI void APIENTRY glSeparableFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); +#endif + +#ifndef GL_EXT_color_matrix +#define GL_EXT_color_matrix 1 +#endif + +#ifndef GL_SGI_color_table +#define GL_SGI_color_table 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorTableSGI (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glColorTableParameterfvSGI (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glColorTableParameterivSGI (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glCopyColorTableSGI (GLenum, GLenum, GLint, GLint, GLsizei); +GLAPI void APIENTRY glGetColorTableSGI (GLenum, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetColorTableParameterfvSGI (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetColorTableParameterivSGI (GLenum, GLenum, GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint *params); +#endif + +#ifndef GL_SGIX_pixel_texture +#define GL_SGIX_pixel_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPixelTexGenSGIX (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); +#endif + +#ifndef GL_SGIS_pixel_texture +#define GL_SGIS_pixel_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPixelTexGenParameteriSGIS (GLenum, GLint); +GLAPI void APIENTRY glPixelTexGenParameterivSGIS (GLenum, const GLint *); +GLAPI void APIENTRY glPixelTexGenParameterfSGIS (GLenum, GLfloat); +GLAPI void APIENTRY glPixelTexGenParameterfvSGIS (GLenum, const GLfloat *); +GLAPI void APIENTRY glGetPixelTexGenParameterivSGIS (GLenum, GLint *); +GLAPI void APIENTRY glGetPixelTexGenParameterfvSGIS (GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFSGISPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, GLfloat *params); +#endif + +#ifndef GL_SGIS_texture4D +#define GL_SGIS_texture4D 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexImage4DSGIS (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glTexSubImage4DSGIS (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels); +#endif + +#ifndef GL_SGI_texture_color_table +#define GL_SGI_texture_color_table 1 +#endif + +#ifndef GL_EXT_cmyka +#define GL_EXT_cmyka 1 +#endif + +#ifndef GL_EXT_texture_object +#define GL_EXT_texture_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLboolean APIENTRY glAreTexturesResidentEXT (GLsizei, const GLuint *, GLboolean *); +GLAPI void APIENTRY glBindTextureEXT (GLenum, GLuint); +GLAPI void APIENTRY glDeleteTexturesEXT (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenTexturesEXT (GLsizei, GLuint *); +GLAPI GLboolean APIENTRY glIsTextureEXT (GLuint); +GLAPI void APIENTRY glPrioritizeTexturesEXT (GLsizei, const GLuint *, const GLclampf *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLboolean (APIENTRYP PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint *textures, GLboolean *residences); +typedef void (APIENTRYP PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture); +typedef void (APIENTRYP PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint *textures); +typedef void (APIENTRYP PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint *textures); +typedef GLboolean (APIENTRYP PFNGLISTEXTUREEXTPROC) (GLuint texture); +typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint *textures, const GLclampf *priorities); +#endif + +#ifndef GL_SGIS_detail_texture +#define GL_SGIS_detail_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDetailTexFuncSGIS (GLenum, GLsizei, const GLfloat *); +GLAPI void APIENTRY glGetDetailTexFuncSGIS (GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); +typedef void (APIENTRYP PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat *points); +#endif + +#ifndef GL_SGIS_sharpen_texture +#define GL_SGIS_sharpen_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSharpenTexFuncSGIS (GLenum, GLsizei, const GLfloat *); +GLAPI void APIENTRY glGetSharpenTexFuncSGIS (GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); +typedef void (APIENTRYP PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat *points); +#endif + +#ifndef GL_EXT_packed_pixels +#define GL_EXT_packed_pixels 1 +#endif + +#ifndef GL_SGIS_texture_lod +#define GL_SGIS_texture_lod 1 +#endif + +#ifndef GL_SGIS_multisample +#define GL_SGIS_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSampleMaskSGIS (GLclampf, GLboolean); +GLAPI void APIENTRY glSamplePatternSGIS (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRYP PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); +#endif + +#ifndef GL_EXT_rescale_normal +#define GL_EXT_rescale_normal 1 +#endif + +#ifndef GL_EXT_vertex_array +#define GL_EXT_vertex_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glArrayElementEXT (GLint); +GLAPI void APIENTRY glColorPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); +GLAPI void APIENTRY glDrawArraysEXT (GLenum, GLint, GLsizei); +GLAPI void APIENTRY glEdgeFlagPointerEXT (GLsizei, GLsizei, const GLboolean *); +GLAPI void APIENTRY glGetPointervEXT (GLenum, GLvoid* *); +GLAPI void APIENTRY glIndexPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *); +GLAPI void APIENTRY glNormalPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *); +GLAPI void APIENTRY glTexCoordPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); +GLAPI void APIENTRY glVertexPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLARRAYELEMENTEXTPROC) (GLint i); +typedef void (APIENTRYP PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (APIENTRYP PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean *pointer); +typedef void (APIENTRYP PFNGLGETPOINTERVEXTPROC) (GLenum pname, GLvoid* *params); +typedef void (APIENTRYP PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +#endif + +#ifndef GL_EXT_misc_attribute +#define GL_EXT_misc_attribute 1 +#endif + +#ifndef GL_SGIS_generate_mipmap +#define GL_SGIS_generate_mipmap 1 +#endif + +#ifndef GL_SGIX_clipmap +#define GL_SGIX_clipmap 1 +#endif + +#ifndef GL_SGIX_shadow +#define GL_SGIX_shadow 1 +#endif + +#ifndef GL_SGIS_texture_edge_clamp +#define GL_SGIS_texture_edge_clamp 1 +#endif + +#ifndef GL_SGIS_texture_border_clamp +#define GL_SGIS_texture_border_clamp 1 +#endif + +#ifndef GL_EXT_blend_minmax +#define GL_EXT_blend_minmax 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendEquationEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDEQUATIONEXTPROC) (GLenum mode); +#endif + +#ifndef GL_EXT_blend_subtract +#define GL_EXT_blend_subtract 1 +#endif + +#ifndef GL_EXT_blend_logic_op +#define GL_EXT_blend_logic_op 1 +#endif + +#ifndef GL_SGIX_interlace +#define GL_SGIX_interlace 1 +#endif + +#ifndef GL_SGIX_pixel_tiles +#define GL_SGIX_pixel_tiles 1 +#endif + +#ifndef GL_SGIX_texture_select +#define GL_SGIX_texture_select 1 +#endif + +#ifndef GL_SGIX_sprite +#define GL_SGIX_sprite 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSpriteParameterfSGIX (GLenum, GLfloat); +GLAPI void APIENTRY glSpriteParameterfvSGIX (GLenum, const GLfloat *); +GLAPI void APIENTRY glSpriteParameteriSGIX (GLenum, GLint); +GLAPI void APIENTRY glSpriteParameterivSGIX (GLenum, const GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GLint *params); +#endif + +#ifndef GL_SGIX_texture_multi_buffer +#define GL_SGIX_texture_multi_buffer 1 +#endif + +#ifndef GL_EXT_point_parameters +#define GL_EXT_point_parameters 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameterfEXT (GLenum, GLfloat); +GLAPI void APIENTRY glPointParameterfvEXT (GLenum, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params); +#endif + +#ifndef GL_SGIS_point_parameters +#define GL_SGIS_point_parameters 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameterfSGIS (GLenum, GLfloat); +GLAPI void APIENTRY glPointParameterfvSGIS (GLenum, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); +#endif + +#ifndef GL_SGIX_instruments +#define GL_SGIX_instruments 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLint APIENTRY glGetInstrumentsSGIX (void); +GLAPI void APIENTRY glInstrumentsBufferSGIX (GLsizei, GLint *); +GLAPI GLint APIENTRY glPollInstrumentsSGIX (GLint *); +GLAPI void APIENTRY glReadInstrumentsSGIX (GLint); +GLAPI void APIENTRY glStartInstrumentsSGIX (void); +GLAPI void APIENTRY glStopInstrumentsSGIX (GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLint (APIENTRYP PFNGLGETINSTRUMENTSSGIXPROC) (void); +typedef void (APIENTRYP PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint *buffer); +typedef GLint (APIENTRYP PFNGLPOLLINSTRUMENTSSGIXPROC) (GLint *marker_p); +typedef void (APIENTRYP PFNGLREADINSTRUMENTSSGIXPROC) (GLint marker); +typedef void (APIENTRYP PFNGLSTARTINSTRUMENTSSGIXPROC) (void); +typedef void (APIENTRYP PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker); +#endif + +#ifndef GL_SGIX_texture_scale_bias +#define GL_SGIX_texture_scale_bias 1 +#endif + +#ifndef GL_SGIX_framezoom +#define GL_SGIX_framezoom 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFrameZoomSGIX (GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFRAMEZOOMSGIXPROC) (GLint factor); +#endif + +#ifndef GL_SGIX_tag_sample_buffer +#define GL_SGIX_tag_sample_buffer 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTagSampleBufferSGIX (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTAGSAMPLEBUFFERSGIXPROC) (void); +#endif + +#ifndef GL_SGIX_polynomial_ffd +#define GL_SGIX_polynomial_ffd 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDeformationMap3dSGIX (GLenum, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, const GLdouble *); +GLAPI void APIENTRY glDeformationMap3fSGIX (GLenum, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, const GLfloat *); +GLAPI void APIENTRY glDeformSGIX (GLbitfield); +GLAPI void APIENTRY glLoadIdentityDeformationMapSGIX (GLbitfield); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDEFORMATIONMAP3DSGIXPROC) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points); +typedef void (APIENTRYP PFNGLDEFORMATIONMAP3FSGIXPROC) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points); +typedef void (APIENTRYP PFNGLDEFORMSGIXPROC) (GLbitfield mask); +typedef void (APIENTRYP PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mask); +#endif + +#ifndef GL_SGIX_reference_plane +#define GL_SGIX_reference_plane 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glReferencePlaneSGIX (const GLdouble *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLREFERENCEPLANESGIXPROC) (const GLdouble *equation); +#endif + +#ifndef GL_SGIX_flush_raster +#define GL_SGIX_flush_raster 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFlushRasterSGIX (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFLUSHRASTERSGIXPROC) (void); +#endif + +#ifndef GL_SGIX_depth_texture +#define GL_SGIX_depth_texture 1 +#endif + +#ifndef GL_SGIS_fog_function +#define GL_SGIS_fog_function 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFogFuncSGIS (GLsizei, const GLfloat *); +GLAPI void APIENTRY glGetFogFuncSGIS (GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat *points); +typedef void (APIENTRYP PFNGLGETFOGFUNCSGISPROC) (GLfloat *points); +#endif + +#ifndef GL_SGIX_fog_offset +#define GL_SGIX_fog_offset 1 +#endif + +#ifndef GL_HP_image_transform +#define GL_HP_image_transform 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glImageTransformParameteriHP (GLenum, GLenum, GLint); +GLAPI void APIENTRY glImageTransformParameterfHP (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glImageTransformParameterivHP (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glImageTransformParameterfvHP (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glGetImageTransformParameterivHP (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetImageTransformParameterfvHP (GLenum, GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, GLfloat *params); +#endif + +#ifndef GL_HP_convolution_border_modes +#define GL_HP_convolution_border_modes 1 +#endif + +#ifndef GL_SGIX_texture_add_env +#define GL_SGIX_texture_add_env 1 +#endif + +#ifndef GL_EXT_color_subtable +#define GL_EXT_color_subtable 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorSubTableEXT (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glCopyColorSubTableEXT (GLenum, GLsizei, GLint, GLint, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +#endif + +#ifndef GL_PGI_vertex_hints +#define GL_PGI_vertex_hints 1 +#endif + +#ifndef GL_PGI_misc_hints +#define GL_PGI_misc_hints 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glHintPGI (GLenum, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLHINTPGIPROC) (GLenum target, GLint mode); +#endif + +#ifndef GL_EXT_paletted_texture +#define GL_EXT_paletted_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorTableEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glGetColorTableEXT (GLenum, GLenum, GLenum, GLvoid *); +GLAPI void APIENTRY glGetColorTableParameterivEXT (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetColorTableParameterfvEXT (GLenum, GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (APIENTRYP PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *data); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +#endif + +#ifndef GL_EXT_clip_volume_hint +#define GL_EXT_clip_volume_hint 1 +#endif + +#ifndef GL_SGIX_list_priority +#define GL_SGIX_list_priority 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetListParameterfvSGIX (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetListParameterivSGIX (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glListParameterfSGIX (GLuint, GLenum, GLfloat); +GLAPI void APIENTRY glListParameterfvSGIX (GLuint, GLenum, const GLfloat *); +GLAPI void APIENTRY glListParameteriSGIX (GLuint, GLenum, GLint); +GLAPI void APIENTRY glListParameterivSGIX (GLuint, GLenum, const GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLLISTPARAMETERFSGIXPROC) (GLuint list, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLLISTPARAMETERISGIXPROC) (GLuint list, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, const GLint *params); +#endif + +#ifndef GL_SGIX_ir_instrument1 +#define GL_SGIX_ir_instrument1 1 +#endif + +#ifndef GL_SGIX_calligraphic_fragment +#define GL_SGIX_calligraphic_fragment 1 +#endif + +#ifndef GL_SGIX_texture_lod_bias +#define GL_SGIX_texture_lod_bias 1 +#endif + +#ifndef GL_SGIX_shadow_ambient +#define GL_SGIX_shadow_ambient 1 +#endif + +#ifndef GL_EXT_index_texture +#define GL_EXT_index_texture 1 +#endif + +#ifndef GL_EXT_index_material +#define GL_EXT_index_material 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glIndexMaterialEXT (GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode); +#endif + +#ifndef GL_EXT_index_func +#define GL_EXT_index_func 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glIndexFuncEXT (GLenum, GLclampf); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref); +#endif + +#ifndef GL_EXT_index_array_formats +#define GL_EXT_index_array_formats 1 +#endif + +#ifndef GL_EXT_compiled_vertex_array +#define GL_EXT_compiled_vertex_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glLockArraysEXT (GLint, GLsizei); +GLAPI void APIENTRY glUnlockArraysEXT (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count); +typedef void (APIENTRYP PFNGLUNLOCKARRAYSEXTPROC) (void); +#endif + +#ifndef GL_EXT_cull_vertex +#define GL_EXT_cull_vertex 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCullParameterdvEXT (GLenum, GLdouble *); +GLAPI void APIENTRY glCullParameterfvEXT (GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat *params); +#endif + +#ifndef GL_SGIX_ycrcb +#define GL_SGIX_ycrcb 1 +#endif + +#ifndef GL_SGIX_fragment_lighting +#define GL_SGIX_fragment_lighting 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFragmentColorMaterialSGIX (GLenum, GLenum); +GLAPI void APIENTRY glFragmentLightfSGIX (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glFragmentLightfvSGIX (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glFragmentLightiSGIX (GLenum, GLenum, GLint); +GLAPI void APIENTRY glFragmentLightivSGIX (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glFragmentLightModelfSGIX (GLenum, GLfloat); +GLAPI void APIENTRY glFragmentLightModelfvSGIX (GLenum, const GLfloat *); +GLAPI void APIENTRY glFragmentLightModeliSGIX (GLenum, GLint); +GLAPI void APIENTRY glFragmentLightModelivSGIX (GLenum, const GLint *); +GLAPI void APIENTRY glFragmentMaterialfSGIX (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glFragmentMaterialfvSGIX (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glFragmentMaterialiSGIX (GLenum, GLenum, GLint); +GLAPI void APIENTRY glFragmentMaterialivSGIX (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glGetFragmentLightfvSGIX (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetFragmentLightivSGIX (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetFragmentMaterialfvSGIX (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetFragmentMaterialivSGIX (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glLightEnviSGIX (GLenum, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param); +#endif + +#ifndef GL_IBM_rasterpos_clip +#define GL_IBM_rasterpos_clip 1 +#endif + +#ifndef GL_HP_texture_lighting +#define GL_HP_texture_lighting 1 +#endif + +#ifndef GL_EXT_draw_range_elements +#define GL_EXT_draw_range_elements 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawRangeElementsEXT (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +#endif + +#ifndef GL_WIN_phong_shading +#define GL_WIN_phong_shading 1 +#endif + +#ifndef GL_WIN_specular_fog +#define GL_WIN_specular_fog 1 +#endif + +#ifndef GL_EXT_light_texture +#define GL_EXT_light_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glApplyTextureEXT (GLenum); +GLAPI void APIENTRY glTextureLightEXT (GLenum); +GLAPI void APIENTRY glTextureMaterialEXT (GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLTEXTURELIGHTEXTPROC) (GLenum pname); +typedef void (APIENTRYP PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode); +#endif + +#ifndef GL_SGIX_blend_alpha_minmax +#define GL_SGIX_blend_alpha_minmax 1 +#endif + +#ifndef GL_EXT_bgra +#define GL_EXT_bgra 1 +#endif + +#ifndef GL_SGIX_async +#define GL_SGIX_async 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glAsyncMarkerSGIX (GLuint); +GLAPI GLint APIENTRY glFinishAsyncSGIX (GLuint *); +GLAPI GLint APIENTRY glPollAsyncSGIX (GLuint *); +GLAPI GLuint APIENTRY glGenAsyncMarkersSGIX (GLsizei); +GLAPI void APIENTRY glDeleteAsyncMarkersSGIX (GLuint, GLsizei); +GLAPI GLboolean APIENTRY glIsAsyncMarkerSGIX (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLASYNCMARKERSGIXPROC) (GLuint marker); +typedef GLint (APIENTRYP PFNGLFINISHASYNCSGIXPROC) (GLuint *markerp); +typedef GLint (APIENTRYP PFNGLPOLLASYNCSGIXPROC) (GLuint *markerp); +typedef GLuint (APIENTRYP PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range); +typedef void (APIENTRYP PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range); +typedef GLboolean (APIENTRYP PFNGLISASYNCMARKERSGIXPROC) (GLuint marker); +#endif + +#ifndef GL_SGIX_async_pixel +#define GL_SGIX_async_pixel 1 +#endif + +#ifndef GL_SGIX_async_histogram +#define GL_SGIX_async_histogram 1 +#endif + +#ifndef GL_INTEL_parallel_arrays +#define GL_INTEL_parallel_arrays 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexPointervINTEL (GLint, GLenum, const GLvoid* *); +GLAPI void APIENTRY glNormalPointervINTEL (GLenum, const GLvoid* *); +GLAPI void APIENTRY glColorPointervINTEL (GLint, GLenum, const GLvoid* *); +GLAPI void APIENTRY glTexCoordPointervINTEL (GLint, GLenum, const GLvoid* *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); +typedef void (APIENTRYP PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const GLvoid* *pointer); +typedef void (APIENTRYP PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); +typedef void (APIENTRYP PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); +#endif + +#ifndef GL_HP_occlusion_test +#define GL_HP_occlusion_test 1 +#endif + +#ifndef GL_EXT_pixel_transform +#define GL_EXT_pixel_transform 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPixelTransformParameteriEXT (GLenum, GLenum, GLint); +GLAPI void APIENTRY glPixelTransformParameterfEXT (GLenum, GLenum, GLfloat); +GLAPI void APIENTRY glPixelTransformParameterivEXT (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glPixelTransformParameterfvEXT (GLenum, GLenum, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); +#endif + +#ifndef GL_EXT_pixel_transform_color_table +#define GL_EXT_pixel_transform_color_table 1 +#endif + +#ifndef GL_EXT_shared_texture_palette +#define GL_EXT_shared_texture_palette 1 +#endif + +#ifndef GL_EXT_separate_specular_color +#define GL_EXT_separate_specular_color 1 +#endif + +#ifndef GL_EXT_secondary_color +#define GL_EXT_secondary_color 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSecondaryColor3bEXT (GLbyte, GLbyte, GLbyte); +GLAPI void APIENTRY glSecondaryColor3bvEXT (const GLbyte *); +GLAPI void APIENTRY glSecondaryColor3dEXT (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glSecondaryColor3dvEXT (const GLdouble *); +GLAPI void APIENTRY glSecondaryColor3fEXT (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glSecondaryColor3fvEXT (const GLfloat *); +GLAPI void APIENTRY glSecondaryColor3iEXT (GLint, GLint, GLint); +GLAPI void APIENTRY glSecondaryColor3ivEXT (const GLint *); +GLAPI void APIENTRY glSecondaryColor3sEXT (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glSecondaryColor3svEXT (const GLshort *); +GLAPI void APIENTRY glSecondaryColor3ubEXT (GLubyte, GLubyte, GLubyte); +GLAPI void APIENTRY glSecondaryColor3ubvEXT (const GLubyte *); +GLAPI void APIENTRY glSecondaryColor3uiEXT (GLuint, GLuint, GLuint); +GLAPI void APIENTRY glSecondaryColor3uivEXT (const GLuint *); +GLAPI void APIENTRY glSecondaryColor3usEXT (GLushort, GLushort, GLushort); +GLAPI void APIENTRY glSecondaryColor3usvEXT (const GLushort *); +GLAPI void APIENTRY glSecondaryColorPointerEXT (GLint, GLenum, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_EXT_texture_perturb_normal +#define GL_EXT_texture_perturb_normal 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTextureNormalEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXTURENORMALEXTPROC) (GLenum mode); +#endif + +#ifndef GL_EXT_multi_draw_arrays +#define GL_EXT_multi_draw_arrays 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMultiDrawArraysEXT (GLenum, GLint *, GLsizei *, GLsizei); +GLAPI void APIENTRY glMultiDrawElementsEXT (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); +#endif + +#ifndef GL_EXT_fog_coord +#define GL_EXT_fog_coord 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFogCoordfEXT (GLfloat); +GLAPI void APIENTRY glFogCoordfvEXT (const GLfloat *); +GLAPI void APIENTRY glFogCoorddEXT (GLdouble); +GLAPI void APIENTRY glFogCoorddvEXT (const GLdouble *); +GLAPI void APIENTRY glFogCoordPointerEXT (GLenum, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFOGCOORDFEXTPROC) (GLfloat coord); +typedef void (APIENTRYP PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord); +typedef void (APIENTRYP PFNGLFOGCOORDDEXTPROC) (GLdouble coord); +typedef void (APIENTRYP PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord); +typedef void (APIENTRYP PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_REND_screen_coordinates +#define GL_REND_screen_coordinates 1 +#endif + +#ifndef GL_EXT_coordinate_frame +#define GL_EXT_coordinate_frame 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTangent3bEXT (GLbyte, GLbyte, GLbyte); +GLAPI void APIENTRY glTangent3bvEXT (const GLbyte *); +GLAPI void APIENTRY glTangent3dEXT (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glTangent3dvEXT (const GLdouble *); +GLAPI void APIENTRY glTangent3fEXT (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTangent3fvEXT (const GLfloat *); +GLAPI void APIENTRY glTangent3iEXT (GLint, GLint, GLint); +GLAPI void APIENTRY glTangent3ivEXT (const GLint *); +GLAPI void APIENTRY glTangent3sEXT (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glTangent3svEXT (const GLshort *); +GLAPI void APIENTRY glBinormal3bEXT (GLbyte, GLbyte, GLbyte); +GLAPI void APIENTRY glBinormal3bvEXT (const GLbyte *); +GLAPI void APIENTRY glBinormal3dEXT (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glBinormal3dvEXT (const GLdouble *); +GLAPI void APIENTRY glBinormal3fEXT (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glBinormal3fvEXT (const GLfloat *); +GLAPI void APIENTRY glBinormal3iEXT (GLint, GLint, GLint); +GLAPI void APIENTRY glBinormal3ivEXT (const GLint *); +GLAPI void APIENTRY glBinormal3sEXT (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glBinormal3svEXT (const GLshort *); +GLAPI void APIENTRY glTangentPointerEXT (GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glBinormalPointerEXT (GLenum, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTANGENT3BEXTPROC) (GLbyte tx, GLbyte ty, GLbyte tz); +typedef void (APIENTRYP PFNGLTANGENT3BVEXTPROC) (const GLbyte *v); +typedef void (APIENTRYP PFNGLTANGENT3DEXTPROC) (GLdouble tx, GLdouble ty, GLdouble tz); +typedef void (APIENTRYP PFNGLTANGENT3DVEXTPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLTANGENT3FEXTPROC) (GLfloat tx, GLfloat ty, GLfloat tz); +typedef void (APIENTRYP PFNGLTANGENT3FVEXTPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLTANGENT3IEXTPROC) (GLint tx, GLint ty, GLint tz); +typedef void (APIENTRYP PFNGLTANGENT3IVEXTPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLTANGENT3SEXTPROC) (GLshort tx, GLshort ty, GLshort tz); +typedef void (APIENTRYP PFNGLTANGENT3SVEXTPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLBINORMAL3BEXTPROC) (GLbyte bx, GLbyte by, GLbyte bz); +typedef void (APIENTRYP PFNGLBINORMAL3BVEXTPROC) (const GLbyte *v); +typedef void (APIENTRYP PFNGLBINORMAL3DEXTPROC) (GLdouble bx, GLdouble by, GLdouble bz); +typedef void (APIENTRYP PFNGLBINORMAL3DVEXTPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLBINORMAL3FEXTPROC) (GLfloat bx, GLfloat by, GLfloat bz); +typedef void (APIENTRYP PFNGLBINORMAL3FVEXTPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLBINORMAL3IEXTPROC) (GLint bx, GLint by, GLint bz); +typedef void (APIENTRYP PFNGLBINORMAL3IVEXTPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLBINORMAL3SEXTPROC) (GLshort bx, GLshort by, GLshort bz); +typedef void (APIENTRYP PFNGLBINORMAL3SVEXTPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_EXT_texture_env_combine +#define GL_EXT_texture_env_combine 1 +#endif + +#ifndef GL_APPLE_specular_vector +#define GL_APPLE_specular_vector 1 +#endif + +#ifndef GL_APPLE_transform_hint +#define GL_APPLE_transform_hint 1 +#endif + +#ifndef GL_SGIX_fog_scale +#define GL_SGIX_fog_scale 1 +#endif + +#ifndef GL_SUNX_constant_data +#define GL_SUNX_constant_data 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFinishTextureSUNX (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFINISHTEXTURESUNXPROC) (void); +#endif + +#ifndef GL_SUN_global_alpha +#define GL_SUN_global_alpha 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGlobalAlphaFactorbSUN (GLbyte); +GLAPI void APIENTRY glGlobalAlphaFactorsSUN (GLshort); +GLAPI void APIENTRY glGlobalAlphaFactoriSUN (GLint); +GLAPI void APIENTRY glGlobalAlphaFactorfSUN (GLfloat); +GLAPI void APIENTRY glGlobalAlphaFactordSUN (GLdouble); +GLAPI void APIENTRY glGlobalAlphaFactorubSUN (GLubyte); +GLAPI void APIENTRY glGlobalAlphaFactorusSUN (GLushort); +GLAPI void APIENTRY glGlobalAlphaFactoruiSUN (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor); +#endif + +#ifndef GL_SUN_triangle_list +#define GL_SUN_triangle_list 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glReplacementCodeuiSUN (GLuint); +GLAPI void APIENTRY glReplacementCodeusSUN (GLushort); +GLAPI void APIENTRY glReplacementCodeubSUN (GLubyte); +GLAPI void APIENTRY glReplacementCodeuivSUN (const GLuint *); +GLAPI void APIENTRY glReplacementCodeusvSUN (const GLushort *); +GLAPI void APIENTRY glReplacementCodeubvSUN (const GLubyte *); +GLAPI void APIENTRY glReplacementCodePointerSUN (GLenum, GLsizei, const GLvoid* *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint *code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort *code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte *code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const GLvoid* *pointer); +#endif + +#ifndef GL_SUN_vertex +#define GL_SUN_vertex 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColor4ubVertex2fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat); +GLAPI void APIENTRY glColor4ubVertex2fvSUN (const GLubyte *, const GLfloat *); +GLAPI void APIENTRY glColor4ubVertex3fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glColor4ubVertex3fvSUN (const GLubyte *, const GLfloat *); +GLAPI void APIENTRY glColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glColor3fVertex3fvSUN (const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord2fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord2fVertex3fvSUN (const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord4fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord4fVertex4fvSUN (const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fSUN (GLfloat, GLfloat, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fvSUN (const GLfloat *, const GLubyte *, const GLfloat *); +GLAPI void APIENTRY glTexCoord2fColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord2fColor3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiVertex3fvSUN (const GLuint *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fSUN (GLuint, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fvSUN (const GLuint *, const GLubyte *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat *tc, const GLubyte *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint *rc, const GLubyte *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +#endif + +#ifndef GL_EXT_blend_func_separate +#define GL_EXT_blend_func_separate 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendFuncSeparateEXT (GLenum, GLenum, GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +#endif + +#ifndef GL_INGR_blend_func_separate +#define GL_INGR_blend_func_separate 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum, GLenum, GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +#endif + +#ifndef GL_INGR_color_clamp +#define GL_INGR_color_clamp 1 +#endif + +#ifndef GL_INGR_interlace_read +#define GL_INGR_interlace_read 1 +#endif + +#ifndef GL_EXT_stencil_wrap +#define GL_EXT_stencil_wrap 1 +#endif + +#ifndef GL_EXT_422_pixels +#define GL_EXT_422_pixels 1 +#endif + +#ifndef GL_NV_texgen_reflection +#define GL_NV_texgen_reflection 1 +#endif + +#ifndef GL_SUN_convolution_border_modes +#define GL_SUN_convolution_border_modes 1 +#endif + +#ifndef GL_EXT_texture_env_add +#define GL_EXT_texture_env_add 1 +#endif + +#ifndef GL_EXT_texture_lod_bias +#define GL_EXT_texture_lod_bias 1 +#endif + +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_EXT_texture_filter_anisotropic 1 +#endif + +#ifndef GL_EXT_vertex_weighting +#define GL_EXT_vertex_weighting 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexWeightfEXT (GLfloat); +GLAPI void APIENTRY glVertexWeightfvEXT (const GLfloat *); +GLAPI void APIENTRY glVertexWeightPointerEXT (GLsizei, GLenum, GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLsizei size, GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_NV_light_max_exponent +#define GL_NV_light_max_exponent 1 +#endif + +#ifndef GL_NV_vertex_array_range +#define GL_NV_vertex_array_range 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFlushVertexArrayRangeNV (void); +GLAPI void APIENTRY glVertexArrayRangeNV (GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void); +typedef void (APIENTRYP PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, const GLvoid *pointer); +#endif + +#ifndef GL_NV_register_combiners +#define GL_NV_register_combiners 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCombinerParameterfvNV (GLenum, const GLfloat *); +GLAPI void APIENTRY glCombinerParameterfNV (GLenum, GLfloat); +GLAPI void APIENTRY glCombinerParameterivNV (GLenum, const GLint *); +GLAPI void APIENTRY glCombinerParameteriNV (GLenum, GLint); +GLAPI void APIENTRY glCombinerInputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glCombinerOutputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLboolean, GLboolean, GLboolean); +GLAPI void APIENTRY glFinalCombinerInputNV (GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glGetCombinerInputParameterfvNV (GLenum, GLenum, GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetCombinerInputParameterivNV (GLenum, GLenum, GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetCombinerOutputParameterfvNV (GLenum, GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetCombinerOutputParameterivNV (GLenum, GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetFinalCombinerInputParameterivNV (GLenum, GLenum, GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (APIENTRYP PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); +typedef void (APIENTRYP PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint *params); +#endif + +#ifndef GL_NV_fog_distance +#define GL_NV_fog_distance 1 +#endif + +#ifndef GL_NV_texgen_emboss +#define GL_NV_texgen_emboss 1 +#endif + +#ifndef GL_NV_blend_square +#define GL_NV_blend_square 1 +#endif + +#ifndef GL_NV_texture_env_combine4 +#define GL_NV_texture_env_combine4 1 +#endif + +#ifndef GL_MESA_resize_buffers +#define GL_MESA_resize_buffers 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glResizeBuffersMESA (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLRESIZEBUFFERSMESAPROC) (void); +#endif + +#ifndef GL_MESA_window_pos +#define GL_MESA_window_pos 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glWindowPos2dMESA (GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos2dvMESA (const GLdouble *); +GLAPI void APIENTRY glWindowPos2fMESA (GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos2fvMESA (const GLfloat *); +GLAPI void APIENTRY glWindowPos2iMESA (GLint, GLint); +GLAPI void APIENTRY glWindowPos2ivMESA (const GLint *); +GLAPI void APIENTRY glWindowPos2sMESA (GLshort, GLshort); +GLAPI void APIENTRY glWindowPos2svMESA (const GLshort *); +GLAPI void APIENTRY glWindowPos3dMESA (GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos3dvMESA (const GLdouble *); +GLAPI void APIENTRY glWindowPos3fMESA (GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos3fvMESA (const GLfloat *); +GLAPI void APIENTRY glWindowPos3iMESA (GLint, GLint, GLint); +GLAPI void APIENTRY glWindowPos3ivMESA (const GLint *); +GLAPI void APIENTRY glWindowPos3sMESA (GLshort, GLshort, GLshort); +GLAPI void APIENTRY glWindowPos3svMESA (const GLshort *); +GLAPI void APIENTRY glWindowPos4dMESA (GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glWindowPos4dvMESA (const GLdouble *); +GLAPI void APIENTRY glWindowPos4fMESA (GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glWindowPos4fvMESA (const GLfloat *); +GLAPI void APIENTRY glWindowPos4iMESA (GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glWindowPos4ivMESA (const GLint *); +GLAPI void APIENTRY glWindowPos4sMESA (GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glWindowPos4svMESA (const GLshort *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y); +typedef void (APIENTRYP PFNGLWINDOWPOS2IVMESAPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLWINDOWPOS2SVMESAPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLWINDOWPOS3IVMESAPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLWINDOWPOS3SVMESAPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLWINDOWPOS4IVMESAPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *v); +#endif + +#ifndef GL_IBM_cull_vertex +#define GL_IBM_cull_vertex 1 +#endif + +#ifndef GL_IBM_multimode_draw_arrays +#define GL_IBM_multimode_draw_arrays 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMultiModeDrawArraysIBM (const GLenum *, const GLint *, const GLsizei *, GLsizei, GLint); +GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *, const GLsizei *, GLenum, const GLvoid* const *, GLsizei, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); +typedef void (APIENTRYP PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount, GLint modestride); +#endif + +#ifndef GL_IBM_vertex_array_lists +#define GL_IBM_vertex_array_lists 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glSecondaryColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glEdgeFlagPointerListIBM (GLint, const GLboolean* *, GLint); +GLAPI void APIENTRY glFogCoordPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glIndexPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glNormalPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glTexCoordPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glVertexPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +#endif + +#ifndef GL_SGIX_subsample +#define GL_SGIX_subsample 1 +#endif + +#ifndef GL_SGIX_ycrcba +#define GL_SGIX_ycrcba 1 +#endif + +#ifndef GL_SGIX_ycrcb_subsample +#define GL_SGIX_ycrcb_subsample 1 +#endif + +#ifndef GL_SGIX_depth_pass_instrument +#define GL_SGIX_depth_pass_instrument 1 +#endif + +#ifndef GL_3DFX_texture_compression_FXT1 +#define GL_3DFX_texture_compression_FXT1 1 +#endif + +#ifndef GL_3DFX_multisample +#define GL_3DFX_multisample 1 +#endif + +#ifndef GL_3DFX_tbuffer +#define GL_3DFX_tbuffer 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTbufferMask3DFX (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTBUFFERMASK3DFXPROC) (GLuint mask); +#endif + +#ifndef GL_EXT_multisample +#define GL_EXT_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSampleMaskEXT (GLclampf, GLboolean); +GLAPI void APIENTRY glSamplePatternEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRYP PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); +#endif + +#ifndef GL_SGIX_vertex_preclip +#define GL_SGIX_vertex_preclip 1 +#endif + +#ifndef GL_SGIX_convolution_accuracy +#define GL_SGIX_convolution_accuracy 1 +#endif + +#ifndef GL_SGIX_resample +#define GL_SGIX_resample 1 +#endif + +#ifndef GL_SGIS_point_line_texgen +#define GL_SGIS_point_line_texgen 1 +#endif + +#ifndef GL_SGIS_texture_color_mask +#define GL_SGIS_texture_color_mask 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTextureColorMaskSGIS (GLboolean, GLboolean, GLboolean, GLboolean); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +#endif + +#ifndef GL_SGIX_igloo_interface +#define GL_SGIX_igloo_interface 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glIglooInterfaceSGIX (GLenum, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const GLvoid *params); +#endif + +#ifndef GL_EXT_texture_env_dot3 +#define GL_EXT_texture_env_dot3 1 +#endif + +#ifndef GL_ATI_texture_mirror_once +#define GL_ATI_texture_mirror_once 1 +#endif + +#ifndef GL_NV_fence +#define GL_NV_fence 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDeleteFencesNV (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenFencesNV (GLsizei, GLuint *); +GLAPI GLboolean APIENTRY glIsFenceNV (GLuint); +GLAPI GLboolean APIENTRY glTestFenceNV (GLuint); +GLAPI void APIENTRY glGetFenceivNV (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glFinishFenceNV (GLuint); +GLAPI void APIENTRY glSetFenceNV (GLuint, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences); +typedef void (APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences); +typedef GLboolean (APIENTRYP PFNGLISFENCENVPROC) (GLuint fence); +typedef GLboolean (APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence); +typedef void (APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence); +typedef void (APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); +#endif + +#ifndef GL_NV_evaluators +#define GL_NV_evaluators 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMapControlPointsNV (GLenum, GLuint, GLenum, GLsizei, GLsizei, GLint, GLint, GLboolean, const GLvoid *); +GLAPI void APIENTRY glMapParameterivNV (GLenum, GLenum, const GLint *); +GLAPI void APIENTRY glMapParameterfvNV (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glGetMapControlPointsNV (GLenum, GLuint, GLenum, GLsizei, GLsizei, GLboolean, GLvoid *); +GLAPI void APIENTRY glGetMapParameterivNV (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGetMapParameterfvNV (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetMapAttribParameterivNV (GLenum, GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetMapAttribParameterfvNV (GLenum, GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glEvalMapsNV (GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points); +typedef void (APIENTRYP PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid *points); +typedef void (APIENTRYP PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode); +#endif + +#ifndef GL_NV_packed_depth_stencil +#define GL_NV_packed_depth_stencil 1 +#endif + +#ifndef GL_NV_register_combiners2 +#define GL_NV_register_combiners2 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCombinerStageParameterfvNV (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glGetCombinerStageParameterfvNV (GLenum, GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat *params); +#endif + +#ifndef GL_NV_texture_compression_vtc +#define GL_NV_texture_compression_vtc 1 +#endif + +#ifndef GL_NV_texture_rectangle +#define GL_NV_texture_rectangle 1 +#endif + +#ifndef GL_NV_texture_shader +#define GL_NV_texture_shader 1 +#endif + +#ifndef GL_NV_texture_shader2 +#define GL_NV_texture_shader2 1 +#endif + +#ifndef GL_NV_vertex_array_range2 +#define GL_NV_vertex_array_range2 1 +#endif + +#ifndef GL_NV_vertex_program +#define GL_NV_vertex_program 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLboolean APIENTRY glAreProgramsResidentNV (GLsizei, const GLuint *, GLboolean *); +GLAPI void APIENTRY glBindProgramNV (GLenum, GLuint); +GLAPI void APIENTRY glDeleteProgramsNV (GLsizei, const GLuint *); +GLAPI void APIENTRY glExecuteProgramNV (GLenum, GLuint, const GLfloat *); +GLAPI void APIENTRY glGenProgramsNV (GLsizei, GLuint *); +GLAPI void APIENTRY glGetProgramParameterdvNV (GLenum, GLuint, GLenum, GLdouble *); +GLAPI void APIENTRY glGetProgramParameterfvNV (GLenum, GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetProgramivNV (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetProgramStringNV (GLuint, GLenum, GLubyte *); +GLAPI void APIENTRY glGetTrackMatrixivNV (GLenum, GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetVertexAttribdvNV (GLuint, GLenum, GLdouble *); +GLAPI void APIENTRY glGetVertexAttribfvNV (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetVertexAttribivNV (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetVertexAttribPointervNV (GLuint, GLenum, GLvoid* *); +GLAPI GLboolean APIENTRY glIsProgramNV (GLuint); +GLAPI void APIENTRY glLoadProgramNV (GLenum, GLuint, GLsizei, const GLubyte *); +GLAPI void APIENTRY glProgramParameter4dNV (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glProgramParameter4dvNV (GLenum, GLuint, const GLdouble *); +GLAPI void APIENTRY glProgramParameter4fNV (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glProgramParameter4fvNV (GLenum, GLuint, const GLfloat *); +GLAPI void APIENTRY glProgramParameters4dvNV (GLenum, GLuint, GLuint, const GLdouble *); +GLAPI void APIENTRY glProgramParameters4fvNV (GLenum, GLuint, GLuint, const GLfloat *); +GLAPI void APIENTRY glRequestResidentProgramsNV (GLsizei, const GLuint *); +GLAPI void APIENTRY glTrackMatrixNV (GLenum, GLuint, GLenum, GLenum); +GLAPI void APIENTRY glVertexAttribPointerNV (GLuint, GLint, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glVertexAttrib1dNV (GLuint, GLdouble); +GLAPI void APIENTRY glVertexAttrib1dvNV (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib1fNV (GLuint, GLfloat); +GLAPI void APIENTRY glVertexAttrib1fvNV (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib1sNV (GLuint, GLshort); +GLAPI void APIENTRY glVertexAttrib1svNV (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib2dNV (GLuint, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib2dvNV (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib2fNV (GLuint, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib2fvNV (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib2sNV (GLuint, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib2svNV (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib3dNV (GLuint, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib3dvNV (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib3fNV (GLuint, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib3fvNV (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib3sNV (GLuint, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib3svNV (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4dNV (GLuint, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexAttrib4dvNV (GLuint, const GLdouble *); +GLAPI void APIENTRY glVertexAttrib4fNV (GLuint, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexAttrib4fvNV (GLuint, const GLfloat *); +GLAPI void APIENTRY glVertexAttrib4sNV (GLuint, GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexAttrib4svNV (GLuint, const GLshort *); +GLAPI void APIENTRY glVertexAttrib4ubNV (GLuint, GLubyte, GLubyte, GLubyte, GLubyte); +GLAPI void APIENTRY glVertexAttrib4ubvNV (GLuint, const GLubyte *); +GLAPI void APIENTRY glVertexAttribs1dvNV (GLuint, GLsizei, const GLdouble *); +GLAPI void APIENTRY glVertexAttribs1fvNV (GLuint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glVertexAttribs1svNV (GLuint, GLsizei, const GLshort *); +GLAPI void APIENTRY glVertexAttribs2dvNV (GLuint, GLsizei, const GLdouble *); +GLAPI void APIENTRY glVertexAttribs2fvNV (GLuint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glVertexAttribs2svNV (GLuint, GLsizei, const GLshort *); +GLAPI void APIENTRY glVertexAttribs3dvNV (GLuint, GLsizei, const GLdouble *); +GLAPI void APIENTRY glVertexAttribs3fvNV (GLuint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glVertexAttribs3svNV (GLuint, GLsizei, const GLshort *); +GLAPI void APIENTRY glVertexAttribs4dvNV (GLuint, GLsizei, const GLdouble *); +GLAPI void APIENTRY glVertexAttribs4fvNV (GLuint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glVertexAttribs4svNV (GLuint, GLsizei, const GLshort *); +GLAPI void APIENTRY glVertexAttribs4ubvNV (GLuint, GLsizei, const GLubyte *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLboolean (APIENTRYP PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint *programs, GLboolean *residences); +typedef void (APIENTRYP PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); +typedef void (APIENTRYP PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat *params); +typedef void (APIENTRYP PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint *programs); +typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte *program); +typedef void (APIENTRYP PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid* *pointer); +typedef GLboolean (APIENTRYP PFNGLISPROGRAMNVPROC) (GLuint id); +typedef void (APIENTRYP PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte *program); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLuint count, const GLdouble *v); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLuint count, const GLfloat *v); +typedef void (APIENTRYP PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); +typedef void (APIENTRYP PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform); +typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei count, const GLubyte *v); +#endif + +#ifndef GL_SGIX_texture_coordinate_clamp +#define GL_SGIX_texture_coordinate_clamp 1 +#endif + +#ifndef GL_SGIX_scalebias_hint +#define GL_SGIX_scalebias_hint 1 +#endif + +#ifndef GL_OML_interlace +#define GL_OML_interlace 1 +#endif + +#ifndef GL_OML_subsample +#define GL_OML_subsample 1 +#endif + +#ifndef GL_OML_resample +#define GL_OML_resample 1 +#endif + +#ifndef GL_NV_copy_depth_to_color +#define GL_NV_copy_depth_to_color 1 +#endif + +#ifndef GL_ATI_envmap_bumpmap +#define GL_ATI_envmap_bumpmap 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexBumpParameterivATI (GLenum, const GLint *); +GLAPI void APIENTRY glTexBumpParameterfvATI (GLenum, const GLfloat *); +GLAPI void APIENTRY glGetTexBumpParameterivATI (GLenum, GLint *); +GLAPI void APIENTRY glGetTexBumpParameterfvATI (GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, const GLint *param); +typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, const GLfloat *param); +typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param); +typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param); +#endif + +#ifndef GL_ATI_fragment_shader +#define GL_ATI_fragment_shader 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLuint APIENTRY glGenFragmentShadersATI (GLuint); +GLAPI void APIENTRY glBindFragmentShaderATI (GLuint); +GLAPI void APIENTRY glDeleteFragmentShaderATI (GLuint); +GLAPI void APIENTRY glBeginFragmentShaderATI (void); +GLAPI void APIENTRY glEndFragmentShaderATI (void); +GLAPI void APIENTRY glPassTexCoordATI (GLuint, GLuint, GLenum); +GLAPI void APIENTRY glSampleMapATI (GLuint, GLuint, GLenum); +GLAPI void APIENTRY glColorFragmentOp1ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glColorFragmentOp2ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glColorFragmentOp3ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glAlphaFragmentOp1ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glAlphaFragmentOp2ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glAlphaFragmentOp3ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glSetFragmentShaderConstantATI (GLuint, const GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLuint (APIENTRYP PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range); +typedef void (APIENTRYP PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id); +typedef void (APIENTRYP PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id); +typedef void (APIENTRYP PFNGLBEGINFRAGMENTSHADERATIPROC) (void); +typedef void (APIENTRYP PFNGLENDFRAGMENTSHADERATIPROC) (void); +typedef void (APIENTRYP PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle); +typedef void (APIENTRYP PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle); +typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +typedef void (APIENTRYP PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat *value); +#endif + +#ifndef GL_ATI_pn_triangles +#define GL_ATI_pn_triangles 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPNTrianglesiATI (GLenum, GLint); +GLAPI void APIENTRY glPNTrianglesfATI (GLenum, GLfloat); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param); +#endif + +#ifndef GL_ATI_vertex_array_object +#define GL_ATI_vertex_array_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLuint APIENTRY glNewObjectBufferATI (GLsizei, const GLvoid *, GLenum); +GLAPI GLboolean APIENTRY glIsObjectBufferATI (GLuint); +GLAPI void APIENTRY glUpdateObjectBufferATI (GLuint, GLuint, GLsizei, const GLvoid *, GLenum); +GLAPI void APIENTRY glGetObjectBufferfvATI (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetObjectBufferivATI (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glFreeObjectBufferATI (GLuint); +GLAPI void APIENTRY glArrayObjectATI (GLenum, GLint, GLenum, GLsizei, GLuint, GLuint); +GLAPI void APIENTRY glGetArrayObjectfvATI (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glGetArrayObjectivATI (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glVariantArrayObjectATI (GLuint, GLenum, GLsizei, GLuint, GLuint); +GLAPI void APIENTRY glGetVariantArrayObjectfvATI (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetVariantArrayObjectivATI (GLuint, GLenum, GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLuint (APIENTRYP PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const GLvoid *pointer, GLenum usage); +typedef GLboolean (APIENTRYP PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve); +typedef void (APIENTRYP PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (APIENTRYP PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint *params); +#endif + +#ifndef GL_EXT_vertex_shader +#define GL_EXT_vertex_shader 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginVertexShaderEXT (void); +GLAPI void APIENTRY glEndVertexShaderEXT (void); +GLAPI void APIENTRY glBindVertexShaderEXT (GLuint); +GLAPI GLuint APIENTRY glGenVertexShadersEXT (GLuint); +GLAPI void APIENTRY glDeleteVertexShaderEXT (GLuint); +GLAPI void APIENTRY glShaderOp1EXT (GLenum, GLuint, GLuint); +GLAPI void APIENTRY glShaderOp2EXT (GLenum, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glShaderOp3EXT (GLenum, GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glSwizzleEXT (GLuint, GLuint, GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glWriteMaskEXT (GLuint, GLuint, GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glInsertComponentEXT (GLuint, GLuint, GLuint); +GLAPI void APIENTRY glExtractComponentEXT (GLuint, GLuint, GLuint); +GLAPI GLuint APIENTRY glGenSymbolsEXT (GLenum, GLenum, GLenum, GLuint); +GLAPI void APIENTRY glSetInvariantEXT (GLuint, GLenum, const GLvoid *); +GLAPI void APIENTRY glSetLocalConstantEXT (GLuint, GLenum, const GLvoid *); +GLAPI void APIENTRY glVariantbvEXT (GLuint, const GLbyte *); +GLAPI void APIENTRY glVariantsvEXT (GLuint, const GLshort *); +GLAPI void APIENTRY glVariantivEXT (GLuint, const GLint *); +GLAPI void APIENTRY glVariantfvEXT (GLuint, const GLfloat *); +GLAPI void APIENTRY glVariantdvEXT (GLuint, const GLdouble *); +GLAPI void APIENTRY glVariantubvEXT (GLuint, const GLubyte *); +GLAPI void APIENTRY glVariantusvEXT (GLuint, const GLushort *); +GLAPI void APIENTRY glVariantuivEXT (GLuint, const GLuint *); +GLAPI void APIENTRY glVariantPointerEXT (GLuint, GLenum, GLuint, const GLvoid *); +GLAPI void APIENTRY glEnableVariantClientStateEXT (GLuint); +GLAPI void APIENTRY glDisableVariantClientStateEXT (GLuint); +GLAPI GLuint APIENTRY glBindLightParameterEXT (GLenum, GLenum); +GLAPI GLuint APIENTRY glBindMaterialParameterEXT (GLenum, GLenum); +GLAPI GLuint APIENTRY glBindTexGenParameterEXT (GLenum, GLenum, GLenum); +GLAPI GLuint APIENTRY glBindTextureUnitParameterEXT (GLenum, GLenum); +GLAPI GLuint APIENTRY glBindParameterEXT (GLenum); +GLAPI GLboolean APIENTRY glIsVariantEnabledEXT (GLuint, GLenum); +GLAPI void APIENTRY glGetVariantBooleanvEXT (GLuint, GLenum, GLboolean *); +GLAPI void APIENTRY glGetVariantIntegervEXT (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetVariantFloatvEXT (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetVariantPointervEXT (GLuint, GLenum, GLvoid* *); +GLAPI void APIENTRY glGetInvariantBooleanvEXT (GLuint, GLenum, GLboolean *); +GLAPI void APIENTRY glGetInvariantIntegervEXT (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetInvariantFloatvEXT (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetLocalConstantBooleanvEXT (GLuint, GLenum, GLboolean *); +GLAPI void APIENTRY glGetLocalConstantIntegervEXT (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetLocalConstantFloatvEXT (GLuint, GLenum, GLfloat *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBEGINVERTEXSHADEREXTPROC) (void); +typedef void (APIENTRYP PFNGLENDVERTEXSHADEREXTPROC) (void); +typedef void (APIENTRYP PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id); +typedef GLuint (APIENTRYP PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range); +typedef void (APIENTRYP PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id); +typedef void (APIENTRYP PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1); +typedef void (APIENTRYP PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2); +typedef void (APIENTRYP PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); +typedef void (APIENTRYP PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +typedef void (APIENTRYP PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +typedef void (APIENTRYP PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); +typedef void (APIENTRYP PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); +typedef GLuint (APIENTRYP PFNGLGENSYMBOLSEXTPROC) (GLenum datatype, GLenum storagetype, GLenum range, GLuint components); +typedef void (APIENTRYP PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr); +typedef void (APIENTRYP PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr); +typedef void (APIENTRYP PFNGLVARIANTBVEXTPROC) (GLuint id, const GLbyte *addr); +typedef void (APIENTRYP PFNGLVARIANTSVEXTPROC) (GLuint id, const GLshort *addr); +typedef void (APIENTRYP PFNGLVARIANTIVEXTPROC) (GLuint id, const GLint *addr); +typedef void (APIENTRYP PFNGLVARIANTFVEXTPROC) (GLuint id, const GLfloat *addr); +typedef void (APIENTRYP PFNGLVARIANTDVEXTPROC) (GLuint id, const GLdouble *addr); +typedef void (APIENTRYP PFNGLVARIANTUBVEXTPROC) (GLuint id, const GLubyte *addr); +typedef void (APIENTRYP PFNGLVARIANTUSVEXTPROC) (GLuint id, const GLushort *addr); +typedef void (APIENTRYP PFNGLVARIANTUIVEXTPROC) (GLuint id, const GLuint *addr); +typedef void (APIENTRYP PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, const GLvoid *addr); +typedef void (APIENTRYP PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); +typedef void (APIENTRYP PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); +typedef GLuint (APIENTRYP PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value); +typedef GLuint (APIENTRYP PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value); +typedef GLuint (APIENTRYP PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value); +typedef GLuint (APIENTRYP PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value); +typedef GLuint (APIENTRYP PFNGLBINDPARAMETEREXTPROC) (GLenum value); +typedef GLboolean (APIENTRYP PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap); +typedef void (APIENTRYP PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (APIENTRYP PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (APIENTRYP PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (APIENTRYP PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, GLvoid* *data); +typedef void (APIENTRYP PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (APIENTRYP PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (APIENTRYP PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (APIENTRYP PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (APIENTRYP PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (APIENTRYP PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +#endif + +#ifndef GL_ATI_vertex_streams +#define GL_ATI_vertex_streams 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexStream1sATI (GLenum, GLshort); +GLAPI void APIENTRY glVertexStream1svATI (GLenum, const GLshort *); +GLAPI void APIENTRY glVertexStream1iATI (GLenum, GLint); +GLAPI void APIENTRY glVertexStream1ivATI (GLenum, const GLint *); +GLAPI void APIENTRY glVertexStream1fATI (GLenum, GLfloat); +GLAPI void APIENTRY glVertexStream1fvATI (GLenum, const GLfloat *); +GLAPI void APIENTRY glVertexStream1dATI (GLenum, GLdouble); +GLAPI void APIENTRY glVertexStream1dvATI (GLenum, const GLdouble *); +GLAPI void APIENTRY glVertexStream2sATI (GLenum, GLshort, GLshort); +GLAPI void APIENTRY glVertexStream2svATI (GLenum, const GLshort *); +GLAPI void APIENTRY glVertexStream2iATI (GLenum, GLint, GLint); +GLAPI void APIENTRY glVertexStream2ivATI (GLenum, const GLint *); +GLAPI void APIENTRY glVertexStream2fATI (GLenum, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexStream2fvATI (GLenum, const GLfloat *); +GLAPI void APIENTRY glVertexStream2dATI (GLenum, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexStream2dvATI (GLenum, const GLdouble *); +GLAPI void APIENTRY glVertexStream3sATI (GLenum, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexStream3svATI (GLenum, const GLshort *); +GLAPI void APIENTRY glVertexStream3iATI (GLenum, GLint, GLint, GLint); +GLAPI void APIENTRY glVertexStream3ivATI (GLenum, const GLint *); +GLAPI void APIENTRY glVertexStream3fATI (GLenum, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexStream3fvATI (GLenum, const GLfloat *); +GLAPI void APIENTRY glVertexStream3dATI (GLenum, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexStream3dvATI (GLenum, const GLdouble *); +GLAPI void APIENTRY glVertexStream4sATI (GLenum, GLshort, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glVertexStream4svATI (GLenum, const GLshort *); +GLAPI void APIENTRY glVertexStream4iATI (GLenum, GLint, GLint, GLint, GLint); +GLAPI void APIENTRY glVertexStream4ivATI (GLenum, const GLint *); +GLAPI void APIENTRY glVertexStream4fATI (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glVertexStream4fvATI (GLenum, const GLfloat *); +GLAPI void APIENTRY glVertexStream4dATI (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glVertexStream4dvATI (GLenum, const GLdouble *); +GLAPI void APIENTRY glNormalStream3bATI (GLenum, GLbyte, GLbyte, GLbyte); +GLAPI void APIENTRY glNormalStream3bvATI (GLenum, const GLbyte *); +GLAPI void APIENTRY glNormalStream3sATI (GLenum, GLshort, GLshort, GLshort); +GLAPI void APIENTRY glNormalStream3svATI (GLenum, const GLshort *); +GLAPI void APIENTRY glNormalStream3iATI (GLenum, GLint, GLint, GLint); +GLAPI void APIENTRY glNormalStream3ivATI (GLenum, const GLint *); +GLAPI void APIENTRY glNormalStream3fATI (GLenum, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glNormalStream3fvATI (GLenum, const GLfloat *); +GLAPI void APIENTRY glNormalStream3dATI (GLenum, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glNormalStream3dvATI (GLenum, const GLdouble *); +GLAPI void APIENTRY glClientActiveVertexStreamATI (GLenum); +GLAPI void APIENTRY glVertexBlendEnviATI (GLenum, GLint); +GLAPI void APIENTRY glVertexBlendEnvfATI (GLenum, GLfloat); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort nx, GLshort ny, GLshort nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint nx, GLint ny, GLint nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream); +typedef void (APIENTRYP PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param); +#endif + +#ifndef GL_ATI_element_array +#define GL_ATI_element_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glElementPointerATI (GLenum, const GLvoid *); +GLAPI void APIENTRY glDrawElementArrayATI (GLenum, GLsizei); +GLAPI void APIENTRY glDrawRangeElementArrayATI (GLenum, GLuint, GLuint, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLELEMENTPOINTERATIPROC) (GLenum type, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count); +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count); +#endif + +#ifndef GL_SUN_mesh_array +#define GL_SUN_mesh_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawMeshArraysSUN (GLenum, GLint, GLsizei, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWMESHARRAYSSUNPROC) (GLenum mode, GLint first, GLsizei count, GLsizei width); +#endif + +#ifndef GL_SUN_slice_accum +#define GL_SUN_slice_accum 1 +#endif + +#ifndef GL_NV_multisample_filter_hint +#define GL_NV_multisample_filter_hint 1 +#endif + +#ifndef GL_NV_depth_clamp +#define GL_NV_depth_clamp 1 +#endif + +#ifndef GL_NV_occlusion_query +#define GL_NV_occlusion_query 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenOcclusionQueriesNV (GLsizei, GLuint *); +GLAPI void APIENTRY glDeleteOcclusionQueriesNV (GLsizei, const GLuint *); +GLAPI GLboolean APIENTRY glIsOcclusionQueryNV (GLuint); +GLAPI void APIENTRY glBeginOcclusionQueryNV (GLuint); +GLAPI void APIENTRY glEndOcclusionQueryNV (void); +GLAPI void APIENTRY glGetOcclusionQueryivNV (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glGetOcclusionQueryuivNV (GLuint, GLenum, GLuint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint *ids); +typedef void (APIENTRYP PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id); +typedef void (APIENTRYP PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id); +typedef void (APIENTRYP PFNGLENDOCCLUSIONQUERYNVPROC) (void); +typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint *params); +#endif + +#ifndef GL_NV_point_sprite +#define GL_NV_point_sprite 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameteriNV (GLenum, GLint); +GLAPI void APIENTRY glPointParameterivNV (GLenum, const GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint *params); +#endif + +#ifndef GL_NV_texture_shader3 +#define GL_NV_texture_shader3 1 +#endif + +#ifndef GL_NV_vertex_program1_1 +#define GL_NV_vertex_program1_1 1 +#endif + +#ifndef GL_EXT_shadow_funcs +#define GL_EXT_shadow_funcs 1 +#endif + +#ifndef GL_EXT_stencil_two_side +#define GL_EXT_stencil_two_side 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glActiveStencilFaceEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face); +#endif + +#ifndef GL_ATI_text_fragment_shader +#define GL_ATI_text_fragment_shader 1 +#endif + +#ifndef GL_APPLE_client_storage +#define GL_APPLE_client_storage 1 +#endif + +#ifndef GL_APPLE_element_array +#define GL_APPLE_element_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glElementPointerAPPLE (GLenum, const GLvoid *); +GLAPI void APIENTRY glDrawElementArrayAPPLE (GLenum, GLint, GLsizei); +GLAPI void APIENTRY glDrawRangeElementArrayAPPLE (GLenum, GLuint, GLuint, GLint, GLsizei); +GLAPI void APIENTRY glMultiDrawElementArrayAPPLE (GLenum, const GLint *, const GLsizei *, GLsizei); +GLAPI void APIENTRY glMultiDrawRangeElementArrayAPPLE (GLenum, GLuint, GLuint, const GLint *, const GLsizei *, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); +typedef void (APIENTRYP PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount); +#endif + +#ifndef GL_APPLE_fence +#define GL_APPLE_fence 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenFencesAPPLE (GLsizei, GLuint *); +GLAPI void APIENTRY glDeleteFencesAPPLE (GLsizei, const GLuint *); +GLAPI void APIENTRY glSetFenceAPPLE (GLuint); +GLAPI GLboolean APIENTRY glIsFenceAPPLE (GLuint); +GLAPI GLboolean APIENTRY glTestFenceAPPLE (GLuint); +GLAPI void APIENTRY glFinishFenceAPPLE (GLuint); +GLAPI GLboolean APIENTRY glTestObjectAPPLE (GLenum, GLuint); +GLAPI void APIENTRY glFinishObjectAPPLE (GLenum, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint *fences); +typedef void (APIENTRYP PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint *fences); +typedef void (APIENTRYP PFNGLSETFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (APIENTRYP PFNGLISFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (APIENTRYP PFNGLTESTFENCEAPPLEPROC) (GLuint fence); +typedef void (APIENTRYP PFNGLFINISHFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (APIENTRYP PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name); +typedef void (APIENTRYP PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name); +#endif + +#ifndef GL_APPLE_vertex_array_object +#define GL_APPLE_vertex_array_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindVertexArrayAPPLE (GLuint); +GLAPI void APIENTRY glDeleteVertexArraysAPPLE (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei, const GLuint *); +GLAPI GLboolean APIENTRY glIsVertexArrayAPPLE (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array); +typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays); +typedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays); +typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array); +#endif + +#ifndef GL_APPLE_vertex_array_range +#define GL_APPLE_vertex_array_range 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexArrayRangeAPPLE (GLsizei, GLvoid *); +GLAPI void APIENTRY glFlushVertexArrayRangeAPPLE (GLsizei, GLvoid *); +GLAPI void APIENTRY glVertexArrayParameteriAPPLE (GLenum, GLint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer); +typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer); +typedef void (APIENTRYP PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param); +#endif + +#ifndef GL_APPLE_ycbcr_422 +#define GL_APPLE_ycbcr_422 1 +#endif + +#ifndef GL_S3_s3tc +#define GL_S3_s3tc 1 +#endif + +#ifndef GL_ATI_draw_buffers +#define GL_ATI_draw_buffers 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawBuffersATI (GLsizei, const GLenum *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum *bufs); +#endif + +#ifndef GL_ATI_pixel_format_float +#define GL_ATI_pixel_format_float 1 +/* This is really a WGL extension, but defines some associated GL enums. + * ATI does not export "GL_ATI_pixel_format_float" in the GL_EXTENSIONS string. + */ +#endif + +#ifndef GL_ATI_texture_env_combine3 +#define GL_ATI_texture_env_combine3 1 +#endif + +#ifndef GL_ATI_texture_float +#define GL_ATI_texture_float 1 +#endif + +#ifndef GL_NV_float_buffer +#define GL_NV_float_buffer 1 +#endif + +#ifndef GL_NV_fragment_program +#define GL_NV_fragment_program 1 +/* Some NV_fragment_program entry points are shared with ARB_vertex_program. */ +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramNamedParameter4fNV (GLuint, GLsizei, const GLubyte *, GLfloat, GLfloat, GLfloat, GLfloat); +GLAPI void APIENTRY glProgramNamedParameter4dNV (GLuint, GLsizei, const GLubyte *, GLdouble, GLdouble, GLdouble, GLdouble); +GLAPI void APIENTRY glProgramNamedParameter4fvNV (GLuint, GLsizei, const GLubyte *, const GLfloat *); +GLAPI void APIENTRY glProgramNamedParameter4dvNV (GLuint, GLsizei, const GLubyte *, const GLdouble *); +GLAPI void APIENTRY glGetProgramNamedParameterfvNV (GLuint, GLsizei, const GLubyte *, GLfloat *); +GLAPI void APIENTRY glGetProgramNamedParameterdvNV (GLuint, GLsizei, const GLubyte *, GLdouble *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v); +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v); +typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params); +#endif + +#ifndef GL_NV_half_float +#define GL_NV_half_float 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertex2hNV (GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glVertex2hvNV (const GLhalfNV *); +GLAPI void APIENTRY glVertex3hNV (GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glVertex3hvNV (const GLhalfNV *); +GLAPI void APIENTRY glVertex4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glVertex4hvNV (const GLhalfNV *); +GLAPI void APIENTRY glNormal3hNV (GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glNormal3hvNV (const GLhalfNV *); +GLAPI void APIENTRY glColor3hNV (GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glColor3hvNV (const GLhalfNV *); +GLAPI void APIENTRY glColor4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glColor4hvNV (const GLhalfNV *); +GLAPI void APIENTRY glTexCoord1hNV (GLhalfNV); +GLAPI void APIENTRY glTexCoord1hvNV (const GLhalfNV *); +GLAPI void APIENTRY glTexCoord2hNV (GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glTexCoord2hvNV (const GLhalfNV *); +GLAPI void APIENTRY glTexCoord3hNV (GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glTexCoord3hvNV (const GLhalfNV *); +GLAPI void APIENTRY glTexCoord4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glTexCoord4hvNV (const GLhalfNV *); +GLAPI void APIENTRY glMultiTexCoord1hNV (GLenum, GLhalfNV); +GLAPI void APIENTRY glMultiTexCoord1hvNV (GLenum, const GLhalfNV *); +GLAPI void APIENTRY glMultiTexCoord2hNV (GLenum, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glMultiTexCoord2hvNV (GLenum, const GLhalfNV *); +GLAPI void APIENTRY glMultiTexCoord3hNV (GLenum, GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glMultiTexCoord3hvNV (GLenum, const GLhalfNV *); +GLAPI void APIENTRY glMultiTexCoord4hNV (GLenum, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glMultiTexCoord4hvNV (GLenum, const GLhalfNV *); +GLAPI void APIENTRY glFogCoordhNV (GLhalfNV); +GLAPI void APIENTRY glFogCoordhvNV (const GLhalfNV *); +GLAPI void APIENTRY glSecondaryColor3hNV (GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glSecondaryColor3hvNV (const GLhalfNV *); +GLAPI void APIENTRY glVertexWeighthNV (GLhalfNV); +GLAPI void APIENTRY glVertexWeighthvNV (const GLhalfNV *); +GLAPI void APIENTRY glVertexAttrib1hNV (GLuint, GLhalfNV); +GLAPI void APIENTRY glVertexAttrib1hvNV (GLuint, const GLhalfNV *); +GLAPI void APIENTRY glVertexAttrib2hNV (GLuint, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glVertexAttrib2hvNV (GLuint, const GLhalfNV *); +GLAPI void APIENTRY glVertexAttrib3hNV (GLuint, GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glVertexAttrib3hvNV (GLuint, const GLhalfNV *); +GLAPI void APIENTRY glVertexAttrib4hNV (GLuint, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); +GLAPI void APIENTRY glVertexAttrib4hvNV (GLuint, const GLhalfNV *); +GLAPI void APIENTRY glVertexAttribs1hvNV (GLuint, GLsizei, const GLhalfNV *); +GLAPI void APIENTRY glVertexAttribs2hvNV (GLuint, GLsizei, const GLhalfNV *); +GLAPI void APIENTRY glVertexAttribs3hvNV (GLuint, GLsizei, const GLhalfNV *); +GLAPI void APIENTRY glVertexAttribs4hvNV (GLuint, GLsizei, const GLhalfNV *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEX2HNVPROC) (GLhalfNV x, GLhalfNV y); +typedef void (APIENTRYP PFNGLVERTEX2HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEX3HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z); +typedef void (APIENTRYP PFNGLVERTEX3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEX4HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); +typedef void (APIENTRYP PFNGLVERTEX4HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLNORMAL3HNVPROC) (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz); +typedef void (APIENTRYP PFNGLNORMAL3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue); +typedef void (APIENTRYP PFNGLCOLOR3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLCOLOR4HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha); +typedef void (APIENTRYP PFNGLCOLOR4HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLTEXCOORD1HNVPROC) (GLhalfNV s); +typedef void (APIENTRYP PFNGLTEXCOORD1HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLTEXCOORD2HNVPROC) (GLhalfNV s, GLhalfNV t); +typedef void (APIENTRYP PFNGLTEXCOORD2HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLTEXCOORD3HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r); +typedef void (APIENTRYP PFNGLTEXCOORD3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLTEXCOORD4HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); +typedef void (APIENTRYP PFNGLTEXCOORD4HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalfNV s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLFOGCOORDHNVPROC) (GLhalfNV fog); +typedef void (APIENTRYP PFNGLFOGCOORDHVNVPROC) (const GLhalfNV *fog); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTHNVPROC) (GLhalfNV weight); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalfNV *weight); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalfNV x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); +#endif + +#ifndef GL_NV_pixel_data_range +#define GL_NV_pixel_data_range 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPixelDataRangeNV (GLenum, GLsizei, GLvoid *); +GLAPI void APIENTRY glFlushPixelDataRangeNV (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, GLvoid *pointer); +typedef void (APIENTRYP PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target); +#endif + +#ifndef GL_NV_primitive_restart +#define GL_NV_primitive_restart 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPrimitiveRestartNV (void); +GLAPI void APIENTRY glPrimitiveRestartIndexNV (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPRIMITIVERESTARTNVPROC) (void); +typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index); +#endif + +#ifndef GL_NV_texture_expand_normal +#define GL_NV_texture_expand_normal 1 +#endif + +#ifndef GL_NV_vertex_program2 +#define GL_NV_vertex_program2 1 +#endif + +#ifndef GL_ATI_map_object_buffer +#define GL_ATI_map_object_buffer 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLvoid* APIENTRY glMapObjectBufferATI (GLuint); +GLAPI void APIENTRY glUnmapObjectBufferATI (GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLvoid* (APIENTRYP PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer); +#endif + +#ifndef GL_ATI_separate_stencil +#define GL_ATI_separate_stencil 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glStencilOpSeparateATI (GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glStencilFuncSeparateATI (GLenum, GLenum, GLint, GLuint); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +#endif + +#ifndef GL_ATI_vertex_attrib_array_object +#define GL_ATI_vertex_attrib_array_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribArrayObjectATI (GLuint, GLint, GLenum, GLboolean, GLsizei, GLuint, GLuint); +GLAPI void APIENTRY glGetVertexAttribArrayObjectfvATI (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glGetVertexAttribArrayObjectivATI (GLuint, GLenum, GLint *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint *params); +#endif + +#ifndef GL_OES_read_format +#define GL_OES_read_format 1 +#endif + +#ifndef GL_EXT_depth_bounds_test +#define GL_EXT_depth_bounds_test 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDepthBoundsEXT (GLclampd, GLclampd); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax); +#endif + +#ifndef GL_EXT_texture_mirror_clamp +#define GL_EXT_texture_mirror_clamp 1 +#endif + +#ifndef GL_EXT_blend_equation_separate +#define GL_EXT_blend_equation_separate 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendEquationSeparateEXT (GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha); +#endif + +#ifndef GL_MESA_pack_invert +#define GL_MESA_pack_invert 1 +#endif + +#ifndef GL_MESA_ycbcr_texture +#define GL_MESA_ycbcr_texture 1 +#endif + +#ifndef GL_EXT_pixel_buffer_object +#define GL_EXT_pixel_buffer_object 1 +#endif + +#ifndef GL_NV_fragment_program_option +#define GL_NV_fragment_program_option 1 +#endif + +#ifndef GL_NV_fragment_program2 +#define GL_NV_fragment_program2 1 +#endif + +#ifndef GL_NV_vertex_program2_option +#define GL_NV_vertex_program2_option 1 +#endif + +#ifndef GL_NV_vertex_program3 +#define GL_NV_vertex_program3 1 +#endif + +#ifndef GL_EXT_framebuffer_object +#define GL_EXT_framebuffer_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLboolean APIENTRY glIsRenderbufferEXT (GLuint); +GLAPI void APIENTRY glBindRenderbufferEXT (GLenum, GLuint); +GLAPI void APIENTRY glDeleteRenderbuffersEXT (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenRenderbuffersEXT (GLsizei, GLuint *); +GLAPI void APIENTRY glRenderbufferStorageEXT (GLenum, GLenum, GLsizei, GLsizei); +GLAPI void APIENTRY glGetRenderbufferParameterivEXT (GLenum, GLenum, GLint *); +GLAPI GLboolean APIENTRY glIsFramebufferEXT (GLuint); +GLAPI void APIENTRY glBindFramebufferEXT (GLenum, GLuint); +GLAPI void APIENTRY glDeleteFramebuffersEXT (GLsizei, const GLuint *); +GLAPI void APIENTRY glGenFramebuffersEXT (GLsizei, GLuint *); +GLAPI GLenum APIENTRY glCheckFramebufferStatusEXT (GLenum); +GLAPI void APIENTRY glFramebufferTexture1DEXT (GLenum, GLenum, GLenum, GLuint, GLint); +GLAPI void APIENTRY glFramebufferTexture2DEXT (GLenum, GLenum, GLenum, GLuint, GLint); +GLAPI void APIENTRY glFramebufferTexture3DEXT (GLenum, GLenum, GLenum, GLuint, GLint, GLint); +GLAPI void APIENTRY glFramebufferRenderbufferEXT (GLenum, GLenum, GLenum, GLuint); +GLAPI void APIENTRY glGetFramebufferAttachmentParameterivEXT (GLenum, GLenum, GLenum, GLint *); +GLAPI void APIENTRY glGenerateMipmapEXT (GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer); +typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint *renderbuffers); +typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint *renderbuffers); +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer); +typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer); +typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint *framebuffers); +typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint *framebuffers); +typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC) (GLenum target); +#endif + +#ifndef GL_GREMEDY_string_marker +#define GL_GREMEDY_string_marker 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glStringMarkerGREMEDY (GLsizei, const GLvoid *); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const GLvoid *string); +#endif + + +#ifdef __cplusplus +} +#endif + +#endif +#endif /* NO_SDL_GLEXT */ +/*@}*/ diff --git a/alienblaster/project/jni/sdl/include/SDL_platform.h b/alienblaster/project/jni/sdl/include/SDL_platform.h new file mode 100644 index 000000000..11d867366 --- /dev/null +++ b/alienblaster/project/jni/sdl/include/SDL_platform.h @@ -0,0 +1,110 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_platform.h + * Try to get a standard set of platform defines + */ + +#ifndef _SDL_platform_h +#define _SDL_platform_h + +#if defined(_AIX) +#undef __AIX__ +#define __AIX__ 1 +#endif +#if defined(__BEOS__) +#undef __BEOS__ +#define __BEOS__ 1 +#endif +#if defined(__HAIKU__) +#undef __HAIKU__ +#define __HAIKU__ 1 +#endif +#if defined(bsdi) || defined(__bsdi) || defined(__bsdi__) +#undef __BSDI__ +#define __BSDI__ 1 +#endif +#if defined(_arch_dreamcast) +#undef __DREAMCAST__ +#define __DREAMCAST__ 1 +#endif +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) +#undef __FREEBSD__ +#define __FREEBSD__ 1 +#endif +#if defined(__HAIKU__) +#undef __HAIKU__ +#define __HAIKU__ 1 +#endif +#if defined(hpux) || defined(__hpux) || defined(__hpux__) +#undef __HPUX__ +#define __HPUX__ 1 +#endif +#if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE) +#undef __IRIX__ +#define __IRIX__ 1 +#endif +#if defined(linux) || defined(__linux) || defined(__linux__) +#undef __LINUX__ +#define __LINUX__ 1 +#endif +#if defined(__APPLE__) +#undef __MACOSX__ +#define __MACOSX__ 1 +#elif defined(macintosh) +#undef __MACOS__ +#define __MACOS__ 1 +#endif +#if defined(__NetBSD__) +#undef __NETBSD__ +#define __NETBSD__ 1 +#endif +#if defined(__OpenBSD__) +#undef __OPENBSD__ +#define __OPENBSD__ 1 +#endif +#if defined(__OS2__) +#undef __OS2__ +#define __OS2__ 1 +#endif +#if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE) +#undef __OSF__ +#define __OSF__ 1 +#endif +#if defined(__QNXNTO__) +#undef __QNXNTO__ +#define __QNXNTO__ 1 +#endif +#if defined(riscos) || defined(__riscos) || defined(__riscos__) +#undef __RISCOS__ +#define __RISCOS__ 1 +#endif +#if defined(__SVR4) +#undef __SOLARIS__ +#define __SOLARIS__ 1 +#endif +#if defined(WIN32) || defined(_WIN32) +#undef __WIN32__ +#define __WIN32__ 1 +#endif + +#endif /* _SDL_platform_h */ diff --git a/alienblaster/project/jni/sdl/include/SDL_quit.h b/alienblaster/project/jni/sdl/include/SDL_quit.h new file mode 100644 index 000000000..6d82e7e06 --- /dev/null +++ b/alienblaster/project/jni/sdl/include/SDL_quit.h @@ -0,0 +1,55 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_quit.h + * Include file for SDL quit event handling + */ + +#ifndef _SDL_quit_h +#define _SDL_quit_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +/** @file SDL_quit.h + * An SDL_QUITEVENT is generated when the user tries to close the application + * window. If it is ignored or filtered out, the window will remain open. + * If it is not ignored or filtered, it is queued normally and the window + * is allowed to close. When the window is closed, screen updates will + * complete, but have no effect. + * + * SDL_Init() installs signal handlers for SIGINT (keyboard interrupt) + * and SIGTERM (system termination request), if handlers do not already + * exist, that generate SDL_QUITEVENT events as well. There is no way + * to determine the cause of an SDL_QUITEVENT, but setting a signal + * handler in your application will override the default generation of + * quit events for that signal. + */ + +/** @file SDL_quit.h + * There are no functions directly affecting the quit event + */ + +#define SDL_QuitRequested() \ + (SDL_PumpEvents(), SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUITMASK)) + +#endif /* _SDL_quit_h */ diff --git a/alienblaster/project/jni/sdl/include/SDL_rwops.h b/alienblaster/project/jni/sdl/include/SDL_rwops.h new file mode 100644 index 000000000..a450119f1 --- /dev/null +++ b/alienblaster/project/jni/sdl/include/SDL_rwops.h @@ -0,0 +1,155 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_rwops.h + * This file provides a general interface for SDL to read and write + * data sources. It can easily be extended to files, memory, etc. + */ + +#ifndef _SDL_rwops_h +#define _SDL_rwops_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** This is the read/write operation structure -- very basic */ + +typedef struct SDL_RWops { + /** Seek to 'offset' relative to whence, one of stdio's whence values: + * SEEK_SET, SEEK_CUR, SEEK_END + * Returns the final offset in the data source. + */ + int (SDLCALL *seek)(struct SDL_RWops *context, int offset, int whence); + + /** Read up to 'maxnum' objects each of size 'size' from the data + * source to the area pointed at by 'ptr'. + * Returns the number of objects read, or -1 if the read failed. + */ + int (SDLCALL *read)(struct SDL_RWops *context, void *ptr, int size, int maxnum); + + /** Write exactly 'num' objects each of size 'objsize' from the area + * pointed at by 'ptr' to data source. + * Returns 'num', or -1 if the write failed. + */ + int (SDLCALL *write)(struct SDL_RWops *context, const void *ptr, int size, int num); + + /** Close and free an allocated SDL_FSops structure */ + int (SDLCALL *close)(struct SDL_RWops *context); + + Uint32 type; + union { +#if defined(__WIN32__) && !defined(__SYMBIAN32__) + struct { + int append; + void *h; + struct { + void *data; + int size; + int left; + } buffer; + } win32io; +#endif +#ifdef HAVE_STDIO_H + struct { + int autoclose; + FILE *fp; + } stdio; +#endif + struct { + Uint8 *base; + Uint8 *here; + Uint8 *stop; + } mem; + struct { + void *data1; + } unknown; + } hidden; + +} SDL_RWops; + + +/** @name Functions to create SDL_RWops structures from various data sources */ +/*@{*/ + +extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromFile(const char *file, const char *mode); + +#ifdef HAVE_STDIO_H +extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromFP(FILE *fp, int autoclose); +#endif + +extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromMem(void *mem, int size); +extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromConstMem(const void *mem, int size); + +extern DECLSPEC SDL_RWops * SDLCALL SDL_AllocRW(void); +extern DECLSPEC void SDLCALL SDL_FreeRW(SDL_RWops *area); + +/*@}*/ + +/** @name Seek Reference Points */ +/*@{*/ +#define RW_SEEK_SET 0 /**< Seek from the beginning of data */ +#define RW_SEEK_CUR 1 /**< Seek relative to current read point */ +#define RW_SEEK_END 2 /**< Seek relative to the end of data */ +/*@}*/ + +/** @name Macros to easily read and write from an SDL_RWops structure */ +/*@{*/ +#define SDL_RWseek(ctx, offset, whence) (ctx)->seek(ctx, offset, whence) +#define SDL_RWtell(ctx) (ctx)->seek(ctx, 0, RW_SEEK_CUR) +#define SDL_RWread(ctx, ptr, size, n) (ctx)->read(ctx, ptr, size, n) +#define SDL_RWwrite(ctx, ptr, size, n) (ctx)->write(ctx, ptr, size, n) +#define SDL_RWclose(ctx) (ctx)->close(ctx) +/*@}*/ + +/** @name Read an item of the specified endianness and return in native format */ +/*@{*/ +extern DECLSPEC Uint16 SDLCALL SDL_ReadLE16(SDL_RWops *src); +extern DECLSPEC Uint16 SDLCALL SDL_ReadBE16(SDL_RWops *src); +extern DECLSPEC Uint32 SDLCALL SDL_ReadLE32(SDL_RWops *src); +extern DECLSPEC Uint32 SDLCALL SDL_ReadBE32(SDL_RWops *src); +extern DECLSPEC Uint64 SDLCALL SDL_ReadLE64(SDL_RWops *src); +extern DECLSPEC Uint64 SDLCALL SDL_ReadBE64(SDL_RWops *src); +/*@}*/ + +/** @name Write an item of native format to the specified endianness */ +/*@{*/ +extern DECLSPEC int SDLCALL SDL_WriteLE16(SDL_RWops *dst, Uint16 value); +extern DECLSPEC int SDLCALL SDL_WriteBE16(SDL_RWops *dst, Uint16 value); +extern DECLSPEC int SDLCALL SDL_WriteLE32(SDL_RWops *dst, Uint32 value); +extern DECLSPEC int SDLCALL SDL_WriteBE32(SDL_RWops *dst, Uint32 value); +extern DECLSPEC int SDLCALL SDL_WriteLE64(SDL_RWops *dst, Uint64 value); +extern DECLSPEC int SDLCALL SDL_WriteBE64(SDL_RWops *dst, Uint64 value); +/*@}*/ + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_rwops_h */ diff --git a/alienblaster/project/jni/sdl/include/SDL_stdinc.h b/alienblaster/project/jni/sdl/include/SDL_stdinc.h new file mode 100644 index 000000000..e1f85fb75 --- /dev/null +++ b/alienblaster/project/jni/sdl/include/SDL_stdinc.h @@ -0,0 +1,620 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_stdinc.h + * This is a general header that includes C language support + */ + +#ifndef _SDL_stdinc_h +#define _SDL_stdinc_h + +#include "SDL_config.h" + + +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_STDIO_H +#include +#endif +#if defined(STDC_HEADERS) +# include +# include +# include +#else +# if defined(HAVE_STDLIB_H) +# include +# elif defined(HAVE_MALLOC_H) +# include +# endif +# if defined(HAVE_STDDEF_H) +# include +# endif +# if defined(HAVE_STDARG_H) +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#if defined(HAVE_INTTYPES_H) +# include +#elif defined(HAVE_STDINT_H) +# include +#endif +#ifdef HAVE_CTYPE_H +# include +#endif +#if defined(HAVE_ICONV) && defined(HAVE_ICONV_H) +# include +#endif + +/** The number of elements in an array */ +#define SDL_arraysize(array) (sizeof(array)/sizeof(array[0])) +#define SDL_TABLESIZE(table) SDL_arraysize(table) + +/* Use proper C++ casts when compiled as C++ to be compatible with the option + -Wold-style-cast of GCC (and -Werror=old-style-cast in GCC 4.2 and above. */ +#ifdef __cplusplus +#define SDL_reinterpret_cast(type, expression) reinterpret_cast(expression) +#define SDL_static_cast(type, expression) static_cast(expression) +#else +#define SDL_reinterpret_cast(type, expression) ((type)(expression)) +#define SDL_static_cast(type, expression) ((type)(expression)) +#endif + +/** @name Basic data types */ +/*@{*/ +typedef enum { + SDL_FALSE = 0, + SDL_TRUE = 1 +} SDL_bool; + +typedef int8_t Sint8; +typedef uint8_t Uint8; +typedef int16_t Sint16; +typedef uint16_t Uint16; +typedef int32_t Sint32; +typedef uint32_t Uint32; + +#ifdef SDL_HAS_64BIT_TYPE +typedef int64_t Sint64; +#ifndef SYMBIAN32_GCCE +typedef uint64_t Uint64; +#endif +#else +/* This is really just a hack to prevent the compiler from complaining */ +typedef struct { + Uint32 hi; + Uint32 lo; +} Uint64, Sint64; +#endif + +/*@}*/ + +/** @name Make sure the types really have the right sizes */ +/*@{*/ +#define SDL_COMPILE_TIME_ASSERT(name, x) \ + typedef int SDL_dummy_ ## name[(x) * 2 - 1] + +SDL_COMPILE_TIME_ASSERT(uint8, sizeof(Uint8) == 1); +SDL_COMPILE_TIME_ASSERT(sint8, sizeof(Sint8) == 1); +SDL_COMPILE_TIME_ASSERT(uint16, sizeof(Uint16) == 2); +SDL_COMPILE_TIME_ASSERT(sint16, sizeof(Sint16) == 2); +SDL_COMPILE_TIME_ASSERT(uint32, sizeof(Uint32) == 4); +SDL_COMPILE_TIME_ASSERT(sint32, sizeof(Sint32) == 4); +SDL_COMPILE_TIME_ASSERT(uint64, sizeof(Uint64) == 8); +SDL_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8); +/*@}*/ + +/** @name Enum Size Check + * Check to make sure enums are the size of ints, for structure packing. + * For both Watcom C/C++ and Borland C/C++ the compiler option that makes + * enums having the size of an int must be enabled. + * This is "-b" for Borland C/C++ and "-ei" for Watcom C/C++ (v11). + */ +/* Enable enums always int in CodeWarrior (for MPW use "-enum int") */ +#ifdef __MWERKS__ +#pragma enumsalwaysint on +#endif + +typedef enum { + DUMMY_ENUM_VALUE +} SDL_DUMMY_ENUM; + +#ifndef __NDS__ +SDL_COMPILE_TIME_ASSERT(enum, sizeof(SDL_DUMMY_ENUM) == sizeof(int)); +#endif +/*@}*/ + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef HAVE_MALLOC +#define SDL_malloc malloc +#else +extern DECLSPEC void * SDLCALL SDL_malloc(size_t size); +#endif + +#ifdef HAVE_CALLOC +#define SDL_calloc calloc +#else +extern DECLSPEC void * SDLCALL SDL_calloc(size_t nmemb, size_t size); +#endif + +#ifdef HAVE_REALLOC +#define SDL_realloc realloc +#else +extern DECLSPEC void * SDLCALL SDL_realloc(void *mem, size_t size); +#endif + +#ifdef HAVE_FREE +#define SDL_free free +#else +extern DECLSPEC void SDLCALL SDL_free(void *mem); +#endif + +#if defined(HAVE_ALLOCA) && !defined(alloca) +# if defined(HAVE_ALLOCA_H) +# include +# elif defined(__GNUC__) +# define alloca __builtin_alloca +# elif defined(_MSC_VER) +# include +# define alloca _alloca +# elif defined(__WATCOMC__) +# include +# elif defined(__BORLANDC__) +# include +# elif defined(__DMC__) +# include +# elif defined(__AIX__) + #pragma alloca +# elif defined(__MRC__) + void *alloca (unsigned); +# else + char *alloca (); +# endif +#endif +#ifdef HAVE_ALLOCA +#define SDL_stack_alloc(type, count) (type*)alloca(sizeof(type)*(count)) +#define SDL_stack_free(data) +#else +#define SDL_stack_alloc(type, count) (type*)SDL_malloc(sizeof(type)*(count)) +#define SDL_stack_free(data) SDL_free(data) +#endif + +#ifdef HAVE_GETENV +#define SDL_getenv getenv +#else +extern DECLSPEC char * SDLCALL SDL_getenv(const char *name); +#endif + +#ifdef HAVE_PUTENV +#define SDL_putenv putenv +#else +extern DECLSPEC int SDLCALL SDL_putenv(const char *variable); +#endif + +#ifdef HAVE_QSORT +#define SDL_qsort qsort +#else +extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size, + int (*compare)(const void *, const void *)); +#endif + +#ifdef HAVE_ABS +#define SDL_abs abs +#else +#define SDL_abs(X) ((X) < 0 ? -(X) : (X)) +#endif + +#define SDL_min(x, y) (((x) < (y)) ? (x) : (y)) +#define SDL_max(x, y) (((x) > (y)) ? (x) : (y)) + +#ifdef HAVE_CTYPE_H +#define SDL_isdigit(X) isdigit(X) +#define SDL_isspace(X) isspace(X) +#define SDL_toupper(X) toupper(X) +#define SDL_tolower(X) tolower(X) +#else +#define SDL_isdigit(X) (((X) >= '0') && ((X) <= '9')) +#define SDL_isspace(X) (((X) == ' ') || ((X) == '\t') || ((X) == '\r') || ((X) == '\n')) +#define SDL_toupper(X) (((X) >= 'a') && ((X) <= 'z') ? ('A'+((X)-'a')) : (X)) +#define SDL_tolower(X) (((X) >= 'A') && ((X) <= 'Z') ? ('a'+((X)-'A')) : (X)) +#endif + +#ifdef HAVE_MEMSET +#define SDL_memset memset +#else +extern DECLSPEC void * SDLCALL SDL_memset(void *dst, int c, size_t len); +#endif + +#if defined(__GNUC__) && defined(i386) +#define SDL_memset4(dst, val, len) \ +do { \ + int u0, u1, u2; \ + __asm__ __volatile__ ( \ + "cld\n\t" \ + "rep ; stosl\n\t" \ + : "=&D" (u0), "=&a" (u1), "=&c" (u2) \ + : "0" (dst), "1" (val), "2" (SDL_static_cast(Uint32, len)) \ + : "memory" ); \ +} while(0) +#endif +#ifndef SDL_memset4 +#define SDL_memset4(dst, val, len) \ +do { \ + unsigned _count = (len); \ + unsigned _n = (_count + 3) / 4; \ + Uint32 *_p = SDL_static_cast(Uint32 *, dst); \ + Uint32 _val = (val); \ + if (len == 0) break; \ + switch (_count % 4) { \ + case 0: do { *_p++ = _val; \ + case 3: *_p++ = _val; \ + case 2: *_p++ = _val; \ + case 1: *_p++ = _val; \ + } while ( --_n ); \ + } \ +} while(0) +#endif + +/* We can count on memcpy existing on Mac OS X and being well-tuned. */ +#if defined(__MACH__) && defined(__APPLE__) +#define SDL_memcpy(dst, src, len) memcpy(dst, src, len) +#elif defined(__GNUC__) && defined(i386) +#define SDL_memcpy(dst, src, len) \ +do { \ + int u0, u1, u2; \ + __asm__ __volatile__ ( \ + "cld\n\t" \ + "rep ; movsl\n\t" \ + "testb $2,%b4\n\t" \ + "je 1f\n\t" \ + "movsw\n" \ + "1:\ttestb $1,%b4\n\t" \ + "je 2f\n\t" \ + "movsb\n" \ + "2:" \ + : "=&c" (u0), "=&D" (u1), "=&S" (u2) \ + : "0" (SDL_static_cast(unsigned, len)/4), "q" (len), "1" (dst),"2" (src) \ + : "memory" ); \ +} while(0) +#endif +#ifndef SDL_memcpy +#ifdef HAVE_MEMCPY +#define SDL_memcpy memcpy +#elif defined(HAVE_BCOPY) +#define SDL_memcpy(d, s, n) bcopy((s), (d), (n)) +#else +extern DECLSPEC void * SDLCALL SDL_memcpy(void *dst, const void *src, size_t len); +#endif +#endif + +/* We can count on memcpy existing on Mac OS X and being well-tuned. */ +#if defined(__MACH__) && defined(__APPLE__) +#define SDL_memcpy4(dst, src, len) memcpy(dst, src, (len)*4) +#elif defined(__GNUC__) && defined(i386) +#define SDL_memcpy4(dst, src, len) \ +do { \ + int ecx, edi, esi; \ + __asm__ __volatile__ ( \ + "cld\n\t" \ + "rep ; movsl" \ + : "=&c" (ecx), "=&D" (edi), "=&S" (esi) \ + : "0" (SDL_static_cast(unsigned, len)), "1" (dst), "2" (src) \ + : "memory" ); \ +} while(0) +#endif +#ifndef SDL_memcpy4 +#define SDL_memcpy4(dst, src, len) SDL_memcpy(dst, src, (len) << 2) +#endif + +#if defined(__GNUC__) && defined(i386) +#define SDL_revcpy(dst, src, len) \ +do { \ + int u0, u1, u2; \ + char *dstp = SDL_static_cast(char *, dst); \ + char *srcp = SDL_static_cast(char *, src); \ + int n = (len); \ + if ( n >= 4 ) { \ + __asm__ __volatile__ ( \ + "std\n\t" \ + "rep ; movsl\n\t" \ + "cld\n\t" \ + : "=&c" (u0), "=&D" (u1), "=&S" (u2) \ + : "0" (n >> 2), \ + "1" (dstp+(n-4)), "2" (srcp+(n-4)) \ + : "memory" ); \ + } \ + switch (n & 3) { \ + case 3: dstp[2] = srcp[2]; \ + case 2: dstp[1] = srcp[1]; \ + case 1: dstp[0] = srcp[0]; \ + break; \ + default: \ + break; \ + } \ +} while(0) +#endif +#ifndef SDL_revcpy +extern DECLSPEC void * SDLCALL SDL_revcpy(void *dst, const void *src, size_t len); +#endif + +#ifdef HAVE_MEMMOVE +#define SDL_memmove memmove +#elif defined(HAVE_BCOPY) +#define SDL_memmove(d, s, n) bcopy((s), (d), (n)) +#else +#define SDL_memmove(dst, src, len) \ +do { \ + if ( dst < src ) { \ + SDL_memcpy(dst, src, len); \ + } else { \ + SDL_revcpy(dst, src, len); \ + } \ +} while(0) +#endif + +#ifdef HAVE_MEMCMP +#define SDL_memcmp memcmp +#else +extern DECLSPEC int SDLCALL SDL_memcmp(const void *s1, const void *s2, size_t len); +#endif + +#ifdef HAVE_STRLEN +#define SDL_strlen strlen +#else +extern DECLSPEC size_t SDLCALL SDL_strlen(const char *string); +#endif + +#ifdef HAVE_STRLCPY +#define SDL_strlcpy strlcpy +#else +extern DECLSPEC size_t SDLCALL SDL_strlcpy(char *dst, const char *src, size_t maxlen); +#endif + +#ifdef HAVE_STRLCAT +#define SDL_strlcat strlcat +#else +extern DECLSPEC size_t SDLCALL SDL_strlcat(char *dst, const char *src, size_t maxlen); +#endif + +#ifdef HAVE_STRDUP +#define SDL_strdup strdup +#else +extern DECLSPEC char * SDLCALL SDL_strdup(const char *string); +#endif + +#ifdef HAVE__STRREV +#define SDL_strrev _strrev +#else +extern DECLSPEC char * SDLCALL SDL_strrev(char *string); +#endif + +#ifdef HAVE__STRUPR +#define SDL_strupr _strupr +#else +extern DECLSPEC char * SDLCALL SDL_strupr(char *string); +#endif + +#ifdef HAVE__STRLWR +#define SDL_strlwr _strlwr +#else +extern DECLSPEC char * SDLCALL SDL_strlwr(char *string); +#endif + +#ifdef HAVE_STRCHR +#define SDL_strchr strchr +#elif defined(HAVE_INDEX) +#define SDL_strchr index +#else +extern DECLSPEC char * SDLCALL SDL_strchr(const char *string, int c); +#endif + +#ifdef HAVE_STRRCHR +#define SDL_strrchr strrchr +#elif defined(HAVE_RINDEX) +#define SDL_strrchr rindex +#else +extern DECLSPEC char * SDLCALL SDL_strrchr(const char *string, int c); +#endif + +#ifdef HAVE_STRSTR +#define SDL_strstr strstr +#else +extern DECLSPEC char * SDLCALL SDL_strstr(const char *haystack, const char *needle); +#endif + +#ifdef HAVE_ITOA +#define SDL_itoa itoa +#else +#define SDL_itoa(value, string, radix) SDL_ltoa((long)value, string, radix) +#endif + +#ifdef HAVE__LTOA +#define SDL_ltoa _ltoa +#else +extern DECLSPEC char * SDLCALL SDL_ltoa(long value, char *string, int radix); +#endif + +#ifdef HAVE__UITOA +#define SDL_uitoa _uitoa +#else +#define SDL_uitoa(value, string, radix) SDL_ultoa((long)value, string, radix) +#endif + +#ifdef HAVE__ULTOA +#define SDL_ultoa _ultoa +#else +extern DECLSPEC char * SDLCALL SDL_ultoa(unsigned long value, char *string, int radix); +#endif + +#ifdef HAVE_STRTOL +#define SDL_strtol strtol +#else +extern DECLSPEC long SDLCALL SDL_strtol(const char *string, char **endp, int base); +#endif + +#ifdef HAVE_STRTOUL +#define SDL_strtoul strtoul +#else +extern DECLSPEC unsigned long SDLCALL SDL_strtoul(const char *string, char **endp, int base); +#endif + +#ifdef SDL_HAS_64BIT_TYPE + +#ifdef HAVE__I64TOA +#define SDL_lltoa _i64toa +#else +extern DECLSPEC char* SDLCALL SDL_lltoa(Sint64 value, char *string, int radix); +#endif + +#ifdef HAVE__UI64TOA +#define SDL_ulltoa _ui64toa +#else +extern DECLSPEC char* SDLCALL SDL_ulltoa(Uint64 value, char *string, int radix); +#endif + +#ifdef HAVE_STRTOLL +#define SDL_strtoll strtoll +#else +extern DECLSPEC Sint64 SDLCALL SDL_strtoll(const char *string, char **endp, int base); +#endif + +#ifdef HAVE_STRTOULL +#define SDL_strtoull strtoull +#else +extern DECLSPEC Uint64 SDLCALL SDL_strtoull(const char *string, char **endp, int base); +#endif + +#endif /* SDL_HAS_64BIT_TYPE */ + +#ifdef HAVE_STRTOD +#define SDL_strtod strtod +#else +extern DECLSPEC double SDLCALL SDL_strtod(const char *string, char **endp); +#endif + +#ifdef HAVE_ATOI +#define SDL_atoi atoi +#else +#define SDL_atoi(X) SDL_strtol(X, NULL, 0) +#endif + +#ifdef HAVE_ATOF +#define SDL_atof atof +#else +#define SDL_atof(X) SDL_strtod(X, NULL) +#endif + +#ifdef HAVE_STRCMP +#define SDL_strcmp strcmp +#else +extern DECLSPEC int SDLCALL SDL_strcmp(const char *str1, const char *str2); +#endif + +#ifdef HAVE_STRNCMP +#define SDL_strncmp strncmp +#else +extern DECLSPEC int SDLCALL SDL_strncmp(const char *str1, const char *str2, size_t maxlen); +#endif + +#ifdef HAVE_STRCASECMP +#define SDL_strcasecmp strcasecmp +#elif defined(HAVE__STRICMP) +#define SDL_strcasecmp _stricmp +#else +extern DECLSPEC int SDLCALL SDL_strcasecmp(const char *str1, const char *str2); +#endif + +#ifdef HAVE_STRNCASECMP +#define SDL_strncasecmp strncasecmp +#elif defined(HAVE__STRNICMP) +#define SDL_strncasecmp _strnicmp +#else +extern DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1, const char *str2, size_t maxlen); +#endif + +#ifdef HAVE_SSCANF +#define SDL_sscanf sscanf +#else +extern DECLSPEC int SDLCALL SDL_sscanf(const char *text, const char *fmt, ...); +#endif + +#ifdef HAVE_SNPRINTF +#define SDL_snprintf snprintf +#else +extern DECLSPEC int SDLCALL SDL_snprintf(char *text, size_t maxlen, const char *fmt, ...); +#endif + +#ifdef HAVE_VSNPRINTF +#define SDL_vsnprintf vsnprintf +#else +extern DECLSPEC int SDLCALL SDL_vsnprintf(char *text, size_t maxlen, const char *fmt, va_list ap); +#endif + +/** @name SDL_ICONV Error Codes + * The SDL implementation of iconv() returns these error codes + */ +/*@{*/ +#define SDL_ICONV_ERROR (size_t)-1 +#define SDL_ICONV_E2BIG (size_t)-2 +#define SDL_ICONV_EILSEQ (size_t)-3 +#define SDL_ICONV_EINVAL (size_t)-4 +/*@}*/ + +#if defined(HAVE_ICONV) && defined(HAVE_ICONV_H) +#define SDL_iconv_t iconv_t +#define SDL_iconv_open iconv_open +#define SDL_iconv_close iconv_close +#else +typedef struct _SDL_iconv_t *SDL_iconv_t; +extern DECLSPEC SDL_iconv_t SDLCALL SDL_iconv_open(const char *tocode, const char *fromcode); +extern DECLSPEC int SDLCALL SDL_iconv_close(SDL_iconv_t cd); +#endif +extern DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft); +/** This function converts a string between encodings in one pass, returning a + * string that must be freed with SDL_free() or NULL on error. + */ +extern DECLSPEC char * SDLCALL SDL_iconv_string(const char *tocode, const char *fromcode, const char *inbuf, size_t inbytesleft); +#define SDL_iconv_utf8_locale(S) SDL_iconv_string("", "UTF-8", S, SDL_strlen(S)+1) +#define SDL_iconv_utf8_ucs2(S) (Uint16 *)SDL_iconv_string("UCS-2", "UTF-8", S, SDL_strlen(S)+1) +#define SDL_iconv_utf8_ucs4(S) (Uint32 *)SDL_iconv_string("UCS-4", "UTF-8", S, SDL_strlen(S)+1) + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_stdinc_h */ diff --git a/alienblaster/project/jni/sdl/include/SDL_syswm.h b/alienblaster/project/jni/sdl/include/SDL_syswm.h new file mode 100644 index 000000000..716dddcb7 --- /dev/null +++ b/alienblaster/project/jni/sdl/include/SDL_syswm.h @@ -0,0 +1,225 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_syswm.h + * Include file for SDL custom system window manager hooks + */ + +#ifndef _SDL_syswm_h +#define _SDL_syswm_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_version.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** @file SDL_syswm.h + * Your application has access to a special type of event 'SDL_SYSWMEVENT', + * which contains window-manager specific information and arrives whenever + * an unhandled window event occurs. This event is ignored by default, but + * you can enable it with SDL_EventState() + */ +#ifdef SDL_PROTOTYPES_ONLY +struct SDL_SysWMinfo; +typedef struct SDL_SysWMinfo SDL_SysWMinfo; +#else + +/* This is the structure for custom window manager events */ +#if defined(SDL_VIDEO_DRIVER_X11) +#if defined(__APPLE__) && defined(__MACH__) +/* conflicts with Quickdraw.h */ +#define Cursor X11Cursor +#endif + +#include +#include + +#if defined(__APPLE__) && defined(__MACH__) +/* matches the re-define above */ +#undef Cursor +#endif + +/** These are the various supported subsystems under UNIX */ +typedef enum { + SDL_SYSWM_X11 +} SDL_SYSWM_TYPE; + +/** The UNIX custom event structure */ +struct SDL_SysWMmsg { + SDL_version version; + SDL_SYSWM_TYPE subsystem; + union { + XEvent xevent; + } event; +}; + +/** The UNIX custom window manager information structure. + * When this structure is returned, it holds information about which + * low level system it is using, and will be one of SDL_SYSWM_TYPE. + */ +typedef struct SDL_SysWMinfo { + SDL_version version; + SDL_SYSWM_TYPE subsystem; + union { + struct { + Display *display; /**< The X11 display */ + Window window; /**< The X11 display window */ + /** These locking functions should be called around + * any X11 functions using the display variable, + * but not the gfxdisplay variable. + * They lock the event thread, so should not be + * called around event functions or from event filters. + */ + /*@{*/ + void (*lock_func)(void); + void (*unlock_func)(void); + /*@}*/ + + /** @name Introduced in SDL 1.0.2 */ + /*@{*/ + Window fswindow; /**< The X11 fullscreen window */ + Window wmwindow; /**< The X11 managed input window */ + /*@}*/ + + /** @name Introduced in SDL 1.2.12 */ + /*@{*/ + Display *gfxdisplay; /**< The X11 display to which rendering is done */ + /*@}*/ + } x11; + } info; +} SDL_SysWMinfo; + +#elif defined(SDL_VIDEO_DRIVER_NANOX) +#include + +/** The generic custom event structure */ +struct SDL_SysWMmsg { + SDL_version version; + int data; +}; + +/** The windows custom window manager information structure */ +typedef struct SDL_SysWMinfo { + SDL_version version ; + GR_WINDOW_ID window ; /* The display window */ +} SDL_SysWMinfo; + +#elif defined(SDL_VIDEO_DRIVER_WINDIB) || defined(SDL_VIDEO_DRIVER_DDRAW) || defined(SDL_VIDEO_DRIVER_GAPI) +#define WIN32_LEAN_AND_MEAN +#include + +/** The windows custom event structure */ +struct SDL_SysWMmsg { + SDL_version version; + HWND hwnd; /**< The window for the message */ + UINT msg; /**< The type of message */ + WPARAM wParam; /**< WORD message parameter */ + LPARAM lParam; /**< LONG message parameter */ +}; + +/** The windows custom window manager information structure */ +typedef struct SDL_SysWMinfo { + SDL_version version; + HWND window; /**< The Win32 display window */ + HGLRC hglrc; /**< The OpenGL context, if any */ +} SDL_SysWMinfo; + +#elif defined(SDL_VIDEO_DRIVER_RISCOS) + +/** RISC OS custom event structure */ +struct SDL_SysWMmsg { + SDL_version version; + int eventCode; /**< The window for the message */ + int pollBlock[64]; +}; + +/** The RISC OS custom window manager information structure */ +typedef struct SDL_SysWMinfo { + SDL_version version; + int wimpVersion; /**< Wimp version running under */ + int taskHandle; /**< The RISC OS task handle */ + int window; /**< The RISC OS display window */ +} SDL_SysWMinfo; + +#elif defined(SDL_VIDEO_DRIVER_PHOTON) +#include +#include + +/** The QNX custom event structure */ +struct SDL_SysWMmsg { + SDL_version version; + int data; +}; + +/** The QNX custom window manager information structure */ +typedef struct SDL_SysWMinfo { + SDL_version version; + int data; +} SDL_SysWMinfo; + +#else + +/** The generic custom event structure */ +struct SDL_SysWMmsg { + SDL_version version; + int data; +}; + +/** The generic custom window manager information structure */ +typedef struct SDL_SysWMinfo { + SDL_version version; + int data; +} SDL_SysWMinfo; + +#endif /* video driver type */ + +#endif /* SDL_PROTOTYPES_ONLY */ + +/* Function prototypes */ +/** + * This function gives you custom hooks into the window manager information. + * It fills the structure pointed to by 'info' with custom information and + * returns 1 if the function is implemented. If it's not implemented, or + * the version member of the 'info' structure is invalid, it returns 0. + * + * You typically use this function like this: + * @code + * SDL_SysWMInfo info; + * SDL_VERSION(&info.version); + * if ( SDL_GetWMInfo(&info) ) { ... } + * @endcode + */ +extern DECLSPEC int SDLCALL SDL_GetWMInfo(SDL_SysWMinfo *info); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_syswm_h */ diff --git a/alienblaster/project/jni/sdl/include/SDL_thread.h b/alienblaster/project/jni/sdl/include/SDL_thread.h new file mode 100644 index 000000000..1ca9a1bc4 --- /dev/null +++ b/alienblaster/project/jni/sdl/include/SDL_thread.h @@ -0,0 +1,120 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_thread_h +#define _SDL_thread_h + +/** @file SDL_thread.h + * Header for the SDL thread management routines + * + * @note These are independent of the other SDL routines. + */ + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +/* Thread synchronization primitives */ +#include "SDL_mutex.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** The SDL thread structure, defined in SDL_thread.c */ +struct SDL_Thread; +typedef struct SDL_Thread SDL_Thread; + +/** Create a thread */ +#if ((defined(__WIN32__) && !defined(HAVE_LIBC)) || defined(__OS2__)) && !defined(__SYMBIAN32__) +/** + * We compile SDL into a DLL on OS/2. This means, that it's the DLL which + * creates a new thread for the calling process with the SDL_CreateThread() + * API. There is a problem with this, that only the RTL of the SDL.DLL will + * be initialized for those threads, and not the RTL of the calling application! + * To solve this, we make a little hack here. + * We'll always use the caller's _beginthread() and _endthread() APIs to + * start a new thread. This way, if it's the SDL.DLL which uses this API, + * then the RTL of SDL.DLL will be used to create the new thread, and if it's + * the application, then the RTL of the application will be used. + * So, in short: + * Always use the _beginthread() and _endthread() of the calling runtime library! + */ +#define SDL_PASSED_BEGINTHREAD_ENDTHREAD +#ifndef _WIN32_WCE +#include /* This has _beginthread() and _endthread() defined! */ +#endif + +#ifdef __OS2__ +typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(void *), void *, unsigned, void *arg); +typedef void (*pfnSDL_CurrentEndThread)(void); +#elif __GNUC__ +typedef unsigned long (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned, + unsigned (__stdcall *func)(void *), void *arg, + unsigned, unsigned *threadID); +typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code); +#else +typedef uintptr_t (__cdecl *pfnSDL_CurrentBeginThread) (void *, unsigned, + unsigned (__stdcall *func)(void *), void *arg, + unsigned, unsigned *threadID); +typedef void (__cdecl *pfnSDL_CurrentEndThread)(unsigned code); +#endif + +extern DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (SDLCALL *fn)(void *), void *data, pfnSDL_CurrentBeginThread pfnBeginThread, pfnSDL_CurrentEndThread pfnEndThread); + +#ifdef __OS2__ +#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, _beginthread, _endthread) +#elif defined(_WIN32_WCE) +#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, NULL, NULL) +#else +#define SDL_CreateThread(fn, data) SDL_CreateThread(fn, data, _beginthreadex, _endthreadex) +#endif +#else +extern DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (SDLCALL *fn)(void *), void *data); +#endif + +/** Get the 32-bit thread identifier for the current thread */ +extern DECLSPEC Uint32 SDLCALL SDL_ThreadID(void); + +/** Get the 32-bit thread identifier for the specified thread, + * equivalent to SDL_ThreadID() if the specified thread is NULL. + */ +extern DECLSPEC Uint32 SDLCALL SDL_GetThreadID(SDL_Thread *thread); + +/** Wait for a thread to finish. + * The return code for the thread function is placed in the area + * pointed to by 'status', if 'status' is not NULL. + */ +extern DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread *thread, int *status); + +/** Forcefully kill a thread without worrying about its state */ +extern DECLSPEC void SDLCALL SDL_KillThread(SDL_Thread *thread); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_thread_h */ diff --git a/alienblaster/project/jni/sdl/include/SDL_timer.h b/alienblaster/project/jni/sdl/include/SDL_timer.h new file mode 100644 index 000000000..d7cd02460 --- /dev/null +++ b/alienblaster/project/jni/sdl/include/SDL_timer.h @@ -0,0 +1,125 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +#ifndef _SDL_timer_h +#define _SDL_timer_h + +/** @file SDL_timer.h + * Header for the SDL time management routines + */ + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** This is the OS scheduler timeslice, in milliseconds */ +#define SDL_TIMESLICE 10 + +/** This is the maximum resolution of the SDL timer on all platforms */ +#define TIMER_RESOLUTION 10 /**< Experimentally determined */ + +/** + * Get the number of milliseconds since the SDL library initialization. + * Note that this value wraps if the program runs for more than ~49 days. + */ +extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void); + +/** Wait a specified number of milliseconds before returning */ +extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms); + +/** Function prototype for the timer callback function */ +typedef Uint32 (SDLCALL *SDL_TimerCallback)(Uint32 interval); + +/** + * Set a callback to run after the specified number of milliseconds has + * elapsed. The callback function is passed the current timer interval + * and returns the next timer interval. If the returned value is the + * same as the one passed in, the periodic alarm continues, otherwise a + * new alarm is scheduled. If the callback returns 0, the periodic alarm + * is cancelled. + * + * To cancel a currently running timer, call SDL_SetTimer(0, NULL); + * + * The timer callback function may run in a different thread than your + * main code, and so shouldn't call any functions from within itself. + * + * The maximum resolution of this timer is 10 ms, which means that if + * you request a 16 ms timer, your callback will run approximately 20 ms + * later on an unloaded system. If you wanted to set a flag signaling + * a frame update at 30 frames per second (every 33 ms), you might set a + * timer for 30 ms: + * @code SDL_SetTimer((33/10)*10, flag_update); @endcode + * + * If you use this function, you need to pass SDL_INIT_TIMER to SDL_Init(). + * + * Under UNIX, you should not use raise or use SIGALRM and this function + * in the same program, as it is implemented using setitimer(). You also + * should not use this function in multi-threaded applications as signals + * to multi-threaded apps have undefined behavior in some implementations. + * + * This function returns 0 if successful, or -1 if there was an error. + */ +extern DECLSPEC int SDLCALL SDL_SetTimer(Uint32 interval, SDL_TimerCallback callback); + +/** @name New timer API + * New timer API, supports multiple timers + * Written by Stephane Peter + */ +/*@{*/ + +/** + * Function prototype for the new timer callback function. + * The callback function is passed the current timer interval and returns + * the next timer interval. If the returned value is the same as the one + * passed in, the periodic alarm continues, otherwise a new alarm is + * scheduled. If the callback returns 0, the periodic alarm is cancelled. + */ +typedef Uint32 (SDLCALL *SDL_NewTimerCallback)(Uint32 interval, void *param); + +/** Definition of the timer ID type */ +typedef struct _SDL_TimerID *SDL_TimerID; + +/** Add a new timer to the pool of timers already running. + * Returns a timer ID, or NULL when an error occurs. + */ +extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval, SDL_NewTimerCallback callback, void *param); + +/** + * Remove one of the multiple timers knowing its ID. + * Returns a boolean value indicating success. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID t); + +/*@}*/ + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_timer_h */ diff --git a/alienblaster/project/jni/sdl/include/SDL_types.h b/alienblaster/project/jni/sdl/include/SDL_types.h new file mode 100644 index 000000000..cfa35236a --- /dev/null +++ b/alienblaster/project/jni/sdl/include/SDL_types.h @@ -0,0 +1,28 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_types.h + * @deprecated Use SDL_stdinc.h instead. + */ + +/* DEPRECATED */ +#include "SDL_stdinc.h" diff --git a/alienblaster/project/jni/sdl/include/SDL_version.h b/alienblaster/project/jni/sdl/include/SDL_version.h new file mode 100644 index 000000000..fa02c3f6d --- /dev/null +++ b/alienblaster/project/jni/sdl/include/SDL_version.h @@ -0,0 +1,91 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_version.h + * This header defines the current SDL version + */ + +#ifndef _SDL_version_h +#define _SDL_version_h + +#include "SDL_stdinc.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** @name Version Number + * Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL + */ +/*@{*/ +#define SDL_MAJOR_VERSION 1 +#define SDL_MINOR_VERSION 2 +#define SDL_PATCHLEVEL 14 +/*@}*/ + +typedef struct SDL_version { + Uint8 major; + Uint8 minor; + Uint8 patch; +} SDL_version; + +/** + * This macro can be used to fill a version structure with the compile-time + * version of the SDL library. + */ +#define SDL_VERSION(X) \ +{ \ + (X)->major = SDL_MAJOR_VERSION; \ + (X)->minor = SDL_MINOR_VERSION; \ + (X)->patch = SDL_PATCHLEVEL; \ +} + +/** This macro turns the version numbers into a numeric value: + * (1,2,3) -> (1203) + * This assumes that there will never be more than 100 patchlevels + */ +#define SDL_VERSIONNUM(X, Y, Z) \ + ((X)*1000 + (Y)*100 + (Z)) + +/** This is the version number macro for the current SDL version */ +#define SDL_COMPILEDVERSION \ + SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL) + +/** This macro will evaluate to true if compiled with SDL at least X.Y.Z */ +#define SDL_VERSION_ATLEAST(X, Y, Z) \ + (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z)) + +/** This function gets the version of the dynamically linked SDL library. + * it should NOT be used to fill a version structure, instead you should + * use the SDL_Version() macro. + */ +extern DECLSPEC const SDL_version * SDLCALL SDL_Linked_Version(void); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_version_h */ diff --git a/alienblaster/project/jni/sdl/include/SDL_video.h b/alienblaster/project/jni/sdl/include/SDL_video.h new file mode 100644 index 000000000..8f7f30520 --- /dev/null +++ b/alienblaster/project/jni/sdl/include/SDL_video.h @@ -0,0 +1,951 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** @file SDL_video.h + * Header file for access to the SDL raw framebuffer window + */ + +#ifndef _SDL_video_h +#define _SDL_video_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_rwops.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** @name Transparency definitions + * These define alpha as the opacity of a surface + */ +/*@{*/ +#define SDL_ALPHA_OPAQUE 255 +#define SDL_ALPHA_TRANSPARENT 0 +/*@}*/ + +/** @name Useful data types */ +/*@{*/ +typedef struct SDL_Rect { + Sint16 x, y; + Uint16 w, h; +} SDL_Rect; + +typedef struct SDL_Color { + Uint8 r; + Uint8 g; + Uint8 b; + Uint8 unused; +} SDL_Color; +#define SDL_Colour SDL_Color + +typedef struct SDL_Palette { + int ncolors; + SDL_Color *colors; +} SDL_Palette; +/*@}*/ + +/** Everything in the pixel format structure is read-only */ +typedef struct SDL_PixelFormat { + SDL_Palette *palette; + Uint8 BitsPerPixel; + Uint8 BytesPerPixel; + Uint8 Rloss; + Uint8 Gloss; + Uint8 Bloss; + Uint8 Aloss; + Uint8 Rshift; + Uint8 Gshift; + Uint8 Bshift; + Uint8 Ashift; + Uint32 Rmask; + Uint32 Gmask; + Uint32 Bmask; + Uint32 Amask; + + /** RGB color key information */ + Uint32 colorkey; + /** Alpha value information (per-surface alpha) */ + Uint8 alpha; +} SDL_PixelFormat; + +/** This structure should be treated as read-only, except for 'pixels', + * which, if not NULL, contains the raw pixel data for the surface. + */ +typedef struct SDL_Surface { + Uint32 flags; /**< Read-only */ + SDL_PixelFormat *format; /**< Read-only */ + int w, h; /**< Read-only */ + Uint16 pitch; /**< Read-only */ + void *pixels; /**< Read-write */ + int offset; /**< Private */ + + /** Hardware-specific surface info */ + struct private_hwdata *hwdata; + + /** clipping information */ + SDL_Rect clip_rect; /**< Read-only */ + Uint32 unused1; /**< for binary compatibility */ + + /** Allow recursive locks */ + Uint32 locked; /**< Private */ + + /** info for fast blit mapping to other surfaces */ + struct SDL_BlitMap *map; /**< Private */ + + /** format version, bumped at every change to invalidate blit maps */ + unsigned int format_version; /**< Private */ + + /** Reference count -- used when freeing surface */ + int refcount; /**< Read-mostly */ +} SDL_Surface; + +/** @name SDL_Surface Flags + * These are the currently supported flags for the SDL_surface + */ +/*@{*/ + +/** Available for SDL_CreateRGBSurface() or SDL_SetVideoMode() */ +/*@{*/ +#define SDL_SWSURFACE 0x00000000 /**< Surface is in system memory */ +#define SDL_HWSURFACE 0x00000001 /**< Surface is in video memory */ +#define SDL_ASYNCBLIT 0x00000004 /**< Use asynchronous blits if possible */ +/*@}*/ + +/** Available for SDL_SetVideoMode() */ +/*@{*/ +#define SDL_ANYFORMAT 0x10000000 /**< Allow any video depth/pixel-format */ +#define SDL_HWPALETTE 0x20000000 /**< Surface has exclusive palette */ +#define SDL_DOUBLEBUF 0x40000000 /**< Set up double-buffered video mode */ +#define SDL_FULLSCREEN 0x80000000 /**< Surface is a full screen display */ +#define SDL_OPENGL 0x00000002 /**< Create an OpenGL rendering context */ +#define SDL_OPENGLBLIT 0x0000000A /**< Create an OpenGL rendering context and use it for blitting */ +#define SDL_RESIZABLE 0x00000010 /**< This video mode may be resized */ +#define SDL_NOFRAME 0x00000020 /**< No window caption or edge frame */ +/*@}*/ + +/** Used internally (read-only) */ +/*@{*/ +#define SDL_HWACCEL 0x00000100 /**< Blit uses hardware acceleration */ +#define SDL_SRCCOLORKEY 0x00001000 /**< Blit uses a source color key */ +#define SDL_RLEACCELOK 0x00002000 /**< Private flag */ +#define SDL_RLEACCEL 0x00004000 /**< Surface is RLE encoded */ +#define SDL_SRCALPHA 0x00010000 /**< Blit uses source alpha blending */ +#define SDL_PREALLOC 0x01000000 /**< Surface uses preallocated memory */ +/*@}*/ + +/*@}*/ + +/** Evaluates to true if the surface needs to be locked before access */ +#define SDL_MUSTLOCK(surface) \ + (surface->offset || \ + ((surface->flags & (SDL_HWSURFACE|SDL_ASYNCBLIT|SDL_RLEACCEL)) != 0)) + +/** typedef for private surface blitting functions */ +typedef int (*SDL_blit)(struct SDL_Surface *src, SDL_Rect *srcrect, + struct SDL_Surface *dst, SDL_Rect *dstrect); + + +/** Useful for determining the video hardware capabilities */ +typedef struct SDL_VideoInfo { + Uint32 hw_available :1; /**< Flag: Can you create hardware surfaces? */ + Uint32 wm_available :1; /**< Flag: Can you talk to a window manager? */ + Uint32 UnusedBits1 :6; + Uint32 UnusedBits2 :1; + Uint32 blit_hw :1; /**< Flag: Accelerated blits HW --> HW */ + Uint32 blit_hw_CC :1; /**< Flag: Accelerated blits with Colorkey */ + Uint32 blit_hw_A :1; /**< Flag: Accelerated blits with Alpha */ + Uint32 blit_sw :1; /**< Flag: Accelerated blits SW --> HW */ + Uint32 blit_sw_CC :1; /**< Flag: Accelerated blits with Colorkey */ + Uint32 blit_sw_A :1; /**< Flag: Accelerated blits with Alpha */ + Uint32 blit_fill :1; /**< Flag: Accelerated color fill */ + Uint32 UnusedBits3 :16; + Uint32 video_mem; /**< The total amount of video memory (in K) */ + SDL_PixelFormat *vfmt; /**< Value: The format of the video surface */ + int current_w; /**< Value: The current video mode width */ + int current_h; /**< Value: The current video mode height */ +} SDL_VideoInfo; + + +/** @name Overlay Formats + * The most common video overlay formats. + * For an explanation of these pixel formats, see: + * http://www.webartz.com/fourcc/indexyuv.htm + * + * For information on the relationship between color spaces, see: + * http://www.neuro.sfc.keio.ac.jp/~aly/polygon/info/color-space-faq.html + */ +/*@{*/ +#define SDL_YV12_OVERLAY 0x32315659 /**< Planar mode: Y + V + U (3 planes) */ +#define SDL_IYUV_OVERLAY 0x56555949 /**< Planar mode: Y + U + V (3 planes) */ +#define SDL_YUY2_OVERLAY 0x32595559 /**< Packed mode: Y0+U0+Y1+V0 (1 plane) */ +#define SDL_UYVY_OVERLAY 0x59565955 /**< Packed mode: U0+Y0+V0+Y1 (1 plane) */ +#define SDL_YVYU_OVERLAY 0x55595659 /**< Packed mode: Y0+V0+Y1+U0 (1 plane) */ +/*@}*/ + +/** The YUV hardware video overlay */ +typedef struct SDL_Overlay { + Uint32 format; /**< Read-only */ + int w, h; /**< Read-only */ + int planes; /**< Read-only */ + Uint16 *pitches; /**< Read-only */ + Uint8 **pixels; /**< Read-write */ + + /** @name Hardware-specific surface info */ + /*@{*/ + struct private_yuvhwfuncs *hwfuncs; + struct private_yuvhwdata *hwdata; + /*@{*/ + + /** @name Special flags */ + /*@{*/ + Uint32 hw_overlay :1; /**< Flag: This overlay hardware accelerated? */ + Uint32 UnusedBits :31; + /*@}*/ +} SDL_Overlay; + + +/** Public enumeration for setting the OpenGL window attributes. */ +typedef enum { + SDL_GL_RED_SIZE, + SDL_GL_GREEN_SIZE, + SDL_GL_BLUE_SIZE, + SDL_GL_ALPHA_SIZE, + SDL_GL_BUFFER_SIZE, + SDL_GL_DOUBLEBUFFER, + SDL_GL_DEPTH_SIZE, + SDL_GL_STENCIL_SIZE, + SDL_GL_ACCUM_RED_SIZE, + SDL_GL_ACCUM_GREEN_SIZE, + SDL_GL_ACCUM_BLUE_SIZE, + SDL_GL_ACCUM_ALPHA_SIZE, + SDL_GL_STEREO, + SDL_GL_MULTISAMPLEBUFFERS, + SDL_GL_MULTISAMPLESAMPLES, + SDL_GL_ACCELERATED_VISUAL, + SDL_GL_SWAP_CONTROL +} SDL_GLattr; + +/** @name flags for SDL_SetPalette() */ +/*@{*/ +#define SDL_LOGPAL 0x01 +#define SDL_PHYSPAL 0x02 +/*@}*/ + +/* Function prototypes */ + +/** + * @name Video Init and Quit + * These functions are used internally, and should not be used unless you + * have a specific need to specify the video driver you want to use. + * You should normally use SDL_Init() or SDL_InitSubSystem(). + */ +/*@{*/ +/** + * Initializes the video subsystem. Sets up a connection + * to the window manager, etc, and determines the current video mode and + * pixel format, but does not initialize a window or graphics mode. + * Note that event handling is activated by this routine. + * + * If you use both sound and video in your application, you need to call + * SDL_Init() before opening the sound device, otherwise under Win32 DirectX, + * you won't be able to set full-screen display modes. + */ +extern DECLSPEC int SDLCALL SDL_VideoInit(const char *driver_name, Uint32 flags); +extern DECLSPEC void SDLCALL SDL_VideoQuit(void); +/*@}*/ + +/** + * This function fills the given character buffer with the name of the + * video driver, and returns a pointer to it if the video driver has + * been initialized. It returns NULL if no driver has been initialized. + */ +extern DECLSPEC char * SDLCALL SDL_VideoDriverName(char *namebuf, int maxlen); + +/** + * This function returns a pointer to the current display surface. + * If SDL is doing format conversion on the display surface, this + * function returns the publicly visible surface, not the real video + * surface. + */ +extern DECLSPEC SDL_Surface * SDLCALL SDL_GetVideoSurface(void); + +/** + * This function returns a read-only pointer to information about the + * video hardware. If this is called before SDL_SetVideoMode(), the 'vfmt' + * member of the returned structure will contain the pixel format of the + * "best" video mode. + */ +extern DECLSPEC const SDL_VideoInfo * SDLCALL SDL_GetVideoInfo(void); + +/** + * Check to see if a particular video mode is supported. + * It returns 0 if the requested mode is not supported under any bit depth, + * or returns the bits-per-pixel of the closest available mode with the + * given width and height. If this bits-per-pixel is different from the + * one used when setting the video mode, SDL_SetVideoMode() will succeed, + * but will emulate the requested bits-per-pixel with a shadow surface. + * + * The arguments to SDL_VideoModeOK() are the same ones you would pass to + * SDL_SetVideoMode() + */ +extern DECLSPEC int SDLCALL SDL_VideoModeOK(int width, int height, int bpp, Uint32 flags); + +/** + * Return a pointer to an array of available screen dimensions for the + * given format and video flags, sorted largest to smallest. Returns + * NULL if there are no dimensions available for a particular format, + * or (SDL_Rect **)-1 if any dimension is okay for the given format. + * + * If 'format' is NULL, the mode list will be for the format given + * by SDL_GetVideoInfo()->vfmt + */ +extern DECLSPEC SDL_Rect ** SDLCALL SDL_ListModes(SDL_PixelFormat *format, Uint32 flags); + +/** + * Set up a video mode with the specified width, height and bits-per-pixel. + * + * If 'bpp' is 0, it is treated as the current display bits per pixel. + * + * If SDL_ANYFORMAT is set in 'flags', the SDL library will try to set the + * requested bits-per-pixel, but will return whatever video pixel format is + * available. The default is to emulate the requested pixel format if it + * is not natively available. + * + * If SDL_HWSURFACE is set in 'flags', the video surface will be placed in + * video memory, if possible, and you may have to call SDL_LockSurface() + * in order to access the raw framebuffer. Otherwise, the video surface + * will be created in system memory. + * + * If SDL_ASYNCBLIT is set in 'flags', SDL will try to perform rectangle + * updates asynchronously, but you must always lock before accessing pixels. + * SDL will wait for updates to complete before returning from the lock. + * + * If SDL_HWPALETTE is set in 'flags', the SDL library will guarantee + * that the colors set by SDL_SetColors() will be the colors you get. + * Otherwise, in 8-bit mode, SDL_SetColors() may not be able to set all + * of the colors exactly the way they are requested, and you should look + * at the video surface structure to determine the actual palette. + * If SDL cannot guarantee that the colors you request can be set, + * i.e. if the colormap is shared, then the video surface may be created + * under emulation in system memory, overriding the SDL_HWSURFACE flag. + * + * If SDL_FULLSCREEN is set in 'flags', the SDL library will try to set + * a fullscreen video mode. The default is to create a windowed mode + * if the current graphics system has a window manager. + * If the SDL library is able to set a fullscreen video mode, this flag + * will be set in the surface that is returned. + * + * If SDL_DOUBLEBUF is set in 'flags', the SDL library will try to set up + * two surfaces in video memory and swap between them when you call + * SDL_Flip(). This is usually slower than the normal single-buffering + * scheme, but prevents "tearing" artifacts caused by modifying video + * memory while the monitor is refreshing. It should only be used by + * applications that redraw the entire screen on every update. + * + * If SDL_RESIZABLE is set in 'flags', the SDL library will allow the + * window manager, if any, to resize the window at runtime. When this + * occurs, SDL will send a SDL_VIDEORESIZE event to you application, + * and you must respond to the event by re-calling SDL_SetVideoMode() + * with the requested size (or another size that suits the application). + * + * If SDL_NOFRAME is set in 'flags', the SDL library will create a window + * without any title bar or frame decoration. Fullscreen video modes have + * this flag set automatically. + * + * This function returns the video framebuffer surface, or NULL if it fails. + * + * If you rely on functionality provided by certain video flags, check the + * flags of the returned surface to make sure that functionality is available. + * SDL will fall back to reduced functionality if the exact flags you wanted + * are not available. + */ +extern DECLSPEC SDL_Surface * SDLCALL SDL_SetVideoMode + (int width, int height, int bpp, Uint32 flags); + +/** @name SDL_Update Functions + * These functions should not be called while 'screen' is locked. + */ +/*@{*/ +/** + * Makes sure the given list of rectangles is updated on the given screen. + */ +extern DECLSPEC void SDLCALL SDL_UpdateRects + (SDL_Surface *screen, int numrects, SDL_Rect *rects); +/** + * If 'x', 'y', 'w' and 'h' are all 0, SDL_UpdateRect will update the entire + * screen. + */ +extern DECLSPEC void SDLCALL SDL_UpdateRect + (SDL_Surface *screen, Sint32 x, Sint32 y, Uint32 w, Uint32 h); +/*@}*/ + +/** + * On hardware that supports double-buffering, this function sets up a flip + * and returns. The hardware will wait for vertical retrace, and then swap + * video buffers before the next video surface blit or lock will return. + * On hardware that doesn not support double-buffering, this is equivalent + * to calling SDL_UpdateRect(screen, 0, 0, 0, 0); + * The SDL_DOUBLEBUF flag must have been passed to SDL_SetVideoMode() when + * setting the video mode for this function to perform hardware flipping. + * This function returns 0 if successful, or -1 if there was an error. + */ +extern DECLSPEC int SDLCALL SDL_Flip(SDL_Surface *screen); + +/** + * Set the gamma correction for each of the color channels. + * The gamma values range (approximately) between 0.1 and 10.0 + * + * If this function isn't supported directly by the hardware, it will + * be emulated using gamma ramps, if available. If successful, this + * function returns 0, otherwise it returns -1. + */ +extern DECLSPEC int SDLCALL SDL_SetGamma(float red, float green, float blue); + +/** + * Set the gamma translation table for the red, green, and blue channels + * of the video hardware. Each table is an array of 256 16-bit quantities, + * representing a mapping between the input and output for that channel. + * The input is the index into the array, and the output is the 16-bit + * gamma value at that index, scaled to the output color precision. + * + * You may pass NULL for any of the channels to leave it unchanged. + * If the call succeeds, it will return 0. If the display driver or + * hardware does not support gamma translation, or otherwise fails, + * this function will return -1. + */ +extern DECLSPEC int SDLCALL SDL_SetGammaRamp(const Uint16 *red, const Uint16 *green, const Uint16 *blue); + +/** + * Retrieve the current values of the gamma translation tables. + * + * You must pass in valid pointers to arrays of 256 16-bit quantities. + * Any of the pointers may be NULL to ignore that channel. + * If the call succeeds, it will return 0. If the display driver or + * hardware does not support gamma translation, or otherwise fails, + * this function will return -1. + */ +extern DECLSPEC int SDLCALL SDL_GetGammaRamp(Uint16 *red, Uint16 *green, Uint16 *blue); + +/** + * Sets a portion of the colormap for the given 8-bit surface. If 'surface' + * is not a palettized surface, this function does nothing, returning 0. + * If all of the colors were set as passed to SDL_SetColors(), it will + * return 1. If not all the color entries were set exactly as given, + * it will return 0, and you should look at the surface palette to + * determine the actual color palette. + * + * When 'surface' is the surface associated with the current display, the + * display colormap will be updated with the requested colors. If + * SDL_HWPALETTE was set in SDL_SetVideoMode() flags, SDL_SetColors() + * will always return 1, and the palette is guaranteed to be set the way + * you desire, even if the window colormap has to be warped or run under + * emulation. + */ +extern DECLSPEC int SDLCALL SDL_SetColors(SDL_Surface *surface, + SDL_Color *colors, int firstcolor, int ncolors); + +/** + * Sets a portion of the colormap for a given 8-bit surface. + * 'flags' is one or both of: + * SDL_LOGPAL -- set logical palette, which controls how blits are mapped + * to/from the surface, + * SDL_PHYSPAL -- set physical palette, which controls how pixels look on + * the screen + * Only screens have physical palettes. Separate change of physical/logical + * palettes is only possible if the screen has SDL_HWPALETTE set. + * + * The return value is 1 if all colours could be set as requested, and 0 + * otherwise. + * + * SDL_SetColors() is equivalent to calling this function with + * flags = (SDL_LOGPAL|SDL_PHYSPAL). + */ +extern DECLSPEC int SDLCALL SDL_SetPalette(SDL_Surface *surface, int flags, + SDL_Color *colors, int firstcolor, + int ncolors); + +/** + * Maps an RGB triple to an opaque pixel value for a given pixel format + */ +extern DECLSPEC Uint32 SDLCALL SDL_MapRGB +(const SDL_PixelFormat * const format, + const Uint8 r, const Uint8 g, const Uint8 b); + +/** + * Maps an RGBA quadruple to a pixel value for a given pixel format + */ +extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA +(const SDL_PixelFormat * const format, + const Uint8 r, const Uint8 g, const Uint8 b, const Uint8 a); + +/** + * Maps a pixel value into the RGB components for a given pixel format + */ +extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel, + const SDL_PixelFormat * const fmt, + Uint8 *r, Uint8 *g, Uint8 *b); + +/** + * Maps a pixel value into the RGBA components for a given pixel format + */ +extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel, + const SDL_PixelFormat * const fmt, + Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a); + +/** @sa SDL_CreateRGBSurface */ +#define SDL_AllocSurface SDL_CreateRGBSurface +/** + * Allocate and free an RGB surface (must be called after SDL_SetVideoMode) + * If the depth is 4 or 8 bits, an empty palette is allocated for the surface. + * If the depth is greater than 8 bits, the pixel format is set using the + * flags '[RGB]mask'. + * If the function runs out of memory, it will return NULL. + * + * The 'flags' tell what kind of surface to create. + * SDL_SWSURFACE means that the surface should be created in system memory. + * SDL_HWSURFACE means that the surface should be created in video memory, + * with the same format as the display surface. This is useful for surfaces + * that will not change much, to take advantage of hardware acceleration + * when being blitted to the display surface. + * SDL_ASYNCBLIT means that SDL will try to perform asynchronous blits with + * this surface, but you must always lock it before accessing the pixels. + * SDL will wait for current blits to finish before returning from the lock. + * SDL_SRCCOLORKEY indicates that the surface will be used for colorkey blits. + * If the hardware supports acceleration of colorkey blits between + * two surfaces in video memory, SDL will try to place the surface in + * video memory. If this isn't possible or if there is no hardware + * acceleration available, the surface will be placed in system memory. + * SDL_SRCALPHA means that the surface will be used for alpha blits and + * if the hardware supports hardware acceleration of alpha blits between + * two surfaces in video memory, to place the surface in video memory + * if possible, otherwise it will be placed in system memory. + * If the surface is created in video memory, blits will be _much_ faster, + * but the surface format must be identical to the video surface format, + * and the only way to access the pixels member of the surface is to use + * the SDL_LockSurface() and SDL_UnlockSurface() calls. + * If the requested surface actually resides in video memory, SDL_HWSURFACE + * will be set in the flags member of the returned surface. If for some + * reason the surface could not be placed in video memory, it will not have + * the SDL_HWSURFACE flag set, and will be created in system memory instead. + */ +extern DECLSPEC SDL_Surface * SDLCALL SDL_CreateRGBSurface + (Uint32 flags, int width, int height, int depth, + Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask); +/** @sa SDL_CreateRGBSurface */ +extern DECLSPEC SDL_Surface * SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels, + int width, int height, int depth, int pitch, + Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask); +extern DECLSPEC void SDLCALL SDL_FreeSurface(SDL_Surface *surface); + +/** + * SDL_LockSurface() sets up a surface for directly accessing the pixels. + * Between calls to SDL_LockSurface()/SDL_UnlockSurface(), you can write + * to and read from 'surface->pixels', using the pixel format stored in + * 'surface->format'. Once you are done accessing the surface, you should + * use SDL_UnlockSurface() to release it. + * + * Not all surfaces require locking. If SDL_MUSTLOCK(surface) evaluates + * to 0, then you can read and write to the surface at any time, and the + * pixel format of the surface will not change. In particular, if the + * SDL_HWSURFACE flag is not given when calling SDL_SetVideoMode(), you + * will not need to lock the display surface before accessing it. + * + * No operating system or library calls should be made between lock/unlock + * pairs, as critical system locks may be held during this time. + * + * SDL_LockSurface() returns 0, or -1 if the surface couldn't be locked. + */ +extern DECLSPEC int SDLCALL SDL_LockSurface(SDL_Surface *surface); +extern DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface *surface); + +/** + * Load a surface from a seekable SDL data source (memory or file.) + * If 'freesrc' is non-zero, the source will be closed after being read. + * Returns the new surface, or NULL if there was an error. + * The new surface should be freed with SDL_FreeSurface(). + */ +extern DECLSPEC SDL_Surface * SDLCALL SDL_LoadBMP_RW(SDL_RWops *src, int freesrc); + +/** Convenience macro -- load a surface from a file */ +#define SDL_LoadBMP(file) SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1) + +/** + * Save a surface to a seekable SDL data source (memory or file.) + * If 'freedst' is non-zero, the source will be closed after being written. + * Returns 0 if successful or -1 if there was an error. + */ +extern DECLSPEC int SDLCALL SDL_SaveBMP_RW + (SDL_Surface *surface, SDL_RWops *dst, int freedst); + +/** Convenience macro -- save a surface to a file */ +#define SDL_SaveBMP(surface, file) \ + SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1) + +/** + * Sets the color key (transparent pixel) in a blittable surface. + * If 'flag' is SDL_SRCCOLORKEY (optionally OR'd with SDL_RLEACCEL), + * 'key' will be the transparent pixel in the source image of a blit. + * SDL_RLEACCEL requests RLE acceleration for the surface if present, + * and removes RLE acceleration if absent. + * If 'flag' is 0, this function clears any current color key. + * This function returns 0, or -1 if there was an error. + */ +extern DECLSPEC int SDLCALL SDL_SetColorKey + (SDL_Surface *surface, Uint32 flag, Uint32 key); + +/** + * This function sets the alpha value for the entire surface, as opposed to + * using the alpha component of each pixel. This value measures the range + * of transparency of the surface, 0 being completely transparent to 255 + * being completely opaque. An 'alpha' value of 255 causes blits to be + * opaque, the source pixels copied to the destination (the default). Note + * that per-surface alpha can be combined with colorkey transparency. + * + * If 'flag' is 0, alpha blending is disabled for the surface. + * If 'flag' is SDL_SRCALPHA, alpha blending is enabled for the surface. + * OR:ing the flag with SDL_RLEACCEL requests RLE acceleration for the + * surface; if SDL_RLEACCEL is not specified, the RLE accel will be removed. + * + * The 'alpha' parameter is ignored for surfaces that have an alpha channel. + */ +extern DECLSPEC int SDLCALL SDL_SetAlpha(SDL_Surface *surface, Uint32 flag, Uint8 alpha); + +/** + * Sets the clipping rectangle for the destination surface in a blit. + * + * If the clip rectangle is NULL, clipping will be disabled. + * If the clip rectangle doesn't intersect the surface, the function will + * return SDL_FALSE and blits will be completely clipped. Otherwise the + * function returns SDL_TRUE and blits to the surface will be clipped to + * the intersection of the surface area and the clipping rectangle. + * + * Note that blits are automatically clipped to the edges of the source + * and destination surfaces. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_SetClipRect(SDL_Surface *surface, const SDL_Rect *rect); + +/** + * Gets the clipping rectangle for the destination surface in a blit. + * 'rect' must be a pointer to a valid rectangle which will be filled + * with the correct values. + */ +extern DECLSPEC void SDLCALL SDL_GetClipRect(SDL_Surface *surface, SDL_Rect *rect); + +/** + * Creates a new surface of the specified format, and then copies and maps + * the given surface to it so the blit of the converted surface will be as + * fast as possible. If this function fails, it returns NULL. + * + * The 'flags' parameter is passed to SDL_CreateRGBSurface() and has those + * semantics. You can also pass SDL_RLEACCEL in the flags parameter and + * SDL will try to RLE accelerate colorkey and alpha blits in the resulting + * surface. + * + * This function is used internally by SDL_DisplayFormat(). + */ +extern DECLSPEC SDL_Surface * SDLCALL SDL_ConvertSurface + (SDL_Surface *src, SDL_PixelFormat *fmt, Uint32 flags); + +/** + * This performs a fast blit from the source surface to the destination + * surface. It assumes that the source and destination rectangles are + * the same size. If either 'srcrect' or 'dstrect' are NULL, the entire + * surface (src or dst) is copied. The final blit rectangles are saved + * in 'srcrect' and 'dstrect' after all clipping is performed. + * If the blit is successful, it returns 0, otherwise it returns -1. + * + * The blit function should not be called on a locked surface. + * + * The blit semantics for surfaces with and without alpha and colorkey + * are defined as follows: + * + * RGBA->RGB: + * SDL_SRCALPHA set: + * alpha-blend (using alpha-channel). + * SDL_SRCCOLORKEY ignored. + * SDL_SRCALPHA not set: + * copy RGB. + * if SDL_SRCCOLORKEY set, only copy the pixels matching the + * RGB values of the source colour key, ignoring alpha in the + * comparison. + * + * RGB->RGBA: + * SDL_SRCALPHA set: + * alpha-blend (using the source per-surface alpha value); + * set destination alpha to opaque. + * SDL_SRCALPHA not set: + * copy RGB, set destination alpha to source per-surface alpha value. + * both: + * if SDL_SRCCOLORKEY set, only copy the pixels matching the + * source colour key. + * + * RGBA->RGBA: + * SDL_SRCALPHA set: + * alpha-blend (using the source alpha channel) the RGB values; + * leave destination alpha untouched. [Note: is this correct?] + * SDL_SRCCOLORKEY ignored. + * SDL_SRCALPHA not set: + * copy all of RGBA to the destination. + * if SDL_SRCCOLORKEY set, only copy the pixels matching the + * RGB values of the source colour key, ignoring alpha in the + * comparison. + * + * RGB->RGB: + * SDL_SRCALPHA set: + * alpha-blend (using the source per-surface alpha value). + * SDL_SRCALPHA not set: + * copy RGB. + * both: + * if SDL_SRCCOLORKEY set, only copy the pixels matching the + * source colour key. + * + * If either of the surfaces were in video memory, and the blit returns -2, + * the video memory was lost, so it should be reloaded with artwork and + * re-blitted: + * @code + * while ( SDL_BlitSurface(image, imgrect, screen, dstrect) == -2 ) { + * while ( SDL_LockSurface(image) < 0 ) + * Sleep(10); + * -- Write image pixels to image->pixels -- + * SDL_UnlockSurface(image); + * } + * @endcode + * + * This happens under DirectX 5.0 when the system switches away from your + * fullscreen application. The lock will also fail until you have access + * to the video memory again. + * + * You should call SDL_BlitSurface() unless you know exactly how SDL + * blitting works internally and how to use the other blit functions. + */ +#define SDL_BlitSurface SDL_UpperBlit + +/** This is the public blit function, SDL_BlitSurface(), and it performs + * rectangle validation and clipping before passing it to SDL_LowerBlit() + */ +extern DECLSPEC int SDLCALL SDL_UpperBlit + (SDL_Surface *src, SDL_Rect *srcrect, + SDL_Surface *dst, SDL_Rect *dstrect); +/** This is a semi-private blit function and it performs low-level surface + * blitting only. + */ +extern DECLSPEC int SDLCALL SDL_LowerBlit + (SDL_Surface *src, SDL_Rect *srcrect, + SDL_Surface *dst, SDL_Rect *dstrect); + +/** + * This function performs a fast fill of the given rectangle with 'color' + * The given rectangle is clipped to the destination surface clip area + * and the final fill rectangle is saved in the passed in pointer. + * If 'dstrect' is NULL, the whole surface will be filled with 'color' + * The color should be a pixel of the format used by the surface, and + * can be generated by the SDL_MapRGB() function. + * This function returns 0 on success, or -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_FillRect + (SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color); + +/** + * This function takes a surface and copies it to a new surface of the + * pixel format and colors of the video framebuffer, suitable for fast + * blitting onto the display surface. It calls SDL_ConvertSurface() + * + * If you want to take advantage of hardware colorkey or alpha blit + * acceleration, you should set the colorkey and alpha value before + * calling this function. + * + * If the conversion fails or runs out of memory, it returns NULL + */ +extern DECLSPEC SDL_Surface * SDLCALL SDL_DisplayFormat(SDL_Surface *surface); + +/** + * This function takes a surface and copies it to a new surface of the + * pixel format and colors of the video framebuffer (if possible), + * suitable for fast alpha blitting onto the display surface. + * The new surface will always have an alpha channel. + * + * If you want to take advantage of hardware colorkey or alpha blit + * acceleration, you should set the colorkey and alpha value before + * calling this function. + * + * If the conversion fails or runs out of memory, it returns NULL + */ +extern DECLSPEC SDL_Surface * SDLCALL SDL_DisplayFormatAlpha(SDL_Surface *surface); + + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** @name YUV video surface overlay functions */ /*@{*/ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/** This function creates a video output overlay + * Calling the returned surface an overlay is something of a misnomer because + * the contents of the display surface underneath the area where the overlay + * is shown is undefined - it may be overwritten with the converted YUV data. + */ +extern DECLSPEC SDL_Overlay * SDLCALL SDL_CreateYUVOverlay(int width, int height, + Uint32 format, SDL_Surface *display); + +/** Lock an overlay for direct access, and unlock it when you are done */ +extern DECLSPEC int SDLCALL SDL_LockYUVOverlay(SDL_Overlay *overlay); +extern DECLSPEC void SDLCALL SDL_UnlockYUVOverlay(SDL_Overlay *overlay); + +/** Blit a video overlay to the display surface. + * The contents of the video surface underneath the blit destination are + * not defined. + * The width and height of the destination rectangle may be different from + * that of the overlay, but currently only 2x scaling is supported. + */ +extern DECLSPEC int SDLCALL SDL_DisplayYUVOverlay(SDL_Overlay *overlay, SDL_Rect *dstrect); + +/** Free a video overlay */ +extern DECLSPEC void SDLCALL SDL_FreeYUVOverlay(SDL_Overlay *overlay); + +/*@}*/ + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** @name OpenGL support functions. */ /*@{*/ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/** + * Dynamically load an OpenGL library, or the default one if path is NULL + * + * If you do this, you need to retrieve all of the GL functions used in + * your program from the dynamic library using SDL_GL_GetProcAddress(). + */ +extern DECLSPEC int SDLCALL SDL_GL_LoadLibrary(const char *path); + +/** + * Get the address of a GL function + */ +extern DECLSPEC void * SDLCALL SDL_GL_GetProcAddress(const char* proc); + +/** + * Set an attribute of the OpenGL subsystem before intialization. + */ +extern DECLSPEC int SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value); + +/** + * Get an attribute of the OpenGL subsystem from the windowing + * interface, such as glX. This is of course different from getting + * the values from SDL's internal OpenGL subsystem, which only + * stores the values you request before initialization. + * + * Developers should track the values they pass into SDL_GL_SetAttribute + * themselves if they want to retrieve these values. + */ +extern DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int* value); + +/** + * Swap the OpenGL buffers, if double-buffering is supported. + */ +extern DECLSPEC void SDLCALL SDL_GL_SwapBuffers(void); + +/** @name OpenGL Internal Functions + * Internal functions that should not be called unless you have read + * and understood the source code for these functions. + */ +/*@{*/ +extern DECLSPEC void SDLCALL SDL_GL_UpdateRects(int numrects, SDL_Rect* rects); +extern DECLSPEC void SDLCALL SDL_GL_Lock(void); +extern DECLSPEC void SDLCALL SDL_GL_Unlock(void); +/*@}*/ + +/*@}*/ + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** @name Window Manager Functions */ +/** These functions allow interaction with the window manager, if any. */ /*@{*/ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/** + * Sets the title and icon text of the display window (UTF-8 encoded) + */ +extern DECLSPEC void SDLCALL SDL_WM_SetCaption(const char *title, const char *icon); +/** + * Gets the title and icon text of the display window (UTF-8 encoded) + */ +extern DECLSPEC void SDLCALL SDL_WM_GetCaption(char **title, char **icon); + +/** + * Sets the icon for the display window. + * This function must be called before the first call to SDL_SetVideoMode(). + * It takes an icon surface, and a mask in MSB format. + * If 'mask' is NULL, the entire icon surface will be used as the icon. + */ +extern DECLSPEC void SDLCALL SDL_WM_SetIcon(SDL_Surface *icon, Uint8 *mask); + +/** + * This function iconifies the window, and returns 1 if it succeeded. + * If the function succeeds, it generates an SDL_APPACTIVE loss event. + * This function is a noop and returns 0 in non-windowed environments. + */ +extern DECLSPEC int SDLCALL SDL_WM_IconifyWindow(void); + +/** + * Toggle fullscreen mode without changing the contents of the screen. + * If the display surface does not require locking before accessing + * the pixel information, then the memory pointers will not change. + * + * If this function was able to toggle fullscreen mode (change from + * running in a window to fullscreen, or vice-versa), it will return 1. + * If it is not implemented, or fails, it returns 0. + * + * The next call to SDL_SetVideoMode() will set the mode fullscreen + * attribute based on the flags parameter - if SDL_FULLSCREEN is not + * set, then the display will be windowed by default where supported. + * + * This is currently only implemented in the X11 video driver. + */ +extern DECLSPEC int SDLCALL SDL_WM_ToggleFullScreen(SDL_Surface *surface); + +typedef enum { + SDL_GRAB_QUERY = -1, + SDL_GRAB_OFF = 0, + SDL_GRAB_ON = 1, + SDL_GRAB_FULLSCREEN /**< Used internally */ +} SDL_GrabMode; +/** + * This function allows you to set and query the input grab state of + * the application. It returns the new input grab state. + * + * Grabbing means that the mouse is confined to the application window, + * and nearly all keyboard input is passed directly to the application, + * and not interpreted by a window manager, if any. + */ +extern DECLSPEC SDL_GrabMode SDLCALL SDL_WM_GrabInput(SDL_GrabMode mode); + +/*@}*/ + +/** @internal Not in public API at the moment - do not use! */ +extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface *src, SDL_Rect *srcrect, + SDL_Surface *dst, SDL_Rect *dstrect); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_video_h */ diff --git a/alienblaster/project/jni/sdl/include/begin_code.h b/alienblaster/project/jni/sdl/include/begin_code.h new file mode 100644 index 000000000..22748090c --- /dev/null +++ b/alienblaster/project/jni/sdl/include/begin_code.h @@ -0,0 +1,191 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2009 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * @file begin_code.h + * This file sets things up for C dynamic library function definitions, + * static inlined functions, and structures aligned at 4-byte alignment. + * If you don't like ugly C preprocessor code, don't look at this file. :) + */ + +/** + * @file begin_code.h + * This shouldn't be nested -- included it around code only. + */ +#ifdef _begin_code_h +#error Nested inclusion of begin_code.h +#endif +#define _begin_code_h + +/** + * @def DECLSPEC + * Some compilers use a special export keyword + */ +#ifndef DECLSPEC +# if defined(__BEOS__) || defined(__HAIKU__) +# if defined(__GNUC__) +# define DECLSPEC __declspec(dllexport) +# else +# define DECLSPEC __declspec(export) +# endif +# elif defined(__WIN32__) +# ifdef __BORLANDC__ +# ifdef BUILD_SDL +# define DECLSPEC +# else +# define DECLSPEC __declspec(dllimport) +# endif +# else +# define DECLSPEC __declspec(dllexport) +# endif +# elif defined(__OS2__) +# ifdef __WATCOMC__ +# ifdef BUILD_SDL +# define DECLSPEC __declspec(dllexport) +# else +# define DECLSPEC +# endif +# elif defined (__GNUC__) && __GNUC__ < 4 +# /* Added support for GCC-EMX = 4 +# define DECLSPEC __attribute__ ((visibility("default"))) +# else +# define DECLSPEC +# endif +# endif +#endif + +/** + * @def SDLCALL + * By default SDL uses the C calling convention + */ +#ifndef SDLCALL +# if defined(__WIN32__) && !defined(__GNUC__) +# define SDLCALL __cdecl +# elif defined(__OS2__) +# if defined (__GNUC__) && __GNUC__ < 4 +# /* Added support for GCC-EMX