Index.h 1.29 KB
Newer Older
daFischer's avatar
daFischer committed
1 2
/* 
 * File:   Index.h
3
 * Author: Johannes Fischer
daFischer's avatar
daFischer committed
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
 *
 * Created on July 23, 2014, 10:10 PM
 */

#ifndef INDEXEXTENSION_H
#define	INDEXEXTENSION_H

#include <stdio.h>
#include <list>
#include <SDL/SDL.h>
#include <SDL/SDL_image.h>
#include <iostream>
#include <fstream>
#include "IndexEntry.h"
#include "Inflater.h"
#include "Messages/Message.h"

using namespace std;

class Index {
public:
    Index(Inflater* in, int numBytes);
26
    Index(Message** messages, int numMessages);
daFischer's avatar
daFischer committed
27 28
    virtual ~Index();
    IndexEntry* lastBefore(int timestamp);
29
    bool fillSurface(SDL_Surface* screen, Message** messages, int numMessages, int areaLeft, ProtocolPreferences* prefs);
daFischer's avatar
daFischer committed
30
    bool readIndexEntry(Inflater* in);
31 32 33
    void loadUntil(IndexEntry* entry, SDL_Surface* screen, Message** messages, int numMessages, ProtocolPreferences* prefs);
    
    int progress;           //timestamp of next to be filled IndexEntry, -1 if all have been filled
daFischer's avatar
daFischer committed
34 35
    
private:
36
    //void fillSurfaces(SDL_Surface* screen, Message** messages, int numMessages, ProtocolPreferences* prefs);
daFischer's avatar
daFischer committed
37 38
    SDL_Surface* readThumbnail(Inflater* in, int* numBytes);
    list<IndexEntry*> index;
39 40
    std::list<IndexEntry*>::iterator it;
    int currentMessage;
41
    SDL_Surface* waypoint;
daFischer's avatar
daFischer committed
42 43 44
    
    short entryNumber;
    int numBytes;
daFischer's avatar
daFischer committed
45 46 47 48
};

#endif	/* INDEXEXTENSION_H */