/[projet1]/users/barnsey123/LUNARCOM/main.c
Defence Force logotype

Diff of /users/barnsey123/LUNARCOM/main.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1107 by barnsey123, Fri Feb 7 10:07:33 2014 UTC revision 1108 by barnsey123, Fri Feb 7 18:14:15 2014 UTC
# Line 18  Occupation. Line 18  Occupation.
18  History  History
19  04/02/2014 Started work with first few vids and sorted out display routines  04/02/2014 Started work with first few vids and sorted out display routines
20  05/02/2014 added more vids  05/02/2014 added more vids
21    07/02/2014 New PlayChunk routine (more efficient), more vids
22  */  */
23  #include <lib.h>  #include <lib.h>
24  #define BLACK 0  #define BLACK 0
# Line 28  History Line 29  History
29  #define MAGENTA 5  #define MAGENTA 5
30  #define CYAN 6  #define CYAN 6
31  #define WHITE 7  #define WHITE 7
32    #define MAXFRAME 6
33  /* Definition of Global variables */  /* Definition of Global variables */
34  extern unsigned char Tears[];           // video talking  extern unsigned char Tears[];           // video talking
35  extern unsigned char LookRight[];       // video looking right  extern unsigned char LookRight[];       // video looking right
# Line 36  extern unsigned char YouFuck[];                // vide Line 38  extern unsigned char YouFuck[];                // vide
38  extern unsigned char Whoops[];          // video whoops  extern unsigned char Whoops[];          // video whoops
39  extern unsigned char NodYes[];          // video nodding  extern unsigned char NodYes[];          // video nodding
40  extern unsigned char LeanForward[];     // video leaning forward  extern unsigned char LeanForward[];     // video leaning forward
41  unsigned char Frame;                            // Frame of video to play  extern unsigned char Disdain[];         // video "don't care/not bothered"
42    extern unsigned char CheckWatch[];      // video check the watch
43    unsigned char Frame, MaxFrame;  // Frame of video to play up to MaxFrame
44  int PauseTime,PauseCount;                       // amount of time to Pause  int PauseTime,PauseCount;                       // amount of time to Pause
45  unsigned char* PtrGraphic;                      // pointer to byte values of loaded picture  unsigned char* PtrGraphic;                      // pointer to byte values of loaded picture
46  unsigned char InkColor;  unsigned char InkColor;
# Line 46  void Pause();          // adds pause to video pl Line 50  void Pause();          // adds pause to video pl
50  void PlayChunk(unsigned char Chunk[]);  // play part of video  void PlayChunk(unsigned char Chunk[]);  // play part of video
51  void PlayVideo();       // play all video  void PlayVideo();       // play all video
52    
   
53  /* Main Program */  /* Main Program */
54    
55  void main(){  void main(){
# Line 62  void main(){ Line 65  void main(){
65  /* Definition of Functions */  /* Definition of Functions */
66    
67  void PlayVideo(){  void PlayVideo(){
68    PlayChunk(LookRight);    MaxFrame=MAXFRAME; // this gets reset at end of PlayChunk so can be freely changed
69      PlayChunk(Yabber);PlayChunk(Yabber);
70      MaxFrame=4;PlayChunk(LookRight);
71      PlayChunk(Yabber);
72      PlayChunk(CheckWatch);
73      PlayChunk(Yabber);PlayChunk(Yabber);
74      MaxFrame=4;PlayChunk(YouFuck);
75    PlayChunk(Yabber);    PlayChunk(Yabber);
76    PlayChunk(Tears);    PlayChunk(Tears);
77    PlayChunk(YouFuck);    //PlayChunk(LookRight);
78      PlayChunk(LeanForward);
79      PlayChunk(Yabber);PlayChunk(Yabber);
80    PlayChunk(Whoops);    PlayChunk(Whoops);
81      MaxFrame=3;PlayChunk(LookRight);
82      PlayChunk(Yabber);
83    PlayChunk(NodYes);    PlayChunk(NodYes);
84    PlayChunk(LeanForward);    PlayChunk(Yabber);PlayChunk(Yabber);
85      PlayChunk(Disdain);
86      PlayChunk(Yabber);
87      PlayChunk(CheckWatch);
88      PlayChunk(YouFuck);
89  }  }
90    
91  void PlayChunk(unsigned char Chunk[]){  void PlayChunk(unsigned char Chunk[]){
92          for (Frame=0;Frame<6; Frame++){          for (Frame=0;Frame<MaxFrame; Frame++){
93                  PtrGraphic=Chunk;                  PtrGraphic=Chunk;
94                  DrawFrame();                  DrawFrame();
95                  Pause();                  Pause();
96          }          }
97          for (Frame=5;Frame>0;Frame--){          for (Frame=MaxFrame-1;Frame>0;Frame--){
98                  PtrGraphic=Chunk;                  PtrGraphic=Chunk;
99                  DrawFrame();                  DrawFrame();
100                  Pause();                  Pause();
101          }          }
102            MaxFrame=MAXFRAME;
103  }  }
104    
105  void Pause(){  void Pause(){

Legend:
Removed from v.1107  
changed lines
  Added in v.1108

  ViewVC Help
Powered by ViewVC 1.1.26