Communication progress slider.

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@70 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
meep-eep
2002-09-23 02:20:14 +00:00
parent ba869f210b
commit 047dcc8980
4 changed files with 45 additions and 96 deletions
+4 -4
View File
@@ -52,10 +52,10 @@ enum
extern DWORD* _varPLUTs; extern DWORD* _varPLUTs;
int TFB_GetFadeAmount (); int TFB_GetFadeAmount (void);
BOOLEAN TFB_HasColorMap (); BOOLEAN TFB_HasColorMap (void);
int TFB_GetColorMapType (); int TFB_GetColorMapType (void);
void TFB_ReleaseColorMap (); void TFB_ReleaseColorMap (void);
BOOLEAN TFB_CopyRGBColorMap (TFB_Palette *dst); BOOLEAN TFB_CopyRGBColorMap (TFB_Palette *dst);
#endif #endif
+8 -8
View File
@@ -45,8 +45,8 @@ enum
int TFB_InitGraphics (int driver, int flags, int width, int height, int bpp); int TFB_InitGraphics (int driver, int flags, int width, int height, int bpp);
int TFB_CreateGamePlayThread (); int TFB_CreateGamePlayThread (void);
void TFB_ProcessEvents (); void TFB_ProcessEvents (void);
// 3DO Graphics Stuff // 3DO Graphics Stuff
@@ -56,7 +56,7 @@ void SetGraphicStrength (int numer, int denom);
void SetGraphicGrabOther (int grab_other); void SetGraphicGrabOther (int grab_other);
void SetGraphicScale (int scale); void SetGraphicScale (int scale);
void SetGraphicUseOtherExtra (int other); void SetGraphicUseOtherExtra (int other);
void *GetScreenBitmap (); void *GetScreenBitmap (void);
void ScreenTransition (int transition, PRECT pRect); void ScreenTransition (int transition, PRECT pRect);
extern float FrameRate; extern float FrameRate;
@@ -120,13 +120,13 @@ typedef struct tfb_drawcommandqueue
volatile int Size; volatile int Size;
} TFB_DrawCommandQueue; } TFB_DrawCommandQueue;
TFB_DrawCommandQueue *TFB_DrawCommandQueue_Create (); TFB_DrawCommandQueue *TFB_DrawCommandQueue_Create (void);
void TFB_BatchGraphics (); void TFB_BatchGraphics (void);
void TFB_UnbatchGraphics (); void TFB_UnbatchGraphics (void);
void TFB_BatchReset (); void TFB_BatchReset (void);
void TFB_DrawCommandQueue_Push (TFB_DrawCommandQueue* myQueue, void TFB_DrawCommandQueue_Push (TFB_DrawCommandQueue* myQueue,
TFB_DrawCommand* Command); TFB_DrawCommand* Command);
@@ -140,7 +140,7 @@ extern TFB_DrawCommandQueue *DrawCommandQueue;
// main thread can draw to the window. // main thread can draw to the window.
void TFB_EnqueueDrawCommand (TFB_DrawCommand* DrawCommand); void TFB_EnqueueDrawCommand (TFB_DrawCommand* DrawCommand);
void TFB_FlushGraphics (); // Only call from main thread!! void TFB_FlushGraphics (void); // Only call from main thread!!
// CCB Stuff // CCB Stuff
+3 -4
View File
@@ -105,11 +105,10 @@ int
GetSoundInfo (int *length, int *offset) GetSoundInfo (int *length, int *offset)
// Umm... How does it know which sound? // Umm... How does it know which sound?
{ {
int ret;
fprintf (stderr, "Unimplemented function activated: GetSoundInfo()\n"); fprintf (stderr, "Unimplemented function activated: GetSoundInfo()\n");
ret = 0; *length = 1;
return (ret); *offset = 0;
return 1;
} }
// Status: Unimplemented // Status: Unimplemented
+29 -79
View File
@@ -16,13 +16,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
//#include "Portfolio.h" //3DO Library we don't get access to
//#include "Init3DO.h"
//#include "Parse3DO.h"
//#include "Utils3DO.h"
//#include "filefunctions.h"
//#include "BlockFile.h"
#include "libs/graphics/gfx_common.h" #include "libs/graphics/gfx_common.h"
//Added by Chris //Added by Chris
@@ -172,95 +165,52 @@ Oscilloscope (int32 grab_data)
#endif #endif
} }
static CCB slider_cels[2]; static STAMP sliderStamp;
static STAMP buttonStamp;
int32 sliderSpace; // slider width - button width
/*
* Initialise the communication progress bar
* x - x location of slider
* y - y location of slider
* width - width of slider
* height - height of slider
* bwidth - width of button indicating current progress
* bheight - height of button indicating progress
* f - image for the slider
*/
void void
InitSlider (int32 x, int32 y, int32 width, int32 height, InitSlider (int32 x, int32 y, int32 width, int32 height,
int32 bwidth, int32 bheight, void *f) int32 bwidth, int32 bheight, FRAME f)
// int32 bwidth, int32 bheight, FRAME_DESC *f)
{ {
#if 0 sliderStamp.origin.x = x;
#define SLIDER_X x sliderStamp.origin.y = y;
#define SLIDER_Y y sliderStamp.frame = f;
#define SLIDER_WIDTH width buttonStamp.origin.x = x;
#define SLIDER_HEIGHT height buttonStamp.origin.y = y - ((bheight - height) >> 1);
#define BUTTON_WIDTH bwidth sliderSpace = width - bwidth;
#define BUTTON_HEIGHT bheight
int32 i;
CCB *ccb;
uint32 *cel_plut;
cel_plut = GET_VAR_PLUT ((f->TypeIndexAndFlags >> 16) & 0xFF);
slider_cels[0].ccb_Width = SLIDER_X;
slider_cels[0].ccb_Height = SLIDER_WIDTH;
slider_cels[0].ccb_SourcePtr = (void *)((uchar *)f + f->DataOffs);
slider_cels[1].ccb_Width = BUTTON_WIDTH;
ccb = slider_cels;
for (i = 0; i < 2; i++, ccb++)
{
ccb->ccb_Flags = CEL_FLAGS | CCB_PACKED | CCB_LDPLUT;
ccb->ccb_HDX = 1 << 20;
ccb->ccb_HDY = 0;
ccb->ccb_VDX = 0;
ccb->ccb_VDY = 1 << 16;
ccb->ccb_PIXC = PIXC_CODED8;
ccb->ccb_PLUTPtr = cel_plut;
if (i == 0)
{
ccb->ccb_XPos = SLIDER_X << 16;
ccb->ccb_YPos = SLIDER_Y << 16;
ccb->ccb_PRE0 =
PRE0_LITERAL |
((SLIDER_HEIGHT - PRE0_VCNT_PREFETCH) << PRE0_VCNT_SHIFT) |
(PRE0_BPP_8 << PRE0_BPP_SHIFT);
}
else
{
ccb->ccb_XPos = SLIDER_X << 16;
ccb->ccb_YPos = (SLIDER_Y - ((BUTTON_HEIGHT - SLIDER_HEIGHT) >> 1)) << 16;
ccb->ccb_PRE0 =
PRE0_LITERAL |
((BUTTON_HEIGHT - PRE0_VCNT_PREFETCH) << PRE0_VCNT_SHIFT) |
(PRE0_BPP_8 << PRE0_BPP_SHIFT);
}
ccb->ccb_NextPtr = ccb + 1;
}
#endif
} }
void void
SetSliderImage (void *f) SetSliderImage (FRAME f)
//SetSliderImage (FRAME_DESC *f)
{ {
#if 0 buttonStamp.frame = f;
slider_cels[1].ccb_SourcePtr = (void *)((uchar *)f + f->DataOffs);
#endif
} }
void void
Slider (void) Slider (void)
{ {
#if 0
#undef SLIDER_X
#undef SLIDER_WIDTH
#undef BUTTON_WIDTH
#define SLIDER_X slider_cels[0].ccb_Width
#define SLIDER_WIDTH slider_cels[0].ccb_Height
#define BUTTON_WIDTH slider_cels[1].ccb_Width
int32 len, offs; int32 len, offs;
if (GetSoundInfo (&len, &offs)) if (GetSoundInfo (&len, &offs))
{ {
if (offs > len) offs = len; if (offs > len)
offs = len;
slider_cels[1].ccb_XPos = (SLIDER_X + ((SLIDER_WIDTH - BUTTON_WIDTH) * offs / len)) << 16; buttonStamp.origin.x = sliderStamp.origin.x + sliderSpace * offs / len;
add_cels (slider_cels, &slider_cels[1]); BatchGraphics ();
DrawStamp (&sliderStamp);
DrawStamp (&buttonStamp);
UnbatchGraphics ();
} }
#endif
} }