Skip to content

Commit 83374e5

Browse files
committed
MSVC and mingw support
git-svn-id: svn://svn.icculus.org/twilight/trunk/dpvideo@2151 d7cf8633-e32d-0410-b094-e92efae38249
1 parent d5391d2 commit 83374e5

16 files changed

+640
-46
lines changed

dpvdecode.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ static void dpvdecode_addframetoseektable(dpvdecodestream_t *s, FILE *file, int
8686
seektable->entry[seektable->entries++].position = position;
8787
}
8888

89-
static dpvdecodeseek_t *dpvdecode_findseekentry(dpvdecodestream_t *s, int framenum)
89+
static dpvdecodeseek_t *dpvdecode_findseekentry(dpvdecodestream_t *s, unsigned int framenum)
9090
{
9191
dpvdecodeseektable_t *seektable;
9292

@@ -461,7 +461,7 @@ int dpvdecode_error(void *stream, char **errorstring)
461461
int dpvdecode_framefortime(void *stream, double t)
462462
{
463463
dpvdecodestream_t *s = stream;
464-
return t * s->info_framerate;
464+
return (int) (t * s->info_framerate);
465465
}
466466

467467
// return the total number of frames in the stream
@@ -645,7 +645,7 @@ int dpvdecode_video(void *stream, int framenum, void *imagedata, unsigned int Rm
645645
s->error = DPVDECODEERROR_NONE;
646646
if (dpvdecode_setpixelformat(s, Rmask, Gmask, Bmask, bytesperpixel))
647647
return s->error;
648-
if (framenum < 0 || framenum >= s->info_frames)
648+
if (framenum < 0 || framenum >= (signed int) s->info_frames)
649649
{
650650
s->videoframenum = -10000;
651651
memset(s->videopixels, 0, s->info_imagewidth * s->info_imageheight * sizeof(*s->videopixels));

dpvdecoder.dsp

+130
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dpvencode.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,8 @@ static void dpvencode_compressimage(dpvencodestream_t *s, unsigned char *pixels,
203203
width = s->width;
204204
height = s->height;
205205
error = ((256.0 / 100.0) / quality);
206-
threshold = error * error;
207-
deltablockthreshold = BLOCKSIZE * BLOCKSIZE * threshold / 8.0;
206+
threshold = (int) (error * error);
207+
deltablockthreshold = (int) (BLOCKSIZE * BLOCKSIZE * threshold / 8.0);
208208
error = 0;
209209
errorbiggest = 0;
210210
deltablocks = 0;
@@ -540,7 +540,7 @@ static int dpvencode_beginstream(dpvencodestream_t *s, unsigned int width, unsig
540540
// video info goes here
541541
hz_bitstream_write_short(s->headerblocks, s->width);
542542
hz_bitstream_write_short(s->headerblocks, s->height);
543-
hz_bitstream_write_int(s->headerblocks, s->framerate * 65536.0);
543+
hz_bitstream_write_int(s->headerblocks, (unsigned int) (s->framerate * 65536.0));
544544
// sound info goes here
545545
// samplespersecond (no sound here, so zero)
546546
hz_bitstream_write_int(s->headerblocks, 0);

dpvencoder.dsp

+101
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dpvideo.dsw

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
Microsoft Developer Studio Workspace File, Format Version 6.00
2+
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
3+
4+
###############################################################################
5+
6+
Project: "dpvdecoder"=.\dpvdecoder.dsp - Package Owner=<4>
7+
8+
Package=<5>
9+
{{{
10+
}}}
11+
12+
Package=<4>
13+
{{{
14+
}}}
15+
16+
###############################################################################
17+
18+
Project: "dpvencoder"=..\dpvencoder.dsp - Package Owner=<4>
19+
20+
Package=<5>
21+
{{{
22+
}}}
23+
24+
Package=<4>
25+
{{{
26+
}}}
27+
28+
###############################################################################
29+
30+
Project: "dpvplayer"=.\dpvplayer.dsp - Package Owner=<4>
31+
32+
Package=<5>
33+
{{{
34+
}}}
35+
36+
Package=<4>
37+
{{{
38+
}}}
39+
40+
###############################################################################
41+
42+
Project: "dpvsimpleplayer"=.\dpvsimpleplayer.dsp - Package Owner=<4>
43+
44+
Package=<5>
45+
{{{
46+
}}}
47+
48+
Package=<4>
49+
{{{
50+
}}}
51+
52+
###############################################################################
53+
54+
Global:
55+
56+
Package=<5>
57+
{{{
58+
}}}
59+
60+
Package=<3>
61+
{{{
62+
}}}
63+
64+
###############################################################################
65+

0 commit comments

Comments
 (0)