Example #1
0
bool dxtc_pixels::VFlip() const
{
    // Check that the given dimensions are 2^x, 2^y
    if (! OpenGLSize())
        return false;

    // Check that the given format are supported
    if (! SupportedFormat())
        return false;

    // Nothing to do if Height == 1
    if (m_Height == 1)
        return true;

    if (DXT1())
        VFlip_DXT1();
    else if (DXT3())
        VFlip_DXT3();
    else if (DXT5())
        VFlip_DXT5();
    else
        return false; // We should never get there

    return true;
}
Example #2
0
void PictureViewer::HandleSimpleData(BMessage *e) 
{
    WindowPeek* motherWindow = ((WindowPeek*)Window());
                                           // CASE 1:  we have files
   
     entry_ref *ref = new entry_ref;
     if ( e->FindRef("refs",ref) == B_OK ) 
     {
                BEntry *file = new BEntry(ref, true);
                if (motherWindow->IsType( file, "image" ))  motherWindow->LoadImage(file);
                delete file;
     }
     
    delete ref;


    // CASE 2:   we don't have a file.

      // make sure we're not wasting our time
//     if (  strcmp(e->FindString("source"),"Peek") == 0 ) {
//             return;
//     }    

     const char *m_type;
     int32 i = 0, action;
     while ( e->FindInt32("be:actions",i,&action) == B_OK && action != B_COPY_TARGET) i++;
     if (action != B_COPY_TARGET) return;
     i = 0;
     while (e->FindString("be:types",i,&m_type) == B_OK && !SupportedFormat(m_type)) i++;
     if (!m_type) return; 
     
     BMessage yahoo(B_COPY_TARGET);
     yahoo.AddString("be:types",m_type);
     e->SendReply(&yahoo,this);
}