Made ValueView.cpp valid C89
This commit is contained in:
parent
c838e8ebcb
commit
33c1ea8f20
3 changed files with 43 additions and 27 deletions
|
@ -1,9 +1,10 @@
|
||||||
|
#include "ValueView.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "WindowsWrapper.h"
|
#include "WindowsWrapper.h"
|
||||||
|
|
||||||
#include "Draw.h"
|
#include "Draw.h"
|
||||||
#include "ValueView.h"
|
|
||||||
|
|
||||||
#define VALUEVIEW_MAX 0x10
|
#define VALUEVIEW_MAX 0x10
|
||||||
|
|
||||||
|
@ -26,6 +27,9 @@ void SetValueView(int *px, int *py, int value)
|
||||||
int fig[4];
|
int fig[4];
|
||||||
BOOL sw;
|
BOOL sw;
|
||||||
int i;
|
int i;
|
||||||
|
RECT rect[20];
|
||||||
|
RECT rcPlus;
|
||||||
|
RECT rcMinus;
|
||||||
|
|
||||||
for (i = 0; i < VALUEVIEW_MAX; ++i)
|
for (i = 0; i < VALUEVIEW_MAX; ++i)
|
||||||
{
|
{
|
||||||
|
@ -91,28 +95,26 @@ void SetValueView(int *px, int *py, int value)
|
||||||
gVV[index].rect.right = 40;
|
gVV[index].rect.right = 40;
|
||||||
gVV[index].rect.bottom = 8 * (index + 1);
|
gVV[index].rect.bottom = 8 * (index + 1);
|
||||||
|
|
||||||
RECT rect[20] = {
|
SET_RECT(rect[0], 0, 56, 8, 64);
|
||||||
{0, 56, 8, 64},
|
SET_RECT(rect[1], 8, 56, 16, 64);
|
||||||
{8, 56, 16, 64},
|
SET_RECT(rect[2], 16, 56, 24, 64);
|
||||||
{16, 56, 24, 64},
|
SET_RECT(rect[3], 24, 56, 32, 64);
|
||||||
{24, 56, 32, 64},
|
SET_RECT(rect[4], 32, 56, 40, 64);
|
||||||
{32, 56, 40, 64},
|
SET_RECT(rect[5], 40, 56, 48, 64);
|
||||||
{40, 56, 48, 64},
|
SET_RECT(rect[6], 48, 56, 56, 64);
|
||||||
{48, 56, 56, 64},
|
SET_RECT(rect[7], 56, 56, 64, 64);
|
||||||
{56, 56, 64, 64},
|
SET_RECT(rect[8], 64, 56, 72, 64);
|
||||||
{64, 56, 72, 64},
|
SET_RECT(rect[9], 72, 56, 80, 64);
|
||||||
{72, 56, 80, 64},
|
SET_RECT(rect[10], 0, 64, 8, 72);
|
||||||
{0, 64, 8, 72},
|
SET_RECT(rect[11], 8, 64, 16, 72);
|
||||||
{8, 64, 16, 72},
|
SET_RECT(rect[12], 16, 64, 24, 72);
|
||||||
{16, 64, 24, 72},
|
SET_RECT(rect[13], 24, 64, 32, 72);
|
||||||
{24, 64, 32, 72},
|
SET_RECT(rect[14], 32, 64, 40, 72);
|
||||||
{32, 64, 40, 72},
|
SET_RECT(rect[15], 40, 64, 48, 72);
|
||||||
{40, 64, 48, 72},
|
SET_RECT(rect[16], 48, 64, 56, 72);
|
||||||
{48, 64, 56, 72},
|
SET_RECT(rect[17], 56, 64, 64, 72);
|
||||||
{56, 64, 64, 72},
|
SET_RECT(rect[18], 64, 64, 72, 72);
|
||||||
{64, 64, 72, 72},
|
SET_RECT(rect[19], 72, 64, 80, 72);
|
||||||
{72, 64, 80, 72},
|
|
||||||
};
|
|
||||||
|
|
||||||
// Get digits
|
// Get digits
|
||||||
dig[0] = 1;
|
dig[0] = 1;
|
||||||
|
@ -133,8 +135,8 @@ void SetValueView(int *px, int *py, int value)
|
||||||
|
|
||||||
sw = FALSE;
|
sw = FALSE;
|
||||||
|
|
||||||
RECT rcPlus = {32, 48, 40, 56};
|
SET_RECT(rcPlus, 32, 48, 40, 56);
|
||||||
RECT rcMinus = {40, 48, 48, 56};
|
SET_RECT(rcMinus, 40, 48, 48, 56);
|
||||||
|
|
||||||
// Draw value
|
// Draw value
|
||||||
CortBox2(&gVV[index].rect, 0x000000, SURFACE_ID_VALUE_VIEW);
|
CortBox2(&gVV[index].rect, 0x000000, SURFACE_ID_VALUE_VIEW);
|
||||||
|
|
|
@ -2,7 +2,11 @@
|
||||||
|
|
||||||
#include "WindowsWrapper.h"
|
#include "WindowsWrapper.h"
|
||||||
|
|
||||||
struct VALUEVIEW
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef struct VALUEVIEW
|
||||||
{
|
{
|
||||||
BOOL flag;
|
BOOL flag;
|
||||||
int *px;
|
int *px;
|
||||||
|
@ -11,9 +15,13 @@ struct VALUEVIEW
|
||||||
int value;
|
int value;
|
||||||
int count;
|
int count;
|
||||||
RECT rect;
|
RECT rect;
|
||||||
};
|
} VALUEVIEW;
|
||||||
|
|
||||||
void ClearValueView(void);
|
void ClearValueView(void);
|
||||||
void SetValueView(int *px, int *py, int value);
|
void SetValueView(int *px, int *py, int value);
|
||||||
void ActValueView(void);
|
void ActValueView(void);
|
||||||
void PutValueView(int flx, int fly);
|
void PutValueView(int flx, int fly);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
|
@ -339,6 +339,12 @@
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\src\ValueView.cpp">
|
RelativePath="..\src\ValueView.cpp">
|
||||||
|
<FileConfiguration
|
||||||
|
Name="Release|Win32">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
CompileAs="1"/>
|
||||||
|
</FileConfiguration>
|
||||||
</File>
|
</File>
|
||||||
<Filter
|
<Filter
|
||||||
Name="NPC"
|
Name="NPC"
|
||||||
|
|
Loading…
Add table
Reference in a new issue