Hello all!
I'm trying to make a fuel indicator to indicate the fuel quantity in the left tip tank of IL-86. The layout of this gauge is bellow:

The white column moves up and down indicating the fuel level in tons in the left tip tank.
I'm using the MAKE_MOVING function and get some problems with some parameters and the mask.
What does the following variables mean?
And more.... what format(with alpha? with transparency? 8bit? or how to make them in PS and convert to the right format) should the card/mask/background in this case be..
The fs2004_panel_sdk is quite vague... Hard to makeout.
View attachment IL_86.zip
I'm trying to make a fuel indicator to indicate the fuel quantity in the left tip tank of IL-86. The layout of this gauge is bellow:
The white column moves up and down indicating the fuel level in tons in the left tip tank.
I'm using the MAKE_MOVING function and get some problems with some parameters and the mask.
Code:
//IL_86_FUEL.FQ_14A.c
// Copyright (c) 2000 Microsoft Corporation. All rights reserved.
// Set up gauge header
char FQ_14A_gauge_name[] = GAUGE_NAME;
extern PELEMENT_HEADER FQ_14A_list;
extern MOUSERECT FQ_14A_mouse_rect[];
GAUGE_HEADER_FS700(GAUGE_W, FQ_14A_gauge_name, &FQ_14A_list, \
FQ_14A_mouse_rect, 0, 0, 0, 0);
/////////////////////////////////////////////////////////////////////////////
FLOAT64 FSAPI set_fuel_bar_y(PELEMENT_MOVING_IMAGE pelement)
{
FLOAT64 val = -0.0000460147857666015625*(pelement->source_var_y.var_value.n);//convert the fuel quatity to the relative displacement of the fuel bar
if (val < -438.0)val = -438.0;
if (val>0)val = 0.0;
return val;
}
FLOAT64 FSAPI set_fuel_bar_x(PELEMENT_MOVING_IMAGE pelement)
{
return 1.0;
}
MAKE_MOVING
(
FQ_14A_slider,
BMP_FQ_14A_SMALL_CARD1,
NULL,
NULL,
IMAGE_CONTAINS_MASK,
0,
70,37
MODULE_VAR_NONE, set_fuel_bar_x,
0, 0,
FUEL_TANK_LEFT_TIP_LEVEL, set_fuel_bar_y,
-438,0
)
PELEMENT_HEADER FQ_14A_moving_list[] =
{
&FQ_14A_slider.header,
NULL
};
/////////////////////////////////////////////////////////////////////////////
MAKE_STATIC
(
FQ_14A_background,
BMP_FQ_14A_SMALL_BACKGROUND,
&FQ_14A_moving_list,
NULL,
IMAGE_USE_TRANSPARENCY,
0,
0, 0
)
PELEMENT_HEADER FQ_14A_list = &FQ_14A_background.header;
/////////////////////////////////////////////////////////////////////////////
MOUSE_BEGIN( FQ_14A_mouse_rect, HELP_NONE, 0, 0 )
MOUSE_END
/////////////////////////////////////////////////////////////////////////////
#undef GAUGE_NAME
#undef GAUGEHDR_VAR_NAME
#undef GAUGE_W
Code:
// IL_86_FUEL.c
// Copyright (c) 2000 Microsoft Corp. All Rights Reserved
#include "..\inc\gauges.h"
#include "IL_86_FUEL.h"
/////////////////////////////////////////////////////////////////////////////
// Attitude
/////////////////////////////////////////////////////////////////////////////
#define GAUGE_NAME "Fuel Quantity Bak 1A"
#define GAUGEHDR_VAR_NAME gaugehdr_FQ_14A
#define GAUGE_W 100
#include "IL_86_FUEL.FQ_14A.c"
/////////////////////////////////////////////////////////////////////////////
// Gauge table entries
/////////////////////////////////////////////////////////////////////////////
GAUGE_TABLE_BEGIN()
GAUGE_TABLE_ENTRY(&gaugehdr_FQ_14A)
GAUGE_TABLE_END()
Code:
// IL_86_FUEL.h
// Copyright (c) 2000 Microsoft Corporation. All rights reserved.
//
#define VERSION_MAJOR 1
#define VERSION_MINOR 0
#define VERSION_BUILD 0
// magic to get the preprocessor to do what we want
#define lita(arg) #arg
#define xlita(arg) lita(arg)
#define cat3(w,x,z) w##.##x##.##z##\000
#define xcat3(w,x,z) cat3(w,x,z)
#define VERSION_STRING xlita(xcat3(VERSION_MAJOR,VERSION_MINOR,VERSION_BUILD))
#ifndef VS_VERSION_INFO
#define VS_VERSION_INFO 0x0001
#endif
/////////////////////////////////////////////////////////////////////////////
//
// FQ_14A Bitmaps
//
#define BMP_FQ_14A_SMALL_BACKGROUND 0x1000
#define BMP_FQ_14A_SMALL_CARD1 0x1100
#define BMP_FQ_14A_SMALL_MASK1 0x1101
Code:
// IL_86_FUEL.rc
// Copyright (c) 2000 Microsoft Corp. All Rights Reserved
#include "IL_86_FUEL.h"
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION VERSION_MAJOR,VERSION_MINOR,0,VERSION_BUILD
PRODUCTVERSION VERSION_MAJOR,VERSION_MINOR,0,VERSION_BUILD
FILEFLAGSMASK 0x3fL
FILEFLAGS 0x0L
FILEOS 0x10004L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "Your Company\0"
VALUE "FileDescription", "Flight Simulator 98 Gauge\0"
VALUE "FileVersion", VERSION_STRING
VALUE "LegalCopyright", "Your Copyright.\0"
VALUE "ProductName", "Your Product\0"
VALUE "ProductVersion", VERSION_STRING
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
/////////////////////////////////////////////////////////////////////////////
//
// FQ_14A Bitmaps
//
BMP_FQ_14A_SMALL_BACKGROUND BITMAP DISCARDABLE "res\\IL_86_FUEL.FQ_14A.bg.BMP"
BMP_FQ_14A_SMALL_CARD1 BITMAP DISCARDABLE "res\\IL_86_FUEL.FQ_14A.CARD1.BMP"
//BMP_FQ_14A_SMALL_MASK1 BITMAP DISCARDABLE "res\\IL_86_FUEL.FQ_14A.MASK1.BMP"
Code:
# makefile
# Copyright (c) 2000 Microsoft Corporation. All rights reserved.
INCDIR = ..\inc
DESTDIR = C:\Program Files\Microsoft Games\Flight Simulator 9\Gauges
INCS = -I$(INCDIR)
LIBS = user32.lib gdi32.lib kernel32.lib
!IFDEF DEBUG
C_FLAGS = /Z7
L_FLAGS = /DEBUG
!ELSE
C_FLAGS =
L_FLAGS =
!ENDIF
goal: IL_86_FUEL.gau
IL_86_FUEL.obj: $(INCDIR)\gauges.h \
IL_86_FUEL.c \
IL_86_FUEL.h \
IL_86_FUEL.FQ_14A.c \
cl $(C_FLAGS) -c $(INCS) IL_86_FUEL.c
IL_86_FUEL.res: IL_86_FUEL.rc \
IL_86_FUEL.h \
res\IL_86_FUEL.FQ_14A.bg.BMP \
res\IL_86_FUEL.FQ_14A.card1.BMP \
res\IL_86_FUEL.FQ_14A.mask1.BMP \
rc -r $(INCS) IL_86_FUEL.rc
IL_86_FUEL.gau: IL_86_FUEL.obj \
IL_86_FUEL.res
link $(L_FLAGS) /dll /out:$(DESTDIR)\IL_86_FUEL.gau IL_86_FUEL.obj IL_86_FUEL.res $(LIBS)
clean:
del $(DESTDIR)\*.exp
del $(DESTDIR)\*.gau
del $(DESTDIR)\*.lib
del *.obj
del *.res
What does the following variables mean?
Code:
#define MAKE_MOVING( NAME, \
RES_ID, \
NEXT_LIST, \
FAILURE, \
DRAW_FLAGS, \ What should it be...
ASI_FLAGS, \
POSITION_X, POSITION_Y, \Position in pixels? Position of the left-top point of the mask/card?
SOURCE_VAR_X, CALLBACK_X, \Could the CALLBACK_X simply be replaced by a constant number?ex. 0.0
MIN_X, MAX_X, \position in pixels? Position of what? The mask or the card? reletive displacement to the initial position or the absolute position? Or position of the the card relative to the mask?
SOURCE_VAR_Y, CALLBACK_Y,
MIN_Y, MAX_Y )\\
And more.... what format(with alpha? with transparency? 8bit? or how to make them in PS and convert to the right format) should the card/mask/background in this case be..
The fs2004_panel_sdk is quite vague... Hard to makeout.
View attachment IL_86.zip
