ソースを参照

fixed a bug that caused the program to crash when trying to render the last page of a notebook with an even amount of pages

master
Victor Giers 1年前
コミット
b8c9da13a6
4個のファイルの変更10行の追加10行の削除
  1. 0
    1
      Notebook.pde
  2. 3
    5
      Slide.pde
  3. 1
    1
      data/save.sav
  4. 6
    3
      notizheftanzeiger.pde

+ 0
- 1
Notebook.pde ファイルの表示

} }




ArrayList<Notebook> notebooks = new ArrayList<Notebook>();


void createNotebooks() { void createNotebooks() {
File datafolder = new File(dataPath("") + "/Notizhefte"); File datafolder = new File(dataPath("") + "/Notizhefte");

+ 3
- 5
Slide.pde ファイルの表示

result.image(leftPage, 0, 0, result.width/2, result.height); result.image(leftPage, 0, 0, result.width/2, result.height);
result.image(rightPage, result.width/2, 0, result.width/2, result.height); result.image(rightPage, result.width/2, 0, result.width/2, result.height);
result.endDraw(); result.endDraw();
PImage res = createImage(width, height, ARGB);
res = result.get();
return res;
return result.get();
} }


boolean transition;


void nextSlide() { void nextSlide() {
transition = true; transition = true;
if (currentSlideNo > notebooks.get(currentNotebookNo).imagepaths.length-1) { if (currentSlideNo > notebooks.get(currentNotebookNo).imagepaths.length-1) {
currentSlideNo = 0; currentSlideNo = 0;
currentNotebookNo++; currentNotebookNo++;
if(currentNotebookNo == notebooks.size()) currentNotebookNo = 0;
} }
} else if (mode == RANDOM) { } else if (mode == RANDOM) {
currentNotebookNo = (int)random(notebooks.size()); currentNotebookNo = (int)random(notebooks.size());
currentSlideNo = (int)random(notebooks.get(currentNotebookNo).imagepaths.length);
currentSlideNo = (int)random(notebooks.get(currentNotebookNo).imagepaths.length-1);
if (currentSlideNo %2 != 0) { if (currentSlideNo %2 != 0) {
currentSlideNo -= 1; currentSlideNo -= 1;
} }

+ 1
- 1
data/save.sav ファイルの表示

168
0 0
8

+ 6
- 3
notizheftanzeiger.pde ファイルの表示



//////// Config //////// Config


int mode = NORMAL; //NORMAL or RANDOM order
float timerTime = 5000; //in milliseconds how long slide is shown
float transitionTime = 3000; //how long it takes to fade the next slide in. must not be greater than "timerTime"
int mode = RANDOM; //NORMAL or RANDOM order
float timerTime = 250; //in milliseconds how long slide is shown
float transitionTime = 100; //how long it takes to fade the next slide in. must not be greater than "timerTime"
boolean displayText = true; //if the "date" should be written on screen boolean displayText = true; //if the "date" should be written on screen
boolean displayTimeline = true; //if the timeline should be drawn on screen boolean displayTimeline = true; //if the timeline should be drawn on screen

// //


Timer timer; Timer timer;
ArrayList<Notebook> notebooks = new ArrayList<Notebook>();
PImage currentSlide, nextSlide; PImage currentSlide, nextSlide;
int currentNotebookNo, currentSlideNo; int currentNotebookNo, currentSlideNo;
int startTransitionTime; int startTransitionTime;
boolean transition;
float transitionProgress; float transitionProgress;
final static int NORMAL = 0; final static int NORMAL = 0;
final static int RANDOM = 1; final static int RANDOM = 1;

読み込み中…
キャンセル
保存