Oscilloscope now has borders (bug #307 part 4) -Mika
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@951 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
Changes towards version 0.3:
|
Changes towards version 0.3:
|
||||||
|
- Oscilloscope now has borders (bug #307 part 4) -Mika
|
||||||
- Flashing rects are no longer constrained to even-numbered pixels on the
|
- Flashing rects are no longer constrained to even-numbered pixels on the
|
||||||
y axis; fixes bug #255, from Nic
|
y axis; fixes bug #255, from Nic
|
||||||
- Fixed minor glitches in main window borders (bug #307 parts 1,2,3) -Mika
|
- Fixed minor glitches in main window borders (bug #307 parts 1,2,3) -Mika
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 955 B After Width: | Height: | Size: 1.2 KiB |
@@ -713,7 +713,7 @@ GetSoundData (void *data)
|
|||||||
|
|
||||||
assert (pos >= 0);
|
assert (pos >= 0);
|
||||||
|
|
||||||
for (i = 0; i < RADAR_WIDTH; ++i)
|
for (i = 0; i < RADAR_WIDTH - 2; ++i)
|
||||||
{
|
{
|
||||||
SDWORD s;
|
SDWORD s;
|
||||||
|
|
||||||
@@ -726,7 +726,7 @@ GetSoundData (void *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
s = *(SWORD*) (&sbuffer[pos]);
|
s = *(SWORD*) (&sbuffer[pos]);
|
||||||
s = (s / 1260) + (RADAR_HEIGHT >> 1);
|
s = (s / 1360) + (RADAR_HEIGHT >> 1);
|
||||||
if (s < 0)
|
if (s < 0)
|
||||||
s = 0;
|
s = 0;
|
||||||
else if (s >= RADAR_HEIGHT)
|
else if (s >= RADAR_HEIGHT)
|
||||||
@@ -785,7 +785,7 @@ GetSoundData (void *data)
|
|||||||
|
|
||||||
assert (pos >= 0);
|
assert (pos >= 0);
|
||||||
|
|
||||||
for (i = 0; i < RADAR_WIDTH; ++i)
|
for (i = 0; i < RADAR_WIDTH - 2; ++i)
|
||||||
{
|
{
|
||||||
SDWORD s;
|
SDWORD s;
|
||||||
|
|
||||||
@@ -799,7 +799,7 @@ GetSoundData (void *data)
|
|||||||
|
|
||||||
s = (*(SWORD*)(&sbuffer[pos])) + (*(SWORD*)(&sbuffer[pos + 2]));
|
s = (*(SWORD*)(&sbuffer[pos])) + (*(SWORD*)(&sbuffer[pos + 2]));
|
||||||
|
|
||||||
s = (s / 1260) + (RADAR_HEIGHT >> 1);
|
s = (s / 1800) + (RADAR_HEIGHT >> 1);
|
||||||
if (s < 0)
|
if (s < 0)
|
||||||
s = 0;
|
s = 0;
|
||||||
else if (s >= RADAR_HEIGHT)
|
else if (s >= RADAR_HEIGHT)
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ static FRAMEPTR scope_frame;
|
|||||||
static int scope_init = 0;
|
static int scope_init = 0;
|
||||||
static TFB_Image *scope_bg = NULL;
|
static TFB_Image *scope_bg = NULL;
|
||||||
static TFB_Image *scope_surf = NULL;
|
static TFB_Image *scope_surf = NULL;
|
||||||
static UBYTE scope_data[RADAR_WIDTH];
|
static UBYTE scope_data[RADAR_WIDTH - 2];
|
||||||
|
|
||||||
void
|
void
|
||||||
InitOscilloscope (DWORD x, DWORD y, DWORD width, DWORD height, FRAME_DESC *f)
|
InitOscilloscope (DWORD x, DWORD y, DWORD width, DWORD height, FRAME_DESC *f)
|
||||||
@@ -77,8 +77,8 @@ Oscilloscope (DWORD grab_data)
|
|||||||
r = scope_surf->Palette[238].r;
|
r = scope_surf->Palette[238].r;
|
||||||
g = scope_surf->Palette[238].g;
|
g = scope_surf->Palette[238].g;
|
||||||
b = scope_surf->Palette[238].b;
|
b = scope_surf->Palette[238].b;
|
||||||
for (i = 0; i < RADAR_WIDTH - 1; ++i)
|
for (i = 0; i < RADAR_WIDTH - 3; ++i)
|
||||||
TFB_DrawImage_Line (i, scope_data[i], i + 1, scope_data[i + 1], r, g, b, scope_surf);
|
TFB_DrawImage_Line (i + 1, scope_data[i], i + 2, scope_data[i + 1], r, g, b, scope_surf);
|
||||||
}
|
}
|
||||||
TFB_DrawImage_Image (scope_surf, 0, 0, 0, NULL, scope_frame->image);
|
TFB_DrawImage_Image (scope_surf, 0, 0, 0, NULL, scope_frame->image);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user