~ubuntu-branches/ubuntu/trusty/hedgewars/trusty-proposed

« back to all changes in this revision

Viewing changes to hedgewars/uMisc.pas

  • Committer: Package Import Robot
  • Author(s): Dmitry E. Oboukhov
  • Date: 2011-11-20 18:31:17 UTC
  • mfrom: (1.2.12)
  • Revision ID: package-import@ubuntu.com-20111120183117-pjhz1n2pvnmxa246
Tags: 0.9.17-1
* [Paul Wise]
 * Mention the homing bee in the package description (Closes: #577092)
 * Also install the hwengine desktop file (LP: #811770)
 * Depend on ttf-dejavu-core since it is smaller
 * Depend on ttf-wqy-zenhei instead of embedding a copy of it
* [Dmitry E. Oboukhov]
 * New upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
    f: file;
54
54
    // Windows Bitmap Header
55
55
    head: array[0..53] of Byte = (
56
 
    $42, $4D, // identifier ("BM")
57
 
    0, 0, 0, 0, // file size
58
 
    0, 0, 0, 0, // reserved
59
 
    54, 0, 0, 0, // starting offset
60
 
    40, 0, 0, 0, // header size
61
 
    0, 0, 0, 0, // width
62
 
    0, 0, 0, 0, // height
63
 
    1, 0, // color planes
64
 
    24, 0, // bit depth
65
 
    0, 0, 0, 0, // compression method (uncompressed)
66
 
    0, 0, 0, 0, // image size
67
 
    96, 0, 0, 0, // horizontal resolution
68
 
    96, 0, 0, 0, // vertical resolution
69
 
    0, 0, 0, 0, // number of colors (all)
70
 
    0, 0, 0, 0 // number of important colors
 
56
    $42, $4D,       // identifier ("BM")
 
57
    0, 0, 0, 0,     // file size
 
58
    0, 0, 0, 0,     // reserved
 
59
    54, 0, 0, 0,    // starting offset
 
60
    40, 0, 0, 0,    // header size
 
61
    0, 0, 0, 0,     // width
 
62
    0, 0, 0, 0,     // height
 
63
    1, 0,           // color planes
 
64
    32, 0,          // bit depth
 
65
    0, 0, 0, 0,     // compression method (uncompressed)
 
66
    0, 0, 0, 0,     // image size
 
67
    96, 0, 0, 0,    // horizontal resolution
 
68
    96, 0, 0, 0,    // vertical resolution
 
69
    0, 0, 0, 0,     // number of colors (all)
 
70
    0, 0, 0, 0      // number of important colors
71
71
    );
72
72
begin
73
73
// flash
75
75
ScreenFadeValue:= sfMax;
76
76
ScreenFadeSpeed:= 5;
77
77
 
78
 
size:= toPowerOf2(cScreenWidth) * toPowerOf2(cScreenHeight) * 3;
 
78
size:= toPowerOf2(cScreenWidth) * toPowerOf2(cScreenHeight) * 4;
79
79
p:= GetMem(size);
80
80
 
81
81
// memory could not be allocated
86
86
end;
87
87
 
88
88
// update header information and file name
89
 
 
90
89
filename:= UserPathPrefix + '/Screenshots/' + filename + '.bmp';
91
90
 
92
91
head[$02]:= (size + 54) and $ff;
106
105
head[$24]:= (size shr 16) and $ff;
107
106
head[$25]:= (size shr 24) and $ff;
108
107
 
109
 
//remember that opengles operates on a single surface, so GL_FRONT *should* be implied
110
 
//glReadBuffer(GL_FRONT);
111
 
glReadPixels(0, 0, cScreenWidth, cScreenHeight, GL_BGR, GL_UNSIGNED_BYTE, p);
 
108
// read pixel from the front buffer
 
109
glReadPixels(0, 0, cScreenWidth, cScreenHeight, GL_BGRA, GL_UNSIGNED_BYTE, p);
112
110
 
113
111
{$IOCHECKS OFF}
114
112
Assign(f, filename);
128
126
{$IOCHECKS ON}
129
127
 
130
128
FreeMem(p, size);
131
 
 
132
129
MakeScreenshot:= success;
133
130
end;
134
131