Changeset 615


Ignore:
Timestamp:
Feb 8, 2011, 11:28:29 PM (10 years ago)
Author:
sam
Message:

Allow to specify FPS in the DebugRecord object.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/deushax/deushax.cpp

    r227 r615  
    6565    new DebugSprite(game);
    6666    new DebugSphere();
    67     //new DebugRecord("lolengine.ogg");
     67    //new DebugRecord("lolengine.ogm", FPS);
    6868    new DebugStats("stats.txt");
    6969
  • trunk/monsterz/monsterz.cpp

    r427 r615  
    2626
    2727#include "debugfps.h"
     28#include "debugrecord.h"
    2829
    2930static float const FPS = 60.0f;
     
    6465    new Interface();
    6566    new DebugFps(20, 20);
     67    //new DebugRecord("monsterz.ogm", FPS);
    6668
    6769    while (!Ticker::Finished())
  • trunk/src/debugrecord.cpp

    r259 r615  
    3333private:
    3434    char const *path;
    35     int width, height;
     35    int width, height, fps;
    3636#if defined USE_PIPI
    3737    pipi_sequence_t *sequence;
     
    4343 */
    4444
    45 DebugRecord::DebugRecord(char const *path)
     45DebugRecord::DebugRecord(char const *path, float fps)
    4646  : data(new DebugRecordData())
    4747{
     
    4949    data->width = 0;
    5050    data->height = 0;
     51    data->fps = (int)(fps + 0.5f);
    5152#if defined USE_PIPI
    5253    data->sequence = NULL;
     
    7778            pipi_close_sequence(data->sequence);
    7879
    79         data->sequence = pipi_open_sequence(data->path, width, height, 30);
     80        data->sequence = pipi_open_sequence(data->path, width, height,
     81                                            1 /* RGB */, data->fps,
     82                                            1, 1, 60 * 1024 * 1024);
    8083#endif
    8184    }
  • trunk/src/debugrecord.h

    r221 r615  
    2424{
    2525public:
    26     DebugRecord(char const *path);
     26    DebugRecord(char const *path, float fps);
    2727    virtual ~DebugRecord();
    2828
  • trunk/src/video.cpp

    r221 r615  
    121121    glPixelStorei(GL_PACK_ALIGNMENT, 1);
    122122
     123#if defined GL_BGRA
     124    glReadPixels(0, 0, width, height, GL_BGRA, GL_UNSIGNED_BYTE, buffer);
     125#else
    123126    glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
     127#endif
    124128
    125129    for (int j = 0; j < height / 2; j++)
Note: See TracChangeset for help on using the changeset viewer.