projectL_1001/0000755000000000000000000000000010740417365012006 5ustar rootrootprojectL_1001/lib/0000755000000000000000000000000010740417365012554 5ustar rootrootprojectL_1001/music/0000755000000000000000000000000010740417365013126 5ustar rootrootprojectL_1001/se/0000755000000000000000000000000010740417365012415 5ustar rootrootprojectL_1001/build.xml0000644000000000000000000000455410537067164013641 0ustar rootroot projectL_1001/src/0000755000000000000000000000000010557123226012571 5ustar rootrootprojectL_1001/src/br/0000755000000000000000000000000010740417365013200 5ustar rootrootprojectL_1001/src/br/append.d0000644000000000000000000000602710534363270014615 0ustar rootrootmodule br.append; private import opengl; private import util.key; private import util.shape; private import br.mainloop; private import util.vector; private import util.matrix; private import std.math; private import br.ship; private import br.enemy; private import br.gamemanager; private import util.particle; private import util.parts; private import util.log; public class Append:Parts{ private: int vanishCount; bool parentExist; public this(Shape shape ,double size ,double R = 1.0,double G = 1.0 ,double B = 1.0,double alpha = 1.0 ,Matrix poseBase = new Matrix()){ this.shape = cast(Shape)shape.clone(); drawing = WIRE; this.size = size; setPoseBase(poseBase); // appendManager.add(this); this.R = R; this.G = G; this.B = B; this.alpha = alpha; parentExist = true; } public void setCollision(double collisionSize){ collisionManager.add(this, collisionManager.kind.SHIP ,2); collisionManager.add(this, collisionManager.kind.SWORD ,2); this.collisionRange = collisionSize; drawing = POLYGON | WIRE; } public void move(){ super.move(); if(parentExist & (parent is null || parent.exists == false)){ parentExist = false; vanishCount = 5; } if(parentExist == false){ vanishCount --; if(vanishCount < 0)destroy(); } } public void destroy(){ super.destroy(); makeParticle(shape, size ,WIRE ,rpos ,new Vector3() ,rpose ,R ,G ,B ,alpha); } } /+ public class BaseOfWing:Parts{ private{ static float[][] a = [ [-0.2 ,0 ,0.2 ], [-0.2 ,0 ,0.2 ] ]; static float[][] b = [ [0 ,0.5 ,0 ], [0 ,1.0 ,0 ] ]; } public this(){ shape = BaseOfWing1.getShape();//new SH_Pole(a,b,4); drawing = WIRE; size = 30; } } public class Wing:Parts{ private{ static float[][] a = [ [-1.0 ,-0.5 ,1.0 ], ]; static float[][] b = [ [0 ,0.5 ,0 ] ]; } public this(){ /* Shape shape1 = new SH_Pole(a,b,4); Shape shape2 = cast(SH_Pole)shape1.clone(); shape1.translate(new Vector3(0.1 ,0 ,0)); shape2.translate(new Vector3(-0.1 ,0 ,0)); shape = shape1 + shape2; */ shape = Wing1.getShape();//new SH_Pole(a,b,4); //shape.translate(new Vector3(1.0 ,0 ,0)); drawing = WIRE; size = 20; } } public class Tail:Parts{ private{ static float[][] a = [ [-1.0 ,-0.5 ,1.0 ], ]; static float[][] b = [ [0 ,0.5 ,0 ] ]; } public this(){ shape = Tail1.getShape();//new SH_Pole(a,b,4); drawing = WIRE; size = 20; } } public class Head:Parts{ private{ static float[] a = [-1.0 ,-0.5 ,1.0 ,-0.5 ] ; static float[] b = [0 ,0.5 ,0 ,-0.5 ] ; static float[] z = [-0.5 ,0 ,0.5]; static float[] scale = [0.3 ,1.0 ,0.3]; } public this(){ shape = Head1.getShape();//new SH_Pot(a,b,z,scale); drawing = WIRE; size = 30; } } +/projectL_1001/src/br/gamemanager.d0000644000000000000000000006147010542750232015612 0ustar rootrootmodule br.gamemanager; private import opengl; private import SDL; private import SDL_mixer; private import std.string; private import std.math; private import util.key; private import util.vector; private import util.matrix; private import util.rand; private import util.collision; private import util.animation; private import util.parts; private import util.particle; private import util.timer; private import util.log; private import util.record; private import util.ascii; private import br.append; private import br.ship; private import br.blast; private import br.mainloop; private import br.enemy; private import br.screen; private import br.stage; private import br.background; private import br.sound; private import br.prefmanager; public Ship ship; public Rand rand; public Screen screen; //public Blast blast; public CollisionManager collisionManager; public PartsManager shipManager; public PartsManager enemyManager; public PartsManager bulletManager; public PartsManager ringManager; //public PartsManager appendManager; public BackGround background; private const int MAXSHIP = 10; private const int DEFAULTSTAGE = 1; private GameManager gameManager; private GameState inGameState; private GameState inResultState; private GameState inMissState; private GameState inTitleState; private GameState inEnding1State; private GameState inEnding2State; private int stageNum; private Stage stage; private int totalTime; private int lapTime; private int restShip; public bool pressingA; public class GameManager{ public: const int SCREEN_WIDTH = 640; const int SCREEN_HEIGHT = 480; const int SCREEN_BPP = 0; /* static int g_videoFlags = SDL_SWSURFACE|SDL_OPENGL; // const SDL_VideoInfo* info = NULL; SDL_Surface *gScreenSurface; */ //int screen_width; //int screen_height; //int screen_bpp; static int count; private: GameState state; GameState nextState; //Parts[10] append; Key key; public this(Key key){ this.key = key; gameManager = this; } public void start(){ rand = new Rand(); screen = new Screen(); // blast = new Blast(); partsManager = new PartsManager(512); shipManager = new PartsManager(10); enemyManager = new PartsManager(128); bulletManager = new PartsManager(512); ringManager = new PartsManager(64); // appendManager = new PartsManager(128); blastManager = new BlastManager(128); particleManager = new ParticleManager(2048); // animationManager = new AnimationManager(64); collisionManager = new CollisionManager(1024); collisionManager.clear(); ship = new Ship(key,0 ,0);//screen.width / 2,screen.height / 2); background = new BackGround(); // record = new Record(Stage.MAXSTAGE ,3); if(prefManager.prefData.fullScreen){ screen.toggleFullScreen(); } nosound(prefManager.prefData.nosound); count = 0; totalTime = 0; lapTime = 0; Sound_init(); /* Mix_OpenAudio(22050,AUDIO_S16,2,4096); chunk_slash = Mix_LoadWAV("se/hit_s02.wav"); chunk_defend = Mix_LoadWAV("se/metal34_a.wav"); chunk_bomb = Mix_LoadWAV("se/bom13_c.wav"); chunk_beep = Mix_LoadWAV("se/beep00.wav"); chunk_warning = Mix_LoadWAV("se/emergency.wav"); chunk_reverse = Mix_LoadWAV("se/hit_s03_a.wav"); if(Mix_OpenAudio(22050,AUDIO_S16,2,4096) < 0)return ; music1 = Mix_LoadMUS("music/FREQ_loop005.ogg"); music2 = Mix_LoadMUS("music/FREQ_loop004.ogg"); */ inGameState = new InGameState(); inResultState = new InResultState(); inMissState = new InMissState(); inTitleState = new InTitleState(); inEnding1State = new InEnding1State(); inEnding2State = new InEnding2State(); state = inTitleState; state.start(); nextState = null; pressingA = true; /* if (Mix_PlayMusic(music, -1) != 0) { throw new Error("Couldn't play music"); } */ } public void move(){ state.move(); if(nextState !is null){ state = nextState; state.start(); nextState = null; } count ++; } public void returnPushed(){ setNextState("titleState"); } public void setNextState(char[] name){ switch(name){ case "gameState":nextState = inGameState;break; case "resultState":nextState = inResultState;break; case "missState":nextState = inMissState;break; case "titleState":nextState = inTitleState;break; case "ending1State":nextState = inEnding1State;break; case "ending2State":nextState = inEnding2State;break; default:break; } } public void draw(){ // glClear(GL_DEPTH_BUFFER_BIT); state.draw(); } public void clear(){ shipManager.clear(); enemyManager.clear(); bulletManager.clear(); ringManager.clear(); partsManager.clear(); // animationManager.clear(); shipManager.clear(); enemyManager.clear(); bulletManager.clear(); collisionManager.clear(); } public void close(){ clear(); Sound_free(); Mix_CloseAudio(); } } private bool setStage(int num){ bool game = true; stageNum = 1; if(num <= Stage.MAXSTAGE)stageNum = num; else{ stageNum = 9; game = false; } stage = getStage(stageNum); stage.goback(); if(stage !is null)Sound_PlayMusic(stage.music); return game; } private Stage getStage(int num){ Stage stage; switch(num){ case 1:stage = new Stage1();break; case 2:stage = new Stage2();break; case 3:stage = new Stage3();break; case 4:stage = new Stage4();break; case 5:stage = new Stage5();break; case 6:stage = new Stage6();break; case 7:stage = new Stage7();break; case 8:stage = new Stage8();break; case 9:stage = new Ending();break; default:stage = null; } return stage; } public abstract class GameState{ protected: // bool _end; public void start(); public void move(); public void draw(); // public bool end(); public char[] name(); } public class InGameState:GameState{ private: int count; const char[] _name = "gameState"; public this(){ } public void start(){ count = 0; // timer = 0; // _end = false; } public void move(){ collisionManager.collisionDetect(); if(stage.cleared){ // stageNum ++; gameManager.setNextState("resultState"); // _end = true; } if((cast(Ship)ship).slow){ if(count % 2==0){ blastManager.run(); partsManager.move(); /* shipManager.move(); enemyManager.move(); bulletManager.move(); ringManager.move(); */ // appendManager.move(); // animationManager.run(); stage.run(); background.move(); particleManager.run(); // timer++; }else shipManager.move(); }else{ blastManager.run(); partsManager.move(); // shipManager.move(); /* enemyManager.move(); bulletManager.move(); ringManager.move(); // appendManager.move(); */ // animationManager.run(); stage.run(); background.move(); particleManager.run(); // timer++; } if(ship.miss){ gameManager.setNextState("missState"); ship.miss = false; } count ++; lapTime ++; totalTime ++; } public void draw(){ screen.setProjection(); glPushMatrix(); background.draw(); partsManager.draw(); /* shipManager.draw(); enemyManager.draw(); bulletManager.draw(); ringManager.draw(); // appendManager.draw(); */ particleManager.draw(); blastManager.draw(); // if(blast.exists)blast.draw(); screen.setModelView(); asciiR = 1.0;asciiG =0.88;asciiB = 0.7; drawTimer(lapTime ,60 ,-268 ,0.6); drawTimer(totalTime ,200 ,-260); stage.draw(); // drawString("ready to destroy the warp hole" ,-300 ,-100 ,5 ,10); /* drawAlphabet('n' ,-350 ,50 ); drawAlphabet('e' ,-320 ,50 ); drawAlphabet('w' ,-290 ,50 ); */ /* drawAlphabet('p' ,0 ,20 ,1.0); drawAlphabet('r' ,30 ,20 ,1.0); drawAlphabet('o' ,60 ,20 ,1.0);_________ drawAlphabet('j' ,90 ,20 ,1.0); drawAlphabet('e' ,120 ,20 ,1.0); drawAlphabet('c' ,150 ,20 ,1.0); drawAlphabet('t' ,180 ,20 ,1.0); drawAlphabet('l' ,220 ,20 ,1.0); */ // drawNumber((count / 60) % 10 ,300 ,-260); // drawColon(320 ,-260); glPopMatrix(); } /* public bool end(){ return _end; } */ public char[] name(){ return _name; } } public class InResultState:GameState{ private: int count; int lapRank ,totalRank; protected const char[] _name = "resultState"; public this(){ lapRank = -1; totalRank = -1; } public void start(){ count = 0; // _end = false; lapRank = prefManager.prefData.record.updateLapRecord(stageNum-1 ,lapTime); totalRank = prefManager.prefData.record.updateTotalRecord(stageNum-1 ,totalTime); Stage next = getStage(stageNum+1); // Log_write(stageNum + 1); // Log_write(Sound_PlayingMusic); // if(next !is null)Log_write(next.music); // Log_write(next.music); // Log_write(Sound_PlayingMusic); if(next !is null){ if(next.music != Sound_PlayingMusic && Sound_PlayingMusic != -1){ Sound_FadeOutMusic(2000); } } } public void move(){ if(240 < count){ // _end = true; lapTime = 0; if(setStage(stageNum + 1))gameManager.setNextState("gameState"); else gameManager.setNextState("ending1State"); } if((cast(Ship)ship).sword){ if(count % 2==0){ blastManager.run(); partsManager.move(); /* shipManager.move(); enemyManager.move(); bulletManager.move(); ringManager.move(); */ // appendManager.move(); background.move(); particleManager.run(); }else shipManager.move(); }else{ /* shipManager.move(); enemyManager.move(); bulletManager.move(); ringManager.move(); */ // appendManager.move(); blastManager.run(); partsManager.move(); // stage.run(); background.move(); particleManager.run(); // timer++; } count ++; } public void draw(){ screen.setProjection(); background.draw(); /* shipManager.draw(); enemyManager.draw(); bulletManager.draw(); ringManager.draw(); // appendManager.draw(); */ partsManager.draw(); particleManager.draw(); blastManager.draw(); screen.setModelView(); /* for(int i=0;i 4930){ // stageNum ++; gameManager.setNextState("titleState"); // _end = true; } int button = gameManager.key.getButtonState(); if(((button & gameManager.key.Button.A) == 0)){ pressingA = false; if(count % 2==0){ timer++; } }else{ pressingA = true; timer++; } count ++; } public void draw(){ screen.setProjection(); glPushMatrix(); screen.setModelView(); drawStaffRoll(); glPopMatrix(); } public void drawStaffRoll(){ asciiR = 1.0;asciiG = 1.0;asciiB = 0.9;asciiAlpha=1.0; int y; y=timer*2 - 330;asciiAlpha = (300.0 - abs(y)) / 300.0; if(-330 < y && y < 330)drawStringCenter("projectL staff" ,y); y=timer*2 - 930;asciiAlpha = (300.0 - abs(y)) / 300.0; if(-330 < y && y < 330)drawStringCenter("all" ,y); y=timer*2 - 1030;asciiAlpha = (300.0 - abs(y)) / 300.0; if(-330 < y && y < 330)drawStringCenter("hiz" ,y); y=timer*2 - 1630;asciiAlpha = (300.0 - abs(y)) / 300.0; if(-330 < y && y < 330)drawStringCenter("inspired by" ,y); y=timer*2 - 1730;asciiAlpha = (300.0 - abs(y)) / 300.0; if(-330 < y && y < 330)drawStringCenter("project N" ,y); y=timer*2 - 1790;asciiAlpha = (300.0 - abs(y)) / 300.0; if(-330 < y && y < 330)drawStringCenter("developed by D.K" ,y); y=timer*2 - 2390;asciiAlpha = (300.0 - abs(y)) / 300.0; if(-330 < y && y < 330)drawStringCenter("adviced by" ,y); y=timer*2 - 2490;asciiAlpha = (300.0 - abs(y)) / 300.0; if(-330 < y && y < 330)drawStringCenter("D.K" ,y); y=timer*2 - 2550;asciiAlpha = (300.0 - abs(y)) / 300.0; if(-330 < y && y < 330)drawStringCenter("and gamehell 2000" ,y); y=timer*2 - 3150;asciiAlpha = (300.0 - abs(y)) / 300.0; if(-330 < y && y < 330)drawStringCenter("sound materials" ,y); y=timer*2 - 3250;asciiAlpha = (300.0 - abs(y)) / 300.0; if(-330 < y && y < 330)drawStringCenter("B.P.M" ,y); y=timer*2 - 3310;asciiAlpha = (300.0 - abs(y)) / 300.0; if(-330 < y && y < 330)drawStringCenter("FLESH AND BONE" ,y); y=timer*2 - 3370;asciiAlpha = (300.0 - abs(y)) / 300.0; if(-330 < y && y < 330)drawStringCenter("THE MATCHMAKERS" ,y); y=timer*2 - 3430;asciiAlpha = (300.0 - abs(y)) / 300.0; if(-330 < y && y < 330)drawStringCenter("Hanac200x" ,y); y=cast(int)fmin(0.0 ,timer*2.0 - 4030.0);asciiAlpha = (300.0 - abs(y)) / 300.0; if(timer*2 > 4810)asciiAlpha = 1.0 -(timer*2.0 -4810.0) /120.0; if(-330 < y && y < 330)drawStringCenter("THANKS FOR YOUR PLAYING" ,y); } public char[] name(){ return _name; } } projectL_1001/src/br/bullet.d0000644000000000000000000001336710541600004014625 0ustar rootrootmodule br.bullet; private import util.parts; private import util.shape; private import util.vector; private import util.matrix; private import util.log; private import util.particle; private import util.basis; private import br.gamemanager; private import br.blast; private import std.math; private import SDL_mixer; private import br.sound; public class Bullet:Parts{ private bool inStage; public this(bool breakable){ collisionManager.add(this ,collisionManager.kind.SHIP ,2); bulletManager.add(this); if(breakable){ collisionManager.add(this, collisionManager.kind.LASER ,2); R = 160.0 / 255.0; G = 247.0 / 255.0; B = 150.0 / 255.0; }else{ R = 245.0 / 255.0; G = 104.0 / 255.0; B = 110.0 / 255.0; } inStage = false; drawing = POLYGON | WIRE; alpha = 1.6; } public void addChild(inout Parts child,char[] name, double dist = 0.1, int childKind = NORMAL, Matrix link = null ,Matrix pose = null){ super.addChild(child ,name ,dist ,childKind ,link ,pose); bulletManager.add(child); } public void move(){ super.move(); if((rpos.y+size < screen.GAME_DOWN || screen.GAME_UP < rpos.y-size || screen.GAME_RIGHT < rpos.x-size || rpos.x+size < screen.GAME_LEFT )){ if(inStage || 300 < cnt )vanish(); }else inStage = true; if(screen.GAME_NEAR < rpos.z - size || rpos.z + size < screen.GAME_FAR){ vanish(); } } public void destroy(){ super.destroy(); new SmallBlast(rpos.x ,rpos.y ,30 ,30 ,5.0 ,90 ,R ,G ,B ,0.02); // makeParticle(shape, size ,WIRE ,rpos ,new Vector3() ,rpose ,R ,G ,B ,alpha * 0.5); makeSimpleParticle(2 ,size ,WIRE ,rpos ,R ,G ,B ,alpha * 0.5); } public override void reportCollision(int kind){ destroy(); Sound_PlaySe(se_kind.REVERSE); // Mix_PlayChannel(0, chunk_reverse, 0); } public void vanish(){ super.vanish(); } } public class StraightBullet:Bullet{ static Shape baseShape; static float[][] a = [ [-2.0 ,0.0 ,1.0] ]; static float[][] b = [ [0.0 ,1.0 ,0.0] ]; double aim; double speed; public this(Vector3 v ,bool breakable, double aim ,double speed = 4.0){ super(breakable); if(baseShape is null){ baseShape = new SH_Pole(a ,b ,4); } // setPoseBase(matRotateZ(aim / PI * 180.0)); //collisionManager.add(this ,collisionManager.kind.BULLET ,2); shape = new SH_Pole(a ,b ,4); size = 17; collisionRange = 8; this.speed = speed; pos = cast(Vector3)v.clone(); rpos = cast(Vector3)pos.clone(); this.aim = aim; } public void move(){ super.move(); if(parent is null){ pos.x += speed * cos(aim); pos.y += speed * sin(aim); } poseZ = aim / PI * 180.0; } } public class SlowStraightBullet:StraightBullet{ public this(Vector3 v ,bool breakable, double aim){ super(v ,breakable ,aim); speed = 1.5; } } public class EBullet2:StraightBullet{ public this(Vector3 v ,bool breakable,double aim){ super(v ,breakable ,aim); Parts b = new StraightBullet(v ,breakable ,aim); addChild(b ,"bul" ,40 ,FOLLOW); Parts b2 = new StraightBullet(v ,breakable, aim); b.addChild(b2 ,"bul" ,40 ,FOLLOW); } } public class Bullet3D:StraightBullet{ public this(Vector3 v ,bool breakable,double aim ,double speed){ super(v ,breakable ,aim ,speed); } public void move(){ if(rpos.z < -800 - 2)pos.z +=2.0; else if(-800 + 2 < rpos.z)pos.z -= 2.0; else { super.move(); } poseZ = aim / PI * 180.0; } } public class Bullet3D2:Bullet{ static Shape baseShape; static float[][] a = [ [-1.0 ,0.0 ,1.0] ]; static float[][] b = [ [0.0 ,1.0 ,0.0] ]; Vector3 aim; public this(Vector3 v ,bool breakable,Vector3 aim){ super(breakable); if(baseShape is null){ baseShape = new SH_Pole(a ,b ,4); } // setPoseBase(matRotateZ(aim / PI * 180.0)); //collisionManager.add(this ,collisionManager.kind.BULLET ,2); shape = new SH_Pole(a ,b ,4); size = 25; collisionRange = 12; pos = cast(Vector3)v.clone(); rpos = cast(Vector3)pos.clone(); this.aim = cast(Vector3)aim.clone(); } public void move(){ super.move(); pos += aim; poseZ += 1.0; } } public class BendBullet:StraightBullet{ private: double bendAim; int bendTime; double afSpeed; public this(Vector3 v ,bool breakable,double aim ,double bendAim ,int bendTime,double speed = 4.0 ,double afSpeed = 4.0){ super(v ,breakable ,aim ,speed); this.bendAim = bendAim; this.bendTime = bendTime; this.afSpeed = afSpeed; } public void move(){ super.move(); if(cnt == bendTime){ aim += bendAim; speed = afSpeed; } // poseZ = aim/PI*180.0; } } public class AccBullet:StraightBullet{ double maxSpeed ,accSpeed; public this(Vector3 v ,bool breakable,double aim ,double min ,double max ,double acc){ super(v ,breakable ,aim ,min); maxSpeed = max; accSpeed = acc; } public void move(){ super.move(); if(speed < maxSpeed)speed += accSpeed; else speed = maxSpeed; } } public class HomingBullet:StraightBullet{ private: double dAim; // int bendTime; // double afSpeed; public this(Vector3 v ,bool breakable,double aim ,double dAim = PI / 90.0,double speed = 4.0 ,int num = 1){ super(v ,breakable ,aim ,speed); this.dAim = dAim; num--; if(0 maxSkipFrame) { frame = maxSkipFrame; prvTickCount = nowTick; } else { prvTickCount += frame * interval; } if(active){ for (int i = 0; i < frame; i++) { gm.move(); } } //active code //glLoadIdentity(); screen.clear(); //partsManager.move(); //partsManager.draw(); gm.draw(); screen.flip(); } prefManager.save(); gm.close(); SDL_Quit(); } } projectL_1001/src/br/screen.d0000644000000000000000000000652510537073466014640 0ustar rootrootmodule br.screen; private import opengl; private import SDL; private import std.string; private import std.c.stdlib; private import br.mainloop; public class Screen{ public: const int SCREEN_WIDTH = 640; const int SCREEN_HEIGHT = 480; const int SCREEN_BPP = 0; const int GAME_LEFT = -400; const int GAME_RIGHT = 400; const int GAME_UP = 300; const int GAME_DOWN = -300; const int GAME_NEAR = -2; const int GAME_FAR = -1600; static int g_videoFlags = SDL_SWSURFACE|SDL_OPENGL; SDL_Surface *gScreenSurface; int width; int height; int bpp; public this(){ // setenv("SDL_VIDEODRIVER","directx" ,1); // setenv("SDL_AUDIODRIVER","directx" ,1); if(SDL_Init( SDL_INIT_VIDEO | SDL_INIT_AUDIO) < 0 ) { throw new Exception( "Unable to init SDL video: " ~ std.string.toString(SDL_GetError())); } //info = SDL_GetVideoInfo( ); width = SCREEN_WIDTH; height = SCREEN_HEIGHT; bpp = SCREEN_BPP; SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 ); // SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 16 ); gScreenSurface = SDL_SetVideoMode( width, height, bpp, g_videoFlags ); SDL_WM_SetCaption("projectL", null); //glFrustum(0 ,width ,height ,0 ,1 ,400); //(width - height) / 2 ,0 ,height ,height); glClearColor(0 ,0 ,0,1.0); // glEnable(GL_DEPTH_TEST); // glEnable(GL_BLEND); // glEnable(GL_LINE_SMOOTH); // glEnable(GL_POLYGON_SMOOTH); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); //glFrustum(0 , 4 , 2 , 0 , 2 , 10); // glClearColor(0.1 ,0.08 ,0 ,1.0); } public void setProjection(){ glLoadIdentity(); glMatrixMode(GL_PROJECTION); glFrustum(-1.0 , 1.0 , -0.75 , 0.75 , 2 , 1600); glViewport(0 ,0 ,width ,height); } public void setModelView(){ glLoadIdentity(); glMatrixMode(GL_MODELVIEW); glOrtho(-400, 400, -300, 300, 2, 1600); glViewport(0 ,0 ,width ,height); } public void setClearColor(double R ,double G,double B,double alpha){ glClearColor(R ,G ,B ,alpha); } public void clear() { glClear(GL_COLOR_BUFFER_BIT); glClear(GL_DEPTH_BUFFER_BIT); } public void flip() { //handleError(); SDL_GL_SwapBuffers(); } public void handleError() { GLenum error = glGetError(); if (error == GL_NO_ERROR) return; closeSDL(); throw new Exception("OpenGL error(" ~ std.string.toString(error) ~ ")"); } public void closeSDL() { close(); SDL_ShowCursor(SDL_ENABLE); } public void close() { } public void toggleFullScreen() { if(g_videoFlags && SDL_FULLSCREEN) SDL_ShowCursor(SDL_DISABLE); else SDL_ShowCursor(SDL_ENABLE); g_videoFlags ^= SDL_FULLSCREEN; gScreenSurface = SDL_SetVideoMode(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_BPP, g_videoFlags); glMatrixMode(GL_PROJECTION); glFrustum(-1.0 , 1.0 , -0.75 , 0.75 , 2 , 1600); glViewport(0 ,0 ,width ,height); glClearColor(0 ,0 ,0,1.0); // glEnable(GL_DEPTH_TEST); //glEnable(GL_DEPTH_TEST); // glEnable(GL_BLEND); // glEnable(GL_LINE_SMOOTH); // glEnable(GL_POLYGON_SMOOTH); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); if(g_videoFlags & SDL_FULLSCREEN )prefManager.prefData.recordFullScreen(true); else prefManager.prefData.recordFullScreen(false); } public void saveBMP(char[] name){ SDL_SaveBMP(gScreenSurface, "screenshot.bmp"); } }projectL_1001/src/br/stage.d0000644000000000000000000004627610542607544014467 0ustar rootrootmodule br.stage; private import std.math; private import SDL_mixer; private import opengl; private import br.gamemanager; private import br.enemy; private import br.enemyImpl; private import br.blast; private import br.sound; private import util.ring; private import util.vector; private import util.ring; private import util.ascii; private import br.bomb; struct enemySet { int time; char[] name; bool made; bool target; double x,y,z,aim; Object[] o; bool boss; } public abstract class Stage:Caller{ private: int cnt; int nowLevelCnt; int totalCnt; int level; bool _exists; bool _cleared; bool boss; protected: enemySet[][] eSets; Enemy[] target; int tIdx; public: static const MAXSTAGE = 8; public this(){ cnt = 0; nowLevelCnt = 0; totalCnt = 0; level = 0; _exists = true; _cleared = false; eSets.length = 0; nextMusic = -1; foreach(enemySet[] es;eSets){ es.length = 0; } target.length = 1; tIdx=0; boss = false; } public void run(){ char[] name; bool made=true; if(eSets.length <= level){ _cleared = true; _exists = false; }else{ foreach(inout enemySet es;eSets[level]){ name = null; if(es.made)continue; if(es.target)made=false; if(count == es.time){ name =es.name.dup; // es.made = true; } if(name !is null){ int span; if(es.boss){ Sound_PlaySe(se_kind.WARNING); // Mix_PlayChannel(-1, chunk_warning, 0); new SmallBlast(0 ,0 ,10 ,10 ,200.0 ,210 ,1.0 ,0.4 ,0.4 ,0.35); span = 90; boss = true; }else span = 45; EnemyRing er = new EnemyRing(this,&es, es.target ,new Vector3(es.x,es.y,es.z-800) ,es.aim,es.o,es.name,span ,45); // er.es.made = true; //makeEnemy(es.name ,es.x ,es.y ,es.z ,es.aim); } } if(made){ bool eTarget = false; foreach(Enemy t;target){ if(t !is null && t.exists){ eTarget = true; } } if(!eTarget){ cnt = -1; enemyManager.allDestroy(); bulletManager.allDestroy(); ringManager.clear(); foreach(inout enemySet[] es;eSets){ foreach(inout enemySet ess;es){ ess.made=false; } } target.length = 0; target.length = 1; tIdx = 0; level ++; nowLevelCnt = 0; } } runImpl(); cnt++; nowLevelCnt++; totalCnt++; } } public void draw(){ drawImpl(); } public bool cleared(){ return _cleared; } public void runImpl(); public void drawImpl(){} public int count(){ return cnt; } public bool exists(){ return _exists; } public void reportRing(Ring ring){ EnemyRing er =cast(EnemyRing)ring; Enemy e= makeEnemy(er.name ,er.x ,er.y ,er.z ,er.aim,er.o); er.es.made = true; if(er.target)addTarget(e); } protected void add(int level ,int time,char[] name,bool target,double x,double y,double z,double aim,Object[] o=null ,bool boss = false){ if(eSets.length <= level)eSets.length=level+1; eSets[level].length =eSets[level].length + 1; eSets[level][eSets[level].length-1].made = false; eSets[level][eSets[level].length-1].time = time; eSets[level][eSets[level].length-1].name = name.dup; eSets[level][eSets[level].length-1].target = target; eSets[level][eSets[level].length-1].x=x; eSets[level][eSets[level].length-1].y=y; eSets[level][eSets[level].length-1].z=z; eSets[level][eSets[level].length-1].aim=aim; eSets[level][eSets[level].length-1].boss=boss; } protected void addTarget(Enemy enemy){ enemy.setTarget(); target[tIdx] = enemy; tIdx ++; if(tIdx < target.length)return; else{ target.length = target.length * 2; } } public int music(); public void goback(){ cnt = -1; nowLevelCnt = -1; nextMusic = -1; enemyManager.clear(); bulletManager.clear(); ringManager.clear(); foreach(inout enemySet[] es;eSets){ foreach(inout enemySet ess;es){ ess.made=false; } } target.length = 0; target.length = 1; tIdx = 0; } } public class EnemyRing:Ring{ public enemySet *es; public bool target; public double x,y,z,aim; public Object[] o; public this(Caller caller ,enemySet *es,bool target ,Vector3 pos ,double aim,Object[] o,char[] name ,int span ,double R=0.4 ,double G=0.2,double B=1.0,double alpha=1.0 ,double deg = 0.0){ if(target){ R = 1.0; G = 0.3 ;B = 0.5; alpha = 1.0; }else{ R = 0.4; G = 0.6 ;B = 2.0; alpha = 1.0; } super(caller,pos,name,span,R,G,B,alpha ,deg); this.es = es; this.target = target; this.x=pos.x; this.y=pos.y; this.z=pos.z; this.aim=aim; this.o = o; } } public class Stage1:Stage{ public this(){ add(0,30 ,"stillEnemy" ,true,200 ,0 ,0 ,PI); add(1,0 ,"stillEnemy" ,true,180 ,100 ,0 ,PI); add(2,0 ,"stillEnemy" ,true,-150 ,-150 ,0 ,PI); add(2,0 ,"stillEnemy" ,true,-250 ,20 ,0 ,PI); add(3,10 ,"stillEnemy" ,false,100 ,150 ,0 ,PI); add(3,15 ,"stillEnemy" ,false,200 ,0 ,0 ,PI); add(3,20 ,"stillEnemy" ,false,100 ,-150 ,0 ,PI); add(3,10 ,"stillEnemy" ,true,-100 ,-150 ,0 ,PI); add(3,15 ,"stillEnemy" ,true,-200 ,0 ,0 ,PI); add(3,20 ,"stillEnemy" ,true,-100 ,150 ,0 ,PI); // add(4,10 ,"wideSlowEnemy" ,true ,340 ,0 ,0 ,PI); add(5,0 ,"boss1" ,true ,300 ,0 , -200 ,PI ,null,true); /* add(6,60 ,"wideSlowEnemy" ,true ,340 ,0 ,0 ,PI); add(6,90 ,"wideSlowEnemy" ,true ,0 ,240 ,0 ,-PI /2.0); add(6,120 ,"wideSlowEnemy" ,true ,-340 ,0 ,0 ,0.0); add(6,150 ,"wideSlowEnemy" ,true ,0 ,-240 ,0 ,PI /2.0); */ } public override void runImpl(){ } public override int music(){ return music_kind.MUSIC1; } } public class Stage2:Stage{ public this(){ add(0,0 ,"stillEnemy" ,true,200 ,-150 ,0 ,PI); add(0,0 ,"stillEnemy" ,false,250 ,-200 ,0 ,PI); add(0,0 ,"stillEnemy" ,true,300 ,-150 ,0 ,PI); add(0,0 ,"stillEnemy" ,false,250 ,-100 ,0 ,PI); add(0,30 ,"stillEnemy" ,true,-100 ,150 ,0 ,PI); add(0,30 ,"stillEnemy" ,false,-150 ,100 ,0 ,PI); add(0,30 ,"stillEnemy" ,true,-100 ,50 ,0 ,PI); add(0,30 ,"stillEnemy" ,false,-50 ,100 ,0 ,PI); add(0,60 ,"stillEnemy" ,true,-300 ,-150 ,0 ,PI); add(0,60 ,"stillEnemy" ,false,-250 ,-200 ,0 ,PI); add(0,60 ,"stillEnemy" ,true,-200 ,-150 ,0 ,PI); add(0,60 ,"stillEnemy" ,false,-250 ,-100 ,0 ,PI); add(3,0 ,"stillEnemy" ,true,300 ,0 ,0 ,PI); add(3,0 ,"stillEnemy" ,false,280 ,30 ,0 ,PI); add(3,0 ,"stillEnemy" ,true,250 ,50 ,0 ,PI); add(3,0 ,"stillEnemy" ,false,220 ,30 ,0 ,PI); add(3,0 ,"stillEnemy" ,true,200 ,0 ,0 ,PI); add(3,0 ,"stillEnemy" ,false,220 ,-30 ,0 ,PI); add(3,0 ,"stillEnemy" ,true,250 ,-50 ,0 ,PI); add(3,0 ,"stillEnemy" ,false,280 ,-30 ,0 ,PI); add(4,0 ,"wideSlowEnemy" ,true,-380 ,0 ,0 ,0); add(4,60 ,"wideSlowEnemy" ,true,-380 ,200 ,0 ,0); add(4,120 ,"wideSlowEnemy" ,true,-380 ,-200 ,0 ,0); add(5,0 ,"boss2" ,true ,300 ,0 , 440 ,PI/2 ,null,true); } public override void runImpl(){ } public override int music(){ return music_kind.MUSIC1; } } public class Stage3:Stage{ public this(){ add(0,0 ,"wideSlowEnemy" ,false,380 ,0 ,0 ,PI); add(0,60 ,"wideSlowEnemy" ,false,0 ,280 ,0 ,-PI/2.0); add(0,120 ,"wideSlowEnemy" ,false,-380 ,0 ,0 ,0); add(0,180 ,"wideSlowEnemy" ,true,0 ,-280 ,0 ,PI/2.0); add(1,240 ,"middleEnemy1" ,true,400 ,0 ,0 ,PI); add(1,0 ,"wideSlowEnemy" ,false,0 ,-280 ,0 ,PI/2.0); add(1,120 ,"wideSlowEnemy" ,false,100 ,280 ,0 ,-PI/2.0); add(1,240 ,"wideSlowEnemy" ,false,-300 ,-280 ,0 ,PI/2.0); add(1,400 ,"wideSlowEnemy" ,false,200 ,280 ,0 ,-PI/2.0); add(1,560 ,"wideSlowEnemy" ,false,0 ,-280 ,0 ,PI/2.0); add(1,720 ,"wideSlowEnemy" ,true,-300 ,280 ,0 ,-PI/2.0); add(2,0 ,"boss3" ,true ,200 ,0 , -200 ,0.0 ,null,true); // add(1,240 ,"wideSlowEnemy" ,false,100 ,-280 ,0 ,PI/2.0); } public override void runImpl(){ } public override int music(){ return music_kind.MUSIC3; } } public class Stage4:Stage{ public this(){ add(0,0 ,"zab" ,false,380 ,0 ,0 ,PI); add(0,10 ,"zab" ,false,200 ,150 ,0 ,PI); add(0,20 ,"zab" ,false,300 ,-60 ,0 ,PI); add(0,30 ,"zab" ,false,150 ,-120 ,0 ,PI); add(0,40 ,"zab" ,false,50 ,200 ,0 ,PI); add(0,50 ,"zab" ,false,-300 ,-240 ,0 ,PI); add(0,60 ,"zab" ,false,-200 ,-60 ,0 ,PI); add(0,70 ,"zab" ,false,-50 ,230 ,0 ,PI); add(0,80 ,"zab" ,false,100 ,30 ,0 ,PI); add(0,90 ,"zab" ,false,0 ,0 ,0 ,PI); add(0,100 ,"zab" ,false,-80 ,-60 ,0 ,PI); add(0,110 ,"zab" ,false,-300 ,-250 ,0 ,PI); add(0,120 ,"zab" ,false,200 ,-210 ,0 ,PI); add(0,130 ,"zab" ,false,20 ,250 ,0 ,PI); add(0,140 ,"zab" ,false,-120 ,20 ,0 ,PI); add(0,150 ,"zab" ,false,340 ,10 ,0 ,PI); add(0,160 ,"zab" ,false,-100 ,150 ,0 ,PI); add(0,170 ,"zab" ,false,170 ,-230 ,0 ,PI); add(0,200 ,"stillEnemy" ,true,-300 ,0 ,0 ,PI); add(1,0 ,"upLaserEnemy" ,false,400 ,-280 ,0 ,PI); add(1,120 ,"downLaserEnemy" ,false,400 ,280 ,0 ,PI); add(1,240 ,"upLaserEnemy" ,false,400 ,-280 ,0 ,PI); add(1,360 ,"downLaserEnemy" ,false,400 ,280 ,0 ,PI); add(1,480 ,"upLaserEnemy" ,false,400 ,-280 ,0 ,PI); add(1,600 ,"downLaserEnemy" ,false,400 ,280 ,0 ,PI); add(1,240 ,"stillEnemy" ,true,-300 ,200 ,0 ,PI); add(1,360 ,"stillEnemy" ,true,50 ,250 ,0 ,PI); add(1,480 ,"stillEnemy" ,true,-150 ,-150 ,0 ,PI); add(1,600 ,"stillEnemy" ,true,200 ,170 ,0 ,PI); add(1,660 ,"stillEnemy" ,true,350 ,0 ,0 ,PI); add(2,0 ,"boss4" ,true,50 ,180 ,-400 ,PI ,null ,true); } public override void runImpl(){ } public override int music(){ return music_kind.MUSIC3; } } public class Stage5:Stage{ public this(){ add(0,0 ,"homingEnemy" ,false,380 ,0 ,-100 ,PI); add(0,45 ,"homingEnemy" ,false,240 ,180 ,-100 ,-PI/3); add(0,90 ,"homingEnemy" ,false,-140 ,-250 ,-100 ,PI/3); add(0,135 ,"homingEnemy" ,false,-360 ,-50 ,-100 ,0); add(0,240 ,"stillEnemy" ,true,50 ,0 ,0 ,0); add(1,0 ,"turretEnemy" ,false,380 ,0 ,0 ,PI); add(1,30 ,"turretEnemy" ,false,140 ,230 ,0 ,PI); add(1,30 ,"turretEnemy" ,false,140 ,-230 ,0 ,PI); add(1,90 ,"homingEnemy" ,false,200 ,100 ,-100 ,PI); add(1,90 ,"homingEnemy" ,false,200 ,-100 ,-100 ,PI); add(1,360 ,"stillEnemy" ,true,-300 ,0 ,0 ,0); add(2,0 ,"turretEnemy" ,false,300 ,0 ,0 ,PI); add(2,0 ,"turretEnemy" ,false,100 ,200 ,0 ,-PI*2/3); add(2,0 ,"turretEnemy" ,false,-100 ,200 ,0 ,-PI/3); add(2,0 ,"turretEnemy" ,false,-300 ,0 ,0 ,0); add(2,0 ,"turretEnemy" ,false,100 ,-200 ,0 ,PI*2/3); add(2,0 ,"turretEnemy" ,false,-100 ,-200 ,0 ,PI/3); add(2,300 ,"stillEnemy" ,true,0 ,0 ,0 ,0); add(3,0 ,"boss5" ,true,-380 ,0 ,-200 ,0 ,null ,true); } public override void runImpl(){ } public override int music(){ return music_kind.MUSIC4; } } public class Stage6:Stage{ public this(){ int interval= 30; for(int t=0;t<=150;t+=interval*2){ add(0,t ,"boundEnemy" ,false,rand.nextFloat(500)-120 ,280 ,0 ,PI); add(0,t+interval ,"boundEnemy" ,false,rand.nextFloat(500)-380 ,280 ,0 ,0); } /* add(0,0 ,"boundEnemy" ,false,200 ,280 ,0 ,PI); add(0,30 ,"boundEnemy" ,false,-100 ,280 ,0 ,0); add(0,60 ,"boundEnemy" ,false,50 ,280 ,0 ,PI); add(0,90 ,"boundEnemy" ,false,100 ,280 ,0 ,0); add(0,120 ,"boundEnemy" ,false,350 ,280 ,0 ,PI); add(0,150 ,"boundEnemy" ,false,-300 ,280 ,0 ,0); */ /* add(0,15 ,"boundEnemy" ,false,250 ,280 ,0 ,PI); add(0,45 ,"boundEnemy" ,false,200 ,280 ,0 ,PI); add(0,75 ,"boundEnemy" ,false,10 ,280 ,0 ,0); add(0,105 ,"boundEnemy" ,false,-50 ,280 ,0 ,PI); add(0,135 ,"boundEnemy" ,false,90 ,280 ,0 ,0); */ add(0,20 ,"sidewayEnemy" ,true,380 ,50 ,0 ,PI * 8.0/9.0 ); add(0,80 ,"sidewayEnemy" ,true,-380 ,120 ,0 ,PI/9.0 ); add(0,140 ,"sidewayEnemy" ,true,380 ,280 ,0 ,PI * 8.0/9.0 ); interval= 23; for(int t=0;t<=350;t+=interval*2){ add(1,t ,"boundEnemy" ,false,rand.nextFloat(500)-120 ,280 ,0 ,PI); add(1,t+interval ,"boundEnemy" ,false,rand.nextFloat(500)-380 ,280 ,0 ,0); } /* add(1,0 ,"boundEnemy" ,false,50 ,280 ,0 ,PI); add(1,20 ,"boundEnemy" ,false,-250 ,280 ,0 ,0); add(1,40 ,"boundEnemy" ,false,300 ,280 ,0 ,PI); add(1,60 ,"boundEnemy" ,false,-50 ,280 ,0 ,0); add(1,80 ,"boundEnemy" ,false,-150 ,280 ,0 ,PI); add(1,100 ,"boundEnemy" ,false,120 ,280 ,0 ,0); add(1,120 ,"boundEnemy" ,false,250 ,280 ,0 ,PI); add(1,140 ,"boundEnemy" ,false,-100 ,280 ,0 ,0); add(1,160 ,"boundEnemy" ,false,-20 ,280 ,0 ,PI); add(1,180 ,"boundEnemy" ,false,60 ,280 ,0 ,0); add(1,200 ,"boundEnemy" ,false,180 ,280 ,0 ,PI); add(1,220 ,"boundEnemy" ,false,-320 ,280 ,0 ,0); add(1,240 ,"boundEnemy" ,false,0 ,280 ,0 ,PI); add(1,260 ,"boundEnemy" ,false,-140 ,280 ,0 ,0); */ // add(1,280 ,"boundEnemy" ,true,-30 ,280 ,0 ,PI); /* add(1,10 ,"boundEnemy" ,false,50 ,280 ,0 ,PI); add(1,30 ,"boundEnemy" ,false,-250 ,280 ,0 ,0); add(1,50 ,"boundEnemy" ,false,300 ,280 ,0 ,PI); add(1,70 ,"boundEnemy" ,false,-50 ,280 ,0 ,0); add(1,90 ,"boundEnemy" ,false,-150 ,280 ,0 ,PI); add(1,110 ,"boundEnemy" ,false,-120 ,280 ,0 ,PI); add(1,130 ,"boundEnemy" ,false,120 ,280 ,0 ,0); add(1,150 ,"boundEnemy" ,false,-300 ,280 ,0 ,0); add(1,170 ,"boundEnemy" ,false,160 ,280 ,0 ,PI); add(1,190 ,"boundEnemy" ,false,260 ,280 ,0 ,0); add(1,210 ,"boundEnemy" ,false,-80 ,280 ,0 ,0); add(1,230 ,"boundEnemy" ,false,200 ,280 ,0 ,PI); add(1,250 ,"boundEnemy" ,false,-100 ,280 ,0 ,PI); add(1,270 ,"boundEnemy" ,false,140 ,280 ,0 ,PI); add(1,290 ,"boundEnemy" ,false,120 ,280 ,0 ,PI); */ add(1,0 ,"fourwayEnemy" ,true,380 ,-120 ,0 ,PI ); add(1,160 ,"fourwayEnemy" ,true,-380 ,110 ,0 ,0 ); add(2,0 ,"boss6" ,true,0 ,-480 ,0 ,0 ,null ,true); } public override void runImpl(){ } public override int music(){ return music_kind.MUSIC4; } } public class Stage7:Stage{ public this(){ int interval= 12; for(int t=0;t<300;t+=interval*2){ float y = rand.nextFloat(300) - 300; add(1,t ,"thrustEnemy" ,false,380 ,y ,0 ,PI ); y = rand.nextFloat(300); add(1,t+interval ,"thrustEnemy" ,false,380 ,y ,0 ,PI ); } float y = rand.nextFloat(600) - 300; add(1,312 ,"thrustEnemy" ,true,380 ,y ,0 ,PI ); double rad1 = PI*2.0/3.0; double rad2 = -PI*2.0/3.0; double x1 ,y1 ,x2 ,y2; x1 = x2 = 300; y1 = y2 = 0; interval = 100; add(2,0 ,"turretEnemy" ,false,300 ,0 ,0 ,PI); for(int t=interval;t<200;t+=interval){ x1 += 200.0*cos(rad1); y1 += 200.0*sin(rad1); x2 += 200.0*cos(rad2); y2 += 200.0*sin(rad2); add(2,t ,"turretEnemy" ,false,x1 ,y1 ,0 ,rad1+PI/2.0); add(2,t ,"turretEnemy" ,false,x2 ,y2 ,0 ,rad2-PI/2.0); rad1 += PI /3.0;//rand.nextFloat(PI / 8.0) - PI / 16.0; rad2 -= PI /3.0;//rand.nextFloat(PI / 8.0) - PI / 16.0; } x1 += 120.0*cos(rad1); y1 += 120.0*sin(rad1); x2 += 120.0*cos(rad2); y2 += 120.0*sin(rad2); add(2,250 ,"turretEnemy" ,true,x1 ,y1 ,0 ,rad1+PI/2.0); add(2,250 ,"turretEnemy" ,true,x2 ,y2 ,0 ,rad2-PI/2.0); interval = 45; for(int t=0;t<700;t+=interval*2){ y = rand.nextFloat(300) - 300; add(2,t ,"thrustEnemy" ,false,380 ,y ,0 ,PI ); y = rand.nextFloat(300); add(2,t+interval ,"thrustEnemy" ,false,380 ,y ,0 ,PI ); } for(int t=0;t<800;t+=200){ for(y=-300;y<=300;y+=60){ add(3,t ,"wall" ,false,380 ,y ,0 ,PI ); } } for(y=-300;y<=300;y+=60){ add(3,800 ,"wall" ,true,380 ,y ,0 ,PI ); } for(int t=0;t<1200;t+=180){ y=rand.nextFloat(400.0)-200.0; add(3,t ,"chaseEnemy" ,false,-380 ,y ,0 ,0 ); } add(4,0 ,"boss7" ,true,-700 ,-70 ,-300 ,0 ,null ,true); } public override void runImpl(){ // background.setAxis(0.5 ,0.5 ,0.0); // background.theta += 0.1; } public override int music(){ return music_kind.MUSIC5; } } public class Stage8:Stage{ public this(){ for(double rad = -PI;rad < PI;rad += PI / 16.0){ add(1,0 ,"foldEnemy" ,false,250 * cos(rad) ,250*sin(rad) ,0 ,PI); } for(double rad = -PI;rad < PI;rad += PI / 16.0){ add(1,90 ,"foldEnemy" ,false,250 * cos(rad) ,250*sin(rad) ,0 ,PI); } for(double rad = -PI;rad < PI;rad += PI / 16.0){ add(1,180 ,"foldEnemy" ,true,250 * cos(rad) ,250*sin(rad) ,0 ,PI); } for(int i=0;i<128;i+=3){ add(2,i,"zab" ,false ,rand.nextFloat(780)-390,rand.nextFloat(580)-290 ,0 ,0); } add(2,128,"zab" ,true ,rand.nextFloat(780)-390,rand.nextFloat(580)-290 ,0 ,0); for(int t=0;t<600;t+=250){ add(3,t,"upLaserEnemy" ,false ,380 ,-280 ,0,PI); add(3,t,"upLaserEnemy" ,false ,-380 ,280 ,0,0); add(3,t,"upLaserEnemy" ,false ,380 ,280 ,0,-PI/2); add(3,t,"upLaserEnemy" ,false ,-380 ,-280 ,0 ,PI/2); } add(3,700,"stillEnemy" ,true ,0 ,0 ,0 ,0); add(4,0 ,"stillEnemy" ,true ,800 ,0 ,0 ,0); add(5,0 ,"boss8" ,true,0 ,0 ,-800 ,0 ,null ,true); } public override void runImpl(){ switch(level){ case 0: if(nowLevelCnt == 0){ Sound_HaltMusic(); } if(nowLevelCnt >= 150){ if(nowLevelCnt == 150){ if(Sound_PlayingMusic()==-1)Sound_PlayMusic(music_kind.MUSIC7); } if(0 <= nextMusic && Sound_PlayingMusic()==-1)Sound_PlayMusic(nextMusic); } break; case 4: if(nowLevelCnt == 0){ Sound_FadeOutMusic(0); background.setAxis(1.0 ,0.6 ,1.0); } if(-330= 150){ if(nowLevelCnt == 150){ if(Sound_PlayingMusic()==-1)Sound_PlayMusic(music_kind.MUSIC7); } if(0 <= nextMusic && Sound_PlayingMusic()==-1)Sound_PlayMusic(nextMusic); } break; default:break; } } public override int music(){ return music_kind.MUSIC6; } } private int nextMusic = -1; public void setNextMusic(int music){ nextMusic = music; } public class Ending:Stage{ public this(){ add(0,0 ,"boss8imitate" ,true,400 ,100 ,-700 ,-15 ,null ,true); add(0,90 ,"boss8imitate" ,true,-100 ,50 ,400 ,-10 ,null ,true); add(0,180 ,"boss8imitate" ,true,50 ,-200 ,-500 ,-5 ,null ,true); add(0,270 ,"boss8imitate" ,true,0 ,0 ,-200 ,0 ,null ,true); add(0,1000 ,"stillEnemy" ,true,800 ,0 ,0 ,0); } public override void runImpl(){ if(totalCnt == 850){ // new Bomb(); new Blast2(0.0 ,0.0 ,0.01 ,0.006 ,350 ,1.0 ,1.0 ,1.0 ,1.0); } if(totalCnt == 1080){ shipManager.allDestroy(); enemyManager.allDestroy(); background.drawing = false; } } public override void drawImpl(){ asciiR = 1.0;asciiG = 1.0;asciiB = 1.0;asciiAlpha = 1.0; if(totalCnt > 400 && totalCnt < 600){ drawString("ready to destroy" ,-300 ,-100 ,0 ,(totalCnt - 400) / 5); drawString(" the warp hole" ,-120 ,-160 ,0 ,(totalCnt - 500) / 5); } if(totalCnt > 630 && totalCnt < 800){ drawString("start destroying" ,-240 ,-130 ,0 ,(totalCnt - 630) / 5); } if(totalCnt > 830 && totalCnt < 1000){ drawString("we are proud of you" ,-270 ,-130 ,0 ,(totalCnt - 830) / 5); } if(totalCnt > 1020 && totalCnt < 1100){ drawString("thank you" ,-120 ,-130 ,0 ,(totalCnt - 1030) / 2); } } public override int music(){ return -1; } }projectL_1001/src/br/sound.d0000644000000000000000000001314510542754026014477 0ustar rootrootmodule br.sound; private import br.gamemanager; private import br.mainloop; private import SDL_mixer; private import SDL; public enum se_kind{ SLASH ,DEFEND ,BOMB ,BEEP ,WARNING ,REVERSE, V_0, V_1 ,V_2 ,V_3 ,V_4 ,V_5 ,V_6 ,V_7 ,V_8 ,V_9 }; public enum music_kind{ MUSIC1 ,MUSIC2 ,MUSIC3 ,MUSIC4 ,MUSIC5 ,MUSIC6 ,MUSIC7 ,MUSIC8 ,MUSIC9 }; private int _Sound_PlayingMusic; private bool _nosound = false; Mix_Chunk* chunk_slash; Mix_Chunk* chunk_defend; Mix_Chunk* chunk_bomb; Mix_Chunk* chunk_beep; Mix_Chunk* chunk_warning; Mix_Chunk* chunk_reverse; Mix_Chunk* voice_0; Mix_Chunk* voice_1; Mix_Chunk* voice_2; Mix_Chunk* voice_3; Mix_Chunk* voice_4; Mix_Chunk* voice_5; Mix_Chunk* voice_6; Mix_Chunk* voice_7; Mix_Chunk* voice_8; Mix_Chunk* voice_9; Mix_Music *music1; Mix_Music *music2; Mix_Music *music3; Mix_Music *music4; Mix_Music *music5; Mix_Music *music6; Mix_Music *music7; Mix_Music *music8; Mix_Music *music9; public void Sound_init(){ SDL_InitSubSystem(SDL_INIT_AUDIO); int audio_rate; Uint16 audio_format; int audio_channels; int audio_buffers; audio_rate = 44100; audio_format = AUDIO_S16; audio_channels = 1; audio_buffers = 4096; if(Mix_OpenAudio(audio_rate, audio_format, audio_channels, audio_buffers) < 0){ _nosound = true; return ; } Mix_QuerySpec(&audio_rate, &audio_format, &audio_channels); chunk_slash = Mix_LoadWAV("se/hit_s02.wav"); chunk_defend = Mix_LoadWAV("se/metal34_a.wav"); chunk_bomb = Mix_LoadWAV("se/bom13_c.wav"); chunk_beep = Mix_LoadWAV("se/beep00.wav"); chunk_warning = Mix_LoadWAV("se/emergency.wav"); chunk_reverse = Mix_LoadWAV("se/hit_s03_a.wav"); voice_0 = Mix_LoadWAV("voice/FREQ_A500_0.wav"); voice_1 = Mix_LoadWAV("voice/FREQ_A500_1.wav"); voice_2 = Mix_LoadWAV("voice/FREQ_A500_2.wav"); voice_3 = Mix_LoadWAV("voice/FREQ_A500_3.wav"); voice_4 = Mix_LoadWAV("voice/FREQ_A500_4.wav"); voice_5 = Mix_LoadWAV("voice/FREQ_A500_5.wav"); voice_6 = Mix_LoadWAV("voice/FREQ_A500_6.wav"); voice_7 = Mix_LoadWAV("voice/FREQ_A500_7.wav"); voice_8 = Mix_LoadWAV("voice/FREQ_A500_8.wav"); voice_9 = Mix_LoadWAV("voice/FREQ_A500_9.wav"); music1 = Mix_LoadMUS("music/FREQ_loop005.ogg"); music2 = Mix_LoadMUS("music/FREQ_loop004.ogg"); music3 = Mix_LoadMUS("music/FREQ_loop002.ogg"); music4 = Mix_LoadMUS("music/mix_loop004_3.ogg"); music5 = Mix_LoadMUS("music/division_bell.ogg"); music6 = Mix_LoadMUS("music/untitled.ogg"); music7 = Mix_LoadMUS("music/splash_intro.ogg"); music8 = Mix_LoadMUS("music/splash_main.ogg"); music9 = Mix_LoadMUS("music/transmigration.ogg"); _Sound_PlayingMusic = -1; } public void Sound_PlaySe(uint kind){ if(!nosound){ switch(kind){ case se_kind.SLASH:Mix_PlayChannel(0 ,chunk_slash ,0);break; case se_kind.DEFEND:Mix_PlayChannel(1 ,chunk_defend ,0);break; case se_kind.BOMB:Mix_PlayChannel(2 ,chunk_bomb ,0);break; case se_kind.BEEP:Mix_PlayChannel(3 ,chunk_beep ,0);break; case se_kind.WARNING:Mix_PlayChannel(4 ,chunk_warning ,0);break; case se_kind.REVERSE:Mix_PlayChannel(5 ,chunk_reverse ,0);break; case se_kind.V_0:Mix_PlayChannel(6 ,voice_0 ,0);break; case se_kind.V_1:Mix_PlayChannel(6 ,voice_1 ,0);break; case se_kind.V_2:Mix_PlayChannel(6 ,voice_2 ,0);break; case se_kind.V_3:Mix_PlayChannel(6 ,voice_3 ,0);break; case se_kind.V_4:Mix_PlayChannel(6 ,voice_4 ,0);break; case se_kind.V_5:Mix_PlayChannel(6 ,voice_5 ,0);break; case se_kind.V_6:Mix_PlayChannel(6 ,voice_6 ,0);break; case se_kind.V_7:Mix_PlayChannel(6 ,voice_7 ,0);break; case se_kind.V_8:Mix_PlayChannel(6 ,voice_8 ,0);break; case se_kind.V_9:Mix_PlayChannel(6 ,voice_9 ,0);break; default:break; } } } public void Sound_PlayMusic(int kind ,int loop = -1){ if(!nosound){ if(Sound_PlayingMusic == kind)return; switch(kind){ case music_kind.MUSIC1:Mix_PlayMusic(music1, loop);break; case music_kind.MUSIC2:Mix_PlayMusic(music2, loop);break; case music_kind.MUSIC3:Mix_PlayMusic(music3, loop);break; case music_kind.MUSIC4:Mix_PlayMusic(music4, loop);break; case music_kind.MUSIC5:Mix_PlayMusic(music5, loop);break; case music_kind.MUSIC6:Mix_PlayMusic(music6, loop);break; case music_kind.MUSIC7:Mix_PlayMusic(music7, loop);break; case music_kind.MUSIC8:Mix_PlayMusic(music8, loop);break; case music_kind.MUSIC9:Mix_PlayMusic(music9, loop);break; default:return; } _Sound_PlayingMusic = kind; } } public void Sound_HaltMusic(){ Mix_HaltMusic(); _Sound_PlayingMusic = -1; } public void Sound_FadeOutMusic(int ms){ Mix_FadeOutMusic(ms); _Sound_PlayingMusic = -1; } public void Sound_free(){ Mix_FreeMusic(music1); Mix_FreeMusic(music2); Mix_FreeMusic(music3); Mix_FreeMusic(music4); Mix_FreeMusic(music5); Mix_FreeMusic(music6); Mix_FreeMusic(music7); Mix_FreeMusic(music8); Mix_FreeMusic(music9); Mix_FreeChunk(chunk_slash); Mix_FreeChunk(chunk_defend); Mix_FreeChunk(chunk_bomb); Mix_FreeChunk(chunk_beep); Mix_FreeChunk(chunk_warning); Mix_FreeChunk(chunk_reverse); Mix_FreeChunk(voice_0); Mix_FreeChunk(voice_1); Mix_FreeChunk(voice_2); Mix_FreeChunk(voice_3); Mix_FreeChunk(voice_4); Mix_FreeChunk(voice_5); Mix_FreeChunk(voice_6); Mix_FreeChunk(voice_7); Mix_FreeChunk(voice_8); Mix_FreeChunk(voice_9); } public void nosound(bool s){ _nosound = s; if(nosound){ Sound_HaltMusic(); } prefManager.prefData.recordNoSound(_nosound); } public bool nosound(){ return _nosound; } public int Sound_PlayingMusic(){ if(Mix_PlayingMusic() == 0)_Sound_PlayingMusic = -1; return _Sound_PlayingMusic; }projectL_1001/src/br/prefmanager.d0000644000000000000000000000332210542571032015624 0ustar rootrootmodule br.prefmanager; private import std.stream; private import util.record; private import br.stage; public class PrefManager{ private: static const VERSION_NUM = 10; static const char[] PREF_FILE ="projectL.prf"; PrefData _prefData; public this(){ _prefData = new PrefData; } public void load() { auto File fd = new File; try { int ver; fd.open(PREF_FILE); fd.read(ver); if (ver != VERSION_NUM) throw new Error("Wrong version num"); _prefData.load(fd); } catch (Object e) { _prefData.start(); } finally { if (fd.isOpen()) fd.close(); } } public void save(){ auto File fd = new File; fd.create(PREF_FILE); fd.write(VERSION_NUM); _prefData.save(fd); fd.close(); } public PrefData prefData() { return _prefData; } } public class PrefData { private: int _fullScreen; int _nosound; Record _record; public this(){ _record = new Record(Stage.MAXSTAGE ,3); } public void start(){ _fullScreen = 0; _nosound = 0; _record.start(); } public void load(File fd) { _record.load(fd); fd.read(_nosound); fd.read(_fullScreen); } public void save(File fd) { _record.save(fd); fd.write(_nosound); fd.write(_fullScreen); } public void recordNoSound(bool ns){ if(ns)_nosound = 1; else _nosound = 0; } public void recordFullScreen(bool fs){ if(fs)_fullScreen = 1; else _fullScreen = 0; } public bool fullScreen(){ return _fullScreen != 0; } public bool nosound(){ return _nosound != 0; } public Record record(){ return _record; } }projectL_1001/src/br/ship.d0000644000000000000000000002635110557123012014304 0ustar rootrootmodule br.ship; private import SDL_mixer; private import opengl; private import str = std.string; private import std.math; private import util.parts; private import util.key; private import util.shape; private import util.vector; private import util.matrix; private import util.log; private import util.beam; private import util.particle; private import br.shapeImpl; private import br.screen; private import br.mainloop; private import br.gamemanager; private import br.append; private import br.blast; public class Ship:Parts{ //import br.mainloop; public: bool sword; bool slow; bool miss; private{ Key key; int pressing; int reload; double gradient; int cPressed; double predegAim; // Vector3[100] rpos0; // Matrix[100] rpose0; } public this(){} public this(Key key,float x,float y){ collisionManager.add(this ,collisionManager.kind.SHIP ,1); this.key = key; start(x ,y); Parts p;//Parts p; // for(int i=0;i 5)speed = 5.0; // else speed = 8.0; if(sword)speed = 6.8; else speed = 6.8; int dir = key.getDirState(); int aim = 5; //Vector aim = new Vector(0,0); if(dir & Key.Dir.RIGHT){ // if(!(button & key.Button.A)) pos.x += speed; aim -= 1; //aim.x += 1; } if(dir & Key.Dir.LEFT){ // if(!(button & key.Button.A)) pos.x -= speed; aim += 1; //aim.x -= 1; } if(dir & Key.Dir.DOWN){ // if(!(button & key.Button.A)) /* if(gradient < 20.0f){ rotateAll(matRotateX(2.0f)); gradient +=2.0f; } */ pos.y -= speed; aim -= 3; //aim.y -= 1; }else if(dir & Key.Dir.UP){ // if(!(button & key.Button.A)) /* if(-20.0 < gradient){ rotateAll(matRotateX(-2.0f)); gradient -=2.0f; } */ pos.y += speed; aim += 3; //aim.y += 1; }else{ /* if(gradient < -1.0){ gradient +=1.0f; rotateAll(matRotateX(1.0f)); }else if(1.0 < gradient){ gradient -=1.0f; rotateAll(matRotateX(-1.0f)); }else poseX =0.0f; */ } double degAim; bool moved = true; switch(aim){ case 1:degAim=135.0; break; case 2:degAim=90.0; break; case 3:degAim=45.0; break; case 4:degAim=180.0; break; case 6:degAim=0.0; break; case 7:degAim=-135.0; break; case 8:degAim=-90.0; break; case 9:degAim=-45.0; break; case 5: default: degAim = predegAim; moved = false; break; } predegAim = degAim; if(childHash["laserGun"] !is null){ (cast(Beam)childHash["laserGun"]).setAim(degAim ,true);//moved); } if(pos.y < screen.GAME_DOWN + size)pos.y = screen.GAME_DOWN + size; if(screen.GAME_UP - size < pos.y)pos.y = screen.GAME_UP - size; if(screen.GAME_RIGHT - size < pos.x)pos.x = screen.GAME_RIGHT - size; if(pos.x < screen.GAME_LEFT + size)pos.x = screen.GAME_LEFT + size; //rotateAll(matRotateY(1 ) ); //glLineWidth(1); //super.draw(); } /* public void drawImpl(){ for(int i=0;i 0){ this.collisionRange = collisionSize; }else this.collisionRange = size / 2.0; // parentExist = true; } public void move(){ super.move(); if(parentExist & (parent is null || parent.exists == false)){ parentExist = false; vanishCount = 5; } if(parentExist == false){ vanishCount --; if(vanishCount < 0)destroy(); } } public void destroy(){ super.destroy(); makeParticle(shape, size ,WIRE ,rpos ,new Vector3() ,rpose ,R ,G ,B ,alpha); } public void reportRing(Ring ring){ } } public class Turret:EnemyAppend{ public this(){ super(TurretShape1.getShape() ,30 ,-1); collisionRange = 15; } public void reportRing(Ring ring){ Vector3 po = vec3translate(new Vector3(1.0 ,0.0 ,0.0), rpose); new Enemy1(rpos , atan2(po.y ,po.x)); } } public class Turret2:EnemyAppend{ public this(int size,int hp){ super(TurretShape2.getShape() ,size ,hp); collisionRange = size / 2.0; } public void reportRing(Ring ring){ switch(ring.name){ case "missile": int term = rand.nextInt(20) + 40; new Missile(rpos ,rposeZ*PI/180 ,term ,5.0); break; case "laser": new Missile(rpos ,rposeZ*PI/180 ,1000 ,8.0 ,2.0); break; case "bomb": new Missile(rpos ,rposeZ*PI/180 ,20 ,3.0); break; default:break; } } } public class Turret3:EnemyAppend{ public this(int size){ super(TurretShape3.getShape() ,size ,4); collisionRange = size / 2.0; } public void reportRing(Ring ring){ switch(ring.name){ case "shot": double aim = rposeZ*PI/180.0; new Enemy1(rpos , aim,4.0); break; case "reflectshot": double aim = rposeZ*PI/180.0; new ReflectEnemy(rpos , aim,6.0); break; /* case "wall": double aim ,bendAim; if(rpos.y < 0){ aim = PI /2.0; bendAim = -PI / 2.0; }else{ aim = -PI/2.0; bendAim = PI/2.0; } for(double d = 0;d < 20;d +=0.5){ new BendBullet(rpos ,true , aim,bendAim ,30 ,d ,3.0); } break; */ default:break; } } } public class NoseTurret:EnemyAppend{ public this(int size,int hp){ super(NoseShape.getShape() ,size ,hp); collisionRange = size / 2.0; } public void reportRing(Ring ring){ } } public class WingTurret:EnemyAppend{ public this(int size){ super(Wing.getShape() ,size ,-1); collisionRange = -1; } public void reportRing(Ring ring){ Vector3 po = ship.rpos - rpos; double aim = atan2(po.y ,po.x); new Enemy2(rpos , aim,2.0); } } public class HeadTurret:EnemyAppend{ public this(int size){ super(Head.getShape() ,size ,-1); collisionRange = -1; } public void reportRing(Ring ring){ Vector3 po = vec3translate(new Vector3(1.0 ,0.0 ,0.0), rpose); double aim = atan2(po.y ,po.x); new Bullet3D(rpos + vec3Normalize(new Vector3(po.y ,-po.x ,po.z)) * 10.0,true , aim,4.0); new Bullet3D(rpos + vec3Normalize(new Vector3(-po.y ,po.x ,po.z)) * 10.0,true , aim,4.0); } } public class TailTurret:EnemyAppend{ public this(int size){ super(Tail.getShape() ,size ,-1); collisionRange = -1; } public void reportRing(Ring ring){ Vector3 po = ship.rpos - rpos;//vec3translate(new Vector3(1.0 ,0.0 ,0.0), rpose); double aim = atan2(po.y ,po.x); new Enemy2(rpos , aim,3.0); // new Enemy3D(rpos , (vec3Normalize(po) + new Vector3(0 ,0 ,0.3)) * 3.0); } } public class HeadTurret2:EnemyAppend{ public this(int size){ super(Head2.getShape() ,size ,-1); collisionRange = -1; } public void reportRing(Ring ring){ for(double aim = PI; -PI <= aim;aim -= PI/6.0){ new BombEnemy(rpos ,aim ,4.0); } } } public class ArmTurret:EnemyAppend{ public this(int size){ super(ArmShape.getShape() ,size ,-1); collisionRange = -1; } public void reportRing(Ring ring){ new BombEnemy(rpos ,-PI/2.0); } } public class TailTurret2:EnemyAppend{ public this(int size){ super(ArmShape.getShape() ,size ,-1); collisionRange = -1; } public void reportRing(Ring ring){ switch(ring.name){ case "shot": Vector3 po = ship.rpos - rpos;//vec3translate(new Vector3(1.0 ,0.0 ,0.0), rpose); double aim = atan2(po.y ,po.x); new AccBullet(rpos ,true , aim,1.0 ,5.0 ,0.1); break; case "eightway": double rad = cast(double)cnt /180.0*PI; for(double aim=-PI;aim collisionRange){ pos.z += aim.z; } poseY += 5; poseZ += 4; } public void reportRing(Ring ring){ // new EBullet2(pos ,true, atan2(ship.pos.y - pos.y ,ship.pos.x - pos.x)); } } public class Enemy3D2:Enemy{ private: static Shape baseShape; static float[][] a = [ [-1.0 ,0.0 ,1.0] ]; static float[][] b = [ [0.0 ,1.0 ,0.0] ]; Vector3 aim; // double speed; public this(Vector3 pos,Object o){ super(1.5); if(baseShape is null){ baseShape = new SH_Pole(a ,b ,5); } shape = cast(Shape)baseShape.clone(); size = 25; collisionRange = 12; this.pos = cast(Vector3)pos.clone; this.rpos = cast(Vector3)this.pos.clone(); this.aim = cast(Vector3)o; // this.speed = speed; } public void move(){ super.move(); /* if(cnt % 30 == 0){ new AttackRing(this ,"shot",30); } */ /* pos.x += speed * cos(aim); pos.y += speed * sin(aim); */ pos += aim; poseY += 5; poseZ += 4; } public void reportRing(Ring ring){ // new EBullet2(pos ,true, atan2(ship.pos.y - pos.y ,ship.pos.x - pos.x)); } } public class Blaster:Enemy{ private: static Shape baseShape; /* static float[][] a = [ [-1.0 ,0.0 ,1.0] ]; static float[][] b = [ [0.0 ,1.0 ,0.0] ]; */ Vector3 aim; // double speed; public this(Vector3 pos,Vector3 aim ,double speed){ super(5.0); if(baseShape is null){ baseShape = new SH_Sphere(1.0 ,12); } shape = cast(Shape)baseShape.clone(); size = 100; collisionRange = 80; this.pos = cast(Vector3)pos.clone; this.rpos = cast(Vector3)this.pos.clone(); this.aim = aim * speed; // this.speed = speed; } public void move(){ super.move(); /* if(cnt % 30 == 0){ new AttackRing(this ,"shot",30); } */ /* pos.x += speed * cos(aim); pos.y += speed * sin(aim); */ pos += aim; poseY += 3; poseZ += 7; } public void reportRing(Ring ring){ // new EBullet2(pos ,true, atan2(ship.pos.y - pos.y ,ship.pos.x - pos.x)); } } public class WideSlowEnemy:Enemy{ private: static Shape baseShape; static float[][] a = [ [-1.0 ,-0.2 ,0.3 ,1.5] ]; static float[][] b = [ [0.0 ,1.0 ,0.7 ,0.0] ]; double aim; public this(float x,float y ,float z ,float aim){ super(2); if(baseShape is null){ baseShape = new SH_Pole(a ,b ,4); } shape = cast(Shape)baseShape.clone(); size = 30; collisionRange = 15; pos = new Vector3(x ,y ,z); this.rpos = cast(Vector3)this.pos.clone(); this.aim = aim; } public void move(){ super.move(); if(cnt == 0){ new AttackRing(this ,"wideshot",30); } if(120 < cnt){ pos.x += 2 * cos(aim); pos.y += 2 * sin(aim); } poseZ = aim / PI * 180; poseX += 5; } public void reportRing(Ring ring){ for(double rad=-PI/2.0;rad<=PI/2.0;rad+=PI/36){ new SlowStraightBullet(pos ,true, rad + aim); } } } public class ThrustEnemy:Enemy{ private: static Shape baseShape; static float[][] a = [ [-0.8 ,-1.0 ,-0.3 ,1.0], [-0.8 ,-0.5 ,-0.3 ,1.0] ]; static float[][] b = [ [0.0 ,1.0 ,0.7 ,0.0], [0.0 ,0.6 ,0.7 ,0.0] ]; double aim; double speed; double maxSpeed; double acc; // double brad; // double bSpeed; public this(float x,float y ,float z ,float aim ,float speed = 8.0){ super(1.0); if(baseShape is null){ baseShape = new SH_Pole(a ,b ,8); } shape = cast(Shape)baseShape.clone(); size = 30; collisionRange = 10; pos = new Vector3(x ,y ,z); this.rpos = cast(Vector3)this.pos.clone(); this.aim = aim; this.speed = 0.0; this.maxSpeed = speed; this.acc = maxSpeed / 30.0; // brad = } public void move(){ super.move(); if(cnt == 0){ new AttackRing(this ,"shot",30); } if(speed < maxSpeed){ speed += acc; }else speed = maxSpeed; pos.x += speed * cos(aim); pos.y += speed * sin(aim); poseZ = aim / PI * 180; poseX += 5; } public void reportRing(Ring ring){ double a = atan2(ship.rpos.y - rpos.y, ship.rpos.x - rpos.x); for(double rad=-PI/12.0;rad<=PI/12.0;rad+=PI/36){ new StraightBullet(pos ,true, rad + a ,5.0 + rad * 8.0); } } } public class UpLaserEnemy:Enemy{ private: static Shape baseShape; static float[][] a = [ [0 ,-0.5 ,0 ,1.0 ,0], [0] ]; static float[][] b = [ [0 ,0.5 ,1.0 ,0.5 ,0.0], [0.5] ]; double aim; public this(float x,float y ,float z ,float aim){ super(-1); if(baseShape is null){ baseShape = new SH_Pole(a ,b ,8); } shape = cast(Shape)baseShape.clone(); size = 40; collisionRange = 20; pos = new Vector3(x ,y ,z); this.rpos = cast(Vector3)this.pos.clone(); this.aim = aim; // poseZ = 90; } public void move(){ super.move(); if(rpos.z < -800 - 2)pos.z +=2; else if(-800 + 2 < rpos.z)pos.z -= 2; else{ pos.x += 2 * cos(aim); pos.y += 2 * sin(aim); } if(cnt % 5 == 0){ new AttackRing(this ,"laser",10); } poseZ = -90 + aim / PI * 180; poseX += 5; } public void reportRing(Ring ring){ new StraightBullet(pos ,true, aim - PI / 2.0 ,5.0); } } public class DownLaserEnemy:Enemy{ private: static Shape baseShape; static float[][] a = [ [0 ,-0.5 ,0 ,1.0 ,0], [0] ]; static float[][] b = [ [0 ,0.5 ,1.0 ,0.5 ,0.0], [0.5] ]; double aim; public this(float x,float y ,float z ,float aim){ super(-1); if(baseShape is null){ baseShape = new SH_Pole(a ,b ,8); } shape = cast(Shape)baseShape.clone(); size = 40; collisionRange = 20; pos = new Vector3(x ,y ,z); this.rpos = cast(Vector3)this.pos.clone(); this.aim = aim; // poseZ = 90; } public void move(){ super.move(); if(rpos.z < -800 - 2)pos.z +=2; else if(-800 + 2 < rpos.z)pos.z -= 2; else { pos.x += 2 * cos(aim); pos.y += 2 * sin(aim); } if(cnt % 5 == 0){ new AttackRing(this ,"laser",10); } poseZ = 90 + aim / PI * 180; poseX += 5; } public void reportRing(Ring ring){ new StraightBullet(pos ,true, aim + PI / 2.0 ,5.0); } } public class StillEnemy:Enemy{ private: static Shape baseShape; static float[][] a = [ [-1.0 ,0.0 ,1.0] ]; static float[][] b = [ [0.0 ,1.0 ,0.0] ]; double aim; public this(float x,float y ,float z){ super(0.5); if(baseShape is null){ baseShape = new SH_Pole(a ,b ,4); } shape = cast(Shape)baseShape.clone(); size = 20; collisionRange = 10; pos = new Vector3(x ,y ,z); this.rpos = cast(Vector3)this.pos.clone(); this.aim = aim; } public void move(){ super.move(); poseZ += 5; } } public class MiddleEnemy1:Enemy{ private: static Shape baseShape; static float[][] a = [ [-0.6 ,-1 ,-0.6 ,1.0 ,0.4], [-0.6 ,0 ,0 ,0 ,0.4] ]; static float[][] b = [ [0 ,0.5 ,1.0 ,0.4 ,0], [0 ,0.6 ,0.6 ,0.6,0] ]; double aim; public this(float x,float y ,float z ,float aim){ super(6); if(baseShape is null){ baseShape = new SH_Pole(a ,b ,6); } shape = cast(Shape)baseShape.clone(); shape.multi(1.5); size = 50; collisionRange = 25; pos = new Vector3(x ,y ,z); this.rpos = cast(Vector3)this.pos.clone(); this.aim = aim; poseZ = aim * 180.0 / PI; } public void move(){ super.move(); float speed = 0.0; if(cnt < 60)speed = cast(float)(60 - (cnt % 60)) / 30.0; else{ if(((cnt - 60) % 180) == 0)new AttackRing(this ,"en1" ,30); else if(((cnt - 60) % 180) == 10)new AttackRing(this ,"en2" ,30); else if(((cnt - 60) % 180) == 20)new AttackRing(this ,"en3" ,30); } pos.x += speed * cos(aim); pos.y += speed * sin(aim); poseX += 1; } public void reportRing(Ring ring){ switch(ring.name){ case "en1": new Enemy1(rpos, aim ,1.3); break; case "en2": new Enemy1(rpos, aim + PI / 6.0 ,1.3); new Enemy1(rpos, aim - PI / 6.0 ,1.3); break; case "en3": new Enemy1(rpos, aim + PI * 2.0 / 6.0 ,1.3); new Enemy1(rpos, aim - PI * 2.0 / 6.0 ,1.3); break; default:break; } } } public class Zab:Enemy{ private: static Shape baseShape; static float[][] a = [ [0.0 ,-1.0 ,0.0 ,1.0 ,0.0] ]; static float[][] b = [ [0.0 ,0.5 ,1.0 ,0.5 ,0.0] ]; double aim; double speed; public this(float x,float y ,float z){ super(0.5); if(baseShape is null){ baseShape = new SH_Pole(a ,b ,4); } shape = cast(Shape)baseShape.clone(); size = 20; collisionRange = 10; pos = new Vector3(x ,y ,z); this.rpos = cast(Vector3)this.pos.clone(); this.aim = atan2(ship.pos.y-pos.y ,ship.pos.x-pos.x); speed = 0.0; poseY = 90; } public void move(){ super.move(); pos.x += speed * cos(aim); pos.y += speed * sin(aim); if(speed < 5.0)speed += 0.2; poseZ += 3; } } public class BackBone:Enemy{ private: static Shape baseShape; static float[][] a = [ [-1.3 ,-0.8 ,0.0 ,0.8 ,1.3] ]; static float[][] b = [ [0.3 ,0.8 ,1.0 ,0.8 ,0.3] ]; double aim; public this(float x,float y ,float z){ super(3); if(baseShape is null){ baseShape = new SH_Pole(a ,b ,4); } shape = cast(Shape)baseShape.clone(); size = 30; collisionRange = 15; pos = new Vector3(x ,y ,z); this.rpos = cast(Vector3)this.pos.clone(); this.aim = 0.0; } public void move(){ super.move(); if(parent is null || !parent.exists){ if(rpos.z < -800 - 2)pos.z +=2.0; else if(-800 + 2 < rpos.z)pos.z -= 2.0; double saim = atan2(ship.pos.y-pos.y,ship.pos.x-pos.x); if(raimmark(aim , saim) > 0.0)aim += 0.6 * PI / 180.0; else aim -= 0.6 * PI / 180.0; poseZ = aim * 180.0 / PI; pos.x += 2 * cos(aim); pos.y += 2 * sin(aim); }else{ if(rpos.z < -800 - 1)pos.z +=0.5; else if(-800 + 1 < rpos.z)pos.z -= 0.5; aim = rposeZ*PI/180.0; } poseX += 3; } } public class Boss1:Boss{ //import br.mainloop; private{ double aim; static Shape baseShape; static float[][] a = [ [-1.0 ,0.0 ,2.0], [-1.0 ,0.0 ,2.0] ]; static float[][] b = [ [0.0 ,1.0 ,0.0], [0.0 ,0.5 ,0.0] ]; } public this(double x,double y,double z,double aim){ super(10); Matrix po = new Matrix(); pos = new Vector3(x ,y ,z); this.rpos = cast(Vector3)this.pos.clone(); setPoseBase(po); this.aim = aim; size = 40; collisionRange = 20; if(baseShape is null){ baseShape = new SH_Pole(a ,b ,8); } shape = cast(Shape)baseShape.clone(); addAnimation(new Rotate(0 ,POSEX ,3 ,0.0 ,true),"rotate"); Parts p; p = new EnemyAppend(Octahedron.getShape() ,20 ,-1); (cast(Enemy)p).disableBorder(); addChild(p ,"jointl1", 70 ,ENGAGED ,matRotateZ(90) * matRotateZ(-30) ,matRotateZ(-30)); p = new Turret();//(Turret1.getShape() ,30 ,-1); (cast(Enemy)p).disableBorder(); childHash["jointl1"].addChild(p ,"turretl1", 70 ,ENGAGED ,matRotateZ(90) * matRotateZ(-60) ,matRotateZ(-60)); p = new EnemyAppend(Octahedron.getShape() ,20 ,-1); (cast(Enemy)p).disableBorder(); childHash["turretl1"].addChild(p ,"jointl2", 70 ,ENGAGED ,matRotateZ(90) * matRotateZ(-90) ,matRotateZ(-90)); p = new Turret();//(Turret1.getShape() ,30 ,-1); (cast(Enemy)p).disableBorder(); childHash["jointl2"].addChild(p ,"turretl2", 70 ,ENGAGED ,matRotateZ(90) * matRotateZ(-120) ,matRotateZ(-120)); p = new EnemyAppend(Octahedron.getShape() ,20 ,-1); (cast(Enemy)p).disableBorder(); addChild(p ,"jointr1", 70 ,ENGAGED ,matRotateZ(-90) * matRotateZ(30) ,matRotateZ(30)); p = new Turret();//Turret1.getShape() ,30 ,-1); (cast(Enemy)p).disableBorder(); childHash["jointr1"].addChild(p ,"turretr1", 70 ,ENGAGED ,matRotateZ(-90) * matRotateZ(60) ,matRotateZ(60)); p = new EnemyAppend(Octahedron.getShape() ,20 ,-1); (cast(Enemy)p).disableBorder(); childHash["turretr1"].addChild(p ,"jointr2", 70 ,ENGAGED ,matRotateZ(-90) * matRotateZ(90) ,matRotateZ(90)); p = new Turret();//(Turret1.getShape() ,30 ,-1); (cast(Enemy)p).disableBorder(); childHash["jointr2"].addChild(p ,"turretr2", 70 ,ENGAGED ,matRotateZ(-90) * matRotateZ(120) ,matRotateZ(120)); rotateAll(matRotateZ(180 ) * matRotateX(90));// * matRotateX(90 ) ); addAnimation(new RotateAll(100 ,matRotateX(-0.9),false), "rotate" ); // addAnimation(new RotateAll(0 ,matRotateX(2),true), "rotate" ); // childHash["joint1"].addAnimation(new Swing(200 ,POSEZ ,-0.4 ,0.8 ,20 ,true) ,"swing2"); } public void move(){ super.move(); switch(state){ case "start": if(rpos.z < -800 - 2)pos.z +=2; else if(-800 + 2 < rpos.z)pos.z -= 2; else { pos.z = -800; childHash["jointl1"].addAnimation(new RotateTo(60 ,BOTHZ ,30 ,1.0 ,false) ,"rotate1"); childHash["jointr1"].addAnimation(new RotateTo(60 ,BOTHZ ,-30 ,1.0 ,false) ,"rotate2"); changeState("standby"); } break; case "standby": if(nowStateCnt >= 60){ childHash["jointl1"].addAnimation(new Swing(200 ,BOTHZ ,-0.3 ,0.8 ,-10 ,true) ,"swing1"); childHash["jointr1"].addAnimation(new Swing(200 ,BOTHZ ,0.3 ,0.8 ,-10 ,true) ,"swing2"); changeState("attack"); } break; case "attack": if(nowStateCnt % 300 < 90 && nowStateCnt % 30 == 0){ // new AttackRing(this ,"shot",30); new AttackRing(cast(Enemy)childHash["turretr1"] ,"shot",30); new AttackRing(cast(Enemy)childHash["turretr2"] ,"shot",30); new AttackRing(cast(Enemy)childHash["turretl1"] ,"shot",30); new AttackRing(cast(Enemy)childHash["turretl2"] ,"shot",30); } break; default:break; } } public void reportRing(Ring ring){ for(double rad=PI/2.0;rad<=PI*3.0/2.0;rad+=PI/36){ new SlowStraightBullet(pos ,true, rad); } } } public class Boss2:Boss{ private: double aim; static Shape baseShape; static float[] a = [-1.2 ,-0.8 ,0.7 ,1.5 ,0.7 ,-0.8 ,-1.2]; static float[] b = [0.0 ,0.7 ,0.4 ,0.0 ,-0.4 ,-0.7 ,0.0]; static float[] z= [-0.7 ,-0.5 ,0.0 ,0.5 ,0.7]; static float[] scale = [0.0 ,0.8 ,1.0 ,0.8 ,0.0]; bool att; public this(double x0,double y0,double z0,double aim){ super(10); Matrix po = new Matrix(); pos = new Vector3(x0 ,y0 ,z0); this.rpos = cast(Vector3)this.pos.clone(); setPoseBase(po); this.aim = aim; size = 40; collisionRange = 20; if(baseShape is null){ baseShape = new SH_Pot(a ,b ,z ,scale); } shape = cast(Shape)baseShape.clone(); Parts p; p = new BackBone(x0 ,y0 ,z0); addChild(p ,"bone1", 70 ,FOLLOW); (cast(Enemy)p).disableBorder(); p = new BackBone(x0 ,y0 ,z0); childHash["bone1"].addChild(p ,"bone2", 90 ,FOLLOW); (cast(Enemy)p).disableBorder(); p = new BackBone(x0 ,y0 ,z0); childHash["bone2"].addChild(p ,"bone3", 80 ,FOLLOW); (cast(Enemy)p).disableBorder(); p = new BackBone(x0 ,y0 ,z0); childHash["bone3"].addChild(p ,"bone4", 80 ,FOLLOW); (cast(Enemy)p).disableBorder(); p = new BackBone(x0 ,y0 ,z0); childHash["bone4"].addChild(p ,"bone5", 80 ,FOLLOW); (cast(Enemy)p).disableBorder(); p = new BackBone(x0 ,y0 ,z0); childHash["bone5"].addChild(p ,"bone6", 80 ,FOLLOW); (cast(Enemy)p).disableBorder(); /* p = new BackBone(x0 ,y0 ,z0); childHash["bone6"].addChild(p ,"bone7", 80 ,FOLLOW); (cast(Enemy)p).disableBorder(); p = new BackBone(x0 ,y0 ,z0); childHash["bone7"].addChild(p ,"bone8", 80 ,FOLLOW); (cast(Enemy)p).disableBorder(); */ att = true; } public void move(){ super.move(); float speed = 1.5; switch(state){ case "start": if(rpos.z < -800 - 20)pos.z +=2.0; else if(-800 + 20 < rpos.z)pos.z -= 2.0; else { // pos.z = -800; changeState("standby"); } aim += 0.8 * PI / 180.0; break; case "standby": if(rpos.z < -800 - 2)pos.z +=2.0; else if(-800 + 2 < rpos.z)pos.z -= 2.0; else { pos.z = -800; changeState("straight"); } break; case "homing": double saim = atan2(ship.pos.y-pos.y,ship.pos.x-pos.x); if(raimmark(aim , saim) > 0.0)aim += 1.2 * PI / 180.0; else aim -= 1.2 * PI / 180.0; if(nowStateCnt > 90){ changeState("straight"); } break; case "straight": if(nowStateCnt > 100){ // att ^=true; changeState("homing"); } if(/*att && */(nowStateCnt == 10)){ new AttackRing(this ,"angle1",45); } speed = 2.5; break; default:break; } poseZ = aim * 180.0 / PI; poseX += 3; pos.x += speed * cos(aim); pos.y += speed * sin(aim); } public void reportRing(Ring ring){ for(double rad=-PI;rad<=PI;rad+=PI/36){ new StraightBullet(pos ,true, rad + aim ,1.5); } /* double s1,s2; s1 = 1.9; s2 = 2.0; switch(ring.name){ case "angle1": for(double rad=-PI;rad 120 && nowStateCnt % 10 == 0){ if("bone14" in childHash)new AttackRing(cast(Enemy)childHash["bone14"], "shot",30); if("bone24" in childHash)new AttackRing(cast(Enemy)childHash["bone24"], "shot",30); if("bone34" in childHash)new AttackRing(cast(Enemy)childHash["bone34"], "shot",30); if("bone44" in childHash)new AttackRing(cast(Enemy)childHash["bone44"], "shot",30); } break; case "attack3": if(pos.x < 200)pos.x += 0.7; else { changeState("attack4"); if("bone12" in childHash)childHash["bone12"].addAnimation(new RotateTo(120 ,BOTHZ ,430 ,0.8) ,"bend"); if("bone22" in childHash)childHash["bone22"].addAnimation(new RotateTo(120 ,BOTHZ ,430 ,0.8) ,"bend"); if("bone32" in childHash)childHash["bone32"].addAnimation(new RotateTo(120 ,BOTHZ ,430 ,0.8) ,"bend"); if("bone42" in childHash)childHash["bone42"].addAnimation(new RotateTo(120 ,BOTHZ ,430 ,0.8) ,"bend"); } if(nowStateCnt % 240 == 40)new AttackRing(this, "all",45); break; case "attack4": if(420 < nowStateCnt){ if("bone11" in childHash)childHash["bone11"].addAnimation(new RotateTo(60 ,BOTHZ ,360) ,"fix"); if("bone21" in childHash)childHash["bone21"].addAnimation(new RotateTo(60 ,BOTHZ ,360) ,"fix"); if("bone31" in childHash)childHash["bone31"].addAnimation(new RotateTo(60 ,BOTHZ ,360) ,"fix"); if("bone41" in childHash)childHash["bone41"].addAnimation(new RotateTo(60 ,BOTHZ ,360) ,"fix"); if("bone12" in childHash)childHash["bone12"].addAnimation(new RotateTo(60 ,BOTHZ ,360) ,"fix"); if("bone22" in childHash)childHash["bone22"].addAnimation(new RotateTo(60 ,BOTHZ ,360) ,"fix"); if("bone32" in childHash)childHash["bone32"].addAnimation(new RotateTo(60 ,BOTHZ ,360) ,"fix"); if("bone42" in childHash)childHash["bone42"].addAnimation(new RotateTo(60 ,BOTHZ ,360) ,"fix"); if("bone13" in childHash)childHash["bone13"].addAnimation(new RotateTo(60 ,BOTHZ ,360) ,"fix"); if("bone23" in childHash)childHash["bone23"].addAnimation(new RotateTo(60 ,BOTHZ ,360) ,"fix"); if("bone33" in childHash)childHash["bone33"].addAnimation(new RotateTo(60 ,BOTHZ ,360) ,"fix"); if("bone43" in childHash)childHash["bone43"].addAnimation(new RotateTo(60 ,BOTHZ ,360) ,"fix"); if("bone14" in childHash)childHash["bone14"].addAnimation(new RotateTo(60 ,BOTHZ ,360) ,"fix"); if("bone24" in childHash)childHash["bone24"].addAnimation(new RotateTo(60 ,BOTHZ ,360) ,"fix"); if("bone34" in childHash)childHash["bone34"].addAnimation(new RotateTo(60 ,BOTHZ ,360) ,"fix"); if("bone44" in childHash)childHash["bone44"].addAnimation(new RotateTo(60 ,BOTHZ ,360) ,"fix"); changeState("attack1"); } if(nowStateCnt > 120 && nowStateCnt % 10 == 0){ if("bone14" in childHash)new AttackRing(cast(Enemy)childHash["bone14"], "shot",30); if("bone24" in childHash)new AttackRing(cast(Enemy)childHash["bone24"], "shot",30); if("bone34" in childHash)new AttackRing(cast(Enemy)childHash["bone34"], "shot",30); if("bone44" in childHash)new AttackRing(cast(Enemy)childHash["bone44"], "shot",30); } break; default:break; } rotateAll(matRotateZ(0.7)); } public void reportRing(Ring ring){ for(double rad=-PI;rad<=PI;rad+=PI/36){ new StraightBullet(pos ,true, rad + aim ,1.8); } } } /* public class Boss4:Boss{ private: double aim; static Shape baseShape; static float[][] a = [ [-0.6 ,-1.2 ,-0.2 ,1.0], [-0.6 ,-0.2 ,0.2 ,1.0] ]; static float[][] b = [ [0.0 ,1.6 ,1.3 ,0.0], [0.0 ,0.8 ,0.8 ,0.0] ]; public this(double x0,double y0,double z0,double aim){ super(10); Matrix po = matRotateX(90); pos = new Vector3(x0 ,y0 ,z0); setPoseBase(po); this.aim = aim; size = 40; collisionRange = 20; if(baseShape is null){ baseShape = new SH_Pole(a ,b ,4); } shape = cast(Shape)baseShape.clone(); Parts p; p = new Arm(); addChild(p ,"armr", 100 ,NORMAL ,new Matrix()); (cast(Enemy)p).disableBorder();p.linkY =110; p = new EnemyAppend(BulletShape.getShape() ,20 ,-1); childHash["armr"].addChild(p ,"finr1", 20 ,ENGAGED ,new Matrix());// ,matRotateY(50) * matRotateZ(180)); (cast(Enemy)p).disableBorder();p.linkY =p.poseY =-130;p.linkY -= 110; p = new EnemyAppend(BulletShape.getShape() ,20 ,-1); childHash["armr"].addChild(p ,"finr2", 20 ,ENGAGED ,new Matrix());// ,matRotateY(-30)*matRotateX(60) * matRotateZ(180)); (cast(Enemy)p).disableBorder();p.linkY =p.poseY =30;p.linkZ =p.poseZ = 120;;p.linkY -= 110; p = new EnemyAppend(BulletShape.getShape() ,20 ,-1); childHash["armr"].addChild(p ,"finr3", 20 ,ENGAGED ,new Matrix());// ,matRotateY(-30)*matRotateX(-60) * matRotateZ(180)); (cast(Enemy)p).disableBorder();p.linkY =p.poseY =30;p.linkZ =p.poseZ = -120;;p.linkY -= 110; p = new Arm(); addChild(p ,"arml", 100 ,NORMAL ,new Matrix()); (cast(Enemy)p).disableBorder();p.linkY = -110; p = new EnemyAppend(BulletShape.getShape() ,20 ,-1); childHash["arml"].addChild(p ,"finl1", 20 ,ENGAGED ,new Matrix());// ,matRotateY(-50) * matRotateZ(180)); (cast(Enemy)p).disableBorder();p.linkY =p.poseY =130;p.linkY += 110; p = new EnemyAppend(BulletShape.getShape() ,20 ,-1); childHash["arml"].addChild(p ,"finl2", 20 ,ENGAGED ,new Matrix());// ,matRotateY(30)*matRotateX(60) * matRotateZ(180)); (cast(Enemy)p).disableBorder();p.linkY =p.poseY =-30;p.linkZ =p.poseZ = 120;p.linkY += 110; p = new EnemyAppend(BulletShape.getShape() ,20 ,-1); childHash["arml"].addChild(p ,"finl3", 20 ,ENGAGED ,new Matrix());// ,matRotateY(30)*matRotateX(-60) * matRotateZ(180)); (cast(Enemy)p).disableBorder();p.linkY =p.poseY =-30;p.linkZ =p.poseZ = -120;p.linkY += 110; // rotateAll(matRotateX(90)); // addAnimation(new RotateAll(90 ,matRotateX(1)) ,"turn"); addAnimation(new Rotate(90 , POSEX ,1) ,"roll1"); // childHash["arml"].addAnimation(new Rotate(90 , LINKX ,1) ,"roll1"); // childHash["armr"].addAnimation(new Rotate(90 , LINKX ,1) ,"roll1"); } public void move(){ super.move(); switch(state){ case "start": if(nowStateCnt == 90){ addAnimation(new Rotate(60 , POSEY ,3) ,"turn"); changeState("standby"); } pos.x += 7.0; break; case "standby": if(nowStateCnt == 90){ changeState("attack"); addAnimation(new RotateAll(90 ,matRotateX(2) ,true) ,"roll1" ); } if(rpos.z < -800 - 2)pos.z +=4.0; else if(-800 + 2 < rpos.z)pos.z -= 4.0; if(nowStateCnt < 30)pos.x += 5.0; else pos.x -= 1.0; break; case "attack": break; default:break; } // Log_write(cast(int)rlinkX); // rotateAll(matRotateX(1)); } } */ public class Boss4:Boss{ //import br.mainloop; private{ double aim; static Shape baseShape; static float[][] a = [ [-1.0 ,0.0 ,1.0] ]; static float[][] b = [ [0.0 ,1.0 ,0.0] ]; bool headright; } public this(double x,double y,double z,double aim){ super(13); Matrix po = matRotate(-90 ,0 ,0 ,1) * matRotate(45 ,1 ,0 ,0); pos = new Vector3(x ,y ,z); this.rpos = cast(Vector3)this.pos.clone(); setPoseBase(po); this.aim = aim; //super(pos ,po); //set(pos ,p); //setPoseBase(p); size = 30; collisionRange = 10; headright = true; if(baseShape is null){ baseShape = new SH_Pole(a ,b ,4); } shape = cast(Shape)baseShape.clone(); Parts p;//Parts p; //wing p = new EnemyAppend(BaseOfWing.getShape() ,45 ,-1);//new BaseOfWing(); (cast(Enemy)p).disableBorder(); //partsManager.add(wing1); addChild(p, "rWingBase", 60 ,NORMAL ,matRotateX(90) * matRotateX(-20)); p = new EnemyAppend(BaseOfWing.getShape() ,30 ,-1);//p = new BaseOfWing(); (cast(Enemy)p).disableBorder(); //partsManager.add(wing2); addChild(p, "lWingBase",60 ,NORMAL ,matRotateX(90) * matRotateZ(180)* matRotateX(- 20) ); p = new EnemyAppend(Tail.getShape() ,30 ,-1);//p = new Tail(); (cast(Enemy)p).disableBorder(); addChild(p, "tail_0", 60 ,ENGAGED ,matRotateX(90) * matRotateY(0) * matRotateZ(-90)); p = new HeadTurret(40);//p = new Head(); (cast(Enemy)p).disableBorder(); addChild(p, "head" ,60 ,NORMAL ,matRotateX(90) * matRotateZ(90) ,matRotateZ(-30) * matRotateY(90)); for(int i = 0;i < 5;i ++){ char[] rw0 = "rWing_"~str.toString(i)~"_"~str.toString(0); char[] rw1 = "rWing_"~str.toString(i)~"_"~str.toString(1); char[] rw2 = "rWing_"~str.toString(i)~"_"~str.toString(2); char[] rw3 = "rWing_"~str.toString(i)~"_"~str.toString(3); char[] lw0 = "lWing_"~str.toString(i)~"_"~str.toString(0); char[] lw1 = "lWing_"~str.toString(i)~"_"~str.toString(1); char[] lw2 = "lWing_"~str.toString(i)~"_"~str.toString(2); char[] lw3 = "lWing_"~str.toString(i)~"_"~str.toString(3); p = new EnemyAppend(Wing.getShape() ,30 ,-1);//p = new Wing(); (cast(Enemy)p).disableBorder(); //partsManager.add(append); childHash["rWingBase"].addChild(p ,rw0 ,60 ,ENGAGED ,matRotateX(90) * matRotateZ(30 * (i - 2)) * matRotateX(-20) ); p = new EnemyAppend(Wing.getShape() ,30 ,-1);//p = new Wing(); (cast(Enemy)p).disableBorder(); childHash[rw0].addChild(p ,rw1 ,60 , ENGAGED);//matRotateX(PI / 2.0) * matRotateZ(PI * (i - 2) / 6)); p = new EnemyAppend(Wing.getShape() ,30 ,-1);//p = new Wing(); (cast(Enemy)p).disableBorder(); //partsManager.add(append3); childHash[rw1].addChild(p ,rw2 ,60 , ENGAGED); p = new WingTurret(30);//p = new Wing(); (cast(Enemy)p).disableBorder(); //partsManager.add(append3); childHash[rw2].addChild(p ,rw3 ,60 , ENGAGED); p = new EnemyAppend(Wing.getShape() ,30 ,-1);//p = new Wing(); (cast(Enemy)p).disableBorder(); //partsManager.add(append); childHash["lWingBase"].addChild(p ,lw0 ,60 ,ENGAGED ,matRotateX(90) * matRotateZ(180 - 30 * (i - 2.0)) * matRotateX(-20)) ; p = new EnemyAppend(Wing.getShape() ,30 ,-1);//p = new Wing(); (cast(Enemy)p).disableBorder(); //partsManager.add(append2); childHash[lw0].addChild(p ,lw1 ,60 , ENGAGED);//matRotateX(PI / 2.0) * matRotateZ(PI * (1.0 + ((i - 2.0) / 6.0)))); p = new EnemyAppend(Wing.getShape() ,30 ,-1);//p = new Wing(); (cast(Enemy)p).disableBorder(); //partsManager.add(append3); childHash[lw1].addChild(p ,lw2 ,60 , ENGAGED); p = new WingTurret(30);//p = new Wing(); (cast(Enemy)p).disableBorder(); //partsManager.add(append3); childHash[lw2].addChild(p ,lw3 ,60 , ENGAGED); } for(int i = 1;i < 4;i ++){ char[] t1 = "tail_"~str.toString(i-1); char[] t2 = "tail_"~str.toString(i); p = new EnemyAppend(Tail.getShape() ,30 ,-1);//p = new Tail(); (cast(Enemy)p).disableBorder(); childHash[t1].addChild(p ,t2 ,60 ,ENGAGED); //append2 = append; } p = new TailTurret(30);//p = new Tail(); (cast(Enemy)p).disableBorder(); childHash["tail_3"].addChild(p ,"tail_4" ,60 ,ENGAGED); changeScale(1.3 ,true); rotateAll(matRotateX(-30 ) ); rotateAll(matRotateY(120 ) ); childHash["tail_0"].addAnimation(new Swing(200 ,BOTHZ ,-0.4 ,0.8 ,20 ,true) ,"swing"); childHash["lWingBase"].addAnimation(new Swing(120 ,BOTHZ ,-0.7 ,0.9 ,20 ,true) ,"swing"); childHash["rWingBase"].addAnimation(new Swing(120 ,BOTHZ ,-0.7 ,0.9 ,20 ,true) ,"swing"); childHash["head"].addAnimation(new RotateTo(120 ,BOTHZ ,-30 ,0.0 ) ,"nod"); addAnimation(new RotateAll(200 ,matRotateY(0.2)) ,"turn"); } public void move(){ super.move(); switch(state){ case "start": if(rpos.z < -800 - 2)pos.z +=2.0; else if(-800 + 2 < rpos.z)pos.z -= 2.0; else { if("head" in childHash && childHash["head"])childHash["head"].addAnimation(new RotateTo(70 ,POSEY ,80) ,"turn1"); headright ^= true; changeState("attack1"); } break; case "attack1": if("head" in childHash && childHash["head"]){ if(!childHash["head"].inAnimation("turn1")){ if(headright)childHash["head"].addAnimation(new RotateTo(140 ,POSEY ,80) ,"turn1"); else childHash["head"].addAnimation(new RotateTo(140 ,POSEY ,-80) ,"turn1"); headright ^= true; } } if(nowStateCnt == 270){ changeState("stop1"); if("head" in childHash && childHash["head"]){ childHash["head"].addAnimation(new RotateTo(60 ,POSEY ,0) ,"fix"); } } if(nowStateCnt % 7 == 0){ if("head" in childHash && childHash["head"])new AttackRing(cast(Enemy)childHash["head"] ,"laser" ,30); } if(110 <= nowStateCnt && nowStateCnt < 130 && nowStateCnt % 11 == 0){ if("rWing_0_3" in childHash && childHash["rWing_0_3"])new AttackRing(cast(Enemy)childHash["rWing_0_3"] ,"laser" ,60); if("rWing_1_3" in childHash && childHash["rWing_1_3"])new AttackRing(cast(Enemy)childHash["rWing_1_3"] ,"laser" ,60); if("rWing_2_3" in childHash && childHash["rWing_2_3"])new AttackRing(cast(Enemy)childHash["rWing_2_3"] ,"laser" ,60); if("rWing_3_3" in childHash && childHash["rWing_3_3"])new AttackRing(cast(Enemy)childHash["rWing_3_3"] ,"laser" ,60); if("rWing_4_3" in childHash && childHash["rWing_4_3"])new AttackRing(cast(Enemy)childHash["rWing_4_3"] ,"laser" ,60); if("lWing_0_3" in childHash && childHash["lWing_0_3"])new AttackRing(cast(Enemy)childHash["lWing_0_3"] ,"laser" ,60); if("lWing_1_3" in childHash && childHash["lWing_1_3"])new AttackRing(cast(Enemy)childHash["lWing_1_3"] ,"laser" ,60); if("lWing_2_3" in childHash && childHash["lWing_2_3"])new AttackRing(cast(Enemy)childHash["lWing_2_3"] ,"laser" ,60); if("lWing_3_3" in childHash && childHash["lWing_3_3"])new AttackRing(cast(Enemy)childHash["lWing_3_3"] ,"laser" ,60); if("lWing_4_3" in childHash && childHash["lWing_4_3"])new AttackRing(cast(Enemy)childHash["lWing_4_3"] ,"laser" ,60); } /* if(nowStateCnt % 30 == 0){ if("tail_4" in childHash && childHash["tail_4"])new AttackRing(cast(Enemy)childHash["tail_4"] ,"enemy" ,60); } */ /* if(nowStateCnt % 30 == 0){ if("rWing_0_3" in childHash && childHash["rWing_0_3"])new AttackRing(cast(Enemy)childHash["rWing_0_3"] ,"laser" ,30); if("rWing_1_3" in childHash && childHash["rWing_1_3"])new AttackRing(cast(Enemy)childHash["rWing_1_3"] ,"laser" ,30); if("rWing_2_3" in childHash && childHash["rWing_2_3"])new AttackRing(cast(Enemy)childHash["rWing_2_3"] ,"laser" ,30); if("rWing_3_3" in childHash && childHash["rWing_3_3"])new AttackRing(cast(Enemy)childHash["rWing_3_3"] ,"laser" ,30); if("rWing_4_3" in childHash && childHash["rWing_4_3"])new AttackRing(cast(Enemy)childHash["rWing_4_3"] ,"laser" ,30); if("lWing_0_3" in childHash && childHash["lWing_0_3"])new AttackRing(cast(Enemy)childHash["lWing_0_3"] ,"laser" ,30); if("lWing_1_3" in childHash && childHash["lWing_1_3"])new AttackRing(cast(Enemy)childHash["lWing_1_3"] ,"laser" ,30); if("lWing_2_3" in childHash && childHash["lWing_2_3"])new AttackRing(cast(Enemy)childHash["lWing_2_3"] ,"laser" ,30); if("lWing_3_3" in childHash && childHash["lWing_3_3"])new AttackRing(cast(Enemy)childHash["lWing_3_3"] ,"laser" ,30); if("lWing_4_3" in childHash && childHash["lWing_4_3"])new AttackRing(cast(Enemy)childHash["lWing_4_3"] ,"laser" ,30); } */ break; case "stop1": if(nowStateCnt == 30){ addAnimation(new RotateAll(100 ,matRotateY(0.4)) ,"turn"); changeState("move1"); } break; case "move1": if(-100 < rpos.x)pos.x -= 1.0; else{ changeState("attack2"); } if(nowStateCnt % 30 == 0){ if("tail_4" in childHash && childHash["tail_4"])new AttackRing(cast(Enemy)childHash["tail_4"] ,"enemy" ,60); } break; case "attack2": if("head" in childHash && childHash["head"]){ if(!childHash["head"].inAnimation("turn1")){ if(headright)childHash["head"].addAnimation(new RotateTo(140 ,POSEY ,80) ,"turn1"); else childHash["head"].addAnimation(new RotateTo(140 ,POSEY ,-80) ,"turn1"); headright ^= true; } } if(nowStateCnt == 270){ changeState("stop2"); if("head" in childHash && childHash["head"]){ childHash["head"].addAnimation(new RotateTo(60 ,POSEY ,0) ,"fix"); } } if(nowStateCnt % 7 == 0){ if("head" in childHash && childHash["head"])new AttackRing(cast(Enemy)childHash["head"] ,"laser" ,30); } if(110 <= nowStateCnt && nowStateCnt < 130 && nowStateCnt % 10 == 0){ if("rWing_0_3" in childHash && childHash["rWing_0_3"])new AttackRing(cast(Enemy)childHash["rWing_0_3"] ,"laser" ,60); if("rWing_1_3" in childHash && childHash["rWing_1_3"])new AttackRing(cast(Enemy)childHash["rWing_1_3"] ,"laser" ,60); if("rWing_2_3" in childHash && childHash["rWing_2_3"])new AttackRing(cast(Enemy)childHash["rWing_2_3"] ,"laser" ,60); if("rWing_3_3" in childHash && childHash["rWing_3_3"])new AttackRing(cast(Enemy)childHash["rWing_3_3"] ,"laser" ,60); if("rWing_4_3" in childHash && childHash["rWing_4_3"])new AttackRing(cast(Enemy)childHash["rWing_4_3"] ,"laser" ,60); if("lWing_0_3" in childHash && childHash["lWing_0_3"])new AttackRing(cast(Enemy)childHash["lWing_0_3"] ,"laser" ,60); if("lWing_1_3" in childHash && childHash["lWing_1_3"])new AttackRing(cast(Enemy)childHash["lWing_1_3"] ,"laser" ,60); if("lWing_2_3" in childHash && childHash["lWing_2_3"])new AttackRing(cast(Enemy)childHash["lWing_2_3"] ,"laser" ,60); if("lWing_3_3" in childHash && childHash["lWing_3_3"])new AttackRing(cast(Enemy)childHash["lWing_3_3"] ,"laser" ,60); if("lWing_4_3" in childHash && childHash["lWing_4_3"])new AttackRing(cast(Enemy)childHash["lWing_4_3"] ,"laser" ,60); } break; case "stop2": if(nowStateCnt == 60){ addAnimation(new RotateAll(100 ,matRotateY(-0.4)) ,"turn"); changeState("move2"); } break; case "move2": if(rpos.x < 100)pos.x += 1.0; else{ changeState("attack1"); } if(nowStateCnt % 30 == 0){ if("tail_4" in childHash && childHash["tail_4"])new AttackRing(cast(Enemy)childHash["tail_4"] ,"enemy" ,60); } break; default:break; } /* if(cnt > 200){ Animation swing = childHash["tail_0"].animes["swing"]; if(swing !is null && swing.count % swing.span == 0){ swing.vanish(); childHash["tail_0"].addAnimation(new Swing(200 ,BOTHZ ,-0.6 ,0.9 ,20 ,true) ,"swing"); } } */ } } public class Boss5:Boss{ //import br.mainloop; private{ double aim; static Shape baseShape; static float[] a = [-1.0 ,-0.7 ,0.6 ,1.0 ,0.8 ,1.0 ,0.6 ,-0.7 ,-1.0]; static float[] b = [0.3 ,1.0 ,0.8 ,0.3 ,0.0 ,-0.3 ,-0.8 ,-1.0 ,-0.3]; static float[] sz = [-0.5 ,0.0 ,0.5]; static float[] scale = [0.6 ,1.0 ,0.6]; } public this(double x,double y,double z,double aim){ super(9); Matrix po = matRotateX(0); pos = new Vector3(x ,y ,z); this.rpos = cast(Vector3)this.pos.clone(); setPoseBase(po); this.aim = aim; //super(pos ,po); //set(pos ,p); //setPoseBase(p); size = 60; collisionRange = 30; if(baseShape is null){ baseShape = new SH_Pot(a ,b ,sz ,scale); } shape = cast(Shape)baseShape.clone(); Parts p;//Parts p; p = new EnemyAppend(TubeShape.getShape() ,30 ,8);//new BaseOfWing(); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(); //partsManager.add(wing1); addChild(p, "tube1", 110 ,ENGAGED );p.linkZ = p.poseZ = 90; p = new NailTurret(30);//new BaseOfWing(); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(); //partsManager.add(wing1); childHash["tube1"].addChild(p, "nail1", 110 ,ENGAGED); p = new EnemyAppend(TubeShape.getShape() ,30 ,8);//new BaseOfWing(); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(); //partsManager.add(wing1); addChild(p, "tube2", 110 ,ENGAGED);p.linkZ = p.poseZ = 45; p = new NailTurret(30);//new BaseOfWing(); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(); //partsManager.add(wing1); childHash["tube2"].addChild(p, "nail2", 110 ,ENGAGED);// ,matRotateZ(0)); p = new EnemyAppend(TubeShape.getShape() ,30 ,8);//new BaseOfWing(); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(); //partsManager.add(wing1); addChild(p, "tube3", 110 ,ENGAGED);p.linkZ = p.poseZ = -45; p = new NailTurret(30);//new BaseOfWing(); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(); //partsManager.add(wing1); childHash["tube3"].addChild(p, "nail3", 110 ,ENGAGED);// ,matRotateZ(0)); p = new EnemyAppend(TubeShape.getShape() ,30 ,8);//new BaseOfWing(); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(); //partsManager.add(wing1); addChild(p, "tube4", 110 ,ENGAGED);p.linkZ = p.poseZ = -90; p = new NailTurret(30);//new BaseOfWing(); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(); //partsManager.add(wing1); childHash["tube4"].addChild(p, "nail4", 110 ,ENGAGED); if("tube1" in childHash && childHash["tube1"].exists)childHash["tube1"].addAnimation( new RotateTo(60 ,BOTHZ ,20 ,1.0) ,"pose"); if("tube2" in childHash && childHash["tube2"].exists)childHash["tube2"].addAnimation( new RotateTo(60 ,BOTHZ ,10 ,1.0) ,"pose"); if("tube3" in childHash && childHash["tube3"].exists)childHash["tube3"].addAnimation( new RotateTo(60 ,BOTHZ ,-10 ,1.0) ,"pose"); if("tube4" in childHash && childHash["tube4"].exists)childHash["tube4"].addAnimation( new RotateTo(60 ,BOTHZ ,-20 ,1.0) ,"pose"); } public void move(){ super.move(); switch(state){ case "start": if(rpos.z < -800 - 2.0)pos.z += 2.0; else if(rpos.z > -800 + 2.0)pos.z -= 2.0; else changeState("attack"); if(nowStateCnt == 61){ if("tube1" in childHash && childHash["tube1"].exists)childHash["tube1"].addAnimation( new RotateTo(60 ,BOTHZ ,90 ,1.0) ,"pose"); if("tube2" in childHash && childHash["tube2"].exists)childHash["tube2"].addAnimation( new RotateTo(60 ,BOTHZ ,45 ,1.0) ,"pose"); if("tube3" in childHash && childHash["tube3"].exists)childHash["tube3"].addAnimation( new RotateTo(60 ,BOTHZ ,-45 ,1.0) ,"pose"); if("tube4" in childHash && childHash["tube4"].exists)childHash["tube4"].addAnimation( new RotateTo(60 ,BOTHZ ,-90 ,1.0) ,"pose"); } break; case "attack": switch(nowStateCnt % 120){ case 0: if("tube2" in childHash && childHash["tube2"].exists){ childHash["tube2"].addAnimation( new RotateTo(90 ,BOTHZ ,rand.nextFloat(50)+30.0) ,"aim"); } break; case 35:case 40:case 45: if("nail2" in childHash && childHash["nail2"].exists){ new AttackRing(cast(Enemy)childHash["nail2"] ,"reflect" ,60); } break; case 60: if("tube3" in childHash && childHash["tube3"].exists){ childHash["tube3"].addAnimation( new RotateTo(90 ,BOTHZ ,-rand.nextFloat(50)-30.0) ,"aim"); } break; case 95:case 100:case 105: if("nail3" in childHash && childHash["nail3"].exists){ new AttackRing(cast(Enemy)childHash["nail3"] ,"reflect" ,60); } break; default:break; } switch(nowStateCnt % 120){ case 0: if("tube1" in childHash && childHash["tube1"].exists){ childHash["tube1"].addAnimation( new RotateTo(25 ,BOTHZ ,40 ,-1.0) ,"up"); } if("nail1" in childHash && childHash["nail1"].exists){ new AttackRing(cast(Enemy)childHash["nail1"] ,"wall" ,60); } break; case 30: if("tube1" in childHash && childHash["tube1"].exists){ childHash["tube1"].addAnimation( new RotateTo(25 ,BOTHZ ,90,-1.0) ,"down" ); } break; case 60: if("tube4" in childHash && childHash["tube4"].exists){ childHash["tube4"].addAnimation( new RotateTo(25 ,BOTHZ ,-40 ,-1.0) ,"up"); } if("nail4" in childHash && childHash["nail4"].exists){ // Log_write(nowStateCnt); new AttackRing(cast(Enemy)childHash["nail4"] ,"wall" ,60); } break; case 90: if("tube4" in childHash && childHash["tube4"].exists){ childHash["tube4"].addAnimation( new RotateTo(25 ,BOTHZ ,-90,-1.0) ,"down" ); } default:break; } if(nowStateCnt == 600){ changeState("rest1"); } break; case "rest1": if(nowStateCnt == 60){ if("tube1" in childHash && childHash["tube1"].exists)childHash["tube1"].addAnimation( new RotateTo(60 ,BOTHZ ,90 ,0.0) ,"pose"); if("tube2" in childHash && childHash["tube2"].exists)childHash["tube2"].addAnimation( new RotateTo(60 ,BOTHZ ,45 ,0.0) ,"pose"); if("tube3" in childHash && childHash["tube3"].exists)childHash["tube3"].addAnimation( new RotateTo(60 ,BOTHZ ,-45 ,0.0) ,"pose"); if("tube4" in childHash && childHash["tube4"].exists)childHash["tube4"].addAnimation( new RotateTo(60 ,BOTHZ ,-90 ,0.0) ,"pose"); if("nail1" in childHash && childHash["nail1"].exists)childHash["nail1"].addAnimation( new RotateTo(60 ,BOTHZ ,0 ,0.0) ,"pose"); if("nail2" in childHash && childHash["nail2"].exists)childHash["nail2"].addAnimation( new RotateTo(60 ,BOTHZ ,-45 ,0.0) ,"pose"); if("nail3" in childHash && childHash["nail3"].exists)childHash["nail3"].addAnimation( new RotateTo(60 ,BOTHZ ,45 ,0.0) ,"pose"); if("nail4" in childHash && childHash["nail4"].exists)childHash["nail4"].addAnimation( new RotateTo(60 ,BOTHZ ,0 ,0.0) ,"pose"); } if(nowStateCnt == 240){ if("nail2" in childHash && childHash["nail2"].exists)childHash["nail2"].addAnimation( new RotateTo(60 ,BOTHZ ,0 ,0.0) ,"pose"); if("nail3" in childHash && childHash["nail3"].exists)childHash["nail3"].addAnimation( new RotateTo(60 ,BOTHZ ,0 ,0.0) ,"pose"); changeState("rest2"); } break; case "rest2": if(nowStateCnt == 60)changeState("attack"); break; default:break; } } } public class Boss6:Boss{ //import br.mainloop; private{ double aim; static Shape baseShape; static float[] a = [-1.3 ,-0.9 ,0.0 ,0.9 ,1.3 ,0.9 ,0.0 ,-0.9]; static float[] b = [0.0 ,0.6 ,1.0 ,0.6 ,0.0 ,-0.6 ,-1.0 ,-0.6]; static float[] sz = [-0.6 ,0.0 ,0.6]; static float[] scale = [0.7 ,1.0 ,0.7]; } int[6] reload; bool right; public this(double x,double y,double z,double aim){ super(18); Matrix po = matRotateX(0); pos = new Vector3(x ,y ,z); this.rpos = cast(Vector3)this.pos.clone(); setPoseBase(po); this.aim = aim; //super(pos ,po); //set(pos ,p); //setPoseBase(p); size = 50; collisionRange = 25; if(baseShape is null){ baseShape = new SH_Pot(a ,b ,sz ,scale); } shape = cast(Shape)baseShape.clone(); Parts p;//Parts p; p = new Turret2(50 ,12); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(); //partsManager.add(wing1); addChild(p, "t1", 280 ,ENGAGED ,new Matrix());p.poseZ = 90;p.linkZ = -5; p = new Turret2(50 ,12); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(); //partsManager.add(wing1); addChild(p, "t2", 190 ,ENGAGED ,new Matrix());p.poseZ = 90;p.linkZ = 0; p = new Turret2(50 ,12); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(); //partsManager.add(wing1); addChild(p, "t3", 100 ,ENGAGED ,new Matrix());p.poseZ = 90;p.linkZ = 10; p = new Turret2(50 ,12); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(); //partsManager.add(wing1); addChild(p, "t4", 100 ,ENGAGED ,new Matrix());p.poseZ = 90;p.linkZ = 170; p = new Turret2(50 ,12); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(); //partsManager.add(wing1); addChild(p, "t5", 190 ,ENGAGED ,new Matrix());p.poseZ = 90;p.linkZ = 180; p = new Turret2(50 ,12); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(); //partsManager.add(wing1); addChild(p, "t6", 280 ,ENGAGED ,new Matrix());p.poseZ = 90;p.poseX = 180;p.linkZ = -175; foreach(inout r;reload){ r = rand.nextInt(180); } right = true; /* p = new EnemyAppend(ShipShape.getShape() ,200 ,-1); (cast(Enemy)p).disableBorder(); //partsManager.add(wing1); addChild(p, "nose", 80 ,ENGAGED ,matRotateY(90) ,new Matrix()); p = new EnemyAppend(ShipShape.getShape() ,200 ,-1); (cast(Enemy)p).disableBorder(); //partsManager.add(wing1); addChild(p, "nose", 80 ,ENGAGED ,matRotateY(-90) ,new Matrix()); */ } public void move(){ super.move(); switch(state){ case "start": if(rpos.y < -200)pos.y += 1.5; else { if("t3" in childHash && childHash["t3"].exists){ childHash["t3"].addAnimation(new RotateTo(30 ,POSEY ,-90) ,"set"); } if("t4" in childHash && childHash["t4"].exists){ childHash["t4"].addAnimation(new RotateTo(30 ,POSEY ,-90) ,"set"); } if("t1" in childHash && childHash["t1"].exists){ childHash["t1"].addAnimation(new RotateTo(30 ,POSEZ ,70) ,"set"); } if("t6" in childHash && childHash["t6"].exists){ childHash["t6"].addAnimation(new RotateTo(30 ,POSEZ ,110) ,"set"); } changeState("standby2"); } attack1(); break; case "standby1": if(nowStateCnt >= 30)changeState("attack1"); break; case "attack1": attack1(); if(right){ if(rpos.x < 150.0)pos.x += 1.0; else right ^= true; }else{ if(-150.0 < rpos.x)pos.x -= 1.0; else right ^= true; } if(nowStateCnt >= 450){ if("t3" in childHash && childHash["t3"].exists){ childHash["t3"].addAnimation(new RotateTo(30 ,POSEY ,-90) ,"set"); } if("t4" in childHash && childHash["t4"].exists){ childHash["t4"].addAnimation(new RotateTo(30 ,POSEY ,-90) ,"set"); } if("t1" in childHash && childHash["t1"].exists){ childHash["t1"].addAnimation(new RotateTo(30 ,POSEZ ,70) ,"set"); } if("t6" in childHash && childHash["t6"].exists){ childHash["t6"].addAnimation(new RotateTo(30 ,POSEZ ,110) ,"set"); } changeState("standby2"); } break; case "standby2": if(nowStateCnt >= 30)changeState("attack2"); break; case "attack2": if(right){ if(rpos.x < 150.0)pos.x += 1.0; else right ^= true; }else{ if(-150.0 < rpos.x)pos.x -= 1.0; else right ^= true; } if(nowStateCnt >= 450){ if("t3" in childHash && childHash["t3"].exists){ childHash["t3"].addAnimation(new RotateTo(30 ,POSEY ,0) ,"set"); } if("t4" in childHash && childHash["t4"].exists){ childHash["t4"].addAnimation(new RotateTo(30 ,POSEY ,0) ,"set"); } if("t1" in childHash && childHash["t1"].exists){ childHash["t1"].addAnimation(new RotateTo(30 ,POSEZ ,90) ,"set"); } if("t6" in childHash && childHash["t6"].exists){ childHash["t6"].addAnimation(new RotateTo(30 ,POSEZ ,90) ,"set"); } changeState("standby1"); } attack2(); break; default:break; } } public void attack1(){ if(reload[0] <= 0){ if("t1" in childHash && childHash["t1"].exists){ new AttackRing(cast(Enemy)childHash["t1"] ,"missile" ,30); } reload[0] = rand.nextInt(90) + 120; } if(reload[1] <= 0){ if("t2" in childHash && childHash["t2"].exists){ new AttackRing(cast(Enemy)childHash["t2"] ,"missile" ,30); } reload[1] = rand.nextInt(90) + 120; } if(reload[2] <= 0){ if("t3" in childHash && childHash["t3"].exists){ new AttackRing(cast(Enemy)childHash["t3"] ,"missile" ,30); } reload[2] = rand.nextInt(60) + 90; } if(reload[3] <= 0){ if("t4" in childHash && childHash["t4"].exists){ new AttackRing(cast(Enemy)childHash["t4"] ,"missile" ,30); } reload[3] = rand.nextInt(60) + 90; } if(reload[4] <= 0){ if("t5" in childHash && childHash["t5"].exists){ new AttackRing(cast(Enemy)childHash["t5"] ,"missile" ,30); } reload[4] = rand.nextInt(90) + 120; } if(reload[5] <= 0){ if("t6" in childHash && childHash["t6"].exists){ new AttackRing(cast(Enemy)childHash["t6"] ,"missile" ,30); } reload[5] = rand.nextInt(90) + 120; } foreach(inout r;reload){ r --; } } public void attack2(){ if(nowStateCnt % 10 == 0){ if("t2" in childHash && childHash["t2"].exists){ new AttackRing(cast(Enemy)childHash["t2"] ,"laser" ,30); } if("t5" in childHash && childHash["t5"].exists){ new AttackRing(cast(Enemy)childHash["t5"] ,"laser" ,30); } } if(nowStateCnt % 90 == 0){ if("t1" in childHash && childHash["t1"].exists){ new AttackRing(cast(Enemy)childHash["t1"] ,"bomb" ,30); } } if(nowStateCnt % 90 == 45){ if("t6" in childHash && childHash["t6"].exists){ new AttackRing(cast(Enemy)childHash["t6"] ,"bomb" ,30); } } } } public class Boss7:Boss{ //import br.mainloop; private{ double aim; static Shape baseShape; static float[] a = [-1.3 ,-0.9 ,0.0 ,0.9 ,1.3 ,0.9 ,0.0 ,-0.9]; static float[] b = [0.0 ,0.6 ,1.0 ,0.6 ,0.0 ,-0.6 ,-1.0 ,-0.6]; static float[] sz = [-0.6 ,0.0 ,0.6]; static float[] scale = [0.7 ,1.0 ,0.7]; } int[6] reload; bool right; char[] runState; int nowRunStateCnt; int speed; public this(double x,double y,double z,double aim){ super(18); Matrix po = matRotateX(0); pos = new Vector3(x ,y ,z); this.rpos = cast(Vector3)this.pos.clone(); setPoseBase(po); this.aim = aim; //super(pos ,po); //set(pos ,p); //setPoseBase(p); size = 40; collisionRange = 25; nowRunStateCnt = 0; runState = "start"; speed = 10; /* if(baseShape is null){ baseShape = new SH_Pot(a ,b ,sz ,scale); } */ shape = BodyShape.getShape(); Parts p;//Parts p; p = new HeadTurret2(50); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(); addChild(p, "head", 80 ,ENGAGED ,matRotateZ(20) ,matRotateZ(-40)); p = new EnemyAppend(new SH_Sphere(1.0 ,6) ,30 ,-1); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(); addChild(p, "rshoulder", 80 ,ENGAGED ,matRotateY(90)); p = new EnemyAppend(new SH_Sphere(1.0 ,6) ,30 ,-1); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(); addChild(p, "lshoulder", 80 ,ENGAGED ,matRotateY(-90)); p = new EnemyAppend(BodyShape.getShape() ,40 ,-1); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(); addChild(p, "body", 120 ,ENGAGED ,matRotateZ(180)); p = new EnemyAppend(BodyShape.getShape() ,40 ,-1); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(); childHash["body"].addChild(p, "ass", 100 ,ENGAGED ,matRotateZ(180)); p = new EnemyAppend(TubeShape.getShape() ,30 ,-1); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(); childHash["rshoulder"].addChild(p, "rarm", 60 ,ENGAGED ,matRotateZ(-60)); p = new EnemyAppend(new SH_Sphere(1.0 ,6) ,20 ,-1); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(); childHash["rarm"].addChild(p, "rarmjoint", 60 ,ENGAGED ,matRotateZ(-60)); p = new ArmTurret(30); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(); childHash["rarmjoint"].addChild(p, "rhand", 80 ,ENGAGED ,matRotateZ(-60)); p = new EnemyAppend(TubeShape.getShape() ,30 ,-1); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(); childHash["lshoulder"].addChild(p, "larm", 80 ,ENGAGED ,matRotateZ(-60)); p = new EnemyAppend(new SH_Sphere(1.0 ,6) ,20 ,-1); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(); childHash["larm"].addChild(p, "larmjoint", 60 ,ENGAGED ,matRotateZ(-60)); p = new ArmTurret(30); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(); childHash["larmjoint"].addChild(p, "lhand", 60 ,ENGAGED ,matRotateZ(-60)); p = new EnemyAppend(new SH_Sphere(1.0 ,6) ,30 ,-1); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(); childHash["ass"].addChild(p, "rhipjoint", 80 ,ENGAGED ,matRotateY(90)); p = new EnemyAppend(new SH_Sphere(1.0 ,6) ,30 ,-1); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(); childHash["ass"].addChild(p, "lhipjoint", 80 ,ENGAGED ,matRotateY(-90)); p = new EnemyAppend(TubeShape.getShape() ,30 ,-1); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(); childHash["rhipjoint"].addChild(p, "rthigh",80 ,ENGAGED ,matRotateZ(-120)); p = new EnemyAppend(new SH_Sphere(1.0 ,6) ,20 ,-1); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(); childHash["rthigh"].addChild(p, "rthighjoint", 60 ,ENGAGED ,matRotateZ(-120)); p = new ArmTurret(30); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(); childHash["rthighjoint"].addChild(p, "rfoot", 80 ,ENGAGED ,matRotateZ(-120)); p = new EnemyAppend(TubeShape.getShape() ,30 ,-1); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(); childHash["lhipjoint"].addChild(p, "lthigh", 80 ,ENGAGED ,matRotateZ(-120)); p = new EnemyAppend(new SH_Sphere(1.0 ,6) ,20 ,-1); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(); childHash["lthigh"].addChild(p, "lthighjoint", 60 ,ENGAGED ,matRotateZ(-120)); p = new ArmTurret(30); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(); childHash["lthighjoint"].addChild(p, "lfoot", 80 ,ENGAGED ,matRotateZ(-120)); p = new EnemyAppend(TubeShape.getShape() ,30 ,-1); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(); childHash["ass"].addChild(p, "tail1", 80 ,ENGAGED ,matRotateZ(150)); p = new EnemyAppend(new SH_Sphere(1.0 ,6) ,20 ,-1); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(); childHash["tail1"].addChild(p, "tailjoint", 60 ,ENGAGED ,matRotateZ(150)); p = new TailTurret2(30); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(); childHash["tailjoint"].addChild(p, "tail2", 60 ,ENGAGED ,matRotateZ(150)); } public void move(){ super.move(); double dx = 0.0; switch(state){ case "start": if(rpos.x < 400){ dx = 5 + (400 - rpos.x) /100; }else changeState("standby"); break; case "standby": if(rpos.z < -800){ pos.z += 2.0; }else changeState("attack1"); break; case "attack1": if(-300 < rpos.x){ dx = -1; }else changeState("attack2"); if(nowStateCnt % 5 == 0){ if("tail2" in childHash && childHash["tail2"].exists){ new AttackRing(cast(Enemy)childHash["tail2"] ,"shot" ,30); } } switch(cnt % 240){ case 0: if("rhand" in childHash && childHash["rhand"].exists){ new AttackRing(cast(Enemy)childHash["rhand"] ,"shot" ,60); } break; case 60: if("lhand" in childHash && childHash["lhand"].exists){ new AttackRing(cast(Enemy)childHash["lhand"] ,"shot" ,60); } break; case 120: if("rfoot" in childHash && childHash["rfoot"].exists){ new AttackRing(cast(Enemy)childHash["rfoot"] ,"shot" ,60); } break; case 180: if("lfoot" in childHash && childHash["lfoot"].exists){ new AttackRing(cast(Enemy)childHash["lfoot"] ,"shot" ,60); } break; default:break; } /* if(cnt % 500 == 0){ if("head" in childHash && childHash["head"].exists){ new AttackRing(cast(Enemy)childHash["head"] ,"shot" ,30); } } */ break; case "attack2": if(nowStateCnt == 120){ if("head" in childHash && childHash["head"].exists){ new AttackRing(cast(Enemy)childHash["head"] ,"eightway" ,30); } } if(nowStateCnt % 5 == 0){ if("tail2" in childHash && childHash["tail2"].exists){ new AttackRing(cast(Enemy)childHash["tail2"] ,"shot" ,30); } } if(nowStateCnt > 390){ changeState("attack3"); } break; case "attack3": if(rpos.x < 500){ dx = 2; }else{ changeState("attack4"); childHash["tail1"].addAnimation(new RotateTo(20 ,BOTHZ , -30 ,0.5) ,"stand"); } if(nowStateCnt % 5 == 0){ if("tail2" in childHash && childHash["tail2"].exists){ new AttackRing(cast(Enemy)childHash["tail2"] ,"shot" ,30); } } switch(cnt % 240){ case 0: if("rhand" in childHash && childHash["rhand"].exists){ new AttackRing(cast(Enemy)childHash["rhand"] ,"shot" ,60); } break; case 60: if("lhand" in childHash && childHash["lhand"].exists){ new AttackRing(cast(Enemy)childHash["lhand"] ,"shot" ,60); } break; case 120: if("rfoot" in childHash && childHash["rfoot"].exists){ new AttackRing(cast(Enemy)childHash["rfoot"] ,"shot" ,60); } break; case 180: if("lfoot" in childHash && childHash["lfoot"].exists){ new AttackRing(cast(Enemy)childHash["lfoot"] ,"shot" ,60); } break; default:break; } /* if(cnt % 500 == 0){ if("head" in childHash && childHash["head"].exists){ new AttackRing(cast(Enemy)childHash["head"] ,"shot" ,30); } } */ break; case "attack4": if(nowStateCnt > 90 && nowStateCnt % 10 == 0){ if("tail2" in childHash && childHash["tail2"].exists){ new AttackRing(cast(Enemy)childHash["tail2"] ,"eightway" ,30); } } if(nowStateCnt > 390){ childHash["tail1"].addAnimation(new RotateTo(20 ,BOTHZ , 0 ,0.5) ,"stand"); changeState("attack1"); } default:break; } pos.x += dx; speed = cast(int)(fmax(1.0 ,10 - 0.4 * dx)); run(speed); } public void run(int speed){ nowRunStateCnt ++; switch(runState){ case "start": changeRunState("r4"); break; /* case "1": if(nowStateCnt > 15){ childHash["lhand"].addAnimation(new RotateTo(15 ,BOTHZ , 0 ) ,"walk"); childHash["rfoot"].addAnimation(new RotateTo(15 ,BOTHZ , 0 ) ,"walk"); changeRunState("2"); } break; case "2": if(nowStateCnt > 15){ childHash["rarm"].addAnimation(new RotateTo(30 ,BOTHZ , 0) ,"walk"); childHash["lthigh"].addAnimation(new RotateTo(30 ,BOTHZ , 0 ) ,"walk"); childHash["larm"].addAnimation(new RotateTo(30 ,BOTHZ , -60 ) ,"walk"); childHash["lhand"].addAnimation(new RotateTo(30 ,BOTHZ , 60 ) ,"walk"); childHash["rthigh"].addAnimation(new RotateTo(30 ,BOTHZ , 60 ) ,"walk"); childHash["rfoot"].addAnimation(new RotateTo(30 ,BOTHZ , -60 ) ,"walk"); changeRunState("3"); } break; case "3": if(nowStateCnt > 15){ childHash["rhand"].addAnimation(new RotateTo(15 ,BOTHZ , 0 ) ,"walk"); childHash["lfoot"].addAnimation(new RotateTo(15 ,BOTHZ , 0 ) ,"walk"); changeRunState("4"); } break; case "4": if(nowStateCnt > 15){ childHash["rarm"].addAnimation(new RotateTo(30 ,BOTHZ , -60 ) ,"walk"); childHash["rhand"].addAnimation(new RotateTo(30 ,BOTHZ , 60 ) ,"walk"); childHash["lthigh"].addAnimation(new RotateTo(30 ,BOTHZ , 60 ) ,"walk"); childHash["lfoot"].addAnimation(new RotateTo(30 ,BOTHZ , -60 ) ,"walk"); childHash["larm"].addAnimation(new RotateTo(30 ,BOTHZ , 0 ) ,"walk"); childHash["rthigh"].addAnimation(new RotateTo(30 ,BOTHZ , 0 ) ,"walk"); changeRunState("1"); } break; */ case "r1": pos.y += 1.0; if(nowRunStateCnt >= speed-1){ changeRunState("r2"); } break; case "r2": if(nowRunStateCnt >= speed-1){ childHash["rarm"].addAnimation(new RotateTo(speed*2 ,BOTHZ , 20) ,"run"); childHash["lthigh"].addAnimation(new RotateTo(speed*2 ,BOTHZ , -20 ) ,"run"); childHash["larm"].addAnimation(new RotateTo(speed*2 ,BOTHZ , 20 ) ,"run"); childHash["rthigh"].addAnimation(new RotateTo(speed*2 ,BOTHZ , -20 ) ,"run"); childHash["ass"].addAnimation(new RotateTo(speed*2 ,BOTHZ , 0 ) ,"run"); childHash["tail1"].addAnimation(new RotateTo(speed*2 ,BOTHZ , -10 ,0.5) ,"run"); changeRunState("r3"); } break; case "r3": pos.y -= 1.0; if(nowRunStateCnt >= speed-1){ childHash["lhand"].addAnimation(new RotateTo(speed ,BOTHZ , 0 ) ,"run"); childHash["rhand"].addAnimation(new RotateTo(speed ,BOTHZ , 0 ) ,"run"); childHash["lfoot"].addAnimation(new RotateTo(speed ,BOTHZ , 0 ) ,"run"); childHash["rfoot"].addAnimation(new RotateTo(speed ,BOTHZ , 0 ) ,"run"); // childHash["tail1"].addAnimation(new RotateTo(20 ,BOTHZ , -30 ,0.5) ,"stand"); changeRunState("r4"); } break; case "r4": if(nowRunStateCnt >= speed-1){ childHash["rarm"].addAnimation(new RotateTo(speed*2 ,BOTHZ , -80 ) ,"run"); childHash["rhand"].addAnimation(new RotateTo(speed*2 ,BOTHZ , 80 ) ,"run"); childHash["lthigh"].addAnimation(new RotateTo(speed*2 ,BOTHZ , 80 ) ,"run"); childHash["lfoot"].addAnimation(new RotateTo(speed*2 ,BOTHZ , -80 ) ,"run"); childHash["larm"].addAnimation(new RotateTo(speed*2 ,BOTHZ , -80 ) ,"run"); childHash["lhand"].addAnimation(new RotateTo(speed*2 ,BOTHZ , 80 ) ,"run"); childHash["rthigh"].addAnimation(new RotateTo(speed*2 ,BOTHZ , 80 ) ,"run"); childHash["rfoot"].addAnimation(new RotateTo(speed*2 ,BOTHZ , -80 ) ,"run"); childHash["ass"].addAnimation(new RotateTo(speed*2 ,BOTHZ , 20 ) ,"run"); childHash["tail1"].addAnimation(new RotateTo(speed*2 ,BOTHZ , 30 ,0.5) ,"run"); changeRunState("r1"); } break; default:break; } } public void changeRunState(char[] state){ this.runState = state.dup; nowRunStateCnt = -1; } } public class Boss8:Boss{ //import br.mainloop; private{ double aim; static Shape baseShape; static float[] a = [-1.5 ,0.0 ,1.5] ; static float[] b = [0.0 ,1.0 ,0.0 ] ; } // int[6] reload; bool right; double[6] speed; public this(double x,double y,double z,double aim){ super(18); Matrix po = matRotateY(90); pos = new Vector3(x ,y ,z); this.rpos = cast(Vector3)this.pos.clone(); setPoseBase(po); this.aim = aim; //super(pos ,po); //set(pos ,p); //setPoseBase(p); size = 50; collisionRange = 25; foreach(inout s;speed){ s = 0.0; } if(baseShape is null){ baseShape = new SH_Pole(a ,b ,6); } shape = cast(Shape)baseShape.clone(); Parts p;//Parts p; p = new EnemyAppend(ArmShape2.getShape(),60 ,-1); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(25); addChild(p, "arm11", 150 ,ENGAGED ,matRotateZ(0)); p = new EnemyAppend(ArmShape2.getShape() ,60 ,-1); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(25); addChild(p, "arm21", 150 ,ENGAGED ,matRotateZ(60)); p = new EnemyAppend(ArmShape2.getShape() ,60 ,-1); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(25); addChild(p, "arm31", 150 ,ENGAGED ,matRotateZ(120)); p = new EnemyAppend(ArmShape2.getShape() ,60 ,-1); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(25); addChild(p, "arm41", 150 ,ENGAGED ,matRotateZ(180)); p = new EnemyAppend(ArmShape2.getShape() ,60 ,-1); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(25); addChild(p, "arm51", 150 ,ENGAGED ,matRotateZ(-120)); p = new EnemyAppend(ArmShape2.getShape() ,60 ,-1); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(25); addChild(p, "arm61", 150 ,ENGAGED ,matRotateZ(-60)); p = new JointTurret(30 ,10); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(20); childHash["arm11"].addChild(p, "arm12", 150 ,ENGAGED); p = new JointTurret(30 ,10); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(20); childHash["arm21"].addChild(p, "arm22", 150 ,ENGAGED); p = new JointTurret(30 ,10); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(20); childHash["arm31"].addChild(p, "arm32", 150 ,ENGAGED); p = new JointTurret(30 ,10); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(20); childHash["arm41"].addChild(p, "arm42", 150 ,ENGAGED); p = new JointTurret(30 ,10); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(20); childHash["arm51"].addChild(p, "arm52", 150 ,ENGAGED); p = new JointTurret(30 ,10); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(20); childHash["arm61"].addChild(p, "arm62", 150 ,ENGAGED); p = new EnemyAppend(NailShape2.getShape(),40 ,-1); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(15); childHash["arm12"].addChild(p, "arm13", 120 ,ENGAGED); p = new EnemyAppend(NailShape2.getShape(),40 ,-1); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(15); childHash["arm22"].addChild(p, "arm23", 120 ,ENGAGED); p = new EnemyAppend(NailShape2.getShape(),40 ,-1); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(15); childHash["arm32"].addChild(p, "arm33", 120 ,ENGAGED); p = new EnemyAppend(NailShape2.getShape(),40 ,-1); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(15); childHash["arm42"].addChild(p, "arm43", 120 ,ENGAGED); p = new EnemyAppend(NailShape2.getShape(),40 ,-1); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(15); childHash["arm52"].addChild(p, "arm53", 120 ,ENGAGED); p = new EnemyAppend(NailShape2.getShape(),40 ,-1); (cast(Enemy)p).disableBorder();(cast(EnemyAppend)p).setCollision(15); childHash["arm62"].addChild(p, "arm63", 120 ,ENGAGED); // rotateAll(matRotateX(10)); } public void move(){ super.move(); switch(state){ case "start": if(rpos.z < -1200)pos.z += 0.4; else changeState("standby"); if(nowStateCnt % 100 == 0)new AttackRing(this ,"circle",60); if(nowStateCnt > 200){ switch(nowStateCnt % 360){ case 0:new AttackRing(cast(Enemy)childHash["arm12"] ,"homing",60);break; case 60:new AttackRing(cast(Enemy)childHash["arm22"] ,"homing",60);break; case 120:new AttackRing(cast(Enemy)childHash["arm32"] ,"homing",60);break; case 180:new AttackRing(cast(Enemy)childHash["arm42"] ,"homing",60);break; case 240:new AttackRing(cast(Enemy)childHash["arm52"] ,"homing",60);break; case 300:new AttackRing(cast(Enemy)childHash["arm62"] ,"homing",60);break; default:break; } } break; case "standby": // else if(nowStateCnt >= 120){ if("arm11" in childHash && childHash["arm11"].exists){ childHash["arm11"].addAnimation(new RotateTo(150 ,BOTHY ,-30 ,1.0) ,"tilt"); } if("arm21" in childHash && childHash["arm21"].exists){ childHash["arm21"].addAnimation(new RotateTo(150 ,BOTHY ,-30 ,1.0) ,"tilt"); } if("arm31" in childHash && childHash["arm31"].exists){ childHash["arm31"].addAnimation(new RotateTo(150 ,BOTHY ,-30 ,1.0) ,"tilt"); } if("arm41" in childHash && childHash["arm41"].exists){ childHash["arm41"].addAnimation(new RotateTo(150 ,BOTHY ,-30 ,1.0) ,"tilt"); } if("arm51" in childHash && childHash["arm51"].exists){ childHash["arm51"].addAnimation(new RotateTo(150 ,BOTHY ,-30 ,1.0) ,"tilt"); } if("arm61" in childHash && childHash["arm61"].exists){ childHash["arm61"].addAnimation(new RotateTo(150 ,BOTHY ,-30 ,1.0) ,"tilt"); } setNextMusic(music_kind.MUSIC8); changeState("tilt"); } break; case "tilt": if(rpos.z < -1000)pos.z += 1.5; else{ if(nowStateCnt >= 150){ changeState("attack1"); } } changeLastState(); break; case "attack1": if(nowStateCnt < 100){ if(nowStateCnt % 20 == 0 && nowStateCnt < 70){ if("arm12" in childHash && childHash["arm12"].exists){ new AttackRing(cast(Enemy)childHash["arm12"] ,"reflect" ,30); } if("arm22" in childHash && childHash["arm22"].exists){ new AttackRing(cast(Enemy)childHash["arm22"] ,"reflect" ,30); } if("arm32" in childHash && childHash["arm32"].exists){ new AttackRing(cast(Enemy)childHash["arm32"] ,"reflect" ,30); } if("arm42" in childHash && childHash["arm42"].exists){ new AttackRing(cast(Enemy)childHash["arm42"] ,"reflect" ,30); } if("arm52" in childHash && childHash["arm52"].exists){ new AttackRing(cast(Enemy)childHash["arm52"] ,"reflect" ,30); } if("arm62" in childHash && childHash["arm62"].exists){ new AttackRing(cast(Enemy)childHash["arm62"] ,"reflect" ,30); } } }else{ if("arm11" in childHash && childHash["arm11"].exists){ childHash["arm11"].addAnimation(new RotateTo(150 ,BOTHY ,20 ,1.0) ,"tilt"); } if("arm21" in childHash && childHash["arm21"].exists){ childHash["arm21"].addAnimation(new RotateTo(150 ,BOTHY ,20 ,1.0) ,"tilt"); } if("arm31" in childHash && childHash["arm31"].exists){ childHash["arm31"].addAnimation(new RotateTo(150 ,BOTHY ,20 ,1.0) ,"tilt"); } if("arm41" in childHash && childHash["arm41"].exists){ childHash["arm41"].addAnimation(new RotateTo(150 ,BOTHY ,20 ,1.0) ,"tilt"); } if("arm51" in childHash && childHash["arm51"].exists){ childHash["arm51"].addAnimation(new RotateTo(150 ,BOTHY ,20 ,1.0) ,"tilt"); } if("arm61" in childHash && childHash["arm61"].exists){ childHash["arm61"].addAnimation(new RotateTo(150 ,BOTHY ,20 ,1.0) ,"tilt"); } changeState("attack2"); } changeLastState(); break; case "attack2": if(nowStateCnt == 150){ if("arm11" in childHash && childHash["arm11"].exists){ childHash["arm11"].addAnimation(new RotateTo(90 ,BOTHY ,-45 ,1.0) ,"tilt"); } if("arm21" in childHash && childHash["arm21"].exists){ childHash["arm21"].addAnimation(new RotateTo(90 ,BOTHY ,-45 ,1.0) ,"tilt"); } if("arm31" in childHash && childHash["arm31"].exists){ childHash["arm31"].addAnimation(new RotateTo(90 ,BOTHY ,-45 ,1.0) ,"tilt"); } if("arm41" in childHash && childHash["arm41"].exists){ childHash["arm41"].addAnimation(new RotateTo(90 ,BOTHY ,-45 ,1.0) ,"tilt"); } if("arm51" in childHash && childHash["arm51"].exists){ childHash["arm51"].addAnimation(new RotateTo(90 ,BOTHY ,-45 ,1.0) ,"tilt"); } if("arm61" in childHash && childHash["arm61"].exists){ childHash["arm61"].addAnimation(new RotateTo(90 ,BOTHY ,-45 ,1.0) ,"tilt"); } changeState("attack3"); } changeLastState(); break; case "attack3": if(rpos.z > -1050)pos.z -= 1.0; else{ if(nowStateCnt % 60 == 0){ if(nowStateCnt < 140){ if("arm12" in childHash && childHash["arm12"].exists){ new AttackRing(cast(Enemy)childHash["arm12"] ,"wave" ,30); } }else{ if(nowStateCnt > 340 && nowStateCnt % 180 == 0){ if("arm12" in childHash && childHash["arm12"].exists){ new AttackRing(cast(Enemy)childHash["arm12"] ,"homing" ,60); } } } if(nowStateCnt < 390){ if("arm22" in childHash && childHash["arm22"].exists){ new AttackRing(cast(Enemy)childHash["arm22"] ,"wave" ,30); } }else{ if(nowStateCnt > 590 && nowStateCnt % 180 == 60){ if("arm22" in childHash && childHash["arm22"].exists){ new AttackRing(cast(Enemy)childHash["arm22"] ,"homing" ,60); } } } if(nowStateCnt < 640){ if("arm32" in childHash && childHash["arm32"].exists){ new AttackRing(cast(Enemy)childHash["arm32"] ,"wave" ,30); } }else{ if(nowStateCnt > 840 && nowStateCnt % 180 == 120){ if("arm32" in childHash && childHash["arm32"].exists){ new AttackRing(cast(Enemy)childHash["arm32"] ,"homing" ,60); } } } if(nowStateCnt < 140){ if("arm42" in childHash && childHash["arm42"].exists){ new AttackRing(cast(Enemy)childHash["arm42"] ,"wave" ,30); } }else{ if(nowStateCnt > 340 && nowStateCnt % 180 == 0){ if("arm42" in childHash && childHash["arm42"].exists){ new AttackRing(cast(Enemy)childHash["arm42"] ,"homing" ,60); } } } if(nowStateCnt < 390){ if("arm52" in childHash && childHash["arm52"].exists){ new AttackRing(cast(Enemy)childHash["arm52"] ,"wave" ,30); } }else{ if(nowStateCnt > 540 && nowStateCnt % 180 == 60){ if("arm52" in childHash && childHash["arm52"].exists){ new AttackRing(cast(Enemy)childHash["arm52"] ,"homing" ,60); } } } if(nowStateCnt < 640){ if("arm62" in childHash && childHash["arm62"].exists){ new AttackRing(cast(Enemy)childHash["arm62"] ,"wave" ,30); } }else{ if(nowStateCnt > 840 && nowStateCnt % 180 == 120){ if("arm62" in childHash && childHash["arm62"].exists){ new AttackRing(cast(Enemy)childHash["arm62"] ,"homing" ,60); } } } } if(nowStateCnt == 200){ if("arm11" in childHash && childHash["arm11"].exists){ childHash["arm11"].addAnimation(new RotateTo(200 ,BOTHY ,0 ,1.0) ,"tilt"); } } if(nowStateCnt == 450){ if("arm21" in childHash && childHash["arm21"].exists){ childHash["arm21"].addAnimation(new RotateTo(200 ,BOTHY ,0 ,1.0) ,"tilt"); } } if(nowStateCnt == 700){ if("arm31" in childHash && childHash["arm31"].exists){ childHash["arm31"].addAnimation(new RotateTo(200 ,BOTHY ,0 ,1.0) ,"tilt"); } } if(nowStateCnt == 200){ if("arm41" in childHash && childHash["arm41"].exists){ childHash["arm41"].addAnimation(new RotateTo(200 ,BOTHY ,0 ,1.0) ,"tilt"); } } if(nowStateCnt == 450){ if("arm51" in childHash && childHash["arm51"].exists){ childHash["arm51"].addAnimation(new RotateTo(200 ,BOTHY ,0 ,1.0) ,"tilt"); } } if(nowStateCnt == 700){ if("arm61" in childHash && childHash["arm61"].exists){ childHash["arm61"].addAnimation(new RotateTo(200 ,BOTHY ,0 ,1.0) ,"tilt"); } } if(nowStateCnt == 140){ if("arm11" in childHash && childHash["arm11"].exists){ childHash["arm11"].addAnimation(new RotateTo(60 ,BOTHY ,-50 ,1.0) ,"tilt"); } } if(nowStateCnt == 390){ if("arm21" in childHash && childHash["arm21"].exists){ childHash["arm21"].addAnimation(new RotateTo(60 ,BOTHY ,-50 ,1.0) ,"tilt"); } } if(nowStateCnt == 640){ if("arm31" in childHash && childHash["arm31"].exists){ childHash["arm31"].addAnimation(new RotateTo(60 ,BOTHY ,-50 ,1.0) ,"tilt"); } } if(nowStateCnt == 140){ if("arm41" in childHash && childHash["arm41"].exists){ childHash["arm41"].addAnimation(new RotateTo(60 ,BOTHY ,-50 ,1.0) ,"tilt"); } } if(nowStateCnt == 390){ if("arm51" in childHash && childHash["arm51"].exists){ childHash["arm51"].addAnimation(new RotateTo(60 ,BOTHY ,-50 ,1.0) ,"tilt"); } } if(nowStateCnt == 640){ if("arm61" in childHash && childHash["arm61"].exists){ childHash["arm61"].addAnimation(new RotateTo(60 ,BOTHY ,-50 ,1.0) ,"tilt"); } } if(nowStateCnt == 900){ if("arm12" in childHash && childHash["arm12"].exists){ new AttackRing(cast(Enemy)childHash["arm12"] ,"homing" ,60); } if("arm22" in childHash && childHash["arm22"].exists){ new AttackRing(cast(Enemy)childHash["arm22"] ,"homing" ,60); } if("arm32" in childHash && childHash["arm32"].exists){ new AttackRing(cast(Enemy)childHash["arm32"] ,"homing" ,60); } if("arm42" in childHash && childHash["arm42"].exists){ new AttackRing(cast(Enemy)childHash["arm42"] ,"homing" ,60); } if("arm52" in childHash && childHash["arm52"].exists){ new AttackRing(cast(Enemy)childHash["arm52"] ,"homing" ,60); } if("arm62" in childHash && childHash["arm62"].exists){ new AttackRing(cast(Enemy)childHash["arm62"] ,"homing" ,60); } } if(nowStateCnt == 960){ changeState("tilt2"); } /* if("arm11" in childHash && childHash["arm11"].exists){ childHash["arm11"].addAnimation(new RotateTo(150 ,BOTHY ,-30 ,1.0) ,"tilt"); } if("arm21" in childHash && childHash["arm21"].exists){ childHash["arm21"].addAnimation(new RotateTo(150 ,BOTHY ,-30 ,1.0) ,"tilt"); } if("arm31" in childHash && childHash["arm31"].exists){ childHash["arm31"].addAnimation(new RotateTo(150 ,BOTHY ,-30 ,1.0) ,"tilt"); } if("arm41" in childHash && childHash["arm41"].exists){ childHash["arm41"].addAnimation(new RotateTo(150 ,BOTHY ,-30 ,1.0) ,"tilt"); } if("arm51" in childHash && childHash["arm51"].exists){ childHash["arm51"].addAnimation(new RotateTo(150 ,BOTHY ,-30 ,1.0) ,"tilt"); } if("arm61" in childHash && childHash["arm61"].exists){ childHash["arm61"].addAnimation(new RotateTo(150 ,BOTHY ,-30 ,1.0) ,"tilt"); } */ // } } changeLastState(); break; case "tilt2": if(nowStateCnt > 0){ if("arm11" in childHash && childHash["arm11"].exists){ childHash["arm11"].addAnimation(new RotateTo(150 ,BOTHY ,-30 ,1.0) ,"tilt"); } if("arm21" in childHash && childHash["arm21"].exists){ childHash["arm21"].addAnimation(new RotateTo(150 ,BOTHY ,-30 ,1.0) ,"tilt"); } if("arm31" in childHash && childHash["arm31"].exists){ childHash["arm31"].addAnimation(new RotateTo(150 ,BOTHY ,-30 ,1.0) ,"tilt"); } if("arm41" in childHash && childHash["arm41"].exists){ childHash["arm41"].addAnimation(new RotateTo(150 ,BOTHY ,-30 ,1.0) ,"tilt"); } if("arm51" in childHash && childHash["arm51"].exists){ childHash["arm51"].addAnimation(new RotateTo(150 ,BOTHY ,-30 ,1.0) ,"tilt"); } if("arm61" in childHash && childHash["arm61"].exists){ childHash["arm61"].addAnimation(new RotateTo(150 ,BOTHY ,-30 ,1.0) ,"tilt"); } changeState("tilt"); } break; case "laststart": if(nowStateCnt > 200){ if("arm11" in childHash && childHash["arm11"].exists){ childHash["arm11"].addAnimation(new RotateTo(150 ,LINKY ,0) ,"turret1"); childHash["arm11"].addAnimation(new RotateTo(150 ,POSEY ,90) ,"turret2"); } if("arm21" in childHash && childHash["arm21"].exists){ childHash["arm21"].addAnimation(new RotateTo(150 ,LINKY ,0) ,"turret1"); childHash["arm21"].addAnimation(new RotateTo(150 ,POSEY ,90) ,"turret2"); } if("arm31" in childHash && childHash["arm31"].exists){ childHash["arm31"].addAnimation(new RotateTo(150 ,LINKY ,0) ,"turret1"); childHash["arm31"].addAnimation(new RotateTo(150 ,POSEY ,90) ,"turret2"); } if("arm41" in childHash && childHash["arm41"].exists){ childHash["arm41"].addAnimation(new RotateTo(150 ,LINKY ,0) ,"turret1"); childHash["arm41"].addAnimation(new RotateTo(150 ,POSEY ,90) ,"turret2"); } if("arm51" in childHash && childHash["arm51"].exists){ childHash["arm51"].addAnimation(new RotateTo(150 ,LINKY ,0) ,"turret1"); childHash["arm51"].addAnimation(new RotateTo(150 ,POSEY ,90) ,"turret2"); } if("arm61" in childHash && childHash["arm61"].exists){ childHash["arm61"].addAnimation(new RotateTo(150 ,LINKY ,0) ,"turret1"); childHash["arm61"].addAnimation(new RotateTo(150 ,POSEY ,90) ,"turret2"); } changeState("laststandby1"); }else{ if("arm11" in childHash && childHash["arm11"].exists && childHash["arm11"].inAnimation){} else if("arm21" in childHash && childHash["arm21"].exists && childHash["arm21"].inAnimation){} else if("arm31" in childHash && childHash["arm31"].exists && childHash["arm31"].inAnimation){} else if("arm41" in childHash && childHash["arm41"].exists && childHash["arm41"].inAnimation){} else if("arm51" in childHash && childHash["arm51"].exists && childHash["arm51"].inAnimation){} else if("arm61" in childHash && childHash["arm61"].exists && childHash["arm61"].inAnimation){} else{ if("arm11" in childHash && childHash["arm11"].exists){ childHash["arm11"].addAnimation(new RotateTo(150 ,LINKY ,0) ,"turret1"); childHash["arm11"].addAnimation(new RotateTo(150 ,POSEY ,90) ,"turret2"); } if("arm21" in childHash && childHash["arm21"].exists){ childHash["arm21"].addAnimation(new RotateTo(150 ,LINKY ,0) ,"turret1"); childHash["arm21"].addAnimation(new RotateTo(150 ,POSEY ,90) ,"turret2"); } if("arm31" in childHash && childHash["arm31"].exists){ childHash["arm31"].addAnimation(new RotateTo(150 ,LINKY ,0) ,"turret1"); childHash["arm31"].addAnimation(new RotateTo(150 ,POSEY ,90) ,"turret2"); } if("arm41" in childHash && childHash["arm41"].exists){ childHash["arm41"].addAnimation(new RotateTo(150 ,LINKY ,0) ,"turret1"); childHash["arm41"].addAnimation(new RotateTo(150 ,POSEY ,90) ,"turret2"); } if("arm51" in childHash && childHash["arm51"].exists){ childHash["arm51"].addAnimation(new RotateTo(150 ,LINKY ,0) ,"turret1"); childHash["arm51"].addAnimation(new RotateTo(150 ,POSEY ,90) ,"turret2"); } if("arm61" in childHash && childHash["arm61"].exists){ childHash["arm61"].addAnimation(new RotateTo(150 ,LINKY ,0) ,"turret1"); childHash["arm61"].addAnimation(new RotateTo(150 ,POSEY ,90) ,"turret2"); } changeState("laststandby1"); } } break; case "laststandby1": if(rpos.z > -1200)pos.z -= 1.5; if(nowStateCnt == 150)changeState("lastattack1"); break; case "lastattack1": if(nowStateCnt % 10 == 0){ new AttackRing(this ,"blaster",90); } if(nowStateCnt == 300){ changeState("laststandby2"); } break; case "laststandby2": if(nowStateCnt == 100){ // Log_write("a"); /* if("arm11" in childHash && childHash["arm11"].exists){ childHash["arm11"].addAnimation(new RotateTo(150 ,POSEY ,0) ,"wall"); } if("arm21" in childHash && childHash["arm21"].exists){ childHash["arm21"].addAnimation(new RotateTo(150 ,POSEY ,0) ,"wall"); } if("arm31" in childHash && childHash["arm31"].exists){ childHash["arm31"].addAnimation(new RotateTo(150 ,POSEY ,0) ,"wall"); } if("arm41" in childHash && childHash["arm41"].exists){ childHash["arm41"].addAnimation(new RotateTo(150 ,POSEY ,0) ,"wall"); } if("arm51" in childHash && childHash["arm51"].exists){ childHash["arm51"].addAnimation(new RotateTo(150 ,POSEY ,0) ,"wall"); } if("arm61" in childHash && childHash["arm61"].exists){ childHash["arm61"].addAnimation(new RotateTo(150 ,POSEY ,0) ,"wall"); } */ } /* if(nowStateCnt > 100){ if("arm11" in childHash && childHash["arm11"].exists){ if(childHash["arm11"].dist < 1000)childHash["arm11"].dist += 5.0; } if("arm21" in childHash && childHash["arm21"].exists){ if(childHash["arm21"].dist < 1000)childHash["arm21"].dist += 5.0; } if("arm31" in childHash && childHash["arm31"].exists){ if(childHash["arm31"].dist < 1000)childHash["arm31"].dist += 5.0; } if("arm41" in childHash && childHash["arm41"].exists){ if(childHash["arm41"].dist < 1000)childHash["arm41"].dist += 5.0; } if("arm51" in childHash && childHash["arm51"].exists){ if(childHash["arm51"].dist < 1000)childHash["arm51"].dist += 5.0; } if("arm61" in childHash && childHash["arm61"].exists){ if(childHash["arm61"].dist < 1000)childHash["arm61"].dist += 5.0; } } */ if(nowStateCnt == 100){ addAnimation(new RotateTo(150 ,POSEY ,60) ,"pose"); for(int i=0;i<6;i++){ if(i%2 == 0)speed[i] = -1.5; else speed[i] = -3.0; } if("arm11" in childHash && childHash["arm11"].exists){ childHash["arm11"].addAnimation(new RotateTo(150 ,POSEY ,-60) ,"wall"); } if("arm21" in childHash && childHash["arm21"].exists){ childHash["arm21"].addAnimation(new RotateTo(150 ,POSEY ,-60) ,"wall"); } if("arm31" in childHash && childHash["arm31"].exists){ childHash["arm31"].addAnimation(new RotateTo(150 ,POSEY ,-60) ,"wall"); } if("arm41" in childHash && childHash["arm41"].exists){ childHash["arm41"].addAnimation(new RotateTo(150 ,POSEY ,-60) ,"wall"); } if("arm51" in childHash && childHash["arm51"].exists){ childHash["arm51"].addAnimation(new RotateTo(150 ,POSEY ,-60) ,"wall"); } if("arm61" in childHash && childHash["arm61"].exists){ childHash["arm61"].addAnimation(new RotateTo(150 ,POSEY ,-60) ,"wall"); } changeState("laststandby3"); } break; case "laststandby3": if("arm11" in childHash && childHash["arm11"].exists){ if(childHash["arm11"].dist < 500)childHash["arm11"].dist += 5.0; }else childHash["arm11"].dist = 500; if("arm21" in childHash && childHash["arm21"].exists){ if(childHash["arm21"].dist < 500)childHash["arm21"].dist += 5.0; }else childHash["arm21"].dist = 500; if("arm31" in childHash && childHash["arm31"].exists){ if(childHash["arm31"].dist < 500)childHash["arm31"].dist += 5.0; }else childHash["arm31"].dist = 500; if("arm41" in childHash && childHash["arm41"].exists){ if(childHash["arm41"].dist < 500)childHash["arm41"].dist += 5.0; }else childHash["arm41"].dist = 500; if("arm51" in childHash && childHash["arm51"].exists){ if(childHash["arm51"].dist < 500)childHash["arm51"].dist += 5.0; }else childHash["arm51"].dist = 500; if("arm61" in childHash && childHash["arm61"].exists){ if(childHash["arm61"].dist < 500)childHash["arm61"].dist += 5.0; }else childHash["arm61"].dist = 500; if(rpos.z < -800)pos.z += 1.0; else if(nowStateCnt > 200){ changeState("lastattack2"); } // moveWall(); break; case "lastattack2": if(nowStateCnt % 60 == 0 && nowStateCnt <= 540)new AttackRing(this ,"bring" ,60); // if(nowStateCnt % 240 == 40)new AttackRing(this ,"ering" ,60); moveWall(); if(nowStateCnt == 600){ if("arm11" in childHash && childHash["arm11"].exists){ childHash["arm11"].addAnimation(new RotateTo(150 ,LINKY ,0) ,"turret1"); childHash["arm11"].addAnimation(new RotateTo(150 ,POSEY ,90) ,"turret2"); } if("arm21" in childHash && childHash["arm21"].exists){ childHash["arm21"].addAnimation(new RotateTo(150 ,LINKY ,0) ,"turret1"); childHash["arm21"].addAnimation(new RotateTo(150 ,POSEY ,90) ,"turret2"); } if("arm31" in childHash && childHash["arm31"].exists){ childHash["arm31"].addAnimation(new RotateTo(150 ,LINKY ,0) ,"turret1"); childHash["arm31"].addAnimation(new RotateTo(150 ,POSEY ,90) ,"turret2"); } if("arm41" in childHash && childHash["arm41"].exists){ childHash["arm41"].addAnimation(new RotateTo(150 ,LINKY ,0) ,"turret1"); childHash["arm41"].addAnimation(new RotateTo(150 ,POSEY ,90) ,"turret2"); } if("arm51" in childHash && childHash["arm51"].exists){ childHash["arm51"].addAnimation(new RotateTo(150 ,LINKY ,0) ,"turret1"); childHash["arm51"].addAnimation(new RotateTo(150 ,POSEY ,90) ,"turret2"); } if("arm61" in childHash && childHash["arm61"].exists){ childHash["arm61"].addAnimation(new RotateTo(150 ,LINKY ,0) ,"turret1"); childHash["arm61"].addAnimation(new RotateTo(150 ,POSEY ,90) ,"turret2"); } addAnimation(new RotateTo(150 ,POSEY ,0) ,"pose"); changeState("laststandby4"); } break; case "laststandby4": if(rpos.z > -900)pos.z -= 1.5; else{ changeState("laststandby5"); } break; case "laststandby5": if(rpos.z > -1200)pos.z -= 1.5; else if(nowStateCnt > 230)changeState("lastattack1"); if("arm11" in childHash && childHash["arm11"].exists){ if(childHash["arm11"].dist < 150 - 2.0)childHash["arm11"].dist +=2.0; else if(150 + 2.0 200){ Animation swing = childHash["tail_0"].animes["swing"]; if(swing !is null && swing.count % swing.span == 0){ swing.vanish(); childHash["tail_0"].addAnimation(new Swing(200 ,BOTHZ ,-0.6 ,0.9 ,20 ,true) ,"swing"); } } */ } } projectL_1001/src/util/0000755000000000000000000000000010740417365013552 5ustar rootrootprojectL_1001/src/util/collision.d0000644000000000000000000001173110542576442015717 0ustar rootrootmodule util.collision; private import util.parts; private import util.vector; private import util.beam; private import std.math; private import br.ship; public interface Collision{ public bool add(Parts p, int group ); public void collisionDetect(int kind); public void clear(); } public class CollisionLaser:Collision{ public: Beam laser; Parts[] group; int idx; const int maxParts; public this(){ maxParts = 16; group.length = maxParts; idx = 0; } public this(int n){ maxParts = n; group.length = maxParts; idx = 0; } public bool add(Parts p ,int g ){ switch(g){ case 1: laser = cast(Beam)p; assert(laser !is null); return true; //break; case 2: for(int i = 0;i < group.length;i ++){ if(group[idx] is null || !group[idx].exists()){ group[idx] = p; return true; } idx ++; if(group.length <= idx)idx = 0; } //break; return false; default: return false; //break; } return false; } public void collisionDetect(int kind){ if(laser is null || !laser.exists || !laser.drawn){ foreach(inout Parts p;group){ if (p !is null && p.exists){ p.laserState =p.NONE; } } return; } Vector l = new Vector(laser.rpos.x ,laser.rpos.y); Vector aim = new Vector(cos(laser.rlinkZ*PI/180) , sin(laser.rlinkZ*PI/180)); Vector vaim = new Vector(-aim.y ,aim.x); Vector el = l + aim * laser.length; //Parts p; //if(p is null || p.exists || p.drawn)return; foreach(inout Parts p;group){ if (p !is null && p.exists){ if(!p.inCollisionRange){ p.laserState =p.NONE; continue; } Vector dpos = new Vector(p.rpos.x ,p.rpos.y) - l + aim * p.collisionRange; // Vector dposb = new Vector(p.rpos.x ,p.rpos.y) - l - aim * p.collisionRange; Vector dpos2 = new Vector(p.rpos.x ,p.rpos.y) - el - aim * p.collisionRange; // Vector dpos2b = new Vector(p.rpos.x ,p.rpos.y) - el - aim * p.collisionRange; if(vecDot(dpos ,aim) < 0 || vecDot(dpos2 ,aim * -1) < 0){ p.laserState = p.NONE; }else{ if(vecDot(dpos ,vaim) > 0){ if(p.laserState == p.LEFT){ laser.reportCollision(kind); p.reportCollision(kind); } p.laserState = p.RIGHT; }else{ if(p.laserState == p.RIGHT){ laser.reportCollision(kind); p.reportCollision(kind); } p.laserState = p.LEFT; } } if(laser is null)break; if(!laser.exists)break; } } } public void clear(){ laser = null; foreach(inout Parts p;group){ p = null; } idx = 0; } } public class CollisionNormal:Collision{ public: Parts[] group1; Parts[] group2; int idx1 ,idx2; const int maxParts; public this() { maxParts = 16; group1.length = maxParts; group2.length = maxParts; idx1 = 0; idx2 = 0; } public this(int n){ maxParts = n; group1.length = maxParts; group2.length = maxParts; idx1 = 0; idx2 = 0; } public bool add(Parts p ,int group ){ Parts[] g; int *idx; switch(group){ case 1:g = group1;idx = &idx1;break; case 2:g = group2;idx = &idx2;break; default:return false; } for(int i = 0;i < g.length;i ++){ if(g[*idx] is null || !g[*idx].exists()){ g[*idx] = p; return true; } *idx = *idx + 1; if(g.length <= *idx)*idx = 0; } return false; } public void collisionDetect(int kind){ Parts p1 ,p2; for (int i = 0;i < group1.length;i ++){ p1 = group1[i]; if (p1 !is null && p1.exists && p1.drawn){ if(!p1.inCollisionRange)continue; for (int j = 0;j < group2.length;j ++){ p2 = group2[j]; if (p2 !is null && p2.exists && p2.drawn){ if(!p2.inCollisionRange)continue; if(p1.rpos.dist(p2.rpos) < p1.collisionRange + p2.collisionRange){ p1.reportCollision(kind); p2.reportCollision(kind); } } if(p1 is null)break; if(!p1.exists)break; } } } } public void clear() { foreach(inout Parts p;group1){ p = null; } foreach(inout Parts p;group2){ p = null; } idx1 = idx2 = 0; } } public class CollisionManager{ public: enum kind { BULLET ,SHIP ,LASER ,SWORD ,BOMB}; const int MAX; Collision[] collisions; protected: int partsIdx = 0; public this(int n) { MAX = kind.max + 1; collisions.length = MAX; for(int i = 0;i < MAX;i ++){ switch(i){ case kind.LASER: case kind.SWORD: collisions[i] = new CollisionLaser(n); break; default: collisions[i] = new CollisionNormal(n); break; } } } public bool add(Parts p ,int kind ,int group){ if(kind < 0 || MAX <= kind)return false; return collisions[kind].add(p ,group); } public void collisionDetect(){ for(int i = 0;i < MAX; i++){ collisions[i].collisionDetect(i); } } public void clear() { foreach(Collision c;collisions){ c.clear(); } } } projectL_1001/src/util/timer.d0000644000000000000000000000135610540755700015040 0ustar rootrootmodule util.timer; private import std.math; private import util.ascii; //public float timerR = 1.0,timerG = 1.0 ,timerB = 1.0 ; public void drawTimer(int timer,float x,float y ,float scale = 1.0){ if(3600 * 100 <= timer)timer = 3600 * 100 -1; drawNumber((((timer / 60) / 60) / 10) % 10,x + 0 ,y ,scale); drawNumber(((timer / 60) / 60) % 10,x + 30*scale ,y ,scale); drawColon(x+50*scale ,y ,scale); drawNumber(((timer / 60) % 60) / 10,x + 70*scale ,y ,scale); drawNumber(((timer / 60) % 60) % 10,x + 100*scale ,y ,scale); drawColon(x+120*scale ,y ,scale); drawNumber(cast(int)ceil((timer % 60) / 0.6) / 10 ,x + 150*scale ,y ,scale); drawNumber(cast(int)ceil((timer % 60) / 0.6) % 10 ,x + 180*scale ,y ,scale); } projectL_1001/src/util/particle.d0000644000000000000000000002205210540761604015517 0ustar rootrootmodule util.particle; private import opengl; private import std.math; private import util.parts; private import util.vector; private import util.shape; private import util.matrix; private import util.log; private import br.gamemanager; /* public class Particle_old:Parts{ public Vector3 velocity; public double dposeX ,dposeY ,dposeZ; public this(Shape shape, double size ,ubyte drawing ,Vector3 pos ,Vector3 vel ,Matrix rposeBase ,double R ,double G ,double B ,double alpha){ this.shape = cast(Shape)shape.clone(); this.size = size; this.pos = cast(Vector3)pos.clone(); this.velocity = cast(Vector3)vel.clone(); setPoseBase(rposeBase); this.R = R; this.G = G; this.B = B; this.alpha = alpha; this.drawing = drawing; dposeX = rand.nextFloat(10); dposeY = rand.nextFloat(10); dposeZ = rand.nextFloat(10); } public void move(){ super.move(); if(cnt > 3){ pos += velocity; poseX += dposeX; poseY += dposeY; poseZ += dposeZ; velocity *= 0.95; } alpha *= 0.95; if(alpha < 0.1)vanish(); } } */ public class Particle{ public: Vector3 velocity; double dpose; double pose; // double dposeX ,dposeY ,dposeZ; double poseX ,poseY ,poseZ; Matrix poseBase; Shape shape; double size; ubyte drawing; Vector3 pos; // Vector3 vel; // Matrix rposeBase; double R ,G ,B ,alpha; int cnt; private bool _exists; public this(){ _exists = false; } public void set(Shape shape, double size ,ubyte drawing ,Vector3 pos ,Vector3 vel ,Matrix rposeBase ,double R ,double G ,double B ,double alpha){ this.shape = cast(Shape)shape.clone(); this.size = size; this.pos = cast(Vector3)pos.clone(); this.velocity = cast(Vector3)vel.clone(); this.poseBase = cast(Matrix)rposeBase.clone(); this.R = R; this.G = G; this.B = B; this.alpha = alpha; this.drawing = drawing; poseX = 0.0; poseY = 0.0; poseZ = 0.0; pose = 0.0; dpose = rand.nextFloat(20); poseX = rand.nextFloat(1); poseY = rand.nextFloat(1); poseZ = rand.nextFloat(1); double dist = sqrt(poseX * poseX + poseY * poseY + poseZ * poseZ); if((1e-6) < dist){ poseX = poseX / dist; poseY = poseY / dist; poseZ = poseZ / dist; } /* dposeX = rand.nextFloat(10); dposeY = rand.nextFloat(10); dposeZ = rand.nextFloat(10); */ cnt = 0; _exists = true; } public void move(){ // super.move(); cnt ++; if(cnt > 3){ pos += velocity; pose += dpose; /* poseX += dposeX; poseY += dposeY; poseZ += dposeZ; */ velocity *= 0.95; } alpha *= 0.95; if(alpha < 0.1)vanish(); } public void draw(){ //glLoadIdentity(); // double size = 10.0; // Matrix rpose = poseBase; // Matrix drawpose = rpose //Matrix p = matRotateX(rposeX) * matRotateY(rposeY) * matRotateZ(rposeZ) * matScale(size * scaleX ,size * scaleY ,size * scaleZ) * poseBase; glTranslatef(pos.x ,pos.y ,pos.z); glScaled(size ,size ,size); glRotated(pose ,poseX ,poseY ,poseZ); if(shape !is null && (1e-6) < size){ // shape.transformMatrix(rpose); Vector3[] av = shape.v; // glEnable(GL_POLYGON_SMOOTH); Vector3 ave; if(drawing & Parts.POLYGON){ polyRect[] pr = shape.rects; for(int i = 0; i < pr.length ;i ++){ glBegin(GL_POLYGON); ave = new Vector3((av[pr[i].v[0]] + av[pr[i].v[1]] + av[pr[i].v[2]] + av[pr[i].v[3]]) / 4.0); double a = fmax(0.0,(1.0 + (pos.z + ave.z) / 1600.0) * alpha); glColor3d(R * a ,G * a ,B * a); //glColor4d(R ,G ,B ,fmax(0.0,(1.0 + (pos.z + ave.z) / 1600.0) * alpha)); //glColor4f(1.0f ,1.0f ,1.0f,(1.0 + (pos.z + ave.z) / 1600.0) * 0.6); for(int j = 0;j < 4 ;j ++){ glVertex3f(av[pr[i].v[j]].x,av[pr[i].v[j]].y,av[pr[i].v[j]].z); } glEnd(); } } // glDisable(GL_POLYGON_SMOOTH); glEnable(GL_BLEND); glEnable(GL_LINE_SMOOTH); if(drawing & Parts.WIRE){ int[][] wires = shape.wires; // double a = fmin(1.0 ,fmax(0.0 ,alpha)); for(int i = 0; i < wires.length ;i ++){ // glColor3d(R * a ,G * a ,B * a); // glColor4d(R ,G ,B ,fmax(0.0,alpha)); glBegin(GL_LINE_STRIP); glVertex3f(0 ,0,0); glVertex3f(0 ,0,0); glColor4d(R ,G ,B ,fmax(0.0,alpha)); for(int j = 0; j < wires[i].length;j ++){ // double a = alpha * fmax(0.0,(1.0 + (pos.z + av[wires[i][j]].z + 600.0) / 1200.0)); // glColor4d(R ,G ,B ,fmax(0.0,a)); glVertex3f(av[wires[i][j]].x ,av[wires[i][j]].y ,av[wires[i][j]].z); //glVertex3f(av[wires[i][j + 1]].x ,av[wires[i][j + 1]].y ,av[wires[i][j + 1]].z); } glEnd(); } } glDisable(GL_LINE_SMOOTH); glDisable(GL_BLEND); // shape.resetVertex(); } // drawn = true; } public void vanish(){ _exists = false; } public bool exists(){ return _exists; } } public void makeParticle(Shape shape, double size, ubyte drawing, Vector3 pos ,Vector3 vel ,Matrix rpose ,double R ,double G ,double B ,double alpha){ if(shape !is null){ foreach(polyRect r;shape.rects){ Vector3[] v; int[][] wires; polyRect[] rects; v.length = r.v.length; for(int i=0;ideg0) if(deg-deg0<180)return -1.0; else return 1.0; else if(deg0-deg<180)return 1.0; else return -1.0; } public double radlimit(double rad0){ double rad = rad0; while(rad < -PI)rad += 2.0 * PI; while(PI rad0) if(rad-rad0 (1e-6)){ dDeg = (targetDeg - *parts.pDeg(degType)) / cast(double)(span - count); } } public void run(){ super.run(); if(parts !is null && parts.exists){ parts.rotate(degType ,dDeg , alpha); } } } public class Rotate:Animation{ public: double dDeg; double alpha; uint degType; public this(int span ,uint degType ,double dDeg ,double alpha = 0.0 ,bool repeat = false){ super(span ,repeat); this.degType = degType; this.dDeg = dDeg; this.alpha = alpha; } public void run(){ super.run(); if(parts !is null && parts.exists){ parts.rotate(degType ,dDeg , alpha); } } } public class RotateAll:Animation{ public: Matrix d; public this(int span ,Matrix d ,bool repeat = false){ super(span ,repeat); this.d = cast(Matrix)d.clone(); } public void run(){ super.run(); if(parts !is null && parts.exists){ parts.rotateAll(d); } } } public class ExtendTo:Animation{ public: double dDist; double targetDist; double alpha; public this(int span ,double targetDist ,double alpha = 0.0 ,bool repeat = false){ super(span ,repeat); this.targetDist = targetDist; this.dDist = 0; this.alpha = alpha; } public void set(Parts parts){ super.set(parts); if(abs(span - count) > (1e-6)){ dDist = (targetDist - parts.dist) / cast(double)(span - count); } } public void run(){ super.run(); if(parts !is null && parts.exists){ parts.dist += dDist; } } }projectL_1001/src/util/rand.d0000644000000000000000000001724510537070340014644 0ustar rootroot/* * $Id: rand.d,v 1.2 2005/01/01 12:40:28 kenta Exp $ * * Copyright 2004 Kenta Cho. Some rights reserved. */ module util.rand; private import std.stream; private import std.date; /** * Random number generator. */ public class Rand { public this() { d_time timer = getUTCtime(); init_genrand(cast(uint)timer); } public void setSeed(long n) { init_genrand(cast(uint)n); } public uint nextInt32() { return genrand_int32(); } public int nextInt(int n) { if (n == 0) return 0; else return genrand_int32() % n; } public int nextSignedInt(int n) { if (n == 0) return 0; else return genrand_int32() % (n * 2) - n; } public float nextFloat(float n) { return genrand_real1() * n; } public float nextSignedFloat(float n) { return genrand_real1() * (n * 2) - n; } /* MT.d Mersenne Twister random number generator -- D Based on code by Makoto Matsumoto, Takuji Nishimura, Shawn Cokus, Matthe Bellew, and Isaku Wada Andrew C. Edwards v0.1 30 September 2003 edwardsac@ieee.org Before using, initialize the state by using init_genrand(seed) or init_by_array(init_key, key_length). Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, Copyright (C) 2003, Andrew C. Edwards 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. The names of its contributors may not 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. The original code included the following notice: Any feedback is very welcome. http://www.math.keio.ac.jp/matumoto/emt.html email: matumoto@math.keio.ac.jp Please CC: edwardsac@ieee.org on all correspondence */ /* Modified by Kenta Cho. Remove 'static' to wrap with Rand class. */ /* Period parameters */ const int N = 624; const int M = 397; const uint MATRIX_A = 0x9908b0dfUL; /* constant vector a */ const uint UMASK = 0x80000000UL; /* most significant w-r bits */ const uint LMASK = 0x7fffffffUL; /* least significant r bits */ uint MIXBITS(uint u, uint v) { return (u & UMASK) | (v & LMASK); } uint TWIST(uint u,uint v) { return (MIXBITS(u,v) >> 1) ^ (v&1 ? MATRIX_A : 0); } uint state[N]; /* the array for the state vector */ int left = 1; int initf = 0; uint *next; /* initializes state[N] with a seed */ void init_genrand(uint s) { state[0]= cast(uint)(s & 0xffffffffUL); for (int j=1; j> 30)) + j); /* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */ /* In the previous versions, MSBs of the seed affect */ /* only MSBs of the array state[]. */ /* 2002/01/09 modified by Makoto Matsumoto */ state[j] &= 0xffffffffUL; /* for >32 bit machines */ } left = 1; initf = 1; } /* initialize by an array with array-length */ /* init_key is the array for initializing keys */ /* key_length is its length */ //uint init_key[]; //uint key_length; void init_by_array(uint init_key[], uint key_length) { int i, j, k; init_genrand(19650218UL); i=1; j=0; k = (N>key_length ? N : key_length); for (; k; k--) { state[i] = cast(uint)(state[i] ^ ((state[i-1] ^ (state[i-1] >> 30)) * 1664525UL)) + init_key[j] + j; /* non linear */ state[i] &= 0xffffffffUL; /* for WORDSIZE > 32 machines */ i++; j++; if (i>=N) { state[0] = state[N-1]; i=1; } if (j>=key_length) j=0; } for (k=N-1; k; k--) { state[i] = cast(uint)(state[i] ^ ((state[i-1] ^ (state[i-1] >> 30)) * 1566083941UL)) - i; /* non linear */ state[i] &= 0xffffffffUL; /* for WORDSIZE > 32 machines */ i++; if (i>=N) { state[0] = state[N-1]; i=1; } } state[0] = 0x80000000UL; /* MSB is 1; assuring non-zero initial array */ left = 1; initf = 1; } void next_state() { uint *p=state; /* if init_genrand() has not been called, */ /* a default initial seed is used */ if (initf==0) init_genrand(5489UL); left = N; next = state; for (int j=N-M+1; --j; p++) *p = p[M] ^ TWIST(p[0], p[1]); for (int j=M; --j; p++) *p = p[M-N] ^ TWIST(p[0], p[1]); *p = p[M-N] ^ TWIST(p[0], state[0]); } /* generates a random number on [0,0xffffffff]-interval */ uint genrand_int32() { uint y; if (--left == 0) next_state(); y = *next++; /* Tempering */ y ^= (y >> 11); y ^= (y << 7) & 0x9d2c5680UL; y ^= (y << 15) & 0xefc60000UL; y ^= (y >> 18); return y; } /* generates a random number on [0,0x7fffffff]-interval */ long genrand_int31() { uint y; if (--left == 0) next_state(); y = *next++; /* Tempering */ y ^= (y >> 11); y ^= (y << 7) & 0x9d2c5680UL; y ^= (y << 15) & 0xefc60000UL; y ^= (y >> 18); return cast(long)(y>>1); } /* generates a random number on [0,1]-real-interval */ double genrand_real1() { uint y; if (--left == 0) next_state(); y = *next++; /* Tempering */ y ^= (y >> 11); y ^= (y << 7) & 0x9d2c5680UL; y ^= (y << 15) & 0xefc60000UL; y ^= (y >> 18); return cast(double)y * (1.0/4294967295.0); /* divided by 2^32-1 */ } /* generates a random number on [0,1)-real-interval */ double genrand_real2() { uint y; if (--left == 0) next_state(); y = *next++; /* Tempering */ y ^= (y >> 11); y ^= (y << 7) & 0x9d2c5680UL; y ^= (y << 15) & 0xefc60000UL; y ^= (y >> 18); return cast(double)y * (1.0/4294967296.0); /* divided by 2^32 */ } /* generates a random number on (0,1)-real-interval */ double genrand_real3() { uint y; if (--left == 0) next_state(); y = *next++; /* Tempering */ y ^= (y >> 11); y ^= (y << 7) & 0x9d2c5680UL; y ^= (y << 15) & 0xefc60000UL; y ^= (y >> 18); return (cast(double)y + 0.5) * (1.0/4294967296.0); /* divided by 2^32 */ } /* generates a random number on [0,1) with 53-bit resolution*/ double genrand_res53() { uint a=genrand_int32()>>5, b=genrand_int32()>>6; return(a*67108864.0+b)*(1.0/9007199254740992.0); } } projectL_1001/src/util/ascii.d0000644000000000000000000002215010542616752015010 0ustar rootrootmodule util.ascii; private import opengl; public float asciiR = 1.0,asciiG = 1.0 ,asciiB = 1.0 ,asciiAlpha = 1.0; public void drawColon(float x,float y ,float scale){ glColor3f(asciiR * asciiAlpha ,asciiG * asciiAlpha ,asciiB * asciiAlpha); for(int i=0;i<4;i++){ glPushMatrix(); glTranslatef(x ,y+((i/2)*2-1)*10*scale ,-800); glScalef(0.7 * scale ,0.7 * scale ,0.7 * scale); glBegin(GL_LINE_LOOP); glVertex2f(3 ,-4); glVertex2f(4 ,-3); glVertex2f(4 ,3); glVertex2f(3 ,4); glVertex2f(-3 ,4); glVertex2f(-4 ,3); glVertex2f(-4 ,-3); glVertex2f(-3 ,-4); glEnd(); glPopMatrix(); } } private: const int[] bar_a = [0 ,2 ,3 ,4 ,5 ,6]; const int[] bar_b = [ ,1 ,3 ,4 ,5 ,6]; const int[] bar_c = [0 ,1 ,4 ,6]; const int[] bar_d = [ 2 ,3 ,4 ,5 ,6]; const int[] bar_e = [0 ,1 ,2 ,3 ,4 ,6]; const int[] bar_f = [0 ,1 ,3 ,4 ]; const int[] bar_g = [0 ,1 ,2 ,3 ,5 ,6]; const int[] bar_h = [ 1 ,3 ,4 ,5 ]; const int[] bar_i = [ ,2 ,5 ]; const int[] bar_j = [ ,2 ,5 ,6]; const int[] bar_k = [ 1 ,3 ,4 ,6]; const int[] bar_l = [ 1 ,4 ,6]; const int[] bar_m = [0 ,1 ,3 ,4 ,6]; const int[] bar_n = [0 ,1 ,2 ,4 ,5 ]; const int[] bar_o = [0 ,1 ,2 ,4 ,5 ,6]; const int[] bar_p = [0 ,1 ,2 ,3 ,4 ]; const int[] bar_q = [0 ,1 ,2 ,3 ,5 ]; const int[] bar_r = [ ,3 ,4 ]; const int[] bar_s = [0 ,1 ,3 ,5 ,6]; const int[] bar_t = [0 ,1 ,4 ]; const int[] bar_u = [ 1 ,2 ,4 ,5 ,6]; const int[] bar_v = [ ,4 ,5 ,6]; const int[] bar_w = [0 ,2 ,3 ,5 ,6]; const int[] bar_x = [ 1 ,2 ,3 ,4 ,5 ]; const int[] bar_y = [ 1 ,2 ,3 ,5 ,6]; const int[] bar_z = [0 ,2 ,3 ,4 ,6]; const int[] bar__ = [ 6]; const int[] bar_0 = [0 ,1 ,2 ,4 ,5 ,6]; const int[] bar_1 = [ 2 ,5 ]; const int[] bar_2 = [0 ,2 ,3 ,4 ,6]; const int[] bar_3 = [0 ,2 ,3 ,5 ,6]; const int[] bar_4 = [ 1 ,2 ,3 ,5 ]; const int[] bar_5 = [0 ,1 ,3 ,5 ,6]; const int[] bar_6 = [0 ,1 ,3 ,4 ,5 ,6]; const int[] bar_7 = [0 ,2 ,5 ]; const int[] bar_8 = [0 ,1 ,2 ,3 ,4 ,5 ,6]; const int[] bar_9 = [0 ,1 ,2 ,3 ,5 ,6]; public void drawAlphabet(char c ,float x,float y ,float scale = 1.0){ bool[7] bar; foreach(inout b;bar){ b = false; } int[] bars; switch(c){ case 'a':case 'A':bars = bar_a;break; case 'b':case 'B':bars = bar_b;break; case 'c':case 'C':bars = bar_c;break; case 'd':case 'D':bars = bar_d;break; case 'e':case 'E':bars = bar_e;break; case 'f':case 'F':bars = bar_f;break; case 'g':case 'G':bars = bar_g;break; case 'h':case 'H':bars = bar_h;break; case 'i':case 'I':bars = bar_i;break; case 'j':case 'J':bars = bar_j;break; case 'k':case 'K':bars = bar_k;break; case 'l':case 'L':bars = bar_l;break; case 'm':case 'M':bars = bar_m;break; case 'n':case 'N':bars = bar_n;break; case 'o':case 'O':bars = bar_o;break; case 'p':case 'P':bars = bar_p;break; case 'q':case 'Q':bars = bar_q;break; case 'r':case 'R':bars = bar_r;break; case 's':case 'S':bars = bar_s;break; case 't':case 'T':bars = bar_t;break; case 'u':case 'U':bars = bar_u;break; case 'v':case 'V':bars = bar_v;break; case 'w':case 'W':bars = bar_w;break; case 'x':case 'X':bars = bar_x;break; case 'y':case 'Y':bars = bar_y;break; case 'z':case 'Z':bars = bar_z;break; case '.':case '_':bars = bar__;break; case '0': bars = bar_0;break; case '1': bars = bar_1;break; case '2': bars = bar_2;break; case '3': bars = bar_3;break; case '4': bars = bar_4;break; case '5': bars = bar_5;break; case '6': bars = bar_6;break; case '7': bars = bar_7;break; case '8': bars = bar_8;break; case '9': bars = bar_9;break; default:break; } foreach(int b;bars){ bar[b] = true; } drawCrossBar(x ,y+20*scale ,scale ,bar[0]); drawVerticalBar(x-10*scale ,y+10*scale ,scale ,bar[1]); drawVerticalBar(x+10*scale ,y+10*scale ,scale ,bar[2]); drawCrossBar(x ,y ,scale ,bar[3]); drawVerticalBar(x-10*scale ,y-10*scale ,scale ,bar[4]); drawVerticalBar(x+10*scale ,y-10*scale ,scale ,bar[5]); drawCrossBar(x ,y-20*scale ,scale ,bar[6]); /* drawCrossBar(x-10*scale ,y+20*scale ,scale ,bar[0]); drawCrossBar(x+10*scale ,y+20*scale ,scale ,bar[1]); drawVerticalBar(x-20*scale ,y+10*scale ,scale ,bar[2]); drawRightDownBar(x-10*scale ,y+10*scale ,scale ,bar[3]); drawVerticalBar(x ,y+10*scale ,scale ,bar[4]); drawRightUpBar(x+10*scale ,y+10*scale ,scale ,bar[5]); drawVerticalBar(x+20*scale ,y+10*scale ,scale ,bar[6]); drawCrossBar(x-10*scale ,y ,scale ,bar[7]); drawCrossBar(x+10*scale ,y ,scale ,bar[8]); drawVerticalBar(x-20*scale ,y-10*scale ,scale ,bar[9]); drawRightUpBar(x-10*scale ,y-10*scale ,scale ,bar[10]); drawVerticalBar(x ,y-10*scale ,scale ,bar[11]); drawRightDownBar(x+10*scale ,y-10*scale ,scale ,bar[12]); drawVerticalBar(x+20*scale ,y-10*scale ,scale ,bar[13]); drawCrossBar(x-10*scale ,y-20*scale ,scale ,bar[14]); drawCrossBar(x+10*scale ,y-20*scale ,scale ,bar[15]); */ } public void drawString(char[] s ,float x ,float y ,float scale = 1.0){ int dx = 0; foreach(char c;s){ drawAlphabet(c ,x + dx ,y ,scale); dx += scale * 30.0; } } public void drawStringCenter(char[] s ,float y ,float scale = 1.0){ int dx = 0; int x = (s.length - 1) * 30 / 2 * -1; foreach(char c;s){ drawAlphabet(c ,x + dx ,y ,scale); dx += scale * 30.0; } } public void drawString(char[] s ,float x ,float y ,int start ,int end ,float scale = 1.0){ // if(end < start || start >= s.length || end < 0)return; int dx = 0; for(int i=0;ispeed){ if(abs(linkZ-deglimit(taim+180))>speed){ if(daimmark(linkZ ,taim) > 0){ dDeg = speed; if(dDeg0 <= 0)speed =minSpeed; speed = fmin(speed+accSpeed ,maxSpeed); }else { dDeg = -speed; if(0 <= dDeg0)speed =minSpeed; speed = fmin(speed+accSpeed ,maxSpeed); } dDeg0 = dDeg; }else { if(abs(dDeg0) < (1e-6)){ speed = minSpeed; dDeg = speed; }else if(rolling)dDeg = dDeg0; else dDeg = -dDeg0; } }else{ linkZ = taim; dDeg = 0; speed = 0.0; } } public void set(double rposeZ){ this.poseZ = rposeZ; this.rposeZ = rposeZ; this.linkZ = rposeZ; this.taim = rposeZ; foreach(inout a;locusaim){ a = rposeZ; } foreach(inout p;locuspos){ p = parent.rpos; //+ new Vector3(dist * cos(linkZ) ,dist * sin(linkZ) ,0); } /* foreach(inout a;locusaim){ a = linkZ; } */ } public void draw(){ glPushMatrix(); super.draw(); glPopMatrix(); //if(started == true)throw new Exception(""); if(started == false){ started = true; for(int i = MAXLOCUS - 1;0 <= i;i --){ locuspos[i] = cast(Vector3)rpos.clone(); locusaim[i] = rposeZ; } if(started == false)throw new Exception(""); //return; } if(started == false)throw new Exception(""); /* glTranslatef(-rpos.x ,-rpos.y ,-rpos.z); for(int i = 0;i < (MAXLOCUS - drawDist); i+=drawDist){ Vector3 pos1 = locuspos[i]; Vector3 pos2 = locuspos[i+drawDist]; double aim1 = locusaim[i]; double aim2 = locusaim[i+drawDist]; if(drawDist <= i){ Vector3 pos0 = locuspos[i-drawDist]; double aim0 = locusaim[i-drawDist]; // glColor4d(locusR ,locusG ,locusB, locusAlpha * (MAXLOCUS - i) / MAXLOCUS); glBegin(GL_POLYGON); glColor4d(locusR ,locusG ,locusB, 0.0); glVertex3f(pos0.x ,pos0.y ,pos0.z); glVertex3f(pos0.x+rootLength * cos(aim0 * PI /180.0),pos0.y+rootLength * sin(aim0 * PI /180.0) ,pos0.z); glColor4d(locusR ,locusG ,locusB, locusAlpha * (MAXLOCUS - i) / MAXLOCUS); glVertex3f(pos1.x+rootLength * cos(aim1 * PI /180.0),pos1.y+rootLength * sin(aim1 * PI /180.0) ,pos1.z); glColor4d(locusR ,locusG ,locusB, 0.0); glVertex3f(pos1.x ,pos1.y ,pos1.z); glEnd(); glBegin(GL_POLYGON); glColor4d(locusR ,locusG ,locusB , 0.0 ); glVertex3f(pos0.x+rootLength * cos(aim0 * PI /180.0),pos0.y+rootLength * sin(aim0 * PI /180.0) ,pos0.z); glVertex3f(pos0.x+length * cos(aim0 * PI /180.0),pos0.y+length * sin(aim0 * PI /180.0) ,pos0.z); glColor4d(locusR ,locusG ,locusB, locusAlpha * (MAXLOCUS - i) / MAXLOCUS); glVertex3f(pos1.x+length * cos(aim1 * PI /180.0),pos1.y+length * sin(aim1 * PI /180.0) ,pos1.z); glVertex3f(pos1.x+rootLength * cos(aim1 * PI /180.0),pos1.y+rootLength * sin(aim1 * PI /180.0) ,pos1.z); glEnd(); } glBegin(GL_POLYGON); glColor4d(locusR ,locusG ,locusB, 0.0); glVertex3f(pos2.x ,pos2.y ,pos2.z); glVertex3f(pos2.x+rootLength * cos(aim2 * PI /180.0),pos2.y+rootLength * sin(aim2 * PI /180.0) ,pos2.z); glColor4d(locusR ,locusG ,locusB, locusAlpha * (MAXLOCUS - i) / MAXLOCUS); glVertex3f(pos1.x+rootLength * cos(aim1 * PI /180.0),pos1.y+rootLength * sin(aim1 * PI /180.0) ,pos1.z); glColor4d(locusR ,locusG ,locusB, 0.0); glVertex3f(pos1.x ,pos1.y ,pos1.z); glEnd(); glBegin(GL_POLYGON); glColor4d(locusR ,locusG ,locusB , 0.0 ); glVertex3f(pos2.x+rootLength * cos(aim2 * PI /180.0),pos2.y+rootLength * sin(aim2 * PI /180.0) ,pos2.z); glVertex3f(pos2.x+length * cos(aim2 * PI /180.0),pos2.y+length * sin(aim2 * PI /180.0) ,pos2.z); glColor4d(locusR ,locusG ,locusB, locusAlpha * (MAXLOCUS - i) / MAXLOCUS); glVertex3f(pos1.x+length * cos(aim1 * PI /180.0),pos1.y+length * sin(aim1 * PI /180.0) ,pos1.z); glVertex3f(pos1.x+rootLength * cos(aim1 * PI /180.0),pos1.y+rootLength * sin(aim1 * PI /180.0) ,pos1.z); glEnd(); */ glEnable(GL_BLEND); // glPushMatrix(); // glTranslatef(locuspos[0].x - rpos.x ,locuspos[0].y - rpos.y ,locuspos[0].z - rpos.z); /* glBegin(GL_POLYGON); glColor4d(locusR ,locusG ,locusB, 0.0); glVertex3f(0.0 ,0.0 ,0.0); glColor4d(locusR ,locusG ,locusB , locusAlpha * drawDist / MAXLOCUS ); glVertex3f(rootLength * cos(linkZ * PI /180.0),rootLength * sin(linkZ * PI /180.0) ,0.0); glColor4d(locusR ,locusG ,locusB, 0.0); glVertex3f(rootLength * cos(locusaim[0] * PI /180.0),rootLength * sin(locusaim[0] * PI /180.0) ,0.0); glColor4d(locusR ,locusG ,locusB, 0.0); glVertex3f(0.0 ,0.0 ,0.0); glEnd(); glBegin(GL_POLYGON); glColor4d(locusR ,locusG ,locusB , locusAlpha * drawDist / MAXLOCUS ); glVertex3f(rootLength * cos(linkZ * PI /180.0),rootLength * sin(linkZ * PI /180.0) ,0.0); glVertex3f(length * cos(linkZ * PI /180.0),length * sin(linkZ * PI /180.0) ,0.0); glColor4d(locusR ,locusG ,locusB, 0.0); glVertex3f(length * cos(locusaim[0] * PI /180.0),length * sin(locusaim[0] * PI /180.0) ,0.0); glVertex3f(rootLength * cos(locusaim[0] * PI /180.0),rootLength * sin(locusaim[0] * PI /180.0) ,0.0); glEnd(); */ // glPopMatrix(); for(int i = 0;i < (MAXLOCUS - drawDist); i+=drawDist){ glPushMatrix(); glBegin(GL_POLYGON); glColor4d(locusR ,locusG ,locusB, 0.0); glVertex3f(rpos.x ,rpos.y ,rpos.z); glColor4d(locusR ,locusG ,locusB , locusAlpha * drawDist / MAXLOCUS ); glVertex3f(rpos.x+rootLength * cos(rposeZ*PI/180) ,rpos.y+rootLength * sin(rposeZ*PI/180) ,rpos.z); glColor4d(locusR ,locusG ,locusB, 0.0); glVertex3f(locuspos[i+drawDist].x +rootLength * cos(locusaim[i+drawDist] * PI /180.0),locuspos[i+drawDist].y+rootLength * sin(locusaim[i+drawDist] * PI /180.0) ,locuspos[i+drawDist].z); glVertex3f(locuspos[i+drawDist].x ,locuspos[i+drawDist].y ,locuspos[i+drawDist].z); glEnd(); glBegin(GL_POLYGON); glColor4d(locusR ,locusG ,locusB , locusAlpha * drawDist / MAXLOCUS ); glVertex3f(rpos.x+rootLength * cos(rposeZ * PI /180.0),rpos.y+rootLength * sin(rposeZ * PI /180.0) ,rpos.z); glVertex3f(rpos.x+length * cos(rposeZ*PI/180) ,rpos.y+length * sin(rposeZ*PI/180) ,rpos.z); for(int j=0;j JOYSTICK_AXIS) dir |= Dir.RIGHT; if (keys[SDLK_LEFT] == SDL_PRESSED || keys[SDLK_KP4] == SDL_PRESSED || keys[SDLK_a] == SDL_PRESSED || x < -JOYSTICK_AXIS) dir |= Dir.LEFT; if (keys[SDLK_DOWN] == SDL_PRESSED || keys[SDLK_KP2] == SDL_PRESSED || keys[SDLK_s] == SDL_PRESSED || y > JOYSTICK_AXIS) dir |= Dir.DOWN; if (keys[SDLK_UP] == SDL_PRESSED || keys[SDLK_KP8] == SDL_PRESSED || keys[SDLK_w] == SDL_PRESSED || y < -JOYSTICK_AXIS) dir |= Dir.UP; return dir; } public int getButtonState() { int btn = 0; int btn1 = 0, btn2 = 0, btn3 = 0, btn4 = 0, btn5 = 0, btn6 = 0, btn7 = 0, btn8 = 0; if (stick) { btn1 = SDL_JoystickGetButton(stick, 0); btn2 = SDL_JoystickGetButton(stick, 1); btn3 = SDL_JoystickGetButton(stick, 2); btn4 = SDL_JoystickGetButton(stick, 3); btn5 = SDL_JoystickGetButton(stick, 4); btn6 = SDL_JoystickGetButton(stick, 5); btn7 = SDL_JoystickGetButton(stick, 6); btn8 = SDL_JoystickGetButton(stick, 7); } if (keys[SDLK_z] == SDL_PRESSED || keys[SDLK_PERIOD] == SDL_PRESSED || keys[SDLK_LCTRL] == SDL_PRESSED || btn1 || btn4 || btn7) { btn |= Button.A; } if (keys[SDLK_x] == SDL_PRESSED || keys[SDLK_SLASH] == SDL_PRESSED || keys[SDLK_LSHIFT] == SDL_PRESSED || btn2 || btn5 || btn8) { btn |= Button.B; } if (keys[SDLK_c] == SDL_PRESSED || keys[SDLK_BACKSLASH] == SDL_PRESSED || keys[SDLK_LALT] == SDL_PRESSED || btn3 || btn6 ) { btn |= Button.C; } return btn; } } projectL_1001/src/util/record.d0000644000000000000000000000352110536135640015172 0ustar rootrootmodule util.record; private import std.stream; public class Record{ public: int[][] lapTime; int[][] totalTime; public this(int stage ,int rank){ lapTime.length = stage; totalTime.length = stage; foreach(inout int[] lap;lapTime){ lap.length = rank; } foreach(inout int[] total;totalTime){ total.length = rank; } start(); } public void start(){ foreach(inout int[] lap;lapTime){ foreach(inout int l;lap){ l = 359999; } } foreach(inout int[] total;totalTime){ foreach(inout int t;total){ t = 359999; } } } public void load(File fd){ foreach(inout int[] lap;lapTime){ foreach(inout int l;lap){ fd.read(l); } } foreach(inout int[] total;totalTime){ foreach(inout int t;total){ fd.read(t); } } } public void save(File fd){ foreach(inout int[] lap;lapTime){ foreach(inout int l;lap){ fd.write(l); } } foreach(inout int[] total;totalTime){ foreach(inout int t;total){ fd.write(t); } } } public int updateLapRecord(int stage ,int lap){ int rank = -1; if(lapTime.length <= stage)return -1; for(int i=0;i (1e-6))deg2 = acos((parent.rpos.z - rpos.z) / rpos.dist(parent.rpos)) * 180.0 / PI; else deg2 = 0.0; double deg = atan2(parent.rpos.y - rpos.y ,parent.rpos.x - rpos.x) * 180.0 / PI; rposeX = poseX + deg2; rposeY = poseY; rposeZ = poseZ + 180 + deg; break; default: rposeX = poseX; rposeY = poseY; rposeZ = poseZ; break; } }else{ rposeX = poseX; rposeY = poseY; rposeZ = poseZ; } rpose = matRotateXYZ(rposeX ,rposeY ,rposeZ) * matScale(scaleX * size ,scaleY * size ,scaleZ * size) * poseBase; ubyte dr; if(!inCollisionRange)dr = WIRE; else dr = drawing; // Matrix drawpose = rpose //Matrix p = matRotateX(rposeX) * matRotateY(rposeY) * matRotateZ(rposeZ) * matScale(size * scaleX ,size * scaleY ,size * scaleZ) * poseBase; glTranslatef(rpos.x + vpos.x ,rpos.y + vpos.y ,rpos.z + vpos.z); glPushMatrix(); // glScalef(scaleX * size ,scaleY * size ,scaleZ * size); //glScaled(size * scaleX ,size * scaleY ,size * scaleZ); if(shape !is null && (1e-6) < size){ // shape.transformMatrix(rpose); // double[16] rp = rpose.m glMultMatrixd(rpose.m[0]~rpose.m[1]~rpose.m[2]~rpose.m[3]); Vector3[] av = shape.v; // glEnable(GL_POLYGON_SMOOTH); Vector3 ave; if(dr & POLYGON){ polyRect[] pr = shape.rects; for(int i = 0; i < pr.length ;i ++){ glBegin(GL_POLYGON); ave = new Vector3((av[pr[i].v[0]] + av[pr[i].v[1]] + av[pr[i].v[2]] + av[pr[i].v[3]]) / 4.0); double a = fmax(0.0,(1.0 + (rpos.z + ave.z) / 1600.0) * alpha); glColor3d(R * a ,G * a ,B * a); //glColor4d(R ,G ,B ,fmax(0.0,(1.0 + (pos.z + ave.z) / 1600.0) * alpha)); //glColor4f(1.0f ,1.0f ,1.0f,(1.0 + (pos.z + ave.z) / 1600.0) * 0.6); for(int j = 0;j < 4 ;j ++){ glVertex3f(av[pr[i].v[j]].x,av[pr[i].v[j]].y,av[pr[i].v[j]].z); } glEnd(); } } // glDisable(GL_POLYGON_SMOOTH); glEnable(GL_BLEND); glEnable(GL_LINE_SMOOTH); if(dr & WIRE){ /* if(fabs(rpos.z+800) < 200.0){ glLineWidth(2); }else glLineWidth(1); */ int[][] wires = shape.wires; // double a = fmin(1.0 ,fmax(0.0 ,alpha)); for(int i = 0; i < wires.length ;i ++){ // glColor3d(R * a ,G * a ,B * a); // glColor4d(R ,G ,B ,fmax(0.0,alpha)); glBegin(GL_LINE_STRIP); for(int j = 0; j < wires[i].length;j ++){ double a; if(abs(rpos.z+ av[wires[i][j]].z + 800) < 100.0)a = alpha * fmax(0.0,(1.0 - fabs(rpos.z + av[wires[i][j]].z+800) / 800.0)); else a = alpha *0.5 * fmax(0.0,(1.0 - fabs(rpos.z + av[wires[i][j]].z+800) / 800.0)); glColor4d(R ,G ,B ,fmax(0.0,a)); glVertex3f(av[wires[i][j]].x ,av[wires[i][j]].y ,av[wires[i][j]].z); //glVertex3f(av[wires[i][j + 1]].x ,av[wires[i][j + 1]].y ,av[wires[i][j + 1]].z); } glEnd(); } // glLineWidth(1); } glDisable(GL_LINE_SMOOTH); glDisable(GL_BLEND); shape.resetVertex(); } glPopMatrix(); // glPushMatrix(); // drawCollision(); // glPopMatrix(); drawn = true; } private void drawCollision(){ if(collisionShape is null){ collisionShape = new SH_Sphere(1.0 ,8); } Shape shape = collisionShape; glTranslatef(rpos.x + vpos.x ,rpos.y + vpos.y ,rpos.z + vpos.z); glScalef(collisionRange*2 ,collisionRange*2 ,collisionRange*2 ); Vector3[] av = shape.v; int[][] wires = shape.wires; // double a = fmin(1.0 ,fmax(0.0 ,alpha)); for(int i = 0; i < wires.length ;i ++){ // glColor3d(R * a ,G * a ,B * a); // glColor4d(R ,G ,B ,fmax(0.0,alpha)); glBegin(GL_LINE_STRIP); for(int j = 0; j < wires[i].length;j ++){ double a; if(abs(rpos.z+ av[wires[i][j]].z + 800) < 100.0)a = alpha * fmax(0.0,(1.0 - fabs(rpos.z + av[wires[i][j]].z+800) / 800.0)); else a = alpha *0.5 * fmax(0.0,(1.0 - fabs(rpos.z + av[wires[i][j]].z+800) / 800.0)); glColor4d(R ,G ,B ,fmax(0.0,a)); glVertex3f(av[wires[i][j]].x ,av[wires[i][j]].y ,av[wires[i][j]].z); //glVertex3f(av[wires[i][j + 1]].x ,av[wires[i][j + 1]].y ,av[wires[i][j + 1]].z); } glEnd(); } } public void rotate(int object ,double deg ,double alpha = 0.0 ){ //rotate(linkX ,deg ,alpha ,engaged); double *oDeg1 ,oDeg2; switch(object){ case LINKX:oDeg1 = &linkX;break; case LINKY:oDeg1 = &linkY;break; case LINKZ:oDeg1 = &linkZ;break; case POSEX:oDeg1 = &poseX;break; case POSEY:oDeg1 = &poseY;break; case POSEZ:oDeg1 = &poseZ;break; case BOTHX:oDeg1 = &linkX;oDeg2 = &poseX;break; case BOTHY:oDeg1 = &linkY;oDeg2 = &poseY;break; case BOTHZ:oDeg1 = &linkZ;oDeg2 = &poseZ;break; default:return; } if(oDeg1 !is null)*oDeg1 += deg; if(oDeg2 !is null)*oDeg2 += deg; //pose *= matRotate(rad ,x ,y ,z); if(0 < childs.length){ for(int i = 0;i < childs.length;i ++){ if(childKind == ENGAGED){ // childs[i].rotate((object % 3) + 6 ,deg ,0.0); } if((1e-6) <= abs(alpha)) childs[i].rotate(object ,deg * alpha ,alpha); } } } public void rotateAll(Matrix m ){ poseBase *= m; linkBase *= m; if(0 < childs.length){ for(int i = 0;i < childs.length;i ++){ childs[i].rotateAll(m); } } } public void scale(double sx ,double sy ,double sz){ this.scaleX = sx; this.scaleY = sy; this.scaleZ = sz; //pose *= matScale(sx ,sy ,sz); } public double poseDirection(){ Vector3 poseV = vec3translate(new Vector3(1 ,0 ,0), rpose); return atan2(poseV.y ,poseV.x); } public bool exists(){ return _exists; } public bool exists(bool value) { return _exists = value; } public bool inCollisionRange(){ return (abs(rpos.z + 800) < collisionRange);/* && (rpos.y+size < screen.GAME_DOWN || screen.GAME_UP < rpos.y-size || screen.GAME_RIGHT < rpos.x-size || rpos.x+size < screen.GAME_LEFT );*/ } public bool attractPoseX(int object ,double deg ,double ddeg){ if(abs(poseX - deg) < ddeg){ poseX = deg; return false; }else if(poseX < deg){ poseX += ddeg; return true; }else{ poseX -= ddeg; return true; } } public bool attract(int object ,double deg ,double ddeg){ double *oDeg1 ,oDeg2; switch(object){ case LINKX:oDeg1 = &linkX;break; case LINKY:oDeg1 = &linkY;break; case LINKZ:oDeg1 = &linkZ;break; case POSEX:oDeg1 = &poseX;break; case POSEY:oDeg1 = &poseY;break; case POSEZ:oDeg1 = &poseZ;break; case BOTHX:oDeg1 = &linkX;oDeg2 = &poseX;break; case BOTHY:oDeg1 = &linkY;oDeg2 = &poseY;break; case BOTHZ:oDeg1 = &linkZ;oDeg2 = &poseZ;break; default:return false; } bool active = false; if(oDeg1 !is null){ if(abs(*oDeg1 - deg) < ddeg){ *oDeg1 = deg; }else if(*oDeg1 < deg){ *oDeg1 += ddeg; active = true; }else{ *oDeg1 -= ddeg; active = true; } } if(oDeg2 !is null){ if(abs(*oDeg2 - deg) < ddeg){ *oDeg2 = deg; }else if(*oDeg2 < deg){ *oDeg2 += ddeg; active = true; }else{ *oDeg2 -= ddeg; active = true; } } return active; } public void reportCollision(int kind){ destroy(); } public void destroy(){ vanish(); // destroyImpl(); } // public void destroyImpl(){} public void vanish(){ exists = false; if(parent !is null){ Parts c; for(int i = 0;i < parent.childs.length;i++){ c = parent.childs[i]; if(c is this){ for(int j = i;j>=1; j<<=1; } a_ = new T[j]; } this() { clear(); } private: T[] a_; int size_; }}projectL_1001/src/util/shape.d0000644000000000000000000003673110534775630015034 0ustar rootrootmodule util.shape; private import std.math; private import util.cloneable; private import std.string; private import util.vector; private import util.matrix; private import util.log; public struct polyRect{ public int[4] v; //public Vector3[4] v; //public Vector3 normal; } private Vector3[] multiple(Vector3[] a,float m){ Vector3[] result; result.length = a.length; for (int i = 0;i < a.length;i ++){ result[i] = a[i] * m; } return result; } private Vector3[] scale(Vector3[] a,float sx ,float sy ,float sz){ Vector3[] result; result.length = a.length; for (int i = 0;i < a.length;i ++){ result[i] = new Vector3(a[i].x * sx ,a[i].y * sy ,a[i].z * sz); } return result; } public class Shape:Cloneable{ private Vector3[] fixedV; public Vector3[] v; public int[][] wires; public polyRect[] rects; public this(){ } public this(Vector3[] v ,int[][] wires, polyRect[] rects){ set(v ,wires ,rects); } public Shape multi(float mul){ v = multiple(v ,mul); return this; } public Shape scalef(float sx ,float sy ,float sz){ scale(v ,sx ,sy ,sz); return this; } public void set(Vector3[] v ,int[][] wires, polyRect[] rects){ //this.fixedV = v.dup; this.fixedV.length = v.length; this.v.length = fixedV.length; for(int i = fixedV.length - 1;0 <= i;i --){ this.fixedV[i] = new Vector3(v[i]); this.v[i] = new Vector3(fixedV[i]); } this.wires.length = wires.length; for(int i = wires.length - 1;0 <= i;i --){ this.wires[i] = wires[i].dup; } this.rects.length = rects.length; for(int i = rects.length - 1;0 <= i;i --){ for(int j = rects[i].v.length - 1;0 <= j;j --){ this.rects[i].v[j] = rects[i].v[j]; } } } /* public Shape opAdd(Shape s){ Shape result = new Shape(); result.fixedV = this.fixedV.dup ~ s.fixedV.dup; result.v.length = result.fixedV.length; for(int i = fixedV.length - 1;0 <= i;i --){ result.v[i] = new Vector3(fixedV[i]); } result.wires.length = this.wires.length + s.wires.length; for(int i = this.wires.length - 1;0 <= i;i --){ result.wires[i] = this.wires[i].dup; } for(int i = result.wires.length - 1 ;this.wires.length <= i;i --){ result.wires[i].length = s.wires[i - this.wires.length].length; for(int j = s.wires[i - this.wires.length].length; 0 <= j;j --){ result.wires[i][j] = 0;//s.wires[i - this.wires.length][j] + this.v.length; } } result.rects.length = this.rects.length + s.rects.length; for(int i = this.rects.length - 1;0 <= i;i --){ for(int j = this.rects[i].v.length - 1;0 <= j;j --){ result.rects[i].v[j] = 0;//this.rects[i].v[j]; } } for(int i = result.rects.length - 1;this.wires.length <= i;i --){ for(int j = s.rects[i - this.wires.length].v.length - 1;0 <= j;j --){ result.rects[i].v[j] = 0;//this.rects[i].v[j] + this.v.length; } } return result; } */ public Object clone(){ Shape shape = new Shape(v ,wires ,rects); return shape; } public void resetVertex(){ for(int i = v.length - 1;0 <= i;i --){ v[i] = new Vector3(fixedV[i]); } } public Shape reverseX(){ foreach(inout vec;v){ vec.x = -vec.x; } return this; } public Shape reverseY(){ foreach(inout vec;v){ vec.y = -vec.y; } return this; } public Shape reverseZ(){ foreach(inout vec;v){ vec.z = -vec.z; } return this; } public void rotated(double rad ,double x,double y ,double z){ Vector3 u = vec3Normalize(new Vector3(x ,y ,z)); double sin = sin(rad); double cos = cos(rad); double[3][3] UU; UU[0][0] = u.x * u.x;UU[0][1] = u.x * u.y;UU[0][2] = u.x * u.z; UU[1][0] = u.y * u.x;UU[1][1] = u.y * u.y;UU[1][2] = u.y * u.z; UU[2][0] = u.z * u.x;UU[2][1] = u.z * u.y;UU[2][2] = u.z * u.z; double[3][3] T ; T[0][0] = cos + (1 - cos) * UU[0][0]; T[0][1] = (1 - cos) * UU[0][1] - u.z * sin; T[0][2] = (1 - cos) * UU[0][2] + u.y * sin; T[1][0] = (1 - cos) * UU[1][0] + u.z * sin; T[1][1] = cos + (1 - cos) * UU[1][1]; T[1][2] = (1 - cos) * UU[1][2] - u.x * sin; T[2][0] = (1 - cos) * UU[2][0] - u.y * sin; T[2][1] = (1 - cos) * UU[2][1] + u.x * sin; T[2][2] = cos + (1 - cos) * UU[2][2]; for(int i = v.length - 1;0 <= i;i --){ v[i] = new Vector3( T[0][0] * v[i].x + T[0][1] * v[i].y + T[0][2] * v[i].z , T[1][0] * v[i].x + T[1][1] * v[i].y + T[1][2] * v[i].z , T[2][0] * v[i].x + T[2][1] * v[i].y + T[2][2] * v[i].z ); } } /* public Shape translate(Vector3 dvec){ for(int i = fixedV.length - 1;0 <= i;i --){ fixedV[i] += dvec; } return this; } */ public void transformMatrix(Matrix t){ for(int i = v.length - 1;0 <= i;i --){ v[i] = vec3translate(v[i] , t); } } public void rollX(float d) { float sin = sin(d); float cos = cos(d); for(int i = v.length - 1;0 <= i;i --){ float ty = v[i].y * cos - v[i].z * sin; v[i].z = v[i].y * sin + v[i].z * cos; v[i].y = ty; } } public void rollY(float d) { float sin = sin(d); float cos = cos(d); for(int i = v.length - 1;0 <= i;i --){ float tx = v[i].x * cos - v[i].z * sin; v[i].z = v[i].x * sin + v[i].z * cos; v[i].x = tx; } } public void rollZ(float d) { float sin = sin(d); float cos = cos(d); for(int i = v.length - 1;0 <= i;i --){ float tx = v[i].x * cos - v[i].y * sin; v[i].y = v[i].x * sin + v[i].y * cos; v[i].x = tx; } } } public class SH_Pole:Shape{ public this(float[] a ,float[] b ,int segment){ if(a.length != b.length || a.length < 1){ Log_write("Pole arguments error" ); throw new Exception("Pole arguments error" ); } Vector3[][] vec; vec.length = segment; for(int i = segment - 1;0 <= i;i --){ vec[i].length = a.length; } for(int i = 0;i < segment ;i ++){ for(int j = 0;j < a.length ;j ++){ vec[i][j] = new Vector3(); vec[i][j].x = a[j]; vec[i][j].y = b[j] * cos(cast(float)i / cast(float)segment * PI * 2.0f); vec[i][j].z = b[j] * sin(cast(float)i / cast(float)segment * PI * 2.0f); } } joint(vec); } public this(float[][] a ,float[][] b ,int segment){ // make wire frame if(a.length != b.length || a.length < 1){ Log_write("Pole arguments error" ); throw new Exception("Pole arguments error" ); } int maxNum = 0; for(int i = a.length -1;0 <= i;i --){ if(a[i].length != b[i].length || a[i].length < 1){ Log_write("Pole arguments error" ); throw new Exception("Pole arguments error" ); } if(maxNum < a[i].length)maxNum = a[i].length; } Vector3[][] vec; vec.length = segment; for(int i = segment - 1;0 <= i;i --){ vec[i].length = maxNum; } int k,l; k = 0; for(int i = 0;i < segment ;i ++){ for(int j = 0;j < maxNum ;j ++){ if(j < a[k].length)l = j; else l = a[k].length - 1; vec[i][j] = new Vector3(); vec[i][j].x = a[k][l]; vec[i][j].y = b[k][l] * cos(cast(float)i / cast(float)segment * PI * 2.0f); vec[i][j].z = b[k][l] * sin(cast(float)i / cast(float)segment * PI * 2.0f); } k ++; if(a.length <= k)k = 0; } joint(vec); } public void joint(Vector3[][] vec){ Vector3[] tv; polyRect[] trects; int[] twires; int number = vec[0].length; for(int i = vec.length -1;0 <= i;i --){ if(vec[i].length != number || number < 1){ Log_write("Pole joint arguments error" ); throw new Exception("Pole joint arguments error" ); } } tv.length = vec.length * vec[0].length; for(int i = 0;i < vec.length ;i ++){ for(int j = 0;j < vec[i].length ;j ++){ tv[i * vec[0].length + j] = vec[i][j]; } } ///* twires.length = (2 * vec.length + 1) * vec[0].length; int num = 0; for(int j = 0;j < vec[0].length ;j ++){ twires[num] = j; num ++; for(int i = 0;i < vec.length ;i ++){ twires[num] = i * vec[0].length + j; num ++; } twires[num] = j; num ++; } ///* int seg = 0; while(true){ seg ++; if(vec.length <= seg)break; for(int j = vec[0].length - 1;0 <= j ;j --){ twires[num] = seg * vec[0].length + j; num ++; } seg ++; if(vec.length <= seg)break; for(int j = 0;j < vec[0].length ;j ++){ twires[num] = seg * vec[0].length + j; num ++; } } //make polygon ///* trects.length = vec.length * (vec[0].length - 1); num = 0; for(int i = 0;i < vec[0].length -1 ;i ++){ trects[num].v[0] = (vec.length - 1) * vec[0].length + i; trects[num].v[1] = (vec.length - 1) * vec[0].length + i + 1; trects[num].v[2] = i + 1; trects[num].v[3] = i; // rects[num].normal = getNormal(rects[num].v);//vec3NormalLine(rects[num].v[0] ,rects[num].v[2], rects[num].v[3]); num ++; } ///* for(int i = 0;i < vec.length - 1;i ++){ for(int j = 0;j < vec[i].length - 1;j ++){ trects[num].v[0] = i * vec[0].length + j; trects[num].v[1] = i * vec[0].length + j + 1; trects[num].v[2] = (i + 1) * vec[0].length + j + 1; trects[num].v[3] = (i + 1) * vec[0].length + j; // rects[num].normal = getNormal(rects[num].v);//vec3NormalLine(rects[num].v[0] ,rects[num].v[2], rects[num].v[3]); num ++; } } int[][] ttwires; ttwires.length = 1; ttwires[0] = twires.dup; set(tv ,ttwires ,trects); } private Vector3 getNormal(Vector3[4] v){ Vector3 v0,v1,v2; v0 = v[0]; if((1e-6) <= v0.dist(v[1]))v1 = v[1]; else v1 = v[2]; v2 = v[3]; return vec3NormalLine(v0 ,v1, v2); } } public class SH_Pot:Shape{ public this(float[] a ,float[] b ,float[] z ,float[] scale){ Vector3[][] vec; if(a.length != b.length){ Log_write("Pot arguments error"); throw new Exception("Pot arguments error"); } if(z.length != scale.length){ Log_write("Pot arguments error"); throw new Exception("Pot arguments error"); } vec.length = z.length; for(int i = 0;i < vec.length; i ++){ vec[i].length = a.length; } for(int i = 0;i < vec.length ;i ++){ for(int j = 0;j < vec[i].length ;j ++){ vec[i][j] = new Vector3(a[j] * scale[i] ,b[j] * scale[i] ,z[i]); } } joint(vec); } public void joint(Vector3[][] vec){ Vector3[] tv; polyRect[] trects; int[][] twires; int number = vec[0].length; for(int i = vec.length -1;0 <= i;i --){ if(vec[i].length != number || number < 1){ Log_write("Pot joint arguments error" ); throw new Exception("Pot joint arguments error" ); } } tv.length = vec.length * vec[0].length; for(int i = 0;i < vec.length ;i ++){ for(int j = 0;j < vec[0].length ;j ++){ tv[i * vec[0].length + j] = vec[i][j]; } } twires.length = vec.length + vec[0].length; for(int i = 0;i < vec.length;i ++){ twires[i].length = vec[i].length + 1; } for(int i = vec.length;i < twires.length;i ++){ twires[i].length = vec.length; } for(int i = 0;i < vec.length;i ++){ for(int j = 0;j < vec[i].length;j ++){ twires[i][j] = i * vec[0].length + j; } twires[i][vec[i].length] = i * vec[0].length + 0; } for(int j = 0;j < vec[0].length;j ++){ for(int i = 0;i < vec.length;i ++){ twires[vec.length + j][i] = i * vec[0].length + j; } } int num = 0; /* // twires.length = ((vec[0].length + 1) * vec.length) + vec.length + vec.length * (vec[0].length - 1) + (vec[0].length - 1); int num = 0; for(int i = 0;i < vec.length ;i ++){ twires[num] = i * vec[0].length + 0; num ++; for(int j = 0;j < vec[0].length ;j ++){ twires[num] = i * vec[0].length + j; num ++; } twires[num] = i * vec[0].length + 0; num ++; } int k ,l; l = 1; while(true){ if(vec[0].length <= l)break; for(k = vec.length - 1;0 <= k;k --){ twires[num] = k * vec[0].length + l; num ++; } l ++; if(vec[0].length <= l)break; for(k = 0;k < vec.length;k ++){ twires[num] = k * vec[0].length + l; num ++; } l ++; } */ // trects.length = (vec.length - 1) * vec[0].length; num = 0; for(int i = 0;i < vec.length - 1;i ++){ for(int j = 0;j < vec[0].length - 1;j ++){ trects[num].v[0] = i * vec[0].length + j; trects[num].v[1] = (i + 1) * vec[0].length + j; trects[num].v[2] = (i + 1) * vec[0].length + j + 1; trects[num].v[3] = i * vec[0].length + j + 1; num ++; } } for(int i = 0;i < vec.length - 1;i ++){ trects[num].v[0] = i * vec[0].length + vec[0].length - 1; trects[num].v[1] = (i + 1) * vec[0].length + vec[0].length - 1; trects[num].v[2] = (i + 1) * vec[0].length + 0; trects[num].v[3] = i * vec[0].length + 0; num ++; } int length = vec.length; if((1e-6) <= vec[0][0].size()){ polyRect[] cover; tv.length = tv.length + vec[0].length; cover.length = vec[0].length; length ++; for(int i = 0;i < vec[0].length;i ++){ tv[tv.length - vec[0].length + i] = new Vector3(0 ,0 ,vec[0][0].z); } num = 0; for(int j = 0;j < vec[0].length - 1;j ++){ cover[num].v[0] = 0 * vec[0].length + j; cover[num].v[1] = (length - 1) * vec[0].length + j; cover[num].v[2] = (length - 1) * vec[0].length + j + 1; cover[num].v[3] = 0 * vec[0].length + j + 1; num ++; } cover[num].v[0] = 0 * vec[0].length + vec[0].length - 1; cover[num].v[1] = (length - 1) * vec[0].length + vec[0].length - 1; cover[num].v[2] = (length - 1) * vec[0].length + 0; cover[num].v[3] = 0 * vec[0].length + 0; num ++; trects = trects~cover; } if((1e-6) <= vec[vec.length - 1][0].size()){ polyRect[] cover; tv.length = tv.length + vec[0].length; cover.length = vec[0].length; length ++; for(int i = 0;i < vec[0].length;i ++){ tv[tv.length - vec[0].length + i] = new Vector3(0 ,0 ,vec[vec.length - 1][0].z); } num = 0; for(int j = 0;j < vec[0].length - 1;j ++){ cover[num].v[0] = (vec.length - 1) * vec[0].length + j; cover[num].v[1] = (length - 1) * vec[0].length + j; cover[num].v[2] = (length - 1) * vec[0].length + j + 1; cover[num].v[3] = (vec.length - 1) * vec[0].length + j + 1; num ++; } cover[num].v[0] = (vec.length - 1) * vec[0].length + vec[0].length - 1; cover[num].v[1] = (length - 1) * vec[0].length + vec[0].length - 1; cover[num].v[2] = (length - 1) * vec[0].length + 0; cover[num].v[3] = (vec.length - 1) * vec[0].length + 0; num ++; trects = trects~cover; } int[][] ttwires; //ttwires.length = 1; //ttwires[0] = twires.dup; set(tv ,twires ,trects); } } public class SH_Sphere:SH_Pole{ public this(double scale ,int segment){ float[] a ,b; a.length = segment; b.length = segment; for(int i = 0;i < segment;i ++){ a[i] = cos(cast(double)i / cast(double)(segment - 1) * PI) * scale; b[i] = sin(cast(double)i / cast(double)(segment - 1) * PI) * scale; } super(a ,b ,segment); } } public class SH_Oval:SH_Pot{ public this(double width ,double height ,int segment){ float[] a ,b,z,scale; a.length = segment; b.length = segment; z.length = 1; scale.length = 1; z[0] = 0.0; scale[0] = 1.0; for(int i = 0;i < segment;i ++){ a[i] = cos(cast(double)i / cast(double)(segment - 1) * 2.0 *PI) * width; b[i] = sin(cast(double)i / cast(double)(segment - 1) * 2.0 * PI) * height; } super(a ,b ,z ,scale); } } projectL_1001/src/.poseidon0000644000000000000000000000035710503061176014413 0ustar rootrootサソ test2 *.d 0 projectL_1001/resource/0000755000000000000000000000000010740417365013635 5ustar rootrootprojectL_1001/resource/projectL.rc0000644000000000000000000000004410540617330015733 0ustar rootrootprojectL ICON PRELOAD "projectL.ico"projectL_1001/resource/projectL.ico0000644000000000000000000000613210540616164016111 0ustar rootroot D ( > 888888888888888888888888888888888889WK^WK^YM`YM`YM`_OdaPfaPf`OeD8?D8?D8?D8?D8?D8?D8?D8?D8?D8?D8?888888888888888888888888888888SJ[SJ[WK^WK^YM`YM`YM`aPfaPfaPfaPfaPfbQgD8?D8?D8?D8?D8?D8?D8?D8?D8?777777777777777777777777989RIZRIZVJ]VJ]VJ]XL_XL_XL_`Oe`Oe`Oe`Oe`Oe`Oe`OeC7>C7>C7>C7>C7>C7>C7>C7>777777777777777777777888SI[SI[RIZWK^WK^XM`XM`XM`XM``Pf`Pf`Pf`Pf`Pf`Pf`Pf`OeD7>D7>D7>D7>D7>D7>D7>777777777777777777777RIZRIZQIZ\N`\N`\N`XL_XL_XL_XL_`Oe`Oe`OeeSh”ueSh`Oe`OeYI\C7>C7>C7>C7>C7>C7>777777777777777777VL\salsaltbmvbnvbnvbnvbnvbn}_rWL_ftftftftftftftftftD8?C7>C7>C7>C7>C7>888888888888777YKKtbmtbmtbmwcowcowcowcowcoyap背背几gugugugugugugugu}dqiRXD8?D8?D8?D8?777777777>;;XJJ[KLsalsalsalvbnvbnvbnvbnubn砺砺砺砺砺ftftftftftftftftiRXiRXC7>C7>C7>777777566XJJYKK\LMsalsalubnvbnvbnvbnvbn砺砺砺砺砺砺遥ftftftftftftftiRXiRXiRXC7>C7>777777XJJXJJ[KLucnsalsalvbnvbnvbnvbn砺砺砺奔zz致~砺JvftftftftftftiRXiRXiRXlTZC7>777[LLXJJYKK[KLucnsalsalvbnvbnvbnzfu怐懸′怐懸′oooooftftftftftftiRXiRXiRXiRXD8?777XJJXJJ[KL[KLweqsalvbnvbnwco郭怐懸′怐懸′怐権ooooox牛|ftftftftiRXiRXiRXiRXkSY777XJJXJJ[KL[KL[KLsalvbn{fs郭郭怐懸′怐懸′「ヰooooo。ヰ及給yftftftiRXiRXiRXiRXiRXVIHXJJXJJXJJ\LM[KLsalwco郭郭郭怐懸′怐懸′怐懸′怐捲n。ヰoo郭郭郭ftgueOThQWjSYjSYiRXWJIWJIWJIYKKYKKYKKubntфtфtыu揩狛m揩狛m揩狛m揩狛m揩狛m揩豪t逆逆詠デPUfPUfPUfPUfPUfPUWJIWJIWJIWJIYKKYKKp_itфtфtцu它拳m揩狛m揩狛m揩狛m揩狛m揩豪t逆逆逆fPUfPUfPUfPUfPUfPUUHGTGFWJIWJIWJIWJIq`jtcntфtчu它憲憲憲拳m揩狛m揩狛m揩狛m逆逆逆wbov^lfPUfPUfPUfPUfPU566UHGUHGVIHWJIVIHq`jq`j{~tфt它憲憲憲憲憲拳m揩狛m揩狛m逆逆wcowcowcobNSbNSbNScNSfPU777TGFTGFTGFVIHTHFp_ip_ip_ip_is建建建建建建建憲懸l档濠svbnvbnvbnvbnaMRaMRaMRaMRaMR888TGFUHGUHGUHGp`iq`jq`jq`jq`jq`j怐憲憲憲憲憲憲憲憲憲軽gtwcowcowcowcowco`MP`MPbNSbNS132888888UHGUHGUHGp`io_hq`jq`jq`jq`jq`j罫vpw揩寺憲憲検ヰqyowtbmtbmtbmtbmwcowco`MP`MP`MP`MP888888888OECTGFUHGtcno_ho_hn^gq`jq`jq`jn^h罫wrz詠z詠z詠z詠z詠ztbmtbmtbmtbmtbmtbmsal`MP`MP`MP888888777777777UHFUHGTGFn^gn^gn^gn^gp_ip_ip_iq`j客v客wqyqyqyp_ip_ip_itbmsalsalsalsal[KL[KL566777777888888888888E?>RFDo_go_go_go_go_go_hp`jp`jo_i罫w罫w罫vp`jp`jp`jp`jp`jp`jtbmtbmtbn\LM888888888888777777777777777888m_hn^gn^gn^gn^gn^gn^gp_ip_ip_itbkp_ip_ip_ip_ip_ip_ip_ip_ip_i<::777777777777777777777777777777777777IDRLFTsajn^gn^gn^g_T_OGXMFVMFVMFVMFVtblp_ip_ip_itbkRIZTK\777777777777777777888888888888888888888676JESJESJESJESJESJESJESIDRNGWNGWNGWNGWNGWNGWMFVSJ[SJ[888888888888888888888777777777777777777777777B?GIDRIDRIDRIDRIDRIDRIDRIDRNGWMFVMFVMFVMFVMFVMFV888777777777777777777777888888888888888888888888888776JESJESJESJESJESJESJESJESJESNGWNGWNGWNGW888888888888888888888888888888888888888888888888888888888888JESJESJESJESJESJESJESJESJESNGW888888888888888888888888888888888888888888888888888888888888888888888888888JESJESJESJESLFV888888888888888888888888888888888888888projectL_1001/resource/shoot.def0000644000000000000000000000003707733302060015442 0ustar rootrootEXETYPE NT SUBSYSTEM WINDOWS projectL_1001/projectL.map0000644000000000000000000000452610557123016014267 0ustar rootroot Start Length Name Class 0002:00000000 0004BDCBH _TEXT CODE 32-bit 0002:0004BDCC 000002F4H ICODE ICODE 32-bit 0003:00000000 00000004H .CRT$XIA DATA 32-bit 0003:00000010 00000004H .CRT$XIZ DATA 32-bit 0003:00000020 00000004H .CRT$XCA DATA 32-bit 0003:00000030 00000004H .CRT$XCZ DATA 32-bit 0003:00000040 00000004H .CRT$XPA DATA 32-bit 0003:00000050 00000004H .CRT$XPZ DATA 32-bit 0003:00000060 00000004H .CRT$XTA DATA 32-bit 0003:00000070 00000004H .CRT$XTZ DATA 32-bit 0003:00000074 00000000H IMP__DATA IMP__DATA 32-bit 0003:00000080 00024828H _DATA DATA 32-bit 0003:000248A8 00000000H FMB DATA 32-bit 0003:000248A8 00000100H FM DATA 32-bit 0003:000249A8 00000000H FME DATA 32-bit 0003:000249A8 00000000H XIB DATA 32-bit 0003:000249A8 00000018H XI DATA 32-bit 0003:000249C0 00000000H XIE DATA 32-bit 0003:000249C0 00000000H XCB DATA 32-bit 0003:000249C0 00000010H XC DATA 32-bit 0003:000249D0 00000000H XCE DATA 32-bit 0003:000249D0 00000000H XIFCB DATA 32-bit 0003:000249D0 00000004H XIFU DATA 32-bit 0003:000249D4 00000000H XIFL DATA 32-bit 0003:000249D4 00000004H XIFM DATA 32-bit 0003:000249D8 00000000H XIFCE DATA 32-bit 0003:000249E0 00000000H CONST CONST 32-bit 0003:000249E0 00000000H EEND ENDBSS 32-bit 0003:000249E0 000033A0H _BSS BSS 32-bit 0003:00027D80 00000000H XOB BSS 32-bit 0003:00027D80 00000004H XO BSS 32-bit 0003:00027D84 00000000H XOE BSS 32-bit 0003:00027D84 00000000H XOFB BSS 32-bit 0003:00027D84 00000108H XOF BSS 32-bit 0003:00027E8C 00000000H XOFE BSS 32-bit 0003:00027E90 00000421H c_common BSS 32-bit 0003:000282C0 00000000H STACK STACK 32-bit Program entry point at 0004102C projectL_1001/readme.txt0000644000000000000000000000636710557117444014021 0ustar rootrootprojectL readme.txt ver.1001 HIZ inspired by projectN(D.K) 斬って斬って斬りまくれ!剣アクションSTG *** 操作 - 自機の移動        矢印キー, テンキー, [WASD] / ジョイステック - レーザーに切り替え    [Z][左Ctrl][.] / トリガ1, 4, 7 タイトル - サウンドON/OFF        [X][左Alt][左Shift][/] / トリガ2, 6, 8 - タイトル/ランキング切り替え  左右 - ウインドウ/全画面切り替え F9キー - ウインドウを隠す      F5キー - ソフトリセット       ENTERキー - 終了            ESCキー *** ルール レーザー・剣は自機の移動方向の反対方向に向かって回転します。 レーザーは緑色の弾を切れます。 剣は敵を切れます。 剣を使っている間は自機以外の動きが低速に、 レーザーを使っている間は高速になります。 赤い敵を全滅させると次の敵群が出現します。 (青い敵は倒す必要ありません) ワイヤーフレームには当たり判定ありません。 ***お約束 このソフトに使用されているファイルはやわらかライセンスとします。 ただし、se・music・voiceフォルダ内のファイルについては無料素材を使用させて頂きましたので、 配布元の規定に従うものとします。 本ソフトを使用したことにより生じた損害については、一切の責任を負いません。 感想・意見・苦情などは hiz_oka@yahoo.co.jp にメールするか、 http://d.hatena.ne.jp/HIZ/ のコメント欄にお願いします。 *** ストーリー  突如現れた謎の宇宙生命体。  彼らは交渉の間も与えずに宣戦布告し、交戦を余儀なくされた。  が、戦況は有利も有利。  追い返すどころかこのまま敵国に侵攻して植民地にしてやろうかという心積もり。  大統領 :「野球やろうぜー!」  官僚ども:「わーい!!」  こんなありさま。  一方、敵国。  戦況は最悪。「全ての責任は貴国にある」と、再三の停戦要請にも応じる気配が無い。  このままでは、無条件降伏を受け入れるしか道がなくなる。  それは独立国家としての生命を絶たれる事を意味していた。    さらに。  近々本国近隣にあるワープホールを使い大規模な強襲を行なうという情報が入った。  これを許せば。完全に反撃の芽を摘まれると共に、本国にも壊滅的な被害が及ぶ。  これだけは食い止めなければならない。    すぐさま、強襲を阻止するための作戦:projectLが立てられた。  軍をワープホール周辺に配置、ワープ直後を狙い各個撃破すること、  それにより時間を稼ぎ、準備が出来次第ワープホールを両軍ごと破壊すること・・・   *** 謝辞  D.K(http://www5b.biglobe.ne.jp/~ms06j/main1.htm)さま  のprojectNより多大なる影響を受けました。感謝 D言語(dmd.175)を使用して記述されています。  Simple DirectMedia Layer (SDL)を使用させていただきました。  SDL_mixerを使用させていただきました。  D-portingさまよりD言語用ヘッダファイル(SDL, SDL_mixer, opengl)を使用させていただきました。  ABAさまのゲームのソースを参考にさせていただきました。  kenmoさまのD言語開発入門(http://www5.atwiki.jp/yaruhara/pages/74.html)を参考にさせていただきました。  ザ・マッチメイカァズ(http://osabisi.sakura.ne.jp/m2/)さまから効果音を使用させていただきました。 )さまから効果音を使用させていただきました。  B.P.M(http://bpm.cside.com/)さまより楽曲・voiceを使用させていただきました。  FLESH&BONE(http://www.fleshbone.com/index.html)さまより楽曲を使用させていただきました。   *** 更新履歴 2006/01/28 ver1.001 ・剣・レーザーの挙動を修正 2006/12/22 ver1.000 ・完成しました。 ver0.010 ・向き固定ボタンを自機位置固定ボタンに変更しました。 その他変更点たくさん ver0.001 とりあえず動くだけのバージョンを公開 projectL_1001/鰆鰡魄粱磴禹糜禮.txt0000644000000000000000000000062410527671234021727 0ustar rootroot免責・著作・配布 柔かいコト  本ゲームは「みんなで楽しく」やわらかいです。  本ゲームを改造したりイジったバージョンを配布しても、何らOKです。改造たのしーい!  改造したところや改造した人の名前を、分かりやすいところに書いておくと  いいかもしれません。  ナイスな改造が出来たら メールなどで教えて。俺にも遊ばせてください。  改造とか一切してないものは好きにコピーして配布しちゃって結構結構。projectL_1001/import/0000755000000000000000000000000010740417365013320 5ustar rootrootprojectL_1001/import/SDL_cdrom.d0000644000000000000000000001171510461565464015304 0ustar rootroot/* SDL - Simple DirectMedia Layer Copyright (C) 1997, 1998, 1999, 2000, 2001 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@devolution.com */ /* This is the CD-audio control API for Simple DirectMedia Layer */ import SDL_types; extern(C): /* 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 */ const int SDL_MAX_TRACKS = 99; /* The types of CD-ROM track possible */ const uint SDL_AUDIO_TRACK = 0x00; const uint SDL_DATA_TRACK = 0x04; /* The possible states which a CD-ROM drive can be in. */ alias int CDstatus; enum { CD_TRAYEMPTY, CD_STOPPED, CD_PLAYING, CD_PAUSED, CD_ERROR = -1 } /* Given a status, returns true if there's a disk in the drive */ bit CD_INDRIVE(int status) { return status > 0; } 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 */ } /* This structure is only current as of the last call to SDL_CDStatus() */ 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]; } /* Conversion functions from frames to Minute/Second/Frames and vice versa */ const uint CD_FPS = 75; void FRAMES_TO_MSF(int f, out int M, out int S, out int F) { int value = f; F = value % CD_FPS; value /= CD_FPS; S = value % 60; value /= 60; M = value; } int MSF_TO_FRAMES(int M, int S, int F) { return 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. */ int SDL_CDNumDrives(); /* Returns a human-readable, system-dependent identifier for the CD-ROM. Example: "/dev/cdrom" "E:" "/dev/disk/ide/1/master" */ char * 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. */ SDL_CD * 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. */ CDstatus 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: // 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); This function returns 0, or -1 if there was an error. */ int 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. It returns 0, or -1 if there was an error. */ int SDL_CDPlay(SDL_CD *cdrom, int start, int length); /* Pause play -- returns 0, or -1 on error */ int SDL_CDPause(SDL_CD *cdrom); /* Resume play -- returns 0, or -1 on error */ int SDL_CDResume(SDL_CD *cdrom); /* Stop play -- returns 0, or -1 on error */ int SDL_CDStop(SDL_CD *cdrom); /* Eject CD-ROM -- returns 0, or -1 on error */ int SDL_CDEject(SDL_CD *cdrom); /* Closes the handle for the CD-ROM drive */ void SDL_CDClose(SDL_CD *cdrom); projectL_1001/import/SDL_timer.d0000644000000000000000000000741710461565464015324 0ustar rootroot/* SDL - Simple DirectMedia Layer Copyright (C) 1997, 1998, 1999, 2000, 2001 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@devolution.com */ import SDL_types; extern(C): /* This is the OS scheduler timeslice, in milliseconds */ const uint SDL_TIMESLICE = 10; /* This is the maximum resolution of the SDL timer on all platforms */ const uint 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. */ Uint32 SDL_GetTicks(); /* Wait a specified number of milliseconds before returning */ void SDL_Delay(Uint32 ms); /* Function prototype for the timer callback function */ alias Uint32 (*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: * SDL_SetTimer((33/10)*10, flag_update); * * 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. */ int SDL_SetTimer(Uint32 interval, SDL_TimerCallback callback); /* 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. */ alias Uint32 (*SDL_NewTimerCallback)(Uint32 interval, void *param); /* Definition of the timer ID type */ alias void *SDL_TimerID; /* Add a new timer to the pool of timers already running. Returns a timer ID, or NULL when an error occurs. */ SDL_TimerID SDL_AddTimer(Uint32 interval, SDL_NewTimerCallback callback, void *param); /* Remove one of the multiple timers knowing its ID. * Returns a boolean value indicating success. */ SDL_bool SDL_RemoveTimer(SDL_TimerID t); projectL_1001/import/SDL_keyboard.d0000644000000000000000000000667110461565464016005 0ustar rootroot/* SDL - Simple DirectMedia Layer Copyright (C) 1997, 1998, 1999, 2000, 2001 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@devolution.com */ /* Include file for SDL keyboard event handling */ import SDL_types; // !!! A hack! struct SDL_keysym is defined in this module, // !!! so we need to resolve the nameclash... // !!! Definitely won't work on *NIX but for now will do. import SDL_keysym_; extern(C): /* 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: char ch; if ( (keysym.unicode & 0xFF80) == 0 ) { ch = keysym.unicode & 0x7F; } else { An international character.. } */ struct SDL_keysym { Uint8 scancode; /* hardware specific scancode */ SDLKey sym; /* SDL virtual keysym */ SDLMod mod; /* current key modifiers */ Uint16 unicode; /* translated character */ } /* This is the mask which refers to all hotkey bindings */ const uint SDL_ALL_HOTKEYS = 0xFFFFFFFF; /* Function prototypes */ /* * Enable/Disable UNICODE translation of keyboard input. * This translation has some overhead, so translation defaults off. * If 'enable' is 1, translation is enabled. * If 'enable' is 0, translation is disabled. * If 'enable' is -1, the translation state is not changed. * It returns the previous state of keyboard translation. */ int SDL_EnableUNICODE(int enable); /* * Enable/Disable keyboard repeat. Keyboard repeat defaults to off. * 'delay' is the initial delay in ms between the time when a key is * pressed, and keyboard repeat begins. * 'interval' is the time in ms between keyboard repeat events. */ const uint SDL_DEFAULT_REPEAT_DELAY = 500; const uint SDL_DEFAULT_REPEAT_INTERVAL = 30; /* * If 'delay' is set to 0, keyboard repeat is disabled. */ int SDL_EnableKeyRepeat(int delay, int interval); /* * Get a snapshot of the current state of the keyboard. * Returns an array of keystates, indexed by the SDLK_* syms. * Used: * Uint8 *keystate = SDL_GetKeyState(NULL); * if ( keystate[SDLK_RETURN] ) ... is pressed. */ Uint8 * SDL_GetKeyState(int *numkeys); /* * Get the current key modifier state */ SDLMod SDL_GetModState(); /* * Set the current key modifier state * This does not change the keyboard state, only the key modifier flags. */ void SDL_SetModState(SDLMod modstate); /* * Get the name of an SDL virtual keysym */ char * SDL_GetKeyName(SDLKey key); projectL_1001/import/SDL_mouse.d0000644000000000000000000000754610461565464015337 0ustar rootroot/* SDL - Simple DirectMedia Layer Copyright (C) 1997, 1998, 1999, 2000, 2001 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@devolution.com */ /* Include file for SDL mouse event handling */ import SDL_types; import SDL_video; extern(C): 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 */ void /*WMcursor*/ *wm_cursor; /* Window-manager 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. */ Uint8 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(). */ Uint8 SDL_GetRelativeMouseState(int *x, int *y); /* * Set the position of the mouse cursor (generates a mouse motion event) */ void 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(). */ SDL_Cursor *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. */ void SDL_SetCursor(SDL_Cursor *cursor); /* * Returns the currently active cursor. */ SDL_Cursor * SDL_GetCursor(); /* * Deallocates a cursor created with SDL_CreateCursor(). */ void 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. */ int 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 */ uint SDL_BUTTON(uint X) { return SDL_PRESSED << (X-1); } const uint SDL_BUTTON_LEFT = 1; const uint SDL_BUTTON_MIDDLE = 2; const uint SDL_BUTTON_RIGHT = 3; const uint SDL_BUTTON_WHEELUP = 4; const uint SDL_BUTTON_WHEELDOWN = 5; const uint SDL_BUTTON_LMASK = SDL_PRESSED << (SDL_BUTTON_LEFT - 1); const uint SDL_BUTTON_MMASK = SDL_PRESSED << (SDL_BUTTON_MIDDLE - 1); const uint SDL_BUTTON_RMASK = SDL_PRESSED << (SDL_BUTTON_RIGHT - 1); projectL_1001/import/SDL_rwops.d0000644000000000000000000000734110461565464015352 0ustar rootroot/* SDL - Simple DirectMedia Layer Copyright (C) 1997, 1998, 1999, 2000, 2001 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@devolution.com */ /* This file provides a general interface for SDL to read and write data sources. It can easily be extended to files, memory, etc. */ import SDL_types; extern(C): typedef int (*_seek_func_t)(SDL_RWops *context, int offset, int whence); typedef int (*_read_func_t)(SDL_RWops *context, void *ptr, int size, int maxnum); typedef int (*_write_func_t)(SDL_RWops *context, void *ptr, int size, int num); typedef int (*_close_func_t)(SDL_RWops *context); /* This is the read/write operation structure -- very basic */ 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. */ _seek_func_t seek; // int (*seek)(SDL_RWops *context, int offset, int whence); /* Read up to 'num' objects each of size 'objsize' from the data source to the area pointed at by 'ptr'. Returns the number of objects read, or -1 if the read failed. */ _read_func_t read; // int (*read)(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. */ _write_func_t write; // int (*write)(SDL_RWops *context, void *ptr, int size, int num); /* Close and free an allocated SDL_FSops structure */ _close_func_t close; // int (*close)(SDL_RWops *context); Uint32 type; union { struct { int autoclose; void *fp; // was FILE } // stdio; struct { Uint8 *base; Uint8 *here; Uint8 *stop; } // mem; struct { void *data1; } // unknown; } // hidden; } /* Functions to create SDL_RWops structures from various data sources */ SDL_RWops * SDL_RWFromFile(char *file, char *mode); SDL_RWops * SDL_RWFromFP(void *fp, int autoclose); SDL_RWops * SDL_RWFromMem(void *mem, int size); SDL_RWops * SDL_AllocRW(); void SDL_FreeRW(SDL_RWops *area); /* Macros to easily read and write from an SDL_RWops structure */ int SDL_RWseek(SDL_RWops *ctx, int offset, int whence) { _seek_func_t seek; // int (*seek)(SDL_RWops *context, int offset, int whence); seek = ctx.seek; return (*seek)(ctx, offset, whence); } int SDL_RWtell(SDL_RWops *ctx) { _seek_func_t seek; // int (*seek)(SDL_RWops *context, int offset, int whence); seek = ctx.seek; return (*seek)(ctx, 0, 1); } int SDL_RWread(SDL_RWops *ctx, void* ptr, int size, int n) { _read_func_t read; // int (*read)(SDL_RWops *context, void *ptr, int size, int maxnum); read = ctx.read; return (*read)(ctx, ptr, size, n); } int SDL_RWwrite(SDL_RWops *ctx, void* ptr, int size, int n) { _write_func_t write; // int (*write)(SDL_RWops *context, void *ptr, int size, int num); write = ctx.write; return (*write)(ctx, ptr, size, n); } int SDL_RWclose(SDL_RWops *ctx) { _close_func_t close; // int (*close)(SDL_RWops *context); close = ctx.close; return (*close)(ctx); } projectL_1001/import/SDL_quit.d0000644000000000000000000000347110461565464015162 0ustar rootroot/* SDL - Simple DirectMedia Layer Copyright (C) 1997, 1998, 1999, 2000, 2001 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@devolution.com */ /* Include file for SDL quit event handling */ import SDL_events; /* 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. */ /* There are no functions directly affecting the quit event */ bit SDL_QuitRequested() { SDL_PumpEvents(); return cast(bit)SDL_PeepEvents(null, 0, SDL_PEEKEVENT, SDL_QUITMASK); } projectL_1001/import/SDL_thread.d0000644000000000000000000000336110461565464015445 0ustar rootroot/* SDL - Simple DirectMedia Layer Copyright (C) 1997, 1998, 1999, 2000, 2001 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@devolution.com */ /* Header for the SDL thread management routines These are independent of the other SDL routines. */ import SDL_types; import SDL_mutex; extern(C): /* The SDL thread structure, defined in SDL_thread.c */ struct SDL_Thread { } /* Create a thread */ SDL_Thread * SDL_CreateThread(int (*fn)(void *), void *data); /* Get the 32-bit thread identifier for the current thread */ Uint32 SDL_ThreadID(); /* Get the 32-bit thread identifier for the specified thread, equivalent to SDL_ThreadID() if the specified thread is NULL. */ Uint32 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. */ void SDL_WaitThread(SDL_Thread *thread, int *status); /* Forcefully kill a thread without worrying about its state */ void SDL_KillThread(SDL_Thread *thread); projectL_1001/import/SDL_types.d0000644000000000000000000000237010461565464015341 0ustar rootroot/* SDL - Simple DirectMedia Layer Copyright (C) 1997, 1998, 1999, 2000, 2001 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@devolution.com */ /* General data types used by the SDL library */ /* Basic data types */ alias int SDL_bool; enum { SDL_FALSE = 0, SDL_TRUE = 1 } alias ubyte Uint8; alias byte Sint8; alias ushort Uint16; alias short Sint16; alias uint Uint32; alias int Sint32; alias ulong Uint64; alias long Sint64; /* General keyboard/mouse state definitions */ enum { SDL_PRESSED = 0x01, SDL_RELEASED = 0x00 }; projectL_1001/import/SDL_getenv.d0000644000000000000000000000055310461565464015466 0ustar rootroot/* Not all environments have a working getenv()/putenv() */ extern(C): /+ /* Put a variable of the form "name=value" into the environment */ int SDL_putenv(char *variable); int putenv(char* X) { return SDL_putenv(X); } /* Retrieve a variable named "name" from the environment */ char *SDL_getenv(char *name); char *getenv(char* X) { return SDL_getenv(X); } +/ projectL_1001/import/COPYING0000644000000000000000000005620110144515002014340 0ustar rootroot GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 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. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] 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 Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, 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 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 a program 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. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, 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 companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. 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, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library 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 compile 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) 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. c) 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. d) 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 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. 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 to 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 Library 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 projectL_1001/import/MPEGfilter.d0000644000000000000000000000362510525335752015431 0ustar rootroot/* SMPEG - SDL MPEG Player Library Copyright (C) 1999 Loki Entertainment Software 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 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* MPEG filters */ // convert to D by shinichiro.h import SDL; extern (C) { /* SMPEG filter info flags */ const int SMPEG_FILTER_INFO_MB_ERROR = 1; const int SMPEG_FILTER_INFO_PIXEL_ERROR = 2; /* Filter info from SMPEG */ struct SMPEG_FilterInfo { Uint16* yuv_mb_square_error; Uint16* yuv_pixel_square_error; } /* Callback functions for the filter */ typedef void (* SMPEG_FilterCallback)( SDL_Overlay * dest, SDL_Overlay * source, SDL_Rect * region, SMPEG_FilterInfo * filter_info, void * data ); typedef void (* SMPEG_FilterDestroy)( SMPEG_Filter * filter ); /* The filter definition itself */ struct SMPEG_Filter { Uint32 flags; void * data; SMPEG_FilterCallback callback; SMPEG_FilterDestroy destroy; } /* The null filter (default). It simply copies the source rectangle to the video overlay. */ SMPEG_Filter * SMPEGfilter_null(); /* The bilinear filter. A basic low-pass filter that will produce a smoother image. */ SMPEG_Filter * SMPEGfilter_bilinear(); /* The deblocking filter. It filters block borders and non-intra coded blocks to reduce blockiness */ SMPEG_Filter * SMPEGfilter_deblocking(); } projectL_1001/import/SDL_audio.d0000644000000000000000000002364110461565464015302 0ustar rootroot/* SDL - Simple DirectMedia Layer Copyright (C) 1997, 1998, 1999, 2000, 2001 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@devolution.com */ import SDL_types; import SDL_error; import SDL_rwops; import SDL_byteorder; extern(C): /* The calculated values in this structure are calculated by SDL_OpenAudio() */ 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. 'stream' is a pointer to the audio data buffer 'len' is the length of that buffer in bytes. Once the callback returns, the buffer will no longer be valid. Stereo samples are stored in a LRLRLR ordering. */ void (*callback)(void *userdata, Uint8 *stream, int len); void *userdata; } /* Audio format flags (defaults to LSB byte order) */ const uint AUDIO_U8 = 0x0008; /* Unsigned 8-bit samples */ const uint AUDIO_S8 = 0x8008; /* Signed 8-bit samples */ const uint AUDIO_U16LSB = 0x0010; /* Unsigned 16-bit samples */ const uint AUDIO_S16LSB = 0x8010; /* Signed 16-bit samples */ const uint AUDIO_U16MSB = 0x1010; /* As above, but big-endian byte order */ const uint AUDIO_S16MSB = 0x9010; /* As above, but big-endian byte order */ const uint AUDIO_U16 = AUDIO_U16LSB; const uint AUDIO_S16 = AUDIO_S16LSB; /* Native audio byte ordering */ //const uint AUDIO_U16SYS = AUDIO_U16LSB; //const uint AUDIO_S16SYS = AUDIO_S16LSB; const uint AUDIO_U16SYS = AUDIO_U16MSB; const uint AUDIO_S16SYS = AUDIO_S16MSB; /* A structure to hold a set of audio conversion filters and buffers */ 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 (*filters[10])(SDL_AudioCVT *cvt, Uint16 format); int filter_index; /* Current audio conversion function */ } /* Function prototypes */ /* 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(). */ int SDL_AudioInit(char *driver_name); void SDL_AudioQuit(); /* 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. */ char *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. * * 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. * * 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. */ int SDL_OpenAudio(SDL_AudioSpec *desired, SDL_AudioSpec *obtained); /* * Get the current audio state: */ alias int SDL_audiostatus; enum { SDL_AUDIO_STOPPED = 0, SDL_AUDIO_PLAYING, SDL_AUDIO_PAUSED } SDL_audiostatus SDL_GetAudioStatus(); /* * 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. */ void 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: * SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...); * * 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. */ SDL_AudioSpec *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 */ SDL_AudioSpec *SDL_LoadWAV(char* file, SDL_AudioSpec* spec, Uint8 **audio_buf, Uint32 *audio_len) { return SDL_LoadWAV_RW(SDL_RWFromFile(file, "rb"), 1, spec, audio_buf, audio_len); } /* * This function frees data previously allocated with SDL_LoadWAV_RW() */ void 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. * This function returns 0, or -1 if there was an error. */ int 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. */ int SDL_ConvertAudio(SDL_AudioCVT *cvt); /* * 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. */ const uint SDL_MIX_MAXVOLUME = 128; void SDL_MixAudio(Uint8 *dst, Uint8 *src, Uint32 len, int volume); /* * 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. */ void SDL_LockAudio(); void SDL_UnlockAudio(); /* * This function shuts down audio processing and closes the audio device. */ void SDL_CloseAudio(); projectL_1001/import/SDL_copying.d0000644000000000000000000000156310461565464015650 0ustar rootroot/* SDL - Simple DirectMedia Layer Copyright (C) 1997, 1998, 1999, 2000, 2001 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@devolution.com */ projectL_1001/import/SDL_error.d0000644000000000000000000000242210461565464015324 0ustar rootroot/* SDL - Simple DirectMedia Layer Copyright (C) 1997, 1998, 1999, 2000, 2001 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@devolution.com */ /* Simple error message routines for SDL */ extern(C): /* Public functions */ void SDL_SetError(char *fmt, ...); char * SDL_GetError(); void SDL_ClearError(); /* Private error message function - used internally */ //#define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM) alias int SDL_errorcode; enum { SDL_ENOMEM, SDL_EFREAD, SDL_EFWRITE, SDL_EFSEEK, SDL_LASTERROR } extern void SDL_Error(SDL_errorcode code); projectL_1001/import/SDL_joystick.d0000644000000000000000000001063310461565464016035 0ustar rootroot/* SDL - Simple DirectMedia Layer Copyright (C) 1997, 1998, 1999, 2000, 2001 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@devolution.com */ /* Include file for SDL joystick event handling */ import SDL_types; extern(C): /* 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 { } /* Function prototypes */ /* * Count the number of joysticks attached to the system */ int SDL_NumJoysticks(); /* * 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. */ char *SDL_JoystickName(int device_index); /* * Open a joystick for use - 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. * * This function returns a joystick identifier, or NULL if an error occurred. */ SDL_Joystick *SDL_JoystickOpen(int device_index); /* * Returns 1 if the joystick has been opened, or 0 if it has not. */ int SDL_JoystickOpened(int device_index); /* * Get the device index of an opened joystick. */ int SDL_JoystickIndex(SDL_Joystick *joystick); /* * Get the number of general axis controls on a joystick */ int 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. */ int SDL_JoystickNumBalls(SDL_Joystick *joystick); /* * Get the number of POV hats on a joystick */ int SDL_JoystickNumHats(SDL_Joystick *joystick); /* * Get the number of buttons on a joystick */ int 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. */ void SDL_JoystickUpdate(); /* * 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. * The state can be one of SDL_QUERY, SDL_ENABLE or SDL_IGNORE. */ int SDL_JoystickEventState(int state); /* * Get the current state of an axis control on a joystick * The state is a value ranging from -32768 to 32767. * The axis indices start at index 0. */ Sint16 SDL_JoystickGetAxis(SDL_Joystick *joystick, int axis); /* * Get the current state of a POV hat on a joystick * The return value is one of the following positions: */ const uint SDL_HAT_CENTERED = 0x00; const uint SDL_HAT_UP = 0x01; const uint SDL_HAT_RIGHT = 0x02; const uint SDL_HAT_DOWN = 0x04; const uint SDL_HAT_LEFT = 0x08; const uint SDL_HAT_RIGHTUP = (SDL_HAT_RIGHT|SDL_HAT_UP); const uint SDL_HAT_RIGHTDOWN = (SDL_HAT_RIGHT|SDL_HAT_DOWN); const uint SDL_HAT_LEFTUP = (SDL_HAT_LEFT|SDL_HAT_UP); const uint SDL_HAT_LEFTDOWN = (SDL_HAT_LEFT|SDL_HAT_DOWN); /* * The hat indices start at index 0. */ Uint8 SDL_JoystickGetHat(SDL_Joystick *joystick, int hat); /* * Get the ball axis change since the last poll * This returns 0, or -1 if you passed it invalid parameters. * The ball indices start at index 0. */ int SDL_JoystickGetBall(SDL_Joystick *joystick, int ball, int *dx, int *dy); /* * Get the current state of a button on a joystick * The button indices start at index 0. */ Uint8 SDL_JoystickGetButton(SDL_Joystick *joystick, int button); /* * Close a joystick previously opened with SDL_JoystickOpen() */ void SDL_JoystickClose(SDL_Joystick *joystick); projectL_1001/import/SDL_mixer.d0000644000000000000000000005376407771276734015347 0ustar rootroot/* SDL_mixer: An audio mixer library based on the SDL library Copyright (C) 1997, 1998, 1999, 2000, 2001 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 */ // convert to D by shinichiro.h /* $Id: SDL_mixer.d,v 1.1.1.1 2003/11/28 17:26:28 kenta Exp $ */ import SDL; extern (C) { /* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL */ const int MIX_MAJOR_VERSION = 1; const int MIX_MINOR_VERSION = 2; const int MIX_PATCHLEVEL = 5; /* This function gets the version of the dynamically linked SDL_mixer library. it should NOT be used to fill a version structure, instead you should use the MIX_VERSION() macro. */ SDL_version * Mix_Linked_Version(); /* The default mixer has 8 simultaneous mixing channels */ const int MIX_CHANNELS = 8; /* Good default values for a PC soundcard */ const int MIX_DEFAULT_FREQUENCY = 22050; version (LittleEndian) { const int MIX_DEFAULT_FORMAT = AUDIO_S16LSB; } version (BigEndian) { const int MIX_DEFAULT_FORMAT = AUDIO_S16MSB; } const int MIX_DEFAULT_CHANNELS = 2; const int MIX_MAX_VOLUME = 128; /* Volume of a chunk */ /* The internal format for an audio chunk */ struct Mix_Chunk { int allocated; Uint8 *abuf; Uint32 alen; Uint8 volume; /* Per-sample volume, 0-128 */ } /* The different fading types supported */ alias int Mix_Fading; enum { MIX_NO_FADING, MIX_FADING_OUT, MIX_FADING_IN } alias int Mix_MusicType; enum { MUS_NONE, MUS_CMD, MUS_WAV, MUS_MOD, MUS_MID, MUS_OGG, MUS_MP3 } /* The internal format for a music chunk interpreted via mikmod */ /* it's mayby enough */ struct Mix_Music {} /* Open the mixer with a certain audio format */ int Mix_OpenAudio(int frequency, Uint16 format, int channels, int chunksize); /* Dynamically change the number of channels managed by the mixer. If decreasing the number of channels, the upper channels are stopped. This function returns the new number of allocated channels. */ int Mix_AllocateChannels(int numchans); /* Find out what the actual audio device parameters are. This function returns 1 if the audio has been opened, 0 otherwise. */ int Mix_QuerySpec(int *frequency,Uint16 *format,int *channels); /* Load a wave file or a music (.mod .s3m .it .xm) file */ Mix_Chunk * Mix_LoadWAV_RW(SDL_RWops *src, int freesrc); Mix_Chunk * Mix_LoadWAV(char *file) { return Mix_LoadWAV_RW(SDL_RWFromFile(file, "rb"), 1); } Mix_Music * Mix_LoadMUS(char *file); /* Load a wave file of the mixer format from a memory buffer */ Mix_Chunk * Mix_QuickLoad_WAV(Uint8 *mem); /* Load raw audio data of the mixer format from a memory buffer */ Mix_Chunk * Mix_QuickLoad_RAW(Uint8 *mem, Uint32 len); /* Free an audio chunk previously loaded */ void Mix_FreeChunk(Mix_Chunk *chunk); void Mix_FreeMusic(Mix_Music *music); /* Find out the music format of a mixer music, or the currently playing music, if 'music' is NULL. */ Mix_MusicType Mix_GetMusicType(Mix_Music *music); /* Set a function that is called after all mixing is performed. This can be used to provide real-time visual display of the audio stream or add a custom mixer filter for the stream data. */ void Mix_SetPostMix(void (*mix_func) (void *udata, Uint8 *stream, int len), void *arg); /* Add your own music player or additional mixer function. If 'mix_func' is NULL, the default music player is re-enabled. */ void Mix_HookMusic(void (*mix_func) (void *udata, Uint8 *stream, int len), void *arg); /* Add your own callback when the music has finished playing. This callback is only called if the music finishes naturally. */ void Mix_HookMusicFinished(void (*music_finished)()); /* Get a pointer to the user data for the current music hook */ void * Mix_GetMusicHookData(); /* * Add your own callback when a channel has finished playing. NULL * to disable callback. The callback may be called from the mixer's audio * callback or it could be called as a result of Mix_HaltChannel(), etc. * do not call SDL_LockAudio() from this callback; you will either be * inside the audio callback, or SDL_mixer will explicitly lock the audio * before calling your callback. */ void Mix_ChannelFinished(void (*channel_finished)(int channel)); /* Special Effects API by ryan c. gordon. (icculus@linuxgames.com) */ const int MIX_CHANNEL_POST = -2; /* This is the format of a special effect callback: * * myeffect(int chan, void *stream, int len, void *udata); * * (chan) is the channel number that your effect is affecting. (stream) is * the buffer of data to work upon. (len) is the size of (stream), and * (udata) is a user-defined bit of data, which you pass as the last arg of * Mix_RegisterEffect(), and is passed back unmolested to your callback. * Your effect changes the contents of (stream) based on whatever parameters * are significant, or just leaves it be, if you prefer. You can do whatever * you like to the buffer, though, and it will continue in its changed state * down the mixing pipeline, through any other effect functions, then finally * to be mixed with the rest of the channels and music for the final output * stream. * * DO NOT EVER call SDL_LockAudio() from your callback function! */ typedef void (*Mix_EffectFunc_t)(int chan, void *stream, int len, void *udata); /* * This is a callback that signifies that a channel has finished all its * loops and has completed playback. This gets called if the buffer * plays out normally, or if you call Mix_HaltChannel(), implicitly stop * a channel via Mix_AllocateChannels(), or unregister a callback while * it's still playing. * * DO NOT EVER call SDL_LockAudio() from your callback function! */ typedef void (*Mix_EffectDone_t)(int chan, void *udata); /* Register a special effect function. At mixing time, the channel data is * copied into a buffer and passed through each registered effect function. * After it passes through all the functions, it is mixed into the final * output stream. The copy to buffer is performed once, then each effect * function performs on the output of the previous effect. Understand that * this extra copy to a buffer is not performed if there are no effects * registered for a given chunk, which saves CPU cycles, and any given * effect will be extra cycles, too, so it is crucial that your code run * fast. Also note that the data that your function is given is in the * format of the sound device, and not the format you gave to Mix_OpenAudio(), * although they may in reality be the same. This is an unfortunate but * necessary speed concern. Use Mix_QuerySpec() to determine if you can * handle the data before you register your effect, and take appropriate * actions. * You may also specify a callback (Mix_EffectDone_t) that is called when * the channel finishes playing. This gives you a more fine-grained control * than Mix_ChannelFinished(), in case you need to free effect-specific * resources, etc. If you don't need this, you can specify NULL. * You may set the callbacks before or after calling Mix_PlayChannel(). * Things like Mix_SetPanning() are just internal special effect functions, * so if you are using that, you've already incurred the overhead of a copy * to a separate buffer, and that these effects will be in the queue with * any functions you've registered. The list of registered effects for a * channel is reset when a chunk finishes playing, so you need to explicitly * set them with each call to Mix_PlayChannel*(). * You may also register a special effect function that is to be run after * final mixing occurs. The rules for these callbacks are identical to those * in Mix_RegisterEffect, but they are run after all the channels and the * music have been mixed into a single stream, whereas channel-specific * effects run on a given channel before any other mixing occurs. These * global effect callbacks are call "posteffects". Posteffects only have * their Mix_EffectDone_t function called when they are unregistered (since * the main output stream is never "done" in the same sense as a channel). * You must unregister them manually when you've had enough. Your callback * will be told that the channel being mixed is (MIX_CHANNEL_POST) if the * processing is considered a posteffect. * * After all these effects have finished processing, the callback registered * through Mix_SetPostMix() runs, and then the stream goes to the audio * device. * * DO NOT EVER call SDL_LockAudio() from your callback function! * * returns zero if error (no such channel), nonzero if added. * Error messages can be retrieved from Mix_GetError(). */ int Mix_RegisterEffect(int chan, Mix_EffectFunc_t f, Mix_EffectDone_t d, void *arg); /* You may not need to call this explicitly, unless you need to stop an * effect from processing in the middle of a chunk's playback. * Posteffects are never implicitly unregistered as they are for channels, * but they may be explicitly unregistered through this function by * specifying MIX_CHANNEL_POST for a channel. * returns zero if error (no such channel or effect), nonzero if removed. * Error messages can be retrieved from Mix_GetError(). */ int Mix_UnregisterEffect(int channel, Mix_EffectFunc_t f); /* You may not need to call this explicitly, unless you need to stop all * effects from processing in the middle of a chunk's playback. Note that * this will also shut off some internal effect processing, since * Mix_SetPanning() and others may use this API under the hood. This is * called internally when a channel completes playback. * Posteffects are never implicitly unregistered as they are for channels, * but they may be explicitly unregistered through this function by * specifying MIX_CHANNEL_POST for a channel. * returns zero if error (no such channel), nonzero if all effects removed. * Error messages can be retrieved from Mix_GetError(). */ int Mix_UnregisterAllEffects(int channel); const char[] MIX_EFFECTSMAXSPEED = "MIX_EFFECTSMAXSPEED"; /* * These are the internally-defined mixing effects. They use the same API that * effects defined in the application use, but are provided here as a * convenience. Some effects can reduce their quality or use more memory in * the name of speed; to enable this, make sure the environment variable * MIX_EFFECTSMAXSPEED (see above) is defined before you call * Mix_OpenAudio(). */ /* Set the panning of a channel. The left and right channels are specified * as integers between 0 and 255, quietest to loudest, respectively. * * Technically, this is just individual volume control for a sample with * two (stereo) channels, so it can be used for more than just panning. * If you want real panning, call it like this: * * Mix_SetPanning(channel, left, 255 - left); * * ...which isn't so hard. * * Setting (channel) to MIX_CHANNEL_POST registers this as a posteffect, and * the panning will be done to the final mixed stream before passing it on * to the audio device. * * This uses the Mix_RegisterEffect() API internally, and returns without * registering the effect function if the audio device is not configured * for stereo output. Setting both (left) and (right) to 255 causes this * effect to be unregistered, since that is the data's normal state. * * returns zero if error (no such channel or Mix_RegisterEffect() fails), * nonzero if panning effect enabled. Note that an audio device in mono * mode is a no-op, but this call will return successful in that case. * Error messages can be retrieved from Mix_GetError(). */ int Mix_SetPanning(int channel, Uint8 left, Uint8 right); /* Set the position of a channel. (angle) is an integer from 0 to 360, that * specifies the location of the sound in relation to the listener. (angle) * will be reduced as neccesary (540 becomes 180 degrees, -100 becomes 260). * Angle 0 is due north, and rotates clockwise as the value increases. * For efficiency, the precision of this effect may be limited (angles 1 * through 7 might all produce the same effect, 8 through 15 are equal, etc). * (distance) is an integer between 0 and 255 that specifies the space * between the sound and the listener. The larger the number, the further * away the sound is. Using 255 does not guarantee that the channel will be * culled from the mixing process or be completely silent. For efficiency, * the precision of this effect may be limited (distance 0 through 5 might * all produce the same effect, 6 through 10 are equal, etc). Setting (angle) * and (distance) to 0 unregisters this effect, since the data would be * unchanged. * * If you need more precise positional audio, consider using OpenAL for * spatialized effects instead of SDL_mixer. This is only meant to be a * basic effect for simple "3D" games. * * If the audio device is configured for mono output, then you won't get * any effectiveness from the angle; however, distance attenuation on the * channel will still occur. While this effect will function with stereo * voices, it makes more sense to use voices with only one channel of sound, * so when they are mixed through this effect, the positioning will sound * correct. You can convert them to mono through SDL before giving them to * the mixer in the first place if you like. * * Setting (channel) to MIX_CHANNEL_POST registers this as a posteffect, and * the positioning will be done to the final mixed stream before passing it * on to the audio device. * * This is a convenience wrapper over Mix_SetDistance() and Mix_SetPanning(). * * returns zero if error (no such channel or Mix_RegisterEffect() fails), * nonzero if position effect is enabled. * Error messages can be retrieved from Mix_GetError(). */ int Mix_SetPosition(int channel, Sint16 angle, Uint8 distance); /* Set the "distance" of a channel. (distance) is an integer from 0 to 255 * that specifies the location of the sound in relation to the listener. * Distance 0 is overlapping the listener, and 255 is as far away as possible * A distance of 255 does not guarantee silence; in such a case, you might * want to try changing the chunk's volume, or just cull the sample from the * mixing process with Mix_HaltChannel(). * For efficiency, the precision of this effect may be limited (distances 1 * through 7 might all produce the same effect, 8 through 15 are equal, etc). * (distance) is an integer between 0 and 255 that specifies the space * between the sound and the listener. The larger the number, the further * away the sound is. * Setting (distance) to 0 unregisters this effect, since the data would be * unchanged. * If you need more precise positional audio, consider using OpenAL for * spatialized effects instead of SDL_mixer. This is only meant to be a * basic effect for simple "3D" games. * * Setting (channel) to MIX_CHANNEL_POST registers this as a posteffect, and * the distance attenuation will be done to the final mixed stream before * passing it on to the audio device. * * This uses the Mix_RegisterEffect() API internally. * * returns zero if error (no such channel or Mix_RegisterEffect() fails), * nonzero if position effect is enabled. * Error messages can be retrieved from Mix_GetError(). */ int Mix_SetDistance(int channel, Uint8 distance); /* Causes a channel to reverse its stereo. This is handy if the user has his * speakers hooked up backwards, or you would like to have a minor bit of * psychedelia in your sound code. :) Calling this function with (flip) * set to non-zero reverses the chunks's usual channels. If (flip) is zero, * the effect is unregistered. * * This uses the Mix_RegisterEffect() API internally, and thus is probably * more CPU intensive than having the user just plug in his speakers * correctly. Mix_SetReverseStereo() returns without registering the effect * function if the audio device is not configured for stereo output. * * If you specify MIX_CHANNEL_POST for (channel), then this the effect is used * on the final mixed stream before sending it on to the audio device (a * posteffect). * * returns zero if error (no such channel or Mix_RegisterEffect() fails), * nonzero if reversing effect is enabled. Note that an audio device in mono * mode is a no-op, but this call will return successful in that case. * Error messages can be retrieved from Mix_GetError(). */ int Mix_SetReverseStereo(int channel, int flip); /* end of effects API. --ryan. */ /* Reserve the first channels (0 -> n-1) for the application, i.e. don't allocate them dynamically to the next sample if requested with a -1 value below. Returns the number of reserved channels. */ int Mix_ReserveChannels(int num); /* Channel grouping functions */ /* Attach a tag to a channel. A tag can be assigned to several mixer channels, to form groups of channels. If 'tag' is -1, the tag is removed (actually -1 is the tag used to represent the group of all the channels). Returns true if everything was OK. */ int Mix_GroupChannel(int which, int tag); /* Assign several consecutive channels to a group */ int Mix_GroupChannels(int from, int to, int tag); /* Finds the first available channel in a group of channels, returning -1 if none are available. */ int Mix_GroupAvailable(int tag); /* Returns the number of channels in a group. This is also a subtle way to get the total number of channels when 'tag' is -1 */ int Mix_GroupCount(int tag); /* Finds the "oldest" sample playing in a group of channels */ int Mix_GroupOldest(int tag); /* Finds the "most recent" (i.e. last) sample playing in a group of channels */ int Mix_GroupNewer(int tag); /* The same as above, but the sound is played at most 'ticks' milliseconds */ int Mix_PlayChannelTimed(int channel, Mix_Chunk *chunk, int loops, int ticks); /* Play an audio chunk on a specific channel. If the specified channel is -1, play on the first free channel. If 'loops' is greater than zero, loop the sound that many times. If 'loops' is -1, loop inifinitely (~65000 times). Returns which channel was used to play the sound. */ int Mix_PlayChannel(int channel, Mix_Chunk* chunk, int loops) { return Mix_PlayChannelTimed(channel,chunk,loops,-1); } int Mix_PlayMusic(Mix_Music *music, int loops); /* Fade in music or a channel over "ms" milliseconds, same semantics as the "Play" functions */ int Mix_FadeInMusic(Mix_Music *music, int loops, int ms); int Mix_FadeInMusicPos(Mix_Music *music, int loops, int ms, double position); int Mix_FadeInChannelTimed(int channel, Mix_Chunk *chunk, int loops, int ms, int ticks); int Mix_FadeInChannel(int channel, Mix_Chunk* chunk, int loops, int ms) { return Mix_FadeInChannelTimed(channel,chunk,loops,ms,-1); } /* Set the volume in the range of 0-128 of a specific channel or chunk. If the specified channel is -1, set volume for all channels. Returns the original volume. If the specified volume is -1, just return the current volume. */ int Mix_Volume(int channel, int volume); int Mix_VolumeChunk(Mix_Chunk *chunk, int volume); int Mix_VolumeMusic(int volume); /* Halt playing of a particular channel */ int Mix_HaltChannel(int channel); int Mix_HaltGroup(int tag); int Mix_HaltMusic(); /* Change the expiration delay for a particular channel. The sample will stop playing after the 'ticks' milliseconds have elapsed, or remove the expiration if 'ticks' is -1 */ int Mix_ExpireChannel(int channel, int ticks); /* Halt a channel, fading it out progressively till it's silent The ms parameter indicates the number of milliseconds the fading will take. */ int Mix_FadeOutChannel(int which, int ms); int Mix_FadeOutGroup(int tag, int ms); int Mix_FadeOutMusic(int ms); /* Query the fading status of a channel */ Mix_Fading Mix_FadingMusic(); Mix_Fading Mix_FadingChannel(int which); /* Pause/Resume a particular channel */ void Mix_Pause(int channel); void Mix_Resume(int channel); int Mix_Paused(int channel); /* Pause/Resume the music stream */ void Mix_PauseMusic(); void Mix_ResumeMusic(); void Mix_RewindMusic(); int Mix_PausedMusic(); /* Set the current position in the music stream. This returns 0 if successful, or -1 if it failed or isn't implemented. This function is only implemented for MOD music formats (set pattern order number) and for OGG music (set position in seconds), at the moment. */ int Mix_SetMusicPosition(double position); /* Check the status of a specific channel. If the specified channel is -1, check all channels. */ int Mix_Playing(int channel); int Mix_PlayingMusic(); /* Stop music and set external music playback command */ int Mix_SetMusicCMD(char *command); /* Synchro value is set by MikMod from modules while playing */ int Mix_SetSynchroValue(int value); int Mix_GetSynchroValue(); /* Get the Mix_Chunk currently associated with a mixer channel Returns NULL if it's an invalid channel, or there's no chunk associated. */ Mix_Chunk * Mix_GetChunk(int channel); /* Close the mixer, halting all playing audio */ void Mix_CloseAudio(); /* We'll use SDL for reporting errors */ // void Mix_SetError SDL_SetError char * Mix_GetError() { return SDL_GetError(); } } /* end of SDL_mixer.h ... */ projectL_1001/import/SDL_active.d0000644000000000000000000000303210461565464015444 0ustar rootroot/* SDL - Simple DirectMedia Layer Copyright (C) 1997, 1998, 1999, 2000, 2001 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@devolution.com */ /* Include file for SDL application focus event handling */ import SDL_types; extern(C): /* The available application states */ const uint SDL_APPMOUSEFOCUS = 0x01; /* The app has mouse coverage */ const uint SDL_APPINPUTFOCUS = 0x02; /* The app has input focus */ const uint 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. */ Uint8 SDL_GetAppState(); projectL_1001/import/SDL_keysym_.d0000644000000000000000000001573310461565464015664 0ustar rootroot/* SDL - Simple DirectMedia Layer Copyright (C) 1997, 1998, 1999, 2000, 2001 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@devolution.com */ /* 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... The names of the keys */ alias int SDLKey; enum { /* 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 */ /* 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 */ /* 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, /* 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, /* 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, /* 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 */ /* 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 } /* Enumeration of valid key mods (possibly OR'd together) */ alias int SDLMod; 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 } const uint KMOD_CTRL = (KMOD_LCTRL|KMOD_RCTRL); const uint KMOD_SHIFT = (KMOD_LSHIFT|KMOD_RSHIFT); const uint KMOD_ALT = (KMOD_LALT|KMOD_RALT); const uint KMOD_META = (KMOD_LMETA|KMOD_RMETA); projectL_1001/import/SDL_mutex.d0000644000000000000000000001071610461565464015342 0ustar rootroot/* SDL - Simple DirectMedia Layer Copyright (C) 1997, 1998, 1999, 2000, 2001 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@devolution.com */ /* Functions to provide thread synchronization primitives These are independent of the other SDL routines. */ import SDL_types; extern(C): /* Synchronization functions which can time out return this value if they time out. */ const uint SDL_MUTEX_TIMEDOUT = 1; /* This is the timeout value which corresponds to never time out */ const uint SDL_MUTEX_MAXWAIT = 0xFFFFFFFF; /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Mutex functions */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ struct SDL_mutex { } /* Create a mutex, initialized unlocked */ SDL_mutex * SDL_CreateMutex(); /* Lock the mutex (Returns 0, or -1 on error) */ int SDL_LockMutex(SDL_mutex *m) { return SDL_mutexP(m); } int SDL_mutexP(SDL_mutex *mutex); /* Unlock the mutex (Returns 0, or -1 on error) */ int SDL_UnlockMutex(SDL_mutex* m) { return SDL_mutexV(m); } int SDL_mutexV(SDL_mutex *mutex); /* Destroy a mutex */ void SDL_DestroyMutex(SDL_mutex *mutex); /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Semaphore functions */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ struct SDL_sem { } /* Create a semaphore, initialized with value, returns NULL on failure. */ SDL_sem * SDL_CreateSemaphore(Uint32 initial_value); /* Destroy a semaphore */ void 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. */ int SDL_SemWait(SDL_sem *sem); /* Non-blocking variant of SDL_SemWait(), returns 0 if the wait succeeds, SDL_MUTEX_TIMEDOUT if the wait would block, and -1 on error. */ int 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. */ int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 ms); /* Atomically increases the semaphore's count (not blocking), returns 0, or -1 on error. */ int SDL_SemPost(SDL_sem *sem); /* Returns the current count of the semaphore */ Uint32 SDL_SemValue(SDL_sem *sem); /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Condition variable functions */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ struct SDL_cond { } /* Create a condition variable */ SDL_cond * SDL_CreateCond(); /* Destroy a condition variable */ void SDL_DestroyCond(SDL_cond *cond); /* Restart one of the threads that are waiting on the condition variable, returns 0 or -1 on error. */ int SDL_CondSignal(SDL_cond *cond); /* Restart all threads that are waiting on the condition variable, returns 0 or -1 on error. */ int SDL_CondBroadcast(SDL_cond *cond); /* Wait on the condition variable, unlocking the provided mutex. The mutex must be locked before entering this function! Returns 0 when it is signaled, or -1 on error. */ int 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. */ int SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms); projectL_1001/import/opengl.d0000644000000000000000000020033410214173654014747 0ustar rootrootversion (Win32) { private import std.c.windows.windows; extern(Windows): } else { extern(C): } alias uint GLenum; alias ubyte GLboolean; alias uint GLbitfield; alias byte GLbyte; alias short GLshort; alias int GLint; alias int GLsizei; alias ubyte GLubyte; alias ushort GLushort; alias uint GLuint; alias float GLfloat; alias float GLclampf; alias double GLdouble; alias double GLclampd; alias void GLvoid; /*************************************************************/ /* Version */ const uint GL_VERSION_1_1 = 1; /* AccumOp */ const uint GL_ACCUM = 0x0100; const uint GL_LOAD = 0x0101; const uint GL_RETURN = 0x0102; const uint GL_MULT = 0x0103; const uint GL_ADD = 0x0104; /* AlphaFunction */ const uint GL_NEVER = 0x0200; const uint GL_LESS = 0x0201; const uint GL_EQUAL = 0x0202; const uint GL_LEQUAL = 0x0203; const uint GL_GREATER = 0x0204; const uint GL_NOTEQUAL = 0x0205; const uint GL_GEQUAL = 0x0206; const uint GL_ALWAYS = 0x0207; /* AttribMask */ const uint GL_CURRENT_BIT = 0x00000001; const uint GL_POINT_BIT = 0x00000002; const uint GL_LINE_BIT = 0x00000004; const uint GL_POLYGON_BIT = 0x00000008; const uint GL_POLYGON_STIPPLE_BIT = 0x00000010; const uint GL_PIXEL_MODE_BIT = 0x00000020; const uint GL_LIGHTING_BIT = 0x00000040; const uint GL_FOG_BIT = 0x00000080; const uint GL_DEPTH_BUFFER_BIT = 0x00000100; const uint GL_ACCUM_BUFFER_BIT = 0x00000200; const uint GL_STENCIL_BUFFER_BIT = 0x00000400; const uint GL_VIEWPORT_BIT = 0x00000800; const uint GL_TRANSFORM_BIT = 0x00001000; const uint GL_ENABLE_BIT = 0x00002000; const uint GL_COLOR_BUFFER_BIT = 0x00004000; const uint GL_HINT_BIT = 0x00008000; const uint GL_EVAL_BIT = 0x00010000; const uint GL_LIST_BIT = 0x00020000; const uint GL_TEXTURE_BIT = 0x00040000; const uint GL_SCISSOR_BIT = 0x00080000; const uint GL_ALL_ATTRIB_BITS = 0x000fffff; /* BeginMode */ const uint GL_POINTS = 0x0000; const uint GL_LINES = 0x0001; const uint GL_LINE_LOOP = 0x0002; const uint GL_LINE_STRIP = 0x0003; const uint GL_TRIANGLES = 0x0004; const uint GL_TRIANGLE_STRIP = 0x0005; const uint GL_TRIANGLE_FAN = 0x0006; const uint GL_QUADS = 0x0007; const uint GL_QUAD_STRIP = 0x0008; const uint GL_POLYGON = 0x0009; /* BlendingFactorDest */ const uint GL_ZERO = 0; const uint GL_ONE = 1; const uint GL_SRC_COLOR = 0x0300; const uint GL_ONE_MINUS_SRC_COLOR = 0x0301; const uint GL_SRC_ALPHA = 0x0302; const uint GL_ONE_MINUS_SRC_ALPHA = 0x0303; const uint GL_DST_ALPHA = 0x0304; const uint GL_ONE_MINUS_DST_ALPHA = 0x0305; /* BlendingFactorSrc */ /* GL_ZERO */ /* GL_ONE */ const uint GL_DST_COLOR = 0x0306; const uint GL_ONE_MINUS_DST_COLOR = 0x0307; const uint GL_SRC_ALPHA_SATURATE = 0x0308; /* GL_SRC_ALPHA */ /* GL_ONE_MINUS_SRC_ALPHA */ /* GL_DST_ALPHA */ /* GL_ONE_MINUS_DST_ALPHA */ /* Boolean */ const uint GL_TRUE = 1; const uint GL_FALSE = 0; /* ClearBufferMask */ /* GL_COLOR_BUFFER_BIT */ /* GL_ACCUM_BUFFER_BIT */ /* GL_STENCIL_BUFFER_BIT */ /* GL_DEPTH_BUFFER_BIT */ /* ClientArrayType */ /* GL_VERTEX_ARRAY */ /* GL_NORMAL_ARRAY */ /* GL_COLOR_ARRAY */ /* GL_INDEX_ARRAY */ /* GL_TEXTURE_COORD_ARRAY */ /* GL_EDGE_FLAG_ARRAY */ /* ClipPlaneName */ const uint GL_CLIP_PLANE0 = 0x3000; const uint GL_CLIP_PLANE1 = 0x3001; const uint GL_CLIP_PLANE2 = 0x3002; const uint GL_CLIP_PLANE3 = 0x3003; const uint GL_CLIP_PLANE4 = 0x3004; const uint GL_CLIP_PLANE5 = 0x3005; /* ColorMaterialFace */ /* GL_FRONT */ /* GL_BACK */ /* GL_FRONT_AND_BACK */ /* ColorMaterialParameter */ /* GL_AMBIENT */ /* GL_DIFFUSE */ /* GL_SPECULAR */ /* GL_EMISSION */ /* GL_AMBIENT_AND_DIFFUSE */ /* ColorPointerType */ /* GL_BYTE */ /* GL_UNSIGNED_BYTE */ /* GL_SHORT */ /* GL_UNSIGNED_SHORT */ /* GL_INT */ /* GL_UNSIGNED_INT */ /* GL_FLOAT */ /* GL_DOUBLE */ /* CullFaceMode */ /* GL_FRONT */ /* GL_BACK */ /* GL_FRONT_AND_BACK */ /* DataType */ const uint GL_BYTE = 0x1400; const uint GL_UNSIGNED_BYTE = 0x1401; const uint GL_SHORT = 0x1402; const uint GL_UNSIGNED_SHORT = 0x1403; const uint GL_INT = 0x1404; const uint GL_UNSIGNED_INT = 0x1405; const uint GL_FLOAT = 0x1406; const uint GL_2_BYTES = 0x1407; const uint GL_3_BYTES = 0x1408; const uint GL_4_BYTES = 0x1409; const uint GL_DOUBLE = 0x140A; /* DepthFunction */ /* GL_NEVER */ /* GL_LESS */ /* GL_EQUAL */ /* GL_LEQUAL */ /* GL_GREATER */ /* GL_NOTEQUAL */ /* GL_GEQUAL */ /* GL_ALWAYS */ /* DrawBufferMode */ const uint GL_NONE = 0; const uint GL_FRONT_LEFT = 0x0400; const uint GL_FRONT_RIGHT = 0x0401; const uint GL_BACK_LEFT = 0x0402; const uint GL_BACK_RIGHT = 0x0403; const uint GL_FRONT = 0x0404; const uint GL_BACK = 0x0405; const uint GL_LEFT = 0x0406; const uint GL_RIGHT = 0x0407; const uint GL_FRONT_AND_BACK = 0x0408; const uint GL_AUX0 = 0x0409; const uint GL_AUX1 = 0x040A; const uint GL_AUX2 = 0x040B; const uint GL_AUX3 = 0x040C; /* Enable */ /* GL_FOG */ /* GL_LIGHTING */ /* GL_TEXTURE_1D */ /* GL_TEXTURE_2D */ /* GL_LINE_STIPPLE */ /* GL_POLYGON_STIPPLE */ /* GL_CULL_FACE */ /* GL_ALPHA_TEST */ /* GL_BLEND */ /* GL_INDEX_LOGIC_OP */ /* GL_COLOR_LOGIC_OP */ /* GL_DITHER */ /* GL_STENCIL_TEST */ /* GL_DEPTH_TEST */ /* GL_CLIP_PLANE0 */ /* GL_CLIP_PLANE1 */ /* GL_CLIP_PLANE2 */ /* GL_CLIP_PLANE3 */ /* GL_CLIP_PLANE4 */ /* GL_CLIP_PLANE5 */ /* GL_LIGHT0 */ /* GL_LIGHT1 */ /* GL_LIGHT2 */ /* GL_LIGHT3 */ /* GL_LIGHT4 */ /* GL_LIGHT5 */ /* GL_LIGHT6 */ /* GL_LIGHT7 */ /* GL_TEXTURE_GEN_S */ /* GL_TEXTURE_GEN_T */ /* GL_TEXTURE_GEN_R */ /* GL_TEXTURE_GEN_Q */ /* GL_MAP1_VERTEX_3 */ /* GL_MAP1_VERTEX_4 */ /* GL_MAP1_COLOR_4 */ /* GL_MAP1_INDEX */ /* GL_MAP1_NORMAL */ /* GL_MAP1_TEXTURE_COORD_1 */ /* GL_MAP1_TEXTURE_COORD_2 */ /* GL_MAP1_TEXTURE_COORD_3 */ /* GL_MAP1_TEXTURE_COORD_4 */ /* GL_MAP2_VERTEX_3 */ /* GL_MAP2_VERTEX_4 */ /* GL_MAP2_COLOR_4 */ /* GL_MAP2_INDEX */ /* GL_MAP2_NORMAL */ /* GL_MAP2_TEXTURE_COORD_1 */ /* GL_MAP2_TEXTURE_COORD_2 */ /* GL_MAP2_TEXTURE_COORD_3 */ /* GL_MAP2_TEXTURE_COORD_4 */ /* GL_POINT_SMOOTH */ /* GL_LINE_SMOOTH */ /* GL_POLYGON_SMOOTH */ /* GL_SCISSOR_TEST */ /* GL_COLOR_MATERIAL */ /* GL_NORMALIZE */ /* GL_AUTO_NORMAL */ /* GL_VERTEX_ARRAY */ /* GL_NORMAL_ARRAY */ /* GL_COLOR_ARRAY */ /* GL_INDEX_ARRAY */ /* GL_TEXTURE_COORD_ARRAY */ /* GL_EDGE_FLAG_ARRAY */ /* GL_POLYGON_OFFSET_POINT */ /* GL_POLYGON_OFFSET_LINE */ /* GL_POLYGON_OFFSET_FILL */ /* ErrorCode */ const uint GL_NO_ERROR = 0; const uint GL_INVALID_ENUM = 0x0500; const uint GL_INVALID_VALUE = 0x0501; const uint GL_INVALID_OPERATION = 0x0502; const uint GL_STACK_OVERFLOW = 0x0503; const uint GL_STACK_UNDERFLOW = 0x0504; const uint GL_OUT_OF_MEMORY = 0x0505; /* FeedBackMode */ const uint GL_2D = 0x0600; const uint GL_3D = 0x0601; const uint GL_3D_COLOR = 0x0602; const uint GL_3D_COLOR_TEXTURE = 0x0603; const uint GL_4D_COLOR_TEXTURE = 0x0604; /* FeedBackToken */ const uint GL_PASS_THROUGH_TOKEN = 0x0700; const uint GL_POINT_TOKEN = 0x0701; const uint GL_LINE_TOKEN = 0x0702; const uint GL_POLYGON_TOKEN = 0x0703; const uint GL_BITMAP_TOKEN = 0x0704; const uint GL_DRAW_PIXEL_TOKEN = 0x0705; const uint GL_COPY_PIXEL_TOKEN = 0x0706; const uint GL_LINE_RESET_TOKEN = 0x0707; /* FogMode */ /* GL_LINEAR */ const uint GL_EXP = 0x0800; const uint GL_EXP2 = 0x0801; /* FogParameter */ /* GL_FOG_COLOR */ /* GL_FOG_DENSITY */ /* GL_FOG_END */ /* GL_FOG_INDEX */ /* GL_FOG_MODE */ /* GL_FOG_START */ /* FrontFaceDirection */ const uint GL_CW = 0x0900; const uint GL_CCW = 0x0901; /* GetMapTarget */ const uint GL_COEFF = 0x0A00; const uint GL_ORDER = 0x0A01; const uint GL_DOMAIN = 0x0A02; /* GetPixelMap */ /* GL_PIXEL_MAP_I_TO_I */ /* GL_PIXEL_MAP_S_TO_S */ /* GL_PIXEL_MAP_I_TO_R */ /* GL_PIXEL_MAP_I_TO_G */ /* GL_PIXEL_MAP_I_TO_B */ /* GL_PIXEL_MAP_I_TO_A */ /* GL_PIXEL_MAP_R_TO_R */ /* GL_PIXEL_MAP_G_TO_G */ /* GL_PIXEL_MAP_B_TO_B */ /* GL_PIXEL_MAP_A_TO_A */ /* GetPointerTarget */ /* GL_VERTEX_ARRAY_POINTER */ /* GL_NORMAL_ARRAY_POINTER */ /* GL_COLOR_ARRAY_POINTER */ /* GL_INDEX_ARRAY_POINTER */ /* GL_TEXTURE_COORD_ARRAY_POINTER */ /* GL_EDGE_FLAG_ARRAY_POINTER */ /* GetTarget */ const uint GL_CURRENT_COLOR = 0x0B00; const uint GL_CURRENT_INDEX = 0x0B01; const uint GL_CURRENT_NORMAL = 0x0B02; const uint GL_CURRENT_TEXTURE_COORDS = 0x0B03; const uint GL_CURRENT_RASTER_COLOR = 0x0B04; const uint GL_CURRENT_RASTER_INDEX = 0x0B05; const uint GL_CURRENT_RASTER_TEXTURE_COORDS = 0x0B06; const uint GL_CURRENT_RASTER_POSITION = 0x0B07; const uint GL_CURRENT_RASTER_POSITION_VALID = 0x0B08; const uint GL_CURRENT_RASTER_DISTANCE = 0x0B09; const uint GL_POINT_SMOOTH = 0x0B10; const uint GL_POINT_SIZE = 0x0B11; const uint GL_POINT_SIZE_RANGE = 0x0B12; const uint GL_POINT_SIZE_GRANULARITY = 0x0B13; const uint GL_LINE_SMOOTH = 0x0B20; const uint GL_LINE_WIDTH = 0x0B21; const uint GL_LINE_WIDTH_RANGE = 0x0B22; const uint GL_LINE_WIDTH_GRANULARITY = 0x0B23; const uint GL_LINE_STIPPLE = 0x0B24; const uint GL_LINE_STIPPLE_PATTERN = 0x0B25; const uint GL_LINE_STIPPLE_REPEAT = 0x0B26; const uint GL_LIST_MODE = 0x0B30; const uint GL_MAX_LIST_NESTING = 0x0B31; const uint GL_LIST_BASE = 0x0B32; const uint GL_LIST_INDEX = 0x0B33; const uint GL_POLYGON_MODE = 0x0B40; const uint GL_POLYGON_SMOOTH = 0x0B41; const uint GL_POLYGON_STIPPLE = 0x0B42; const uint GL_EDGE_FLAG = 0x0B43; const uint GL_CULL_FACE = 0x0B44; const uint GL_CULL_FACE_MODE = 0x0B45; const uint GL_FRONT_FACE = 0x0B46; const uint GL_LIGHTING = 0x0B50; const uint GL_LIGHT_MODEL_LOCAL_VIEWER = 0x0B51; const uint GL_LIGHT_MODEL_TWO_SIDE = 0x0B52; const uint GL_LIGHT_MODEL_AMBIENT = 0x0B53; const uint GL_SHADE_MODEL = 0x0B54; const uint GL_COLOR_MATERIAL_FACE = 0x0B55; const uint GL_COLOR_MATERIAL_PARAMETER = 0x0B56; const uint GL_COLOR_MATERIAL = 0x0B57; const uint GL_FOG = 0x0B60; const uint GL_FOG_INDEX = 0x0B61; const uint GL_FOG_DENSITY = 0x0B62; const uint GL_FOG_START = 0x0B63; const uint GL_FOG_END = 0x0B64; const uint GL_FOG_MODE = 0x0B65; const uint GL_FOG_COLOR = 0x0B66; const uint GL_DEPTH_RANGE = 0x0B70; const uint GL_DEPTH_TEST = 0x0B71; const uint GL_DEPTH_WRITEMASK = 0x0B72; const uint GL_DEPTH_CLEAR_VALUE = 0x0B73; const uint GL_DEPTH_FUNC = 0x0B74; const uint GL_ACCUM_CLEAR_VALUE = 0x0B80; const uint GL_STENCIL_TEST = 0x0B90; const uint GL_STENCIL_CLEAR_VALUE = 0x0B91; const uint GL_STENCIL_FUNC = 0x0B92; const uint GL_STENCIL_VALUE_MASK = 0x0B93; const uint GL_STENCIL_FAIL = 0x0B94; const uint GL_STENCIL_PASS_DEPTH_FAIL = 0x0B95; const uint GL_STENCIL_PASS_DEPTH_PASS = 0x0B96; const uint GL_STENCIL_REF = 0x0B97; const uint GL_STENCIL_WRITEMASK = 0x0B98; const uint GL_MATRIX_MODE = 0x0BA0; const uint GL_NORMALIZE = 0x0BA1; const uint GL_VIEWPORT = 0x0BA2; const uint GL_MODELVIEW_STACK_DEPTH = 0x0BA3; const uint GL_PROJECTION_STACK_DEPTH = 0x0BA4; const uint GL_TEXTURE_STACK_DEPTH = 0x0BA5; const uint GL_MODELVIEW_MATRIX = 0x0BA6; const uint GL_PROJECTION_MATRIX = 0x0BA7; const uint GL_TEXTURE_MATRIX = 0x0BA8; const uint GL_ATTRIB_STACK_DEPTH = 0x0BB0; const uint GL_CLIENT_ATTRIB_STACK_DEPTH = 0x0BB1; const uint GL_ALPHA_TEST = 0x0BC0; const uint GL_ALPHA_TEST_FUNC = 0x0BC1; const uint GL_ALPHA_TEST_REF = 0x0BC2; const uint GL_DITHER = 0x0BD0; const uint GL_BLEND_DST = 0x0BE0; const uint GL_BLEND_SRC = 0x0BE1; const uint GL_BLEND = 0x0BE2; const uint GL_LOGIC_OP_MODE = 0x0BF0; const uint GL_INDEX_LOGIC_OP = 0x0BF1; const uint GL_COLOR_LOGIC_OP = 0x0BF2; const uint GL_AUX_BUFFERS = 0x0C00; const uint GL_DRAW_BUFFER = 0x0C01; const uint GL_READ_BUFFER = 0x0C02; const uint GL_SCISSOR_BOX = 0x0C10; const uint GL_SCISSOR_TEST = 0x0C11; const uint GL_INDEX_CLEAR_VALUE = 0x0C20; const uint GL_INDEX_WRITEMASK = 0x0C21; const uint GL_COLOR_CLEAR_VALUE = 0x0C22; const uint GL_COLOR_WRITEMASK = 0x0C23; const uint GL_INDEX_MODE = 0x0C30; const uint GL_RGBA_MODE = 0x0C31; const uint GL_DOUBLEBUFFER = 0x0C32; const uint GL_STEREO = 0x0C33; const uint GL_RENDER_MODE = 0x0C40; const uint GL_PERSPECTIVE_CORRECTION_HINT= 0x0C50; const uint GL_POINT_SMOOTH_HINT = 0x0C51; const uint GL_LINE_SMOOTH_HINT = 0x0C52; const uint GL_POLYGON_SMOOTH_HINT = 0x0C53; const uint GL_FOG_HINT = 0x0C54; const uint GL_TEXTURE_GEN_S = 0x0C60; const uint GL_TEXTURE_GEN_T = 0x0C61; const uint GL_TEXTURE_GEN_R = 0x0C62; const uint GL_TEXTURE_GEN_Q = 0x0C63; const uint GL_PIXEL_MAP_I_TO_I = 0x0C70; const uint GL_PIXEL_MAP_S_TO_S = 0x0C71; const uint GL_PIXEL_MAP_I_TO_R = 0x0C72; const uint GL_PIXEL_MAP_I_TO_G = 0x0C73; const uint GL_PIXEL_MAP_I_TO_B = 0x0C74; const uint GL_PIXEL_MAP_I_TO_A = 0x0C75; const uint GL_PIXEL_MAP_R_TO_R = 0x0C76; const uint GL_PIXEL_MAP_G_TO_G = 0x0C77; const uint GL_PIXEL_MAP_B_TO_B = 0x0C78; const uint GL_PIXEL_MAP_A_TO_A = 0x0C79; const uint GL_PIXEL_MAP_I_TO_I_SIZE = 0x0CB0; const uint GL_PIXEL_MAP_S_TO_S_SIZE = 0x0CB1; const uint GL_PIXEL_MAP_I_TO_R_SIZE = 0x0CB2; const uint GL_PIXEL_MAP_I_TO_G_SIZE = 0x0CB3; const uint GL_PIXEL_MAP_I_TO_B_SIZE = 0x0CB4; const uint GL_PIXEL_MAP_I_TO_A_SIZE = 0x0CB5; const uint GL_PIXEL_MAP_R_TO_R_SIZE = 0x0CB6; const uint GL_PIXEL_MAP_G_TO_G_SIZE = 0x0CB7; const uint GL_PIXEL_MAP_B_TO_B_SIZE = 0x0CB8; const uint GL_PIXEL_MAP_A_TO_A_SIZE = 0x0CB9; const uint GL_UNPACK_SWAP_BYTES = 0x0CF0; const uint GL_UNPACK_LSB_FIRST = 0x0CF1; const uint GL_UNPACK_ROW_LENGTH = 0x0CF2; const uint GL_UNPACK_SKIP_ROWS = 0x0CF3; const uint GL_UNPACK_SKIP_PIXELS = 0x0CF4; const uint GL_UNPACK_ALIGNMENT = 0x0CF5; const uint GL_PACK_SWAP_BYTES = 0x0D00; const uint GL_PACK_LSB_FIRST = 0x0D01; const uint GL_PACK_ROW_LENGTH = 0x0D02; const uint GL_PACK_SKIP_ROWS = 0x0D03; const uint GL_PACK_SKIP_PIXELS = 0x0D04; const uint GL_PACK_ALIGNMENT = 0x0D05; const uint GL_MAP_COLOR = 0x0D10; const uint GL_MAP_STENCIL = 0x0D11; const uint GL_INDEX_SHIFT = 0x0D12; const uint GL_INDEX_OFFSET = 0x0D13; const uint GL_RED_SCALE = 0x0D14; const uint GL_RED_BIAS = 0x0D15; const uint GL_ZOOM_X = 0x0D16; const uint GL_ZOOM_Y = 0x0D17; const uint GL_GREEN_SCALE = 0x0D18; const uint GL_GREEN_BIAS = 0x0D19; const uint GL_BLUE_SCALE = 0x0D1A; const uint GL_BLUE_BIAS = 0x0D1B; const uint GL_ALPHA_SCALE = 0x0D1C; const uint GL_ALPHA_BIAS = 0x0D1D; const uint GL_DEPTH_SCALE = 0x0D1E; const uint GL_DEPTH_BIAS = 0x0D1F; const uint GL_MAX_EVAL_ORDER = 0x0D30; const uint GL_MAX_LIGHTS = 0x0D31; const uint GL_MAX_CLIP_PLANES = 0x0D32; const uint GL_MAX_TEXTURE_SIZE = 0x0D33; const uint GL_MAX_PIXEL_MAP_TABLE = 0x0D34; const uint GL_MAX_ATTRIB_STACK_DEPTH = 0x0D35; const uint GL_MAX_MODELVIEW_STACK_DEPTH = 0x0D36; const uint GL_MAX_NAME_STACK_DEPTH = 0x0D37; const uint GL_MAX_PROJECTION_STACK_DEPTH = 0x0D38; const uint GL_MAX_TEXTURE_STACK_DEPTH = 0x0D39; const uint GL_MAX_VIEWPORT_DIMS = 0x0D3A; const uint GL_MAX_CLIENT_ATTRIB_STACK_DEPTH = 0x0D3B; const uint GL_SUBPIXEL_BITS = 0x0D50; const uint GL_INDEX_BITS = 0x0D51; const uint GL_RED_BITS = 0x0D52; const uint GL_GREEN_BITS = 0x0D53; const uint GL_BLUE_BITS = 0x0D54; const uint GL_ALPHA_BITS = 0x0D55; const uint GL_DEPTH_BITS = 0x0D56; const uint GL_STENCIL_BITS = 0x0D57; const uint GL_ACCUM_RED_BITS = 0x0D58; const uint GL_ACCUM_GREEN_BITS = 0x0D59; const uint GL_ACCUM_BLUE_BITS = 0x0D5A; const uint GL_ACCUM_ALPHA_BITS = 0x0D5B; const uint GL_NAME_STACK_DEPTH = 0x0D70; const uint GL_AUTO_NORMAL = 0x0D80; const uint GL_MAP1_COLOR_4 = 0x0D90; const uint GL_MAP1_INDEX = 0x0D91; const uint GL_MAP1_NORMAL = 0x0D92; const uint GL_MAP1_TEXTURE_COORD_1 = 0x0D93; const uint GL_MAP1_TEXTURE_COORD_2 = 0x0D94; const uint GL_MAP1_TEXTURE_COORD_3 = 0x0D95; const uint GL_MAP1_TEXTURE_COORD_4 = 0x0D96; const uint GL_MAP1_VERTEX_3 = 0x0D97; const uint GL_MAP1_VERTEX_4 = 0x0D98; const uint GL_MAP2_COLOR_4 = 0x0DB0; const uint GL_MAP2_INDEX = 0x0DB1; const uint GL_MAP2_NORMAL = 0x0DB2; const uint GL_MAP2_TEXTURE_COORD_1 = 0x0DB3; const uint GL_MAP2_TEXTURE_COORD_2 = 0x0DB4; const uint GL_MAP2_TEXTURE_COORD_3 = 0x0DB5; const uint GL_MAP2_TEXTURE_COORD_4 = 0x0DB6; const uint GL_MAP2_VERTEX_3 = 0x0DB7; const uint GL_MAP2_VERTEX_4 = 0x0DB8; const uint GL_MAP1_GRID_DOMAIN = 0x0DD0; const uint GL_MAP1_GRID_SEGMENTS = 0x0DD1; const uint GL_MAP2_GRID_DOMAIN = 0x0DD2; const uint GL_MAP2_GRID_SEGMENTS = 0x0DD3; const uint GL_TEXTURE_1D = 0x0DE0; const uint GL_TEXTURE_2D = 0x0DE1; const uint GL_FEEDBACK_BUFFER_POINTER = 0x0DF0; const uint GL_FEEDBACK_BUFFER_SIZE = 0x0DF1; const uint GL_FEEDBACK_BUFFER_TYPE = 0x0DF2; const uint GL_SELECTION_BUFFER_POINTER = 0x0DF3; const uint GL_SELECTION_BUFFER_SIZE = 0x0DF4; /* GL_TEXTURE_BINDING_1D */ /* GL_TEXTURE_BINDING_2D */ /* GL_VERTEX_ARRAY */ /* GL_NORMAL_ARRAY */ /* GL_COLOR_ARRAY */ /* GL_INDEX_ARRAY */ /* GL_TEXTURE_COORD_ARRAY */ /* GL_EDGE_FLAG_ARRAY */ /* GL_VERTEX_ARRAY_SIZE */ /* GL_VERTEX_ARRAY_TYPE */ /* GL_VERTEX_ARRAY_STRIDE */ /* GL_NORMAL_ARRAY_TYPE */ /* GL_NORMAL_ARRAY_STRIDE */ /* GL_COLOR_ARRAY_SIZE */ /* GL_COLOR_ARRAY_TYPE */ /* GL_COLOR_ARRAY_STRIDE */ /* GL_INDEX_ARRAY_TYPE */ /* GL_INDEX_ARRAY_STRIDE */ /* GL_TEXTURE_COORD_ARRAY_SIZE */ /* GL_TEXTURE_COORD_ARRAY_TYPE */ /* GL_TEXTURE_COORD_ARRAY_STRIDE */ /* GL_EDGE_FLAG_ARRAY_STRIDE */ /* GL_POLYGON_OFFSET_FACTOR */ /* GL_POLYGON_OFFSET_UNITS */ /* GetTextureParameter */ /* GL_TEXTURE_MAG_FILTER */ /* GL_TEXTURE_MIN_FILTER */ /* GL_TEXTURE_WRAP_S */ /* GL_TEXTURE_WRAP_T */ const uint GL_TEXTURE_WIDTH = 0x1000; const uint GL_TEXTURE_HEIGHT = 0x1001; const uint GL_TEXTURE_INTERNAL_FORMAT = 0x1003; const uint GL_TEXTURE_BORDER_COLOR = 0x1004; const uint GL_TEXTURE_BORDER = 0x1005; /* GL_TEXTURE_RED_SIZE */ /* GL_TEXTURE_GREEN_SIZE */ /* GL_TEXTURE_BLUE_SIZE */ /* GL_TEXTURE_ALPHA_SIZE */ /* GL_TEXTURE_LUMINANCE_SIZE */ /* GL_TEXTURE_INTENSITY_SIZE */ /* GL_TEXTURE_PRIORITY */ /* GL_TEXTURE_RESIDENT */ /* HintMode */ const uint GL_DONT_CARE = 0x1100; const uint GL_FASTEST = 0x1101; const uint GL_NICEST = 0x1102; /* HintTarget */ /* GL_PERSPECTIVE_CORRECTION_HINT */ /* GL_POINT_SMOOTH_HINT */ /* GL_LINE_SMOOTH_HINT */ /* GL_POLYGON_SMOOTH_HINT */ /* GL_FOG_HINT */ /* GL_PHONG_HINT */ /* IndexPointerType */ /* GL_SHORT */ /* GL_INT */ /* GL_FLOAT */ /* GL_DOUBLE */ /* LightModelParameter */ /* GL_LIGHT_MODEL_AMBIENT */ /* GL_LIGHT_MODEL_LOCAL_VIEWER */ /* GL_LIGHT_MODEL_TWO_SIDE */ /* LightName */ const uint GL_LIGHT0 = 0x4000; const uint GL_LIGHT1 = 0x4001; const uint GL_LIGHT2 = 0x4002; const uint GL_LIGHT3 = 0x4003; const uint GL_LIGHT4 = 0x4004; const uint GL_LIGHT5 = 0x4005; const uint GL_LIGHT6 = 0x4006; const uint GL_LIGHT7 = 0x4007; /* LightParameter */ const uint GL_AMBIENT = 0x1200; const uint GL_DIFFUSE = 0x1201; const uint GL_SPECULAR = 0x1202; const uint GL_POSITION = 0x1203; const uint GL_SPOT_DIRECTION = 0x1204; const uint GL_SPOT_EXPONENT = 0x1205; const uint GL_SPOT_CUTOFF = 0x1206; const uint GL_CONSTANT_ATTENUATION = 0x1207; const uint GL_LINEAR_ATTENUATION = 0x1208; const uint GL_QUADRATIC_ATTENUATION = 0x1209; /* InterleavedArrays */ /* GL_V2F */ /* GL_V3F */ /* GL_C4UB_V2F */ /* GL_C4UB_V3F */ /* GL_C3F_V3F */ /* GL_N3F_V3F */ /* GL_C4F_N3F_V3F */ /* GL_T2F_V3F */ /* GL_T4F_V4F */ /* GL_T2F_C4UB_V3F */ /* GL_T2F_C3F_V3F */ /* GL_T2F_N3F_V3F */ /* GL_T2F_C4F_N3F_V3F */ /* GL_T4F_C4F_N3F_V4F */ /* ListMode */ const uint GL_COMPILE = 0x1300; const uint GL_COMPILE_AND_EXECUTE = 0x1301; /* ListNameType */ /* GL_BYTE */ /* GL_UNSIGNED_BYTE */ /* GL_SHORT */ /* GL_UNSIGNED_SHORT */ /* GL_INT */ /* GL_UNSIGNED_INT */ /* GL_FLOAT */ /* GL_2_BYTES */ /* GL_3_BYTES */ /* GL_4_BYTES */ /* LogicOp */ const uint GL_CLEAR = 0x1500; const uint GL_AND = 0x1501; const uint GL_AND_REVERSE = 0x1502; const uint GL_COPY = 0x1503; const uint GL_AND_INVERTED = 0x1504; const uint GL_NOOP = 0x1505; const uint GL_XOR = 0x1506; const uint GL_OR = 0x1507; const uint GL_NOR = 0x1508; const uint GL_EQUIV = 0x1509; const uint GL_INVERT = 0x150A; const uint GL_OR_REVERSE = 0x150B; const uint GL_COPY_INVERTED = 0x150C; const uint GL_OR_INVERTED = 0x150D; const uint GL_NAND = 0x150E; const uint GL_SET = 0x150F; /* MapTarget */ /* GL_MAP1_COLOR_4 */ /* GL_MAP1_INDEX */ /* GL_MAP1_NORMAL */ /* GL_MAP1_TEXTURE_COORD_1 */ /* GL_MAP1_TEXTURE_COORD_2 */ /* GL_MAP1_TEXTURE_COORD_3 */ /* GL_MAP1_TEXTURE_COORD_4 */ /* GL_MAP1_VERTEX_3 */ /* GL_MAP1_VERTEX_4 */ /* GL_MAP2_COLOR_4 */ /* GL_MAP2_INDEX */ /* GL_MAP2_NORMAL */ /* GL_MAP2_TEXTURE_COORD_1 */ /* GL_MAP2_TEXTURE_COORD_2 */ /* GL_MAP2_TEXTURE_COORD_3 */ /* GL_MAP2_TEXTURE_COORD_4 */ /* GL_MAP2_VERTEX_3 */ /* GL_MAP2_VERTEX_4 */ /* MaterialFace */ /* GL_FRONT */ /* GL_BACK */ /* GL_FRONT_AND_BACK */ /* MaterialParameter */ const uint GL_EMISSION = 0x1600; const uint GL_SHININESS = 0x1601; const uint GL_AMBIENT_AND_DIFFUSE = 0x1602; const uint GL_COLOR_INDEXES = 0x1603; /* GL_AMBIENT */ /* GL_DIFFUSE */ /* GL_SPECULAR */ /* MatrixMode */ const uint GL_MODELVIEW = 0x1700; const uint GL_PROJECTION = 0x1701; const uint GL_TEXTURE = 0x1702; /* MeshMode1 */ /* GL_POINT */ /* GL_LINE */ /* MeshMode2 */ /* GL_POINT */ /* GL_LINE */ /* GL_FILL */ /* NormalPointerType */ /* GL_BYTE */ /* GL_SHORT */ /* GL_INT */ /* GL_FLOAT */ /* GL_DOUBLE */ /* PixelCopyType */ const uint GL_COLOR = 0x1800; const uint GL_DEPTH = 0x1801; const uint GL_STENCIL = 0x1802; /* PixelFormat */ const uint GL_COLOR_INDEX = 0x1900; const uint GL_STENCIL_INDEX = 0x1901; const uint GL_DEPTH_COMPONENT = 0x1902; const uint GL_RED = 0x1903; const uint GL_GREEN = 0x1904; const uint GL_BLUE = 0x1905; const uint GL_ALPHA = 0x1906; const uint GL_RGB = 0x1907; const uint GL_RGBA = 0x1908; const uint GL_LUMINANCE = 0x1909; const uint GL_LUMINANCE_ALPHA = 0x190A; /* PixelMap */ /* GL_PIXEL_MAP_I_TO_I */ /* GL_PIXEL_MAP_S_TO_S */ /* GL_PIXEL_MAP_I_TO_R */ /* GL_PIXEL_MAP_I_TO_G */ /* GL_PIXEL_MAP_I_TO_B */ /* GL_PIXEL_MAP_I_TO_A */ /* GL_PIXEL_MAP_R_TO_R */ /* GL_PIXEL_MAP_G_TO_G */ /* GL_PIXEL_MAP_B_TO_B */ /* GL_PIXEL_MAP_A_TO_A */ /* PixelStore */ /* GL_UNPACK_SWAP_BYTES */ /* GL_UNPACK_LSB_FIRST */ /* GL_UNPACK_ROW_LENGTH */ /* GL_UNPACK_SKIP_ROWS */ /* GL_UNPACK_SKIP_PIXELS */ /* GL_UNPACK_ALIGNMENT */ /* GL_PACK_SWAP_BYTES */ /* GL_PACK_LSB_FIRST */ /* GL_PACK_ROW_LENGTH */ /* GL_PACK_SKIP_ROWS */ /* GL_PACK_SKIP_PIXELS */ /* GL_PACK_ALIGNMENT */ /* PixelTransfer */ /* GL_MAP_COLOR */ /* GL_MAP_STENCIL */ /* GL_INDEX_SHIFT */ /* GL_INDEX_OFFSET */ /* GL_RED_SCALE */ /* GL_RED_BIAS */ /* GL_GREEN_SCALE */ /* GL_GREEN_BIAS */ /* GL_BLUE_SCALE */ /* GL_BLUE_BIAS */ /* GL_ALPHA_SCALE */ /* GL_ALPHA_BIAS */ /* GL_DEPTH_SCALE */ /* GL_DEPTH_BIAS */ /* PixelType */ const uint GL_BITMAP = 0x1A00; /* GL_BYTE */ /* GL_UNSIGNED_BYTE */ /* GL_SHORT */ /* GL_UNSIGNED_SHORT */ /* GL_INT */ /* GL_UNSIGNED_INT */ /* GL_FLOAT */ /* PolygonMode */ const uint GL_POINT = 0x1B00; const uint GL_LINE = 0x1B01; const uint GL_FILL = 0x1B02; /* ReadBufferMode */ /* GL_FRONT_LEFT */ /* GL_FRONT_RIGHT */ /* GL_BACK_LEFT */ /* GL_BACK_RIGHT */ /* GL_FRONT */ /* GL_BACK */ /* GL_LEFT */ /* GL_RIGHT */ /* GL_AUX0 */ /* GL_AUX1 */ /* GL_AUX2 */ /* GL_AUX3 */ /* RenderingMode */ const uint GL_RENDER = 0x1C00; const uint GL_FEEDBACK = 0x1C01; const uint GL_SELECT = 0x1C02; /* ShadingModel */ const uint GL_FLAT = 0x1D00; const uint GL_SMOOTH = 0x1D01; /* StencilFunction */ /* GL_NEVER */ /* GL_LESS */ /* GL_EQUAL */ /* GL_LEQUAL */ /* GL_GREATER */ /* GL_NOTEQUAL */ /* GL_GEQUAL */ /* GL_ALWAYS */ /* StencilOp */ /* GL_ZERO */ const uint GL_KEEP = 0x1E00; const uint GL_REPLACE = 0x1E01; const uint GL_INCR = 0x1E02; const uint GL_DECR = 0x1E03; /* GL_INVERT */ /* StringName */ const uint GL_VENDOR = 0x1F00; const uint GL_RENDERER = 0x1F01; const uint GL_VERSION = 0x1F02; const uint GL_EXTENSIONS = 0x1F03; /* TextureCoordName */ const uint GL_S = 0x2000; const uint GL_T = 0x2001; const uint GL_R = 0x2002; const uint GL_Q = 0x2003; /* TexCoordPointerType */ /* GL_SHORT */ /* GL_INT */ /* GL_FLOAT */ /* GL_DOUBLE */ /* TextureEnvMode */ const uint GL_MODULATE = 0x2100; const uint GL_DECAL = 0x2101; /* GL_BLEND */ /* GL_REPLACE */ /* TextureEnvParameter */ const uint GL_TEXTURE_ENV_MODE = 0x2200; const uint GL_TEXTURE_ENV_COLOR = 0x2201; /* TextureEnvTarget */ const uint GL_TEXTURE_ENV = 0x2300; /* TextureGenMode */ const uint GL_EYE_LINEAR = 0x2400; const uint GL_OBJECT_LINEAR = 0x2401; const uint GL_SPHERE_MAP = 0x2402; /* TextureGenParameter */ const uint GL_TEXTURE_GEN_MODE = 0x2500; const uint GL_OBJECT_PLANE = 0x2501; const uint GL_EYE_PLANE = 0x2502; /* TextureMagFilter */ const uint GL_NEAREST = 0x2600; const uint GL_LINEAR = 0x2601; /* TextureMinFilter */ /* GL_NEAREST */ /* GL_LINEAR */ const uint GL_NEAREST_MIPMAP_NEAREST = 0x2700; const uint GL_LINEAR_MIPMAP_NEAREST = 0x2701; const uint GL_NEAREST_MIPMAP_LINEAR = 0x2702; const uint GL_LINEAR_MIPMAP_LINEAR = 0x2703; /* TextureParameterName */ const uint GL_TEXTURE_MAG_FILTER = 0x2800; const uint GL_TEXTURE_MIN_FILTER = 0x2801; const uint GL_TEXTURE_WRAP_S = 0x2802; const uint GL_TEXTURE_WRAP_T = 0x2803; /* GL_TEXTURE_BORDER_COLOR */ /* GL_TEXTURE_PRIORITY */ /* TextureTarget */ /* GL_TEXTURE_1D */ /* GL_TEXTURE_2D */ /* GL_PROXY_TEXTURE_1D */ /* GL_PROXY_TEXTURE_2D */ /* TextureWrapMode */ const uint GL_CLAMP = 0x2900; const uint GL_REPEAT = 0x2901; /* VertexPointerType */ /* GL_SHORT */ /* GL_INT */ /* GL_FLOAT */ /* GL_DOUBLE */ /* ClientAttribMask */ const uint GL_CLIENT_PIXEL_STORE_BIT = 0x00000001; const uint GL_CLIENT_VERTEX_ARRAY_BIT = 0x00000002; const uint GL_CLIENT_ALL_ATTRIB_BITS = 0xffffffff; /* polygon_offset */ const uint GL_POLYGON_OFFSET_FACTOR = 0x8038; const uint GL_POLYGON_OFFSET_UNITS = 0x2A00; const uint GL_POLYGON_OFFSET_POINT = 0x2A01; const uint GL_POLYGON_OFFSET_LINE = 0x2A02; const uint GL_POLYGON_OFFSET_FILL = 0x8037; /* texture */ const uint GL_ALPHA4 = 0x803B; const uint GL_ALPHA8 = 0x803C; const uint GL_ALPHA12 = 0x803D; const uint GL_ALPHA16 = 0x803E; const uint GL_LUMINANCE4 = 0x803F; const uint GL_LUMINANCE8 = 0x8040; const uint GL_LUMINANCE12 = 0x8041; const uint GL_LUMINANCE16 = 0x8042; const uint GL_LUMINANCE4_ALPHA4 = 0x8043; const uint GL_LUMINANCE6_ALPHA2 = 0x8044; const uint GL_LUMINANCE8_ALPHA8 = 0x8045; const uint GL_LUMINANCE12_ALPHA4 = 0x8046; const uint GL_LUMINANCE12_ALPHA12 = 0x8047; const uint GL_LUMINANCE16_ALPHA16 = 0x8048; const uint GL_INTENSITY = 0x8049; const uint GL_INTENSITY4 = 0x804A; const uint GL_INTENSITY8 = 0x804B; const uint GL_INTENSITY12 = 0x804C; const uint GL_INTENSITY16 = 0x804D; const uint GL_R3_G3_B2 = 0x2A10; const uint GL_RGB4 = 0x804F; const uint GL_RGB5 = 0x8050; const uint GL_RGB8 = 0x8051; const uint GL_RGB10 = 0x8052; const uint GL_RGB12 = 0x8053; const uint GL_RGB16 = 0x8054; const uint GL_RGBA2 = 0x8055; const uint GL_RGBA4 = 0x8056; const uint GL_RGB5_A1 = 0x8057; const uint GL_RGBA8 = 0x8058; const uint GL_RGB10_A2 = 0x8059; const uint GL_RGBA12 = 0x805A; const uint GL_RGBA16 = 0x805B; const uint GL_TEXTURE_RED_SIZE = 0x805C; const uint GL_TEXTURE_GREEN_SIZE = 0x805D; const uint GL_TEXTURE_BLUE_SIZE = 0x805E; const uint GL_TEXTURE_ALPHA_SIZE = 0x805F; const uint GL_TEXTURE_LUMINANCE_SIZE = 0x8060; const uint GL_TEXTURE_INTENSITY_SIZE = 0x8061; const uint GL_PROXY_TEXTURE_1D = 0x8063; const uint GL_PROXY_TEXTURE_2D = 0x8064; /* texture_object */ const uint GL_TEXTURE_PRIORITY = 0x8066; const uint GL_TEXTURE_RESIDENT = 0x8067; const uint GL_TEXTURE_BINDING_1D = 0x8068; const uint GL_TEXTURE_BINDING_2D = 0x8069; /* vertex_array */ const uint GL_VERTEX_ARRAY = 0x8074; const uint GL_NORMAL_ARRAY = 0x8075; const uint GL_COLOR_ARRAY = 0x8076; const uint GL_INDEX_ARRAY = 0x8077; const uint GL_TEXTURE_COORD_ARRAY = 0x8078; const uint GL_EDGE_FLAG_ARRAY = 0x8079; const uint GL_VERTEX_ARRAY_SIZE = 0x807A; const uint GL_VERTEX_ARRAY_TYPE = 0x807B; const uint GL_VERTEX_ARRAY_STRIDE = 0x807C; const uint GL_NORMAL_ARRAY_TYPE = 0x807E; const uint GL_NORMAL_ARRAY_STRIDE = 0x807F; const uint GL_COLOR_ARRAY_SIZE = 0x8081; const uint GL_COLOR_ARRAY_TYPE = 0x8082; const uint GL_COLOR_ARRAY_STRIDE = 0x8083; const uint GL_INDEX_ARRAY_TYPE = 0x8085; const uint GL_INDEX_ARRAY_STRIDE = 0x8086; const uint GL_TEXTURE_COORD_ARRAY_SIZE = 0x8088; const uint GL_TEXTURE_COORD_ARRAY_TYPE = 0x8089; const uint GL_TEXTURE_COORD_ARRAY_STRIDE = 0x808A; const uint GL_EDGE_FLAG_ARRAY_STRIDE = 0x808C; const uint GL_VERTEX_ARRAY_POINTER = 0x808E; const uint GL_NORMAL_ARRAY_POINTER = 0x808F; const uint GL_COLOR_ARRAY_POINTER = 0x8090; const uint GL_INDEX_ARRAY_POINTER = 0x8091; const uint GL_TEXTURE_COORD_ARRAY_POINTER= 0x8092; const uint GL_EDGE_FLAG_ARRAY_POINTER = 0x8093; const uint GL_V2F = 0x2A20; const uint GL_V3F = 0x2A21; const uint GL_C4UB_V2F = 0x2A22; const uint GL_C4UB_V3F = 0x2A23; const uint GL_C3F_V3F = 0x2A24; const uint GL_N3F_V3F = 0x2A25; const uint GL_C4F_N3F_V3F = 0x2A26; const uint GL_T2F_V3F = 0x2A27; const uint GL_T4F_V4F = 0x2A28; const uint GL_T2F_C4UB_V3F = 0x2A29; const uint GL_T2F_C3F_V3F = 0x2A2A; const uint GL_T2F_N3F_V3F = 0x2A2B; const uint GL_T2F_C4F_N3F_V3F = 0x2A2C; const uint GL_T4F_C4F_N3F_V4F = 0x2A2D; /* Extensions */ const uint GL_EXT_vertex_array = 1; const uint GL_EXT_bgra = 1; const uint GL_EXT_paletted_texture = 1; const uint GL_WIN_swap_hint = 1; const uint GL_WIN_draw_range_elements = 1; // const uint GL_WIN_phong_shading 1 // const uint GL_WIN_specular_fog 1 /* EXT_vertex_array */ const uint GL_VERTEX_ARRAY_EXT = 0x8074; const uint GL_NORMAL_ARRAY_EXT = 0x8075; const uint GL_COLOR_ARRAY_EXT = 0x8076; const uint GL_INDEX_ARRAY_EXT = 0x8077; const uint GL_TEXTURE_COORD_ARRAY_EXT = 0x8078; const uint GL_EDGE_FLAG_ARRAY_EXT = 0x8079; const uint GL_VERTEX_ARRAY_SIZE_EXT = 0x807A; const uint GL_VERTEX_ARRAY_TYPE_EXT = 0x807B; const uint GL_VERTEX_ARRAY_STRIDE_EXT = 0x807C; const uint GL_VERTEX_ARRAY_COUNT_EXT = 0x807D; const uint GL_NORMAL_ARRAY_TYPE_EXT = 0x807E; const uint GL_NORMAL_ARRAY_STRIDE_EXT = 0x807F; const uint GL_NORMAL_ARRAY_COUNT_EXT = 0x8080; const uint GL_COLOR_ARRAY_SIZE_EXT = 0x8081; const uint GL_COLOR_ARRAY_TYPE_EXT = 0x8082; const uint GL_COLOR_ARRAY_STRIDE_EXT = 0x8083; const uint GL_COLOR_ARRAY_COUNT_EXT = 0x8084; const uint GL_INDEX_ARRAY_TYPE_EXT = 0x8085; const uint GL_INDEX_ARRAY_STRIDE_EXT = 0x8086; const uint GL_INDEX_ARRAY_COUNT_EXT = 0x8087; const uint GL_TEXTURE_COORD_ARRAY_SIZE_EXT = 0x8088; const uint GL_TEXTURE_COORD_ARRAY_TYPE_EXT = 0x8089; const uint GL_TEXTURE_COORD_ARRAY_STRIDE_EXT = 0x808A; const uint GL_TEXTURE_COORD_ARRAY_COUNT_EXT = 0x808B; const uint GL_EDGE_FLAG_ARRAY_STRIDE_EXT = 0x808C; const uint GL_EDGE_FLAG_ARRAY_COUNT_EXT = 0x808D; const uint GL_VERTEX_ARRAY_POINTER_EXT = 0x808E; const uint GL_NORMAL_ARRAY_POINTER_EXT = 0x808F; const uint GL_COLOR_ARRAY_POINTER_EXT = 0x8090; const uint GL_INDEX_ARRAY_POINTER_EXT = 0x8091; const uint GL_TEXTURE_COORD_ARRAY_POINTER_EXT = 0x8092; const uint GL_EDGE_FLAG_ARRAY_POINTER_EXT = 0x8093; const uint GL_DOUBLE_EXT = GL_DOUBLE; /* EXT_bgra */ const uint GL_BGR_EXT = 0x80E0; const uint GL_BGRA_EXT = 0x80E1; /* EXT_paletted_texture */ /* These must match the GL_COLOR_TABLE_*_SGI enumerants */ const uint GL_COLOR_TABLE_FORMAT_EXT = 0x80D8; const uint GL_COLOR_TABLE_WIDTH_EXT = 0x80D9; const uint GL_COLOR_TABLE_RED_SIZE_EXT = 0x80DA; const uint GL_COLOR_TABLE_GREEN_SIZE_EXT = 0x80DB; const uint GL_COLOR_TABLE_BLUE_SIZE_EXT = 0x80DC; const uint GL_COLOR_TABLE_ALPHA_SIZE_EXT = 0x80DD; const uint GL_COLOR_TABLE_LUMINANCE_SIZE_EXT = 0x80DE; const uint GL_COLOR_TABLE_INTENSITY_SIZE_EXT = 0x80DF; const uint GL_COLOR_INDEX1_EXT = 0x80E2; const uint GL_COLOR_INDEX2_EXT = 0x80E3; const uint GL_COLOR_INDEX4_EXT = 0x80E4; const uint GL_COLOR_INDEX8_EXT = 0x80E5; const uint GL_COLOR_INDEX12_EXT = 0x80E6; const uint GL_COLOR_INDEX16_EXT = 0x80E7; /* WIN_draw_range_elements */ const uint GL_MAX_ELEMENTS_VERTICES_WIN = 0x80E8; const uint GL_MAX_ELEMENTS_INDICES_WIN = 0x80E9; /* WIN_phong_shading */ const uint GL_PHONG_WIN = 0x80EA; const uint GL_PHONG_HINT_WIN = 0x80EB; /* WIN_specular_fog */ const uint GL_FOG_SPECULAR_TEXTURE_WIN = 0x80EC; /* For compatibility with OpenGL v1.0 */ const uint GL_LOGIC_OP = GL_INDEX_LOGIC_OP; const uint GL_TEXTURE_COMPONENTS = GL_TEXTURE_INTERNAL_FORMAT; /*************************************************************/ void /*APIENTRY*/glAccum (GLenum op, GLfloat value); void /*APIENTRY*/glAlphaFunc (GLenum func, GLclampf ref); GLboolean /*APIENTRY*/glAreTexturesResident (GLsizei n, GLuint *textures, GLboolean *residences); void /*APIENTRY*/glArrayElement (GLint i); void /*APIENTRY*/glBegin (GLenum mode); void /*APIENTRY*/glBindTexture (GLenum target, GLuint texture); void /*APIENTRY*/glBitmap (GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, GLubyte *bitmap); void /*APIENTRY*/glBlendFunc (GLenum sfactor, GLenum dfactor); void /*APIENTRY*/glCallList (GLuint list); void /*APIENTRY*/glCallLists (GLsizei n, GLenum type, GLvoid *lists); void /*APIENTRY*/glClear (GLbitfield mask); void /*APIENTRY*/glClearAccum (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); void /*APIENTRY*/glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); void /*APIENTRY*/glClearDepth (GLclampd depth); void /*APIENTRY*/glClearIndex (GLfloat c); void /*APIENTRY*/glClearStencil (GLint s); void /*APIENTRY*/glClipPlane (GLenum plane, GLdouble *equation); void /*APIENTRY*/glColor3b (GLbyte red, GLbyte green, GLbyte blue); void /*APIENTRY*/glColor3bv (GLbyte *v); void /*APIENTRY*/glColor3d (GLdouble red, GLdouble green, GLdouble blue); void /*APIENTRY*/glColor3dv (GLdouble *v); void /*APIENTRY*/glColor3f (GLfloat red, GLfloat green, GLfloat blue); void /*APIENTRY*/glColor3fv (GLfloat *v); void /*APIENTRY*/glColor3i (GLint red, GLint green, GLint blue); void /*APIENTRY*/glColor3iv (GLint *v); void /*APIENTRY*/glColor3s (GLshort red, GLshort green, GLshort blue); void /*APIENTRY*/glColor3sv (GLshort *v); void /*APIENTRY*/glColor3ub (GLubyte red, GLubyte green, GLubyte blue); void /*APIENTRY*/glColor3ubv (GLubyte *v); void /*APIENTRY*/glColor3ui (GLuint red, GLuint green, GLuint blue); void /*APIENTRY*/glColor3uiv (GLuint *v); void /*APIENTRY*/glColor3us (GLushort red, GLushort green, GLushort blue); void /*APIENTRY*/glColor3usv (GLushort *v); void /*APIENTRY*/glColor4b (GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha); void /*APIENTRY*/glColor4bv (GLbyte *v); void /*APIENTRY*/glColor4d (GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha); void /*APIENTRY*/glColor4dv (GLdouble *v); void /*APIENTRY*/glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); void /*APIENTRY*/glColor4fv (GLfloat *v); void /*APIENTRY*/glColor4i (GLint red, GLint green, GLint blue, GLint alpha); void /*APIENTRY*/glColor4iv (GLint *v); void /*APIENTRY*/glColor4s (GLshort red, GLshort green, GLshort blue, GLshort alpha); void /*APIENTRY*/glColor4sv (GLshort *v); void /*APIENTRY*/glColor4ub (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); void /*APIENTRY*/glColor4ubv (GLubyte *v); void /*APIENTRY*/glColor4ui (GLuint red, GLuint green, GLuint blue, GLuint alpha); void /*APIENTRY*/glColor4uiv (GLuint *v); void /*APIENTRY*/glColor4us (GLushort red, GLushort green, GLushort blue, GLushort alpha); void /*APIENTRY*/glColor4usv (GLushort *v); void /*APIENTRY*/glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); void /*APIENTRY*/glColorMaterial (GLenum face, GLenum mode); void /*APIENTRY*/glColorPointer (GLint size, GLenum type, GLsizei stride, GLvoid *pointer); void /*APIENTRY*/glCopyPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum type); void /*APIENTRY*/glCopyTexImage1D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border); void /*APIENTRY*/glCopyTexImage2D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); void /*APIENTRY*/glCopyTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); void /*APIENTRY*/glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); void /*APIENTRY*/glCullFace (GLenum mode); void /*APIENTRY*/glDeleteLists (GLuint list, GLsizei range); void /*APIENTRY*/glDeleteTextures (GLsizei n, GLuint *textures); void /*APIENTRY*/glDepthFunc (GLenum func); void /*APIENTRY*/glDepthMask (GLboolean flag); void /*APIENTRY*/glDepthRange (GLclampd zNear, GLclampd zFar); void /*APIENTRY*/glDisable (GLenum cap); void /*APIENTRY*/glDisableClientState (GLenum array); void /*APIENTRY*/glDrawArrays (GLenum mode, GLint first, GLsizei count); void /*APIENTRY*/glDrawBuffer (GLenum mode); void /*APIENTRY*/glDrawElements (GLenum mode, GLsizei count, GLenum type, GLvoid *indices); void /*APIENTRY*/glDrawPixels (GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels); void /*APIENTRY*/glEdgeFlag (GLboolean flag); void /*APIENTRY*/glEdgeFlagPointer (GLsizei stride, GLvoid *pointer); void /*APIENTRY*/glEdgeFlagv (GLboolean *flag); void /*APIENTRY*/glEnable (GLenum cap); void /*APIENTRY*/glEnableClientState (GLenum array); void /*APIENTRY*/glEnd (); void /*APIENTRY*/glEndList (); void /*APIENTRY*/glEvalCoord1d (GLdouble u); void /*APIENTRY*/glEvalCoord1dv (GLdouble *u); void /*APIENTRY*/glEvalCoord1f (GLfloat u); void /*APIENTRY*/glEvalCoord1fv (GLfloat *u); void /*APIENTRY*/glEvalCoord2d (GLdouble u, GLdouble v); void /*APIENTRY*/glEvalCoord2dv (GLdouble *u); void /*APIENTRY*/glEvalCoord2f (GLfloat u, GLfloat v); void /*APIENTRY*/glEvalCoord2fv (GLfloat *u); void /*APIENTRY*/glEvalMesh1 (GLenum mode, GLint i1, GLint i2); void /*APIENTRY*/glEvalMesh2 (GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2); void /*APIENTRY*/glEvalPoint1 (GLint i); void /*APIENTRY*/glEvalPoint2 (GLint i, GLint j); void /*APIENTRY*/glFeedbackBuffer (GLsizei size, GLenum type, GLfloat *buffer); void /*APIENTRY*/glFinish (); void /*APIENTRY*/glFlush (); void /*APIENTRY*/glFogf (GLenum pname, GLfloat param); void /*APIENTRY*/glFogfv (GLenum pname, GLfloat *params); void /*APIENTRY*/glFogi (GLenum pname, GLint param); void /*APIENTRY*/glFogiv (GLenum pname, GLint *params); void /*APIENTRY*/glFrontFace (GLenum mode); void /*APIENTRY*/glFrustum (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); GLuint /*APIENTRY*/glGenLists (GLsizei range); void /*APIENTRY*/glGenTextures (GLsizei n, GLuint *textures); void /*APIENTRY*/glGetBooleanv (GLenum pname, GLboolean *params); void /*APIENTRY*/glGetClipPlane (GLenum plane, GLdouble *equation); void /*APIENTRY*/glGetDoublev (GLenum pname, GLdouble *params); GLenum /*APIENTRY*/glGetError (); void /*APIENTRY*/glGetFloatv (GLenum pname, GLfloat *params); void /*APIENTRY*/glGetIntegerv (GLenum pname, GLint *params); void /*APIENTRY*/glGetLightfv (GLenum light, GLenum pname, GLfloat *params); void /*APIENTRY*/glGetLightiv (GLenum light, GLenum pname, GLint *params); void /*APIENTRY*/glGetMapdv (GLenum target, GLenum query, GLdouble *v); void /*APIENTRY*/glGetMapfv (GLenum target, GLenum query, GLfloat *v); void /*APIENTRY*/glGetMapiv (GLenum target, GLenum query, GLint *v); void /*APIENTRY*/glGetMaterialfv (GLenum face, GLenum pname, GLfloat *params); void /*APIENTRY*/glGetMaterialiv (GLenum face, GLenum pname, GLint *params); void /*APIENTRY*/glGetPixelMapfv (GLenum map, GLfloat *values); void /*APIENTRY*/glGetPixelMapuiv (GLenum map, GLuint *values); void /*APIENTRY*/glGetPixelMapusv (GLenum map, GLushort *values); void /*APIENTRY*/glGetPointerv (GLenum pname, GLvoid* *params); void /*APIENTRY*/glGetPolygonStipple (GLubyte *mask); GLubyte * /*APIENTRY*/glGetString (GLenum name); void /*APIENTRY*/glGetTexEnvfv (GLenum target, GLenum pname, GLfloat *params); void /*APIENTRY*/glGetTexEnviv (GLenum target, GLenum pname, GLint *params); void /*APIENTRY*/glGetTexGendv (GLenum coord, GLenum pname, GLdouble *params); void /*APIENTRY*/glGetTexGenfv (GLenum coord, GLenum pname, GLfloat *params); void /*APIENTRY*/glGetTexGeniv (GLenum coord, GLenum pname, GLint *params); void /*APIENTRY*/glGetTexImage (GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); void /*APIENTRY*/glGetTexLevelParameterfv (GLenum target, GLint level, GLenum pname, GLfloat *params); void /*APIENTRY*/glGetTexLevelParameteriv (GLenum target, GLint level, GLenum pname, GLint *params); void /*APIENTRY*/glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params); void /*APIENTRY*/glGetTexParameteriv (GLenum target, GLenum pname, GLint *params); void /*APIENTRY*/glHint (GLenum target, GLenum mode); void /*APIENTRY*/glIndexMask (GLuint mask); void /*APIENTRY*/glIndexPointer (GLenum type, GLsizei stride, GLvoid *pointer); void /*APIENTRY*/glIndexd (GLdouble c); void /*APIENTRY*/glIndexdv (GLdouble *c); void /*APIENTRY*/glIndexf (GLfloat c); void /*APIENTRY*/glIndexfv (GLfloat *c); void /*APIENTRY*/glIndexi (GLint c); void /*APIENTRY*/glIndexiv (GLint *c); void /*APIENTRY*/glIndexs (GLshort c); void /*APIENTRY*/glIndexsv (GLshort *c); void /*APIENTRY*/glIndexub (GLubyte c); void /*APIENTRY*/glIndexubv (GLubyte *c); void /*APIENTRY*/glInitNames (); void /*APIENTRY*/glInterleavedArrays (GLenum format, GLsizei stride, GLvoid *pointer); GLboolean /*APIENTRY*/glIsEnabled (GLenum cap); GLboolean /*APIENTRY*/glIsList (GLuint list); GLboolean /*APIENTRY*/glIsTexture (GLuint texture); void /*APIENTRY*/glLightModelf (GLenum pname, GLfloat param); void /*APIENTRY*/glLightModelfv (GLenum pname, GLfloat *params); void /*APIENTRY*/glLightModeli (GLenum pname, GLint param); void /*APIENTRY*/glLightModeliv (GLenum pname, GLint *params); void /*APIENTRY*/glLightf (GLenum light, GLenum pname, GLfloat param); void /*APIENTRY*/glLightfv (GLenum light, GLenum pname, GLfloat *params); void /*APIENTRY*/glLighti (GLenum light, GLenum pname, GLint param); void /*APIENTRY*/glLightiv (GLenum light, GLenum pname, GLint *params); void /*APIENTRY*/glLineStipple (GLint factor, GLushort pattern); void /*APIENTRY*/glLineWidth (GLfloat width); void /*APIENTRY*/glListBase (GLuint base); void /*APIENTRY*/glLoadIdentity (); void /*APIENTRY*/glLoadMatrixd (GLdouble *m); void /*APIENTRY*/glLoadMatrixf (GLfloat *m); void /*APIENTRY*/glLoadName (GLuint name); void /*APIENTRY*/glLogicOp (GLenum opcode); void /*APIENTRY*/glMap1d (GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, GLdouble *points); void /*APIENTRY*/glMap1f (GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, GLfloat *points); void /*APIENTRY*/glMap2d (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble *points); void /*APIENTRY*/glMap2f (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat *points); void /*APIENTRY*/glMapGrid1d (GLint un, GLdouble u1, GLdouble u2); void /*APIENTRY*/glMapGrid1f (GLint un, GLfloat u1, GLfloat u2); void /*APIENTRY*/glMapGrid2d (GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2); void /*APIENTRY*/glMapGrid2f (GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2); void /*APIENTRY*/glMaterialf (GLenum face, GLenum pname, GLfloat param); void /*APIENTRY*/glMaterialfv (GLenum face, GLenum pname, GLfloat *params); void /*APIENTRY*/glMateriali (GLenum face, GLenum pname, GLint param); void /*APIENTRY*/glMaterialiv (GLenum face, GLenum pname, GLint *params); void /*APIENTRY*/glMatrixMode (GLenum mode); void /*APIENTRY*/glMultMatrixd (GLdouble *m); void /*APIENTRY*/glMultMatrixf (GLfloat *m); void /*APIENTRY*/glNewList (GLuint list, GLenum mode); void /*APIENTRY*/glNormal3b (GLbyte nx, GLbyte ny, GLbyte nz); void /*APIENTRY*/glNormal3bv (GLbyte *v); void /*APIENTRY*/glNormal3d (GLdouble nx, GLdouble ny, GLdouble nz); void /*APIENTRY*/glNormal3dv (GLdouble *v); void /*APIENTRY*/glNormal3f (GLfloat nx, GLfloat ny, GLfloat nz); void /*APIENTRY*/glNormal3fv (GLfloat *v); void /*APIENTRY*/glNormal3i (GLint nx, GLint ny, GLint nz); void /*APIENTRY*/glNormal3iv (GLint *v); void /*APIENTRY*/glNormal3s (GLshort nx, GLshort ny, GLshort nz); void /*APIENTRY*/glNormal3sv (GLshort *v); void /*APIENTRY*/glNormalPointer (GLenum type, GLsizei stride, GLvoid *pointer); void /*APIENTRY*/glOrtho (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); void /*APIENTRY*/glPassThrough (GLfloat token); void /*APIENTRY*/glPixelMapfv (GLenum map, GLsizei mapsize, GLfloat *values); void /*APIENTRY*/glPixelMapuiv (GLenum map, GLsizei mapsize, GLuint *values); void /*APIENTRY*/glPixelMapusv (GLenum map, GLsizei mapsize, GLushort *values); void /*APIENTRY*/glPixelStoref (GLenum pname, GLfloat param); void /*APIENTRY*/glPixelStorei (GLenum pname, GLint param); void /*APIENTRY*/glPixelTransferf (GLenum pname, GLfloat param); void /*APIENTRY*/glPixelTransferi (GLenum pname, GLint param); void /*APIENTRY*/glPixelZoom (GLfloat xfactor, GLfloat yfactor); void /*APIENTRY*/glPointSize (GLfloat size); void /*APIENTRY*/glPolygonMode (GLenum face, GLenum mode); void /*APIENTRY*/glPolygonOffset (GLfloat factor, GLfloat units); void /*APIENTRY*/glPolygonStipple (GLubyte *mask); void /*APIENTRY*/glPopAttrib (); void /*APIENTRY*/glPopClientAttrib (); void /*APIENTRY*/glPopMatrix (); void /*APIENTRY*/glPopName (); void /*APIENTRY*/glPrioritizeTextures (GLsizei n, GLuint *textures, GLclampf *priorities); void /*APIENTRY*/glPushAttrib (GLbitfield mask); void /*APIENTRY*/glPushClientAttrib (GLbitfield mask); void /*APIENTRY*/glPushMatrix (); void /*APIENTRY*/glPushName (GLuint name); void /*APIENTRY*/glRasterPos2d (GLdouble x, GLdouble y); void /*APIENTRY*/glRasterPos2dv (GLdouble *v); void /*APIENTRY*/glRasterPos2f (GLfloat x, GLfloat y); void /*APIENTRY*/glRasterPos2fv (GLfloat *v); void /*APIENTRY*/glRasterPos2i (GLint x, GLint y); void /*APIENTRY*/glRasterPos2iv (GLint *v); void /*APIENTRY*/glRasterPos2s (GLshort x, GLshort y); void /*APIENTRY*/glRasterPos2sv (GLshort *v); void /*APIENTRY*/glRasterPos3d (GLdouble x, GLdouble y, GLdouble z); void /*APIENTRY*/glRasterPos3dv (GLdouble *v); void /*APIENTRY*/glRasterPos3f (GLfloat x, GLfloat y, GLfloat z); void /*APIENTRY*/glRasterPos3fv (GLfloat *v); void /*APIENTRY*/glRasterPos3i (GLint x, GLint y, GLint z); void /*APIENTRY*/glRasterPos3iv (GLint *v); void /*APIENTRY*/glRasterPos3s (GLshort x, GLshort y, GLshort z); void /*APIENTRY*/glRasterPos3sv (GLshort *v); void /*APIENTRY*/glRasterPos4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w); void /*APIENTRY*/glRasterPos4dv (GLdouble *v); void /*APIENTRY*/glRasterPos4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w); void /*APIENTRY*/glRasterPos4fv (GLfloat *v); void /*APIENTRY*/glRasterPos4i (GLint x, GLint y, GLint z, GLint w); void /*APIENTRY*/glRasterPos4iv (GLint *v); void /*APIENTRY*/glRasterPos4s (GLshort x, GLshort y, GLshort z, GLshort w); void /*APIENTRY*/glRasterPos4sv (GLshort *v); void /*APIENTRY*/glReadBuffer (GLenum mode); void /*APIENTRY*/glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels); void /*APIENTRY*/glRectd (GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2); void /*APIENTRY*/glRectdv (GLdouble *v1, GLdouble *v2); void /*APIENTRY*/glRectf (GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); void /*APIENTRY*/glRectfv (GLfloat *v1, GLfloat *v2); void /*APIENTRY*/glRecti (GLint x1, GLint y1, GLint x2, GLint y2); void /*APIENTRY*/glRectiv (GLint *v1, GLint *v2); void /*APIENTRY*/glRects (GLshort x1, GLshort y1, GLshort x2, GLshort y2); void /*APIENTRY*/glRectsv (GLshort *v1, GLshort *v2); GLint /*APIENTRY*/glRenderMode (GLenum mode); void /*APIENTRY*/glRotated (GLdouble angle, GLdouble x, GLdouble y, GLdouble z); void /*APIENTRY*/glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z); void /*APIENTRY*/glScaled (GLdouble x, GLdouble y, GLdouble z); void /*APIENTRY*/glScalef (GLfloat x, GLfloat y, GLfloat z); void /*APIENTRY*/glScissor (GLint x, GLint y, GLsizei width, GLsizei height); void /*APIENTRY*/glSelectBuffer (GLsizei size, GLuint *buffer); void /*APIENTRY*/glShadeModel (GLenum mode); void /*APIENTRY*/glStencilFunc (GLenum func, GLint ref, GLuint mask); void /*APIENTRY*/glStencilMask (GLuint mask); void /*APIENTRY*/glStencilOp (GLenum fail, GLenum zfail, GLenum zpass); void /*APIENTRY*/glTexCoord1d (GLdouble s); void /*APIENTRY*/glTexCoord1dv (GLdouble *v); void /*APIENTRY*/glTexCoord1f (GLfloat s); void /*APIENTRY*/glTexCoord1fv (GLfloat *v); void /*APIENTRY*/glTexCoord1i (GLint s); void /*APIENTRY*/glTexCoord1iv (GLint *v); void /*APIENTRY*/glTexCoord1s (GLshort s); void /*APIENTRY*/glTexCoord1sv (GLshort *v); void /*APIENTRY*/glTexCoord2d (GLdouble s, GLdouble t); void /*APIENTRY*/glTexCoord2dv (GLdouble *v); void /*APIENTRY*/glTexCoord2f (GLfloat s, GLfloat t); void /*APIENTRY*/glTexCoord2fv (GLfloat *v); void /*APIENTRY*/glTexCoord2i (GLint s, GLint t); void /*APIENTRY*/glTexCoord2iv (GLint *v); void /*APIENTRY*/glTexCoord2s (GLshort s, GLshort t); void /*APIENTRY*/glTexCoord2sv (GLshort *v); void /*APIENTRY*/glTexCoord3d (GLdouble s, GLdouble t, GLdouble r); void /*APIENTRY*/glTexCoord3dv (GLdouble *v); void /*APIENTRY*/glTexCoord3f (GLfloat s, GLfloat t, GLfloat r); void /*APIENTRY*/glTexCoord3fv (GLfloat *v); void /*APIENTRY*/glTexCoord3i (GLint s, GLint t, GLint r); void /*APIENTRY*/glTexCoord3iv (GLint *v); void /*APIENTRY*/glTexCoord3s (GLshort s, GLshort t, GLshort r); void /*APIENTRY*/glTexCoord3sv (GLshort *v); void /*APIENTRY*/glTexCoord4d (GLdouble s, GLdouble t, GLdouble r, GLdouble q); void /*APIENTRY*/glTexCoord4dv (GLdouble *v); void /*APIENTRY*/glTexCoord4f (GLfloat s, GLfloat t, GLfloat r, GLfloat q); void /*APIENTRY*/glTexCoord4fv (GLfloat *v); void /*APIENTRY*/glTexCoord4i (GLint s, GLint t, GLint r, GLint q); void /*APIENTRY*/glTexCoord4iv (GLint *v); void /*APIENTRY*/glTexCoord4s (GLshort s, GLshort t, GLshort r, GLshort q); void /*APIENTRY*/glTexCoord4sv (GLshort *v); void /*APIENTRY*/glTexCoordPointer (GLint size, GLenum type, GLsizei stride, GLvoid *pointer); void /*APIENTRY*/glTexEnvf (GLenum target, GLenum pname, GLfloat param); void /*APIENTRY*/glTexEnvfv (GLenum target, GLenum pname, GLfloat *params); void /*APIENTRY*/glTexEnvi (GLenum target, GLenum pname, GLint param); void /*APIENTRY*/glTexEnviv (GLenum target, GLenum pname, GLint *params); void /*APIENTRY*/glTexGend (GLenum coord, GLenum pname, GLdouble param); void /*APIENTRY*/glTexGendv (GLenum coord, GLenum pname, GLdouble *params); void /*APIENTRY*/glTexGenf (GLenum coord, GLenum pname, GLfloat param); void /*APIENTRY*/glTexGenfv (GLenum coord, GLenum pname, GLfloat *params); void /*APIENTRY*/glTexGeni (GLenum coord, GLenum pname, GLint param); void /*APIENTRY*/glTexGeniv (GLenum coord, GLenum pname, GLint *params); void /*APIENTRY*/glTexImage1D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, GLvoid *pixels); void /*APIENTRY*/glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, GLvoid *pixels); void /*APIENTRY*/glTexParameterf (GLenum target, GLenum pname, GLfloat param); void /*APIENTRY*/glTexParameterfv (GLenum target, GLenum pname, GLfloat *params); void /*APIENTRY*/glTexParameteri (GLenum target, GLenum pname, GLint param); void /*APIENTRY*/glTexParameteriv (GLenum target, GLenum pname, GLint *params); void /*APIENTRY*/glTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, GLvoid *pixels); void /*APIENTRY*/glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels); void /*APIENTRY*/glTranslated (GLdouble x, GLdouble y, GLdouble z); void /*APIENTRY*/glTranslatef (GLfloat x, GLfloat y, GLfloat z); void /*APIENTRY*/glVertex2d (GLdouble x, GLdouble y); void /*APIENTRY*/glVertex2dv (GLdouble *v); void /*APIENTRY*/glVertex2f (GLfloat x, GLfloat y); void /*APIENTRY*/glVertex2fv (GLfloat *v); void /*APIENTRY*/glVertex2i (GLint x, GLint y); void /*APIENTRY*/glVertex2iv (GLint *v); void /*APIENTRY*/glVertex2s (GLshort x, GLshort y); void /*APIENTRY*/glVertex2sv (GLshort *v); void /*APIENTRY*/glVertex3d (GLdouble x, GLdouble y, GLdouble z); void /*APIENTRY*/glVertex3dv (GLdouble *v); void /*APIENTRY*/glVertex3f (GLfloat x, GLfloat y, GLfloat z); void /*APIENTRY*/glVertex3fv (GLfloat *v); void /*APIENTRY*/glVertex3i (GLint x, GLint y, GLint z); void /*APIENTRY*/glVertex3iv (GLint *v); void /*APIENTRY*/glVertex3s (GLshort x, GLshort y, GLshort z); void /*APIENTRY*/glVertex3sv (GLshort *v); void /*APIENTRY*/glVertex4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w); void /*APIENTRY*/glVertex4dv (GLdouble *v); void /*APIENTRY*/glVertex4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w); void /*APIENTRY*/glVertex4fv (GLfloat *v); void /*APIENTRY*/glVertex4i (GLint x, GLint y, GLint z, GLint w); void /*APIENTRY*/glVertex4iv (GLint *v); void /*APIENTRY*/glVertex4s (GLshort x, GLshort y, GLshort z, GLshort w); void /*APIENTRY*/glVertex4sv (GLshort *v); void /*APIENTRY*/glVertexPointer (GLint size, GLenum type, GLsizei stride, GLvoid *pointer); void /*APIENTRY*/glViewport (GLint x, GLint y, GLsizei width, GLsizei height); /* EXT_vertex_array */ typedef void (* PFNGLARRAYELEMENTEXTPROC) (GLint i); typedef void (* PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count); typedef void (* PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, GLvoid *pointer); typedef void (* PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, GLvoid *pointer); typedef void (* PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, GLvoid *pointer); typedef void (* PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, GLvoid *pointer); typedef void (* PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, GLvoid *pointer); typedef void (* PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, GLboolean *pointer); typedef void (* PFNGLGETPOINTERVEXTPROC) (GLenum pname, GLvoid* *params); typedef void (* PFNGLARRAYELEMENTARRAYEXTPROC)(GLenum mode, GLsizei count, GLvoid* pi); /* WIN_draw_range_elements */ typedef void (* PFNGLDRAWRANGEELEMENTSWINPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, GLvoid *indices); /* WIN_swap_hint */ typedef void (* PFNGLADDSWAPHINTRECTWINPROC) (GLint x, GLint y, GLsizei width, GLsizei height); /* EXT_paletted_texture */ typedef void (* PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, GLvoid *data); typedef void (* PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, GLvoid *data); typedef void (* PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *data); typedef void (* PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); typedef void (* PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); //import openglu; projectL_1001/import/SDL_byteorder.d0000644000000000000000000000256710461565464016204 0ustar rootroot/* SDL - Simple DirectMedia Layer Copyright (C) 1997, 1998, 1999, 2000, 2001 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@devolution.com */ /* Macros for determining the byte-order of this platform */ /* The two types of endianness */ const uint SDL_LIL_ENDIAN = 1234; const uint SDL_BIG_ENDIAN = 4321; /* Pardon the mess, I'm trying to determine the endianness of this host. I'm doing it by preprocessor defines rather than some sort of configure script so that application code can use this too. The "right" way would be to dynamically generate this file on install, but that's a lot of work. */ const uint SDL_BYTEORDER = SDL_LIL_ENDIAN; projectL_1001/import/bulletml.d0000644000000000000000000000315010144515002015265 0ustar rootrootextern (C) { alias int BulletMLParserTinyXML; int* BulletMLParserTinyXML_new(char*); void BulletMLParserTinyXML_parse(int* ); void BulletMLParserTinyXML_delete(int*); alias int BulletMLParser; alias int BulletMLState; alias int BulletMLRunner; alias int BulletMLRunnerD; int* BulletMLRunner_new_parser(BulletMLParser*); int* BulletMLRunner_new_state(BulletMLState*); void BulletMLRunner_delete(int*); void BulletMLRunner_run(int* ); bool BulletMLRunner_isEnd(int* ); void BulletMLRunner_set_getBulletDirection(int*, double (*fp) (int* )); void BulletMLRunner_set_getAimDirection(int*, double (*fp) (int* )); void BulletMLRunner_set_getBulletSpeed(int*, double (*fp) (int* )); void BulletMLRunner_set_getDefaultSpeed(int*, double (*fp) (int* )); void BulletMLRunner_set_getRank(int*, double (*fp) (int* )); void BulletMLRunner_set_createSimpleBullet(int*, void (*fp) (int* , double, double)); void BulletMLRunner_set_createBullet(int*, void (*fp) (int* , BulletMLState*, double, double)); void BulletMLRunner_set_getTurn(int*, int (*fp) (int* )); void BulletMLRunner_set_doVanish(int*, void (*fp) (int* )); void BulletMLRunner_set_doChangeDirection(int*, void (*fp) (int* , double)); void BulletMLRunner_set_doChangeSpeed(int*, void (*fp) (int* , double)); void BulletMLRunner_set_doAccelX(int*, void (*fp) (int* , double)); void BulletMLRunner_set_doAccelY(int*, void (*fp) (int* , double)); void BulletMLRunner_set_getBulletSpeedX(int*, double (*fp) (int* )); void BulletMLRunner_set_getBulletSpeedY(int*, double (*fp) (int* )); void BulletMLRunner_set_getRand(int*, double (*fp) (int* )); } projectL_1001/import/SDL_keysym.d0000644000000000000000000001641710144515002015502 0ustar rootroot/* SDL - Simple DirectMedia Layer Copyright (C) 1997, 1998, 1999, 2000, 2001 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@devolution.com */ /* 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... The names of the keys */ alias int SDLKey; enum { /* 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 */ /* 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 */ /* 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, /* 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, /* 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, /* 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 */ /* 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 } /* Enumeration of valid key mods (possibly OR'd together) */ alias int SDLMod; 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 } const uint KMOD_CTRL = (KMOD_LCTRL|KMOD_RCTRL); const uint KMOD_SHIFT = (KMOD_LSHIFT|KMOD_RSHIFT); const uint KMOD_ALT = (KMOD_LALT|KMOD_RALT); const uint KMOD_META = (KMOD_LMETA|KMOD_RMETA); projectL_1001/import/SDL_version_.d0000644000000000000000000000432610461565464016024 0ustar rootroot/* SDL - Simple DirectMedia Layer Copyright (C) 1997, 1998, 1999, 2000, 2001 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@devolution.com */ /* This header defines the current SDL version */ import SDL_types; extern(C): /* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL */ const uint SDL_MAJOR_VERSION = 1; const uint SDL_MINOR_VERSION = 2; const uint SDL_PATCHLEVEL = 6; struct SDL_version { Uint8 major; Uint8 minor; Uint8 patch; } /* This macro can be used to fill a version structure with the compile-time * version of the SDL library. */ void SDL_VERSION(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 */ uint SDL_VERSIONNUM(Uint8 X, Uint8 Y, Uint8 Z) { return X * 1000 + Y * 100 + Z; } /* This is the version number macro for the current SDL version */ const uint SDL_COMPILEDVERSION = SDL_MAJOR_VERSION * 1000 + SDL_MINOR_VERSION * 100 + SDL_PATCHLEVEL; /* This macro will evaluate to true if compiled with SDL at least X.Y.Z */ bit SDL_VERSION_ATLEAST(Uint8 X, Uint8 Y, Uint8 Z) { return (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. */ SDL_version * SDL_Linked_Version(); projectL_1001/import/SDL_events.d0000644000000000000000000002551610461565464015510 0ustar rootroot/* SDL - Simple DirectMedia Layer Copyright (C) 1997, 1998, 1999, 2000, 2001 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@devolution.com */ /* Include file for SDL event handling */ import SDL_types; import SDL_active; import SDL_keyboard; import SDL_mouse; import SDL_joystick; import SDL_syswm; extern(C): /* Event enumerations */ 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 } /* Predefined event masks */ uint SDL_EVENTMASK(uint X) { return 1 << (X); } enum { SDL_ACTIVEEVENTMASK = 1 << SDL_ACTIVEEVENT, SDL_KEYDOWNMASK = 1 << SDL_KEYDOWN, SDL_KEYUPMASK = 1 << SDL_KEYUP, SDL_MOUSEMOTIONMASK = 1 << SDL_MOUSEMOTION, SDL_MOUSEBUTTONDOWNMASK = 1 << SDL_MOUSEBUTTONDOWN, SDL_MOUSEBUTTONUPMASK = 1 << SDL_MOUSEBUTTONUP, SDL_MOUSEEVENTMASK = (1 << SDL_MOUSEMOTION) | (1 << SDL_MOUSEBUTTONDOWN)| (1 << SDL_MOUSEBUTTONUP), SDL_JOYAXISMOTIONMASK = (1 << SDL_JOYAXISMOTION), SDL_JOYBALLMOTIONMASK = (1 << SDL_JOYBALLMOTION), SDL_JOYHATMOTIONMASK = (1 << SDL_JOYHATMOTION), SDL_JOYBUTTONDOWNMASK = (1 << SDL_JOYBUTTONDOWN), SDL_JOYBUTTONUPMASK = 1 << SDL_JOYBUTTONUP, SDL_JOYEVENTMASK = (1 << SDL_JOYAXISMOTION)| (1 << SDL_JOYBALLMOTION)| (1 << SDL_JOYHATMOTION)| (1 << SDL_JOYBUTTONDOWN)| (1 << SDL_JOYBUTTONUP), SDL_VIDEORESIZEMASK = 1 << SDL_VIDEORESIZE, SDL_VIDEOEXPOSEMASK = 1 << SDL_VIDEOEXPOSE, SDL_QUITMASK = 1 << SDL_QUIT, SDL_SYSWMEVENTMASK = 1 << SDL_SYSWMEVENT } const uint SDL_ALLEVENTS = 0xFFFFFFFF; /* Application visibility event structure */ 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 */ } /* Keyboard event structure */ 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; } /* Mouse motion event structure */ 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 */ } /* Mouse button event structure */ 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 */ } /* Joystick axis motion event structure */ 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) */ } /* Joystick trackball motion event structure */ 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 */ } /* Joystick hat position change event structure */ 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: 8 1 2 7 0 3 6 5 4 Note that zero means the POV is centered. */ } /* Joystick button event structure */ 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 */ } /* The "window resized" event When you get this event, you are responsible for setting a new video mode with the new width and height. */ struct SDL_ResizeEvent { Uint8 type; /* SDL_VIDEORESIZE */ int w; /* New width */ int h; /* New height */ } /* The "screen redraw" event */ struct SDL_ExposeEvent { Uint8 type; /* SDL_VIDEOEXPOSE */ } /* The "quit requested" event */ struct SDL_QuitEvent { Uint8 type; /* SDL_QUIT */ } /* A user-defined event type */ 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 */ } /* If you want to use this event, you should include SDL_syswm.h */ struct SDL_SysWMEvent { Uint8 type; SDL_SysWMmsg *msg; } /* General event structure */ 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; } /* 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. */ void SDL_PumpEvents(); /* 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. This function returns the number of events actually stored, or -1 if there was an error. This function is thread-safe. */ alias int SDL_eventaction; enum { SDL_ADDEVENT, SDL_PEEKEVENT, SDL_GETEVENT } /* */ int 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. */ int 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. */ int SDL_WaitEvent(SDL_Event *event); /* Add an event to the event queue. This function returns 0, or -1 if the event couldn't be added to the event queue. If the event queue is full, this function fails. */ int SDL_PushEvent(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: */ alias int (*SDL_EventFilter)(SDL_Event *event); /* 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. */ void 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. */ SDL_EventFilter SDL_GetEventFilter(); /* 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. */ const int SDL_QUERY = -1; const int SDL_IGNORE = 0; const int SDL_DISABLE = 0; const int SDL_ENABLE = 1; Uint8 SDL_EventState(Uint8 type, int state); projectL_1001/import/SDL_endian.d0000644000000000000000000000666710461565464015450 0ustar rootroot/* SDL - Simple DirectMedia Layer Copyright (C) 1997, 1998, 1999, 2000, 2001 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@devolution.com */ /* Functions for reading and writing endian-specific values */ /* These functions read and write data of the specified endianness, dynamically translating to the host machine endianness. e.g.: If you want to read a 16 bit value on big-endian machine from an open file containing little endian values, you would use: value = SDL_ReadLE16(rp); Note that the read/write functions use SDL_RWops pointers instead of FILE pointers. This allows you to read and write endian values from large chunks of memory as well as files and other data sources. */ import SDL_types; import SDL_rwops; import SDL_byteorder; extern(C): /* 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. */ Uint16 SDL_Swap16(Uint16 D) { return((D<<8)|(D>>8)); } Uint32 SDL_Swap32(Uint32 D) { return((D<<24)|((D<<8)&0x00FF0000)|((D>>8)&0x0000FF00)|(D>>24)); } Uint64 SDL_Swap64(Uint64 val) { Uint32 hi, lo; /* Separate into high and low 32-bit values and swap them */ lo = cast(Uint32)(val&0xFFFFFFFF); val >>= 32; hi = cast(Uint32)(val&0xFFFFFFFF); val = SDL_Swap32(lo); val <<= 32; val |= SDL_Swap32(hi); return(val); } /* Byteswap item from the specified endianness to the native endianness */ //#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) Uint16 SDL_SwapLE16(Uint16 X) { return SDL_Swap16(X); } Uint32 SDL_SwapLE32(Uint32 X) { return SDL_Swap32(X); } Uint64 SDL_SwapLE64(Uint64 X) { return SDL_Swap64(X); } Uint16 SDL_SwapBE16(Uint16 X) { return (X); } Uint32 SDL_SwapBE32(Uint32 X) { return (X); } Uint64 SDL_SwapBE64(Uint64 X) { return (X); } /* Read an item of the specified endianness and return in native format */ Uint16 SDL_ReadLE16(SDL_RWops *src); Uint16 SDL_ReadBE16(SDL_RWops *src); Uint32 SDL_ReadLE32(SDL_RWops *src); Uint32 SDL_ReadBE32(SDL_RWops *src); Uint64 SDL_ReadLE64(SDL_RWops *src); Uint64 SDL_ReadBE64(SDL_RWops *src); /* Write an item of native format to the specified endianness */ int SDL_WriteLE16(SDL_RWops *dst, Uint16 value); int SDL_WriteBE16(SDL_RWops *dst, Uint16 value); int SDL_WriteLE32(SDL_RWops *dst, Uint32 value); int SDL_WriteBE32(SDL_RWops *dst, Uint32 value); int SDL_WriteLE64(SDL_RWops *dst, Uint64 value); int SDL_WriteBE64(SDL_RWops *dst, Uint64 value); projectL_1001/import/openglu.d0000644000000000000000000003661710214173670015145 0ustar rootrootimport opengl; version (Win32) { extern(Windows): } else { extern(C): } GLubyte* gluErrorString ( GLenum errCode); wchar* gluErrorUnicodeStringEXT ( GLenum errCode); GLubyte* gluGetString ( GLenum name); void gluOrtho2D ( GLdouble left, GLdouble right, GLdouble bottom, GLdouble top); void gluPerspective ( GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar); void gluPickMatrix ( GLdouble x, GLdouble y, GLdouble width, GLdouble height, GLint[4] viewport); void gluLookAt ( GLdouble eyex, GLdouble eyey, GLdouble eyez, GLdouble centerx, GLdouble centery, GLdouble centerz, GLdouble upx, GLdouble upy, GLdouble upz); int gluProject ( GLdouble objx, GLdouble objy, GLdouble objz, GLdouble[16] modelMatrix, GLdouble[16] projMatrix, GLint[4] viewport, GLdouble *winx, GLdouble *winy, GLdouble *winz); int gluUnProject ( GLdouble winx, GLdouble winy, GLdouble winz, GLdouble[16] modelMatrix, GLdouble[16] projMatrix, GLint[4] viewport, GLdouble *objx, GLdouble *objy, GLdouble *objz); int gluScaleImage ( GLenum format, GLint widthin, GLint heightin, GLenum typein, void *datain, GLint widthout, GLint heightout, GLenum typeout, void *dataout); int gluBuild1DMipmaps ( GLenum target, GLint components, GLint width, GLenum format, GLenum type, void *data); int gluBuild2DMipmaps ( GLenum target, GLint components, GLint width, GLint height, GLenum format, GLenum type, void *data); struct GLUnurbs { } struct GLUquadric { } struct GLUtesselator { } /* backwards compatibility: */ alias GLUnurbs GLUnurbsObj; alias GLUquadric GLUquadricObj; alias GLUtesselator GLUtesselatorObj; alias GLUtesselator GLUtriangulatorObj; GLUquadric* gluNewQuadric (); void gluDeleteQuadric ( GLUquadric *state); void gluQuadricNormals ( GLUquadric *quadObject, GLenum normals); void gluQuadricTexture ( GLUquadric *quadObject, GLboolean textureCoords); void gluQuadricOrientation ( GLUquadric *quadObject, GLenum orientation); void gluQuadricDrawStyle ( GLUquadric *quadObject, GLenum drawStyle); void gluCylinder ( GLUquadric *qobj, GLdouble baseRadius, GLdouble topRadius, GLdouble height, GLint slices, GLint stacks); void gluDisk ( GLUquadric *qobj, GLdouble innerRadius, GLdouble outerRadius, GLint slices, GLint loops); void gluPartialDisk ( GLUquadric *qobj, GLdouble innerRadius, GLdouble outerRadius, GLint slices, GLint loops, GLdouble startAngle, GLdouble sweepAngle); void gluSphere ( GLUquadric *qobj, GLdouble radius, GLint slices, GLint stacks); void gluQuadricCallback ( GLUquadric *qobj, GLenum which, void (* fn)()); GLUtesselator* gluNewTess( ); void gluDeleteTess( GLUtesselator *tess ); void gluTessBeginPolygon( GLUtesselator *tess, void *polygon_data ); void gluTessBeginContour( GLUtesselator *tess ); void gluTessVertex( GLUtesselator *tess, GLdouble[3] coords, void *data ); void gluTessEndContour( GLUtesselator *tess ); void gluTessEndPolygon( GLUtesselator *tess ); void gluTessProperty( GLUtesselator *tess, GLenum which, GLdouble value ); void gluTessNormal( GLUtesselator *tess, GLdouble x, GLdouble y, GLdouble z ); void gluTessCallback( GLUtesselator *tess, GLenum which, void ( *fn)()); void gluGetTessProperty( GLUtesselator *tess, GLenum which, GLdouble *value ); GLUnurbs* gluNewNurbsRenderer (); void gluDeleteNurbsRenderer ( GLUnurbs *nobj); void gluBeginSurface ( GLUnurbs *nobj); void gluBeginCurve ( GLUnurbs *nobj); void gluEndCurve ( GLUnurbs *nobj); void gluEndSurface ( GLUnurbs *nobj); void gluBeginTrim ( GLUnurbs *nobj); void gluEndTrim ( GLUnurbs *nobj); void gluPwlCurve ( GLUnurbs *nobj, GLint count, GLfloat *array, GLint stride, GLenum type); void gluNurbsCurve ( GLUnurbs *nobj, GLint nknots, GLfloat *knot, GLint stride, GLfloat *ctlarray, GLint order, GLenum type); void gluNurbsSurface( GLUnurbs *nobj, GLint sknot_count, float *sknot, GLint tknot_count, GLfloat *tknot, GLint s_stride, GLint t_stride, GLfloat *ctlarray, GLint sorder, GLint torder, GLenum type); void gluLoadSamplingMatrices ( GLUnurbs *nobj, GLfloat[16] modelMatrix, GLfloat[16] projMatrix, GLint[4] viewport ); void gluNurbsProperty ( GLUnurbs *nobj, GLenum property, GLfloat value ); void gluGetNurbsProperty ( GLUnurbs *nobj, GLenum property, GLfloat *value ); void gluNurbsCallback ( GLUnurbs *nobj, GLenum which, void (* fn)() ); /**** function prototypes ****/ /* gluQuadricCallback */ typedef void (* GLUquadricErrorProc) (GLenum); /* gluTessCallback */ typedef void (* GLUtessBeginProc) (GLenum); typedef void (* GLUtessEdgeFlagProc) (GLboolean); typedef void (* GLUtessVertexProc) (void *); typedef void (* GLUtessEndProc) (); typedef void (* GLUtessErrorProc) (GLenum); typedef void (* GLUtessCombineProc) (GLdouble[3], void*[4], GLfloat[4], void** ); typedef void (* GLUtessBeginDataProc) (GLenum, void *); typedef void (* GLUtessEdgeFlagDataProc) (GLboolean, void *); typedef void (* GLUtessVertexDataProc) (void *, void *); typedef void (* GLUtessEndDataProc) (void *); typedef void (* GLUtessErrorDataProc) (GLenum, void *); typedef void (* GLUtessCombineDataProc) (GLdouble[3], void*[4], GLfloat[4], void**, void* ); /* gluNurbsCallback */ typedef void (* GLUnurbsErrorProc) (GLenum); /**** Generic constants ****/ /* Version */ const int GLU_VERSION_1_1 = 1; const int GLU_VERSION_1_2 = 1; /* Errors: (return value 0 = no error) */ const int GLU_INVALID_ENUM = 100900; const int GLU_INVALID_VALUE = 100901; const int GLU_OUT_OF_MEMORY = 100902; const int GLU_INCOMPATIBLE_GL_VERSION = 100903; /* StringName */ const int GLU_VERSION = 100800; const int GLU_EXTENSIONS = 100801; /* Boolean */ const int GLU_TRUE = GL_TRUE; const int GLU_FALSE = GL_FALSE; /**** Quadric constants ****/ /* QuadricNormal */ const int GLU_SMOOTH = 100000; const int GLU_FLAT = 100001; const int GLU_NONE = 100002; /* QuadricDrawStyle */ const int GLU_POINT = 100010; const int GLU_LINE = 100011; const int GLU_FILL = 100012; const int GLU_SILHOUETTE = 100013; /* QuadricOrientation */ const int GLU_OUTSIDE = 100020; const int GLU_INSIDE = 100021; /* types: */ /* GLU_ERROR 100103 */ /**** Tesselation constants ****/ const real GLU_TESS_MAX_COORD = 1.0e150; /* TessProperty */ const int GLU_TESS_WINDING_RULE = 100140; const int GLU_TESS_BOUNDARY_ONLY = 100141; const int GLU_TESS_TOLERANCE = 100142; /* TessWinding */ const int GLU_TESS_WINDING_ODD = 100130; const int GLU_TESS_WINDING_NONZERO = 100131; const int GLU_TESS_WINDING_POSITIVE = 100132; const int GLU_TESS_WINDING_NEGATIVE = 100133; const int GLU_TESS_WINDING_ABS_GEQ_TWO = 100134; /* TessCallback */ const int GLU_TESS_BEGIN = 100100; /* void (*)(GLenum type) */ const int GLU_TESS_VERTEX = 100101; /* void (*)(void *data) */ const int GLU_TESS_END = 100102; /* void (*)(void) */ const int GLU_TESS_ERROR = 100103; /* void (*)(GLenum errno) */ const int GLU_TESS_EDGE_FLAG = 100104; /* void (*)(GLboolean boundaryEdge) */ const int GLU_TESS_COMBINE = 100105; /* void (*)(GLdouble coords[3], void *data[4], GLfloat weight[4], void **dataOut) */ const int GLU_TESS_BEGIN_DATA = 100106; /* void (*)(GLenum type, void *polygon_data) */ const int GLU_TESS_VERTEX_DATA = 100107; /* void (*)(void *data, void *polygon_data) */ const int GLU_TESS_END_DATA = 100108; /* void (*)(void *polygon_data) */ const int GLU_TESS_ERROR_DATA = 100109; /* void (*)(GLenum errno, void *polygon_data) */ const int GLU_TESS_EDGE_FLAG_DATA = 100110; /* void (*)(GLboolean boundaryEdge, void *polygon_data) */ const int GLU_TESS_COMBINE_DATA = 100111; /* void (*)(GLdouble coords[3], void *data[4], GLfloat weight[4], void **dataOut, void *polygon_data) */ /* TessError */ const int GLU_TESS_ERROR1 = 100151; const int GLU_TESS_ERROR2 = 100152; const int GLU_TESS_ERROR3 = 100153; const int GLU_TESS_ERROR4 = 100154; const int GLU_TESS_ERROR5 = 100155; const int GLU_TESS_ERROR6 = 100156; const int GLU_TESS_ERROR7 = 100157; const int GLU_TESS_ERROR8 = 100158; const int GLU_TESS_MISSING_BEGIN_POLYGON = GLU_TESS_ERROR1; const int GLU_TESS_MISSING_BEGIN_CONTOUR = GLU_TESS_ERROR2; const int GLU_TESS_MISSING_END_POLYGON = GLU_TESS_ERROR3; const int GLU_TESS_MISSING_END_CONTOUR = GLU_TESS_ERROR4; const int GLU_TESS_COORD_TOO_LARGE = GLU_TESS_ERROR5; const int GLU_TESS_NEED_COMBINE_CALLBACK = GLU_TESS_ERROR6; /**** NURBS constants ****/ /* NurbsProperty */ const int GLU_AUTO_LOAD_MATRIX = 100200; const int GLU_CULLING = 100201; const int GLU_SAMPLING_TOLERANCE = 100203; const int GLU_DISPLAY_MODE = 100204; const int GLU_PARAMETRIC_TOLERANCE = 100202; const int GLU_SAMPLING_METHOD = 100205; const int GLU_U_STEP = 100206; const int GLU_V_STEP = 100207; /* NurbsSampling */ const int GLU_PATH_LENGTH = 100215; const int GLU_PARAMETRIC_ERROR = 100216; const int GLU_DOMAIN_DISTANCE = 100217; /* NurbsTrim */ const int GLU_MAP1_TRIM_2 = 100210; const int GLU_MAP1_TRIM_3 = 100211; /* NurbsDisplay */ /* GLU_FILL 100012 */ const int GLU_OUTLINE_POLYGON = 100240; const int GLU_OUTLINE_PATCH = 100241; /* NurbsCallback */ /* GLU_ERROR 100103 */ /* NurbsErrors */ const int GLU_NURBS_ERROR1 = 100251; const int GLU_NURBS_ERROR2 = 100252; const int GLU_NURBS_ERROR3 = 100253; const int GLU_NURBS_ERROR4 = 100254; const int GLU_NURBS_ERROR5 = 100255; const int GLU_NURBS_ERROR6 = 100256; const int GLU_NURBS_ERROR7 = 100257; const int GLU_NURBS_ERROR8 = 100258; const int GLU_NURBS_ERROR9 = 100259; const int GLU_NURBS_ERROR10 = 100260; const int GLU_NURBS_ERROR11 = 100261; const int GLU_NURBS_ERROR12 = 100262; const int GLU_NURBS_ERROR13 = 100263; const int GLU_NURBS_ERROR14 = 100264; const int GLU_NURBS_ERROR15 = 100265; const int GLU_NURBS_ERROR16 = 100266; const int GLU_NURBS_ERROR17 = 100267; const int GLU_NURBS_ERROR18 = 100268; const int GLU_NURBS_ERROR19 = 100269; const int GLU_NURBS_ERROR20 = 100270; const int GLU_NURBS_ERROR21 = 100271; const int GLU_NURBS_ERROR22 = 100272; const int GLU_NURBS_ERROR23 = 100273; const int GLU_NURBS_ERROR24 = 100274; const int GLU_NURBS_ERROR25 = 100275; const int GLU_NURBS_ERROR26 = 100276; const int GLU_NURBS_ERROR27 = 100277; const int GLU_NURBS_ERROR28 = 100278; const int GLU_NURBS_ERROR29 = 100279; const int GLU_NURBS_ERROR30 = 100280; const int GLU_NURBS_ERROR31 = 100281; const int GLU_NURBS_ERROR32 = 100282; const int GLU_NURBS_ERROR33 = 100283; const int GLU_NURBS_ERROR34 = 100284; const int GLU_NURBS_ERROR35 = 100285; const int GLU_NURBS_ERROR36 = 100286; const int GLU_NURBS_ERROR37 = 100287; /**** Backwards compatibility for old tesselator ****/ void gluBeginPolygon( GLUtesselator *tess ); void gluNextContour( GLUtesselator *tess, GLenum type ); void gluEndPolygon( GLUtesselator *tess ); /* Contours types -- obsolete! */ const int GLU_CW = 100120; const int GLU_CCW = 100121; const int GLU_INTERIOR = 100122; const int GLU_EXTERIOR = 100123; const int GLU_UNKNOWN = 100124; /* Names without "TESS_" prefix */ const int GLU_BEGIN = GLU_TESS_BEGIN; const int GLU_VERTEX = GLU_TESS_VERTEX; const int GLU_END = GLU_TESS_END; const int GLU_ERROR = GLU_TESS_ERROR; const int GLU_EDGE_FLAG = GLU_TESS_EDGE_FLAG; projectL_1001/import/SDL_video.d0000644000000000000000000010530410461565464015304 0ustar rootroot/* SDL - Simple DirectMedia Layer Copyright (C) 1997, 1998, 1999, 2000, 2001 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@devolution.com */ /* Header file for access to the SDL raw framebuffer window */ import SDL_types; import SDL_mutex; import SDL_rwops; extern(C): /* Transparency definitions: These define alpha as the opacity of a surface */ const uint SDL_ALPHA_OPAQUE = 255; const uint SDL_ALPHA_TRANSPARENT = 0; /* Useful data types */ struct SDL_Rect { Sint16 x, y; Uint16 w, h; } struct SDL_Color { Uint8 r; Uint8 g; Uint8 b; Uint8 unused; } struct SDL_Palette { int ncolors; SDL_Color *colors; } /* Everything in the pixel format structure is read-only */ 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; } /* typedef for private surface blitting functions */ typedef int (*SDL_blit)(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect); /* This structure should be treated as read-only, except for 'pixels', which, if not NULL, contains the raw pixel data for the surface. */ 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 */ void /*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 */ void /*SDL_BlitMap*/ *map; /* Private */ /* format version, bumped at every change to invalidate blit maps */ uint format_version; /* Private */ /* Reference count -- used when freeing surface */ int refcount; /* Read-mostly */ } /* These are the currently supported flags for the SDL_surface */ /* Available for SDL_CreateRGBSurface() or SDL_SetVideoMode() */ const uint SDL_SWSURFACE = 0x00000000; /* Surface is in system memory */ const uint SDL_HWSURFACE = 0x00000001; /* Surface is in video memory */ const uint SDL_ASYNCBLIT = 0x00000004; /* Use asynchronous blits if possible */ /* Available for SDL_SetVideoMode() */ const uint SDL_ANYFORMAT = 0x10000000; /* Allow any video depth/pixel-format */ const uint SDL_HWPALETTE = 0x20000000; /* Surface has exclusive palette */ const uint SDL_DOUBLEBUF = 0x40000000; /* Set up double-buffered video mode */ const uint SDL_FULLSCREEN = 0x80000000; /* Surface is a full screen display */ const uint SDL_OPENGL = 0x00000002; /* Create an OpenGL rendering context */ const uint SDL_OPENGLBLIT = 0x0000000A; /* Create an OpenGL rendering context and use it for blitting */ const uint SDL_RESIZABLE = 0x00000010; /* This video mode may be resized */ const uint SDL_NOFRAME = 0x00000020; /* No window caption or edge frame */ /* Used internally (read-only) */ const uint SDL_HWACCEL = 0x00000100; /* Blit uses hardware acceleration */ const uint SDL_SRCCOLORKEY = 0x00001000; /* Blit uses a source color key */ const uint SDL_RLEACCELOK = 0x00002000; /* Private flag */ const uint SDL_RLEACCEL = 0x00004000; /* Surface is RLE encoded */ const uint SDL_SRCALPHA = 0x00010000; /* Blit uses source alpha blending */ const uint SDL_PREALLOC = 0x01000000; /* Surface uses preallocated memory */ /* Evaluates to true if the surface needs to be locked before access */ bit SDL_MUSTLOCK(SDL_Surface *surface) { return surface.offset || ((surface.flags & (SDL_HWSURFACE | SDL_ASYNCBLIT | SDL_RLEACCEL)) != 0); } /* Useful for determining the video hardware capabilities */ struct SDL_VideoInfo { Uint32 flags; // 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 */ } /* 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 */ const uint SDL_YV12_OVERLAY = 0x32315659; /* Planar mode: Y + V + U (3 planes) */ const uint SDL_IYUV_OVERLAY = 0x56555949; /* Planar mode: Y + U + V (3 planes) */ const uint SDL_YUY2_OVERLAY = 0x32595559; /* Packed mode: Y0+U0+Y1+V0 (1 plane) */ const uint SDL_UYVY_OVERLAY = 0x59565955; /* Packed mode: U0+Y0+V0+Y1 (1 plane) */ const uint SDL_YVYU_OVERLAY = 0x55595659; /* Packed mode: Y0+V0+Y1+U0 (1 plane) */ /* The YUV hardware video overlay */ struct SDL_Overlay { Uint32 format; /* Read-only */ int w, h; /* Read-only */ int planes; /* Read-only */ Uint16 *pitches; /* Read-only */ Uint8 **pixels; /* Read-write */ /* Hardware-specific surface info */ void /*private_yuvhwfuncs*/ *hwfuncs; void /*private_yuvhwdata*/ *hwdata; /* Special flags */ union { bit hw_overlay; Uint32 _dummy; } // Uint32 hw_overlay :1; /* Flag: This overlay hardware accelerated? */ // Uint32 UnusedBits :31; } /* Public enumeration for setting the OpenGL window attributes. */ alias int SDL_GLattr; 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 } /* flags for SDL_SetPalette() */ const uint SDL_LOGPAL = 0x01; const uint SDL_PHYSPAL = 0x02; /* Function prototypes */ /* 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(). * * SDL_VideoInit() 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. */ int SDL_VideoInit(char *driver_name, Uint32 flags); void SDL_VideoQuit(); /* 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. */ char *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. */ SDL_Surface * SDL_GetVideoSurface(); /* * 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. */ SDL_VideoInfo * SDL_GetVideoInfo(); /* * 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() */ int 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 */ SDL_Rect ** 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. */ SDL_Surface *SDL_SetVideoMode (int width, int height, int bpp, Uint32 flags); /* * Makes sure the given list of rectangles is updated on the given screen. * If 'x', 'y', 'w' and 'h' are all 0, SDL_UpdateRect will update the entire * screen. * These functions should not be called while 'screen' is locked. */ void SDL_UpdateRects (SDL_Surface *screen, int numrects, SDL_Rect *rects); void 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. */ int 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. */ int 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. */ int SDL_SetGammaRamp(Uint16 *red, Uint16 *green, 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. */ int 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. */ int 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). */ int 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 */ Uint32 SDL_MapRGB (SDL_PixelFormat *format, Uint8 r, Uint8 g, Uint8 b); /* * Maps an RGBA quadruple to a pixel value for a given pixel format */ Uint32 SDL_MapRGBA(SDL_PixelFormat *format, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* * Maps a pixel value into the RGB components for a given pixel format */ void SDL_GetRGB(Uint32 pixel, SDL_PixelFormat *fmt, Uint8 *r, Uint8 *g, Uint8 *b); /* * Maps a pixel value into the RGBA components for a given pixel format */ void SDL_GetRGBA(Uint32 pixel, SDL_PixelFormat *fmt, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a); /* * 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. */ SDL_Surface *SDL_CreateRGBSurface (Uint32 flags, int width, int height, int depth, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask); SDL_Surface *SDL_CreateRGBSurfaceFrom(void *pixels, int width, int height, int depth, int pitch, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask); void SDL_FreeSurface(SDL_Surface *surface); SDL_Surface *SDL_AllocSurface (Uint32 flags, int width, int height, int depth, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask) { return SDL_CreateRGBSurface(flags, width, height, depth, Rmask, Gmask, Bmask, Amask); } /* * 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. */ int SDL_LockSurface(SDL_Surface *surface); void 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(). */ SDL_Surface * SDL_LoadBMP_RW(SDL_RWops *src, int freesrc); /* Convenience macro -- load a surface from a file */ SDL_Surface * SDL_LoadBMP(char* file) { return 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. */ int SDL_SaveBMP_RW (SDL_Surface *surface, SDL_RWops *dst, int freedst); /* Convenience macro -- save a surface to a file */ int SDL_SaveBMP(SDL_Surface *surface, char* file) { return 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. */ int 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. */ int 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. */ SDL_bool SDL_SetClipRect(SDL_Surface *surface, 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. */ void 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(). */ SDL_Surface *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 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. * * 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: while ( SDL_BlitSurface(image, imgrect, screen, dstrect) == -2 ) { while ( SDL_LockSurface(image) < 0 ) Sleep(10); -- Write image pixels to image.pixels -- SDL_UnlockSurface(image); } * 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. */ /* This is the public blit function, SDL_BlitSurface(), and it performs rectangle validation and clipping before passing it to SDL_LowerBlit() */ int 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. */ int SDL_LowerBlit (SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect); int SDL_BlitSurface (SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect) { return SDL_UpperBlit(src, srcrect, dst, 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. */ int 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 */ SDL_Surface * 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 */ SDL_Surface * SDL_DisplayFormatAlpha(SDL_Surface *surface); /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* 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. */ SDL_Overlay *SDL_CreateYUVOverlay(int width, int height, Uint32 format, SDL_Surface *display); /* Lock an overlay for direct access, and unlock it when you are done */ int SDL_LockYUVOverlay(SDL_Overlay *overlay); void 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. */ int SDL_DisplayYUVOverlay(SDL_Overlay *overlay, SDL_Rect *dstrect); /* Free a video overlay */ void SDL_FreeYUVOverlay(SDL_Overlay *overlay); /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* OpenGL support functions. */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * Dynamically load a GL driver, if SDL is built with dynamic GL. * * SDL links normally with the OpenGL library on your system by default, * but you can compile it to dynamically load the GL driver at runtime. * 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(). * * This is disabled in default builds of SDL. */ int SDL_GL_LoadLibrary(char *path); /* * Get the address of a GL function (for extension functions) */ void *SDL_GL_GetProcAddress(char* proc); /* * Set an attribute of the OpenGL subsystem before intialization. */ int 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. */ int SDL_GL_GetAttribute(SDL_GLattr attr, int* value); /* * Swap the OpenGL buffers, if double-buffering is supported. */ void SDL_GL_SwapBuffers(); /* * Internal functions that should not be called unless you have read * and understood the source code for these functions. */ void SDL_GL_UpdateRects(int numrects, SDL_Rect* rects); void SDL_GL_Lock(); void SDL_GL_Unlock(); /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* These functions allow interaction with the window manager, if any. */ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* * Sets/Gets the title and icon text of the display window */ void SDL_WM_SetCaption(char *title, char *icon); void 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. */ void 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. */ int SDL_WM_IconifyWindow(); /* * 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. */ int SDL_WM_ToggleFullScreen(SDL_Surface *surface); /* * This function allows you to set and query the input grab state of * the application. It returns the new input grab state. */ alias int SDL_GrabMode; enum { SDL_GRAB_QUERY = -1, SDL_GRAB_OFF = 0, SDL_GRAB_ON = 1, SDL_GRAB_FULLSCREEN /* Used internally */ } /* * 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. */ SDL_GrabMode SDL_WM_GrabInput(SDL_GrabMode mode); /* Not in public API at the moment - do not use! */ int SDL_SoftStretch(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect); projectL_1001/import/SDL.d0000644000000000000000000000564110461565464014121 0ustar rootroot/* SDL - Simple DirectMedia Layer Copyright (C) 1997, 1998, 1999, 2000, 2001 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@devolution.com */ public import SDL_keysym_; public import SDL_version_; public import SDL_active; public import SDL_audio; public import SDL_byteorder; public import SDL_cdrom; public import SDL_copying; public import SDL_endian; public import SDL_error; public import SDL_events; public import SDL_getenv; public import SDL_joystick; public import SDL_keyboard; public import SDL_mouse; public import SDL_mutex; public import SDL_quit; public import SDL_rwops; public import SDL_syswm; public import SDL_thread; public import SDL_timer; public import SDL_types; public import SDL_video; extern(C): /* As of version 0.5, SDL is loaded dynamically into the application */ /* These are the flags which may be passed to SDL_Init() -- you should specify the subsystems which you will be using in your application. */ const uint SDL_INIT_TIMER = 0x00000001; const uint SDL_INIT_AUDIO = 0x00000010; const uint SDL_INIT_VIDEO = 0x00000020; const uint SDL_INIT_CDROM = 0x00000100; const uint SDL_INIT_JOYSTICK = 0x00000200; const uint SDL_INIT_NOPARACHUTE = 0x00100000; /* Don't catch fatal signals */ const uint SDL_INIT_EVENTTHREAD = 0x01000000; /* Not supported on all OS's */ const uint 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) */ int SDL_Init(Uint32 flags); /* This function initializes specific SDL subsystems */ int SDL_InitSubSystem(Uint32 flags); /* This function cleans up specific SDL subsystems */ void 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. */ Uint32 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. */ void SDL_Quit(); projectL_1001/import/smpeg.d0000644000000000000000000001457410525335670014612 0ustar rootroot/* SMPEG - SDL MPEG Player Library Copyright (C) 1999 Loki Entertainment Software 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 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* This is the C interface to the SMPEG library */ // convert to D by shinichiro.h import SDL; import MPEGfilter; extern (C) { const int SMPEG_MAJOR_VERSION = 0; const int SMPEG_MINOR_VERSION = 4; const int SMPEG_PATCHLEVEL = 3; struct SMPEG_version { Uint8 major; Uint8 minor; Uint8 patch; } /* This macro can be used to fill a version structure with the compile-time * version of the SDL library. */ void SMPEG_VERSION(out SMPEG_version X) { X.major = SMPEG_MAJOR_VERSION; X.minor = SMPEG_MINOR_VERSION; X.patch = SMPEG_PATCHLEVEL; } /* This is the actual SMPEG object */ struct SMPEG; /* Used to get information about the SMPEG object */ struct SMPEG_Info { int has_audio; int has_video; int width; int height; int current_frame; double current_fps; char audio_string[80]; int audio_current_frame; Uint32 current_offset; Uint32 total_size; double current_time; double total_time; } /* Possible MPEG status codes */ enum { SMPEG_ERROR = -1, SMPEG_STOPPED, SMPEG_PLAYING } alias int SMPEGstatus; /* Matches the declaration of SDL_UpdateRect() */ typedef void(*SMPEG_DisplayCallback)(SDL_Surface* dst, int x, int y, uint w, uint h); /* Create a new SMPEG object from an MPEG file. On return, if 'info' is not NULL, it will be filled with information about the MPEG object. This function returns a new SMPEG object. Use SMPEG_error() to find out whether or not there was a problem building the MPEG stream. The sdl_audio parameter indicates if SMPEG should initialize the SDL audio subsystem. If not, you will have to use the SMPEG_playaudio() function below to extract the decoded data. */ SMPEG* SMPEG_new(char *file, SMPEG_Info* info, int sdl_audio); /* The same as above for a file descriptor */ SMPEG* SMPEG_new_descr(int file, SMPEG_Info* info, int sdl_audio); /* The same as above but for a raw chunk of data. SMPEG makes a copy of the data, so the application is free to delete after a successful call to this function. */ SMPEG* SMPEG_new_data(void *data, int size, SMPEG_Info* info, int sdl_audio); /* The same for a generic SDL_RWops structure. */ SMPEG* SMPEG_new_rwops(SDL_RWops *src, SMPEG_Info* info, int sdl_audio); /* Get current information about an SMPEG object */ void SMPEG_getinfo( SMPEG* mpeg, SMPEG_Info* info ); /* Enable or disable audio playback in MPEG stream */ void SMPEG_enableaudio( SMPEG* mpeg, int enable ); /* Enable or disable video playback in MPEG stream */ void SMPEG_enablevideo( SMPEG* mpeg, int enable ); /* Delete an SMPEG object */ void SMPEG_delete( SMPEG* mpeg ); /* Get the current status of an SMPEG object */ SMPEGstatus SMPEG_status( SMPEG* mpeg ); /* Set the audio volume of an MPEG stream, in the range 0-100 */ void SMPEG_setvolume( SMPEG* mpeg, int volume ); /* Set the destination surface for MPEG video playback 'surfLock' is a mutex used to synchronize access to 'dst', and can be NULL. 'callback' is a function called when an area of 'dst' needs to be updated. If 'callback' is NULL, the default function (SDL_UpdateRect) will be used. */ void SMPEG_setdisplay(SMPEG* mpeg, SDL_Surface* dst, SDL_mutex* surfLock, SMPEG_DisplayCallback callback); /* Set or clear looping play on an SMPEG object */ void SMPEG_loop( SMPEG* mpeg, int repeat ); /* Scale pixel display on an SMPEG object */ void SMPEG_scaleXY( SMPEG* mpeg, int width, int height ); void SMPEG_scale( SMPEG* mpeg, int scale ); /* */ void SMPEG_double(SMPEG* mpeg, bit on) { SMPEG_scale(mpeg, (on) ? 2 : 1); } /* Move the video display area within the destination surface */ void SMPEG_move( SMPEG* mpeg, int x, int y ); /* Set the region of the video to be shown */ void SMPEG_setdisplayregion(SMPEG* mpeg, int x, int y, int w, int h); /* Play an SMPEG object */ void SMPEG_play( SMPEG* mpeg ); /* Pause/Resume playback of an SMPEG object */ void SMPEG_pause( SMPEG* mpeg ); /* Stop playback of an SMPEG object */ void SMPEG_stop( SMPEG* mpeg ); /* Rewind the play position of an SMPEG object to the beginning of the MPEG */ void SMPEG_rewind( SMPEG* mpeg ); /* Seek 'bytes' bytes in the MPEG stream */ void SMPEG_seek( SMPEG* mpeg, int bytes); /* Skip 'seconds' seconds in the MPEG stream */ void SMPEG_skip( SMPEG* mpeg, float seconds ); /* Render a particular frame in the MPEG video API CHANGE: This function no longer takes a target surface and position. Use SMPEG_setdisplay() and SMPEG_move() to set this information. */ void SMPEG_renderFrame( SMPEG* mpeg, int framenum ); /* Render the last frame of an MPEG video */ void SMPEG_renderFinal( SMPEG* mpeg, SDL_Surface* dst, int x, int y ); /* Set video filter */ SMPEG_Filter * SMPEG_filter( SMPEG* mpeg, SMPEG_Filter * filter ); /* Return NULL if there is no error in the MPEG stream, or an error message if there was a fatal error in the MPEG stream for the SMPEG object. */ char *SMPEG_error( SMPEG* mpeg ); /* Exported callback function for audio playback. The function takes a buffer and the amount of data to fill, and returns the amount of data in bytes that was actually written. This will be the amount requested unless the MPEG audio has finished. */ int SMPEG_playAudio( SMPEG *mpeg, Uint8 *stream, int len ); /* Wrapper for SMPEG_playAudio() that can be passed to SDL and SDL_mixer */ void SMPEG_playAudioSDL( void *mpeg, Uint8 *stream, int len ); /* Get the best SDL audio spec for the audio stream */ int SMPEG_wantedSpec( SMPEG *mpeg, SDL_AudioSpec *wanted ); /* Inform SMPEG of the actual SDL audio spec used for sound playback */ void SMPEG_actualSpec( SMPEG *mpeg, SDL_AudioSpec *spec ); } projectL_1001/import/SDL_syswm.d0000644000000000000000000000425310461565464015361 0ustar rootroot/* SDL - Simple DirectMedia Layer Copyright (C) 1997, 1998, 1999, 2000, 2001 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@devolution.com */ /* Include file for SDL custom system window manager hooks */ import SDL_version_; extern(C): /* 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() */ //!!!import windows;!!! alias void* HWND; alias uint UINT; alias uint WPARAM; alias uint LPARAM; /* The windows custom event structure */ struct SDL_SysWMmsg { SDL_version _version; // !!! "version" is a D keyword 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 */ struct SDL_SysWMinfo { SDL_version _version; // !!! "version" is a D keyword HWND window; /* The Win32 display window */ } /* 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. */ int SDL_GetWMInfo(SDL_SysWMinfo *info); projectL_1001/readme_e.txt0000644000000000000000000000364410557117422014314 0ustar rootrootprojectL readme_e.txt ver.1000 HIZ inspired by projectN(D.K) Slash & slash & slash! sword action shooting. *** control - move ship        arrow key,ten key, [WASD] / joystick - change to laser    [Z][left Ctrl][.] / Trigger 1, 4, 7 in title - sound ON/OFF        [X][left Alt][left Shift][/] / Trigger 2, 6, 8 - toggle title/ranking   left and right - toggle window/fullscreen F9 key - hide window       F5 key - soft reset        ENTER key - quit           ESC key *** rule Laser and sword are rotate to opposite direction of ship moving. Laser can slash green bullets. Sword can slash enemies. When you use sword, game speed is slow and when you use laser, game speed is high. When you kill off red enemies, next enemie group is appeared. There is no collision detection in wireframe. *** Comments If you have any comments, please mail to hiz_oka@yahoo.co.jp *** Acknowledgement ProjectL is inspired by projectN produced by D.K(http://www5b.biglobe.ne.jp/~ms06j/main1.htm) ProjectL is written in the D Programming Language(ver. 0.175). Simple DirectMedia Layer is used for media handling. SDL_mixer and Ogg Vorbis CODEC are used for playing BGMs/SEs. D Header files at D - porting are for use with OpenGL, SDL and SDL_mixer. Mersenne Twister is used for creating a random number. ABA's game sources are refered. kenmo's introduction to D program language (http://www5.atwiki.jp/yaruhara/pages/74.html) are refered. sound materials -musics B.P.M(http://bpm.cside.com/) FLESH&BONE(http://www.fleshbone.com/index.html) -sound effects The・matchmakers(http://osabisi.sakura.ne.jp/m2/) Hanac200x(http://homepage1.nifty.com/hp_tk_prg/index.html) -voices B.P.M(http://bpm.cside.com/) *** Change log 2006/01/28 ver1.001 ・corrected the behavior of sword and laser. 2006/12/22 ver1.000 ・released. projectL_1001/voice/0000755000000000000000000000000010740417365013113 5ustar rootroot