Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const int SCREEN_CENTRE_X = 128;
- const int SCREEN_CENTRE_Y = 88;
- const int CUBE_TEXT_TIMER_DUR = 200;
- ffc script portal{
- void run(int bitty, int cubetimer, int modulus, int textime){
- int cube[12]={SCREEN_CENTRE_X+30,SCREEN_CENTRE_Y+30, 1,
- SCREEN_CENTRE_X+30,SCREEN_CENTRE_Y-30, 1,
- SCREEN_CENTRE_X-30,SCREEN_CENTRE_Y-30, 1,
- SCREEN_CENTRE_X-30,SCREEN_CENTRE_Y+30, 1};
- int cube_uv[8]={0,0, 31,0, 31, 31, 31, 0}; //Texture coordinates.
- //How mdo these work?
- //!
- int cube_csets[4]={0,0,0,0}; //Csets
- int textures[10]; //Holds textures.
- int tex_state; //Which texture to use this frame.
- int cube_tex[2]={2,2}; //Texture size.
- //Draw each half of the aperature, using DrawTile, and slowly move them to open.
- int aperature_left_x; int aperature_right_x;
- int aperature_timer;
- int cube_rot_timer;
- if ( modulus <= 0 ) modulus = 30;
- if ( cubetimer <= 0 ) cubetimer = 60000;
- cube_rot_timer = cubetimer;
- if ( textime <= 0 ) textime = CUBE_TEXT_TIMER_DUR;
- while(aperature_timer--){
- //DrawTile(left side)
- //Move it left to open it
- //DrawTile(right side)
- //move it right to open it
- Waitframe();
- }
- bool waiting = true;
- while(aperature_timer <= 0 ){
- if ( cube_rot_timer <= 0 ) {
- //Reset the timer for cube rotation base don if D1 was set.
- if ( cubetimer ) cube_rot_timer= 60000;
- else cube_rot_timer = cubetimer;
- }
- cube_timer--; //A monulus of this determines if we rotate the cube this frame.
- //the aperature has opened.
- //Draw both halves of the aperature in an open state.
- //Handle texture change timer.
- if ( textime > 0 ) { textime--; } //Tick off the texture timer.
- else { //The timer has elapsed.
- if ( this->InitD[3] <= 0 ) textime = CUBE_TEXT_TIMER_DUR;
- else textime = this->InitD[3];
- //Advance the array texture.
- if ( tex_state < 10 ) { tex_state++; }
- else tex_state = 0; //Wrap to index 0.
- }
- //DrawTile(left side)
- //DrawTile(right side)
- //Decide if we rotate the cube:
- if ( cube_rot_timer != cubetimer && cube_rot_timer % modulus == 0 ) {
- //if this is not the initial frame, check if the rotation
- //timer modulus. Defualt move every 30 frames.
- //Do rotational effect to cube[]
- }
- //Draw the cube.
- Screen->Quad3D(3,cube,cube_uv, cube_csets,cube_tex, 0, textures[tex_state], 0);
- Waitframe();
- }
- }
- void __RotateQuad3D_X(int angle, int pos} {
- //int cx, int cy, int cz){
- for(int i=0; i<3; i++){
- int y = pos[(i*3)+1];
- int z = pos[(i*3)+2];
- pos[(i*3)+1] = y * Cos(angle) - z * Sin(angle);
- pos[(i*3)+2] = z * Cos(angle) + y * Sin(angle);
- }
- }
- }
- /*
- //Find a free bitmap to use
- //We want a circle of shimmering blue and white
- //We want some tiles copies to it
- //We need to make the area around it translucent.
- //Triangle 3D might do better?
- //Or a cube?
- */r
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement