Add rayman2 source files

This commit is contained in:
2024-09-18 02:33:44 +08:00
parent bcc093f8ed
commit fb036c54fd
14339 changed files with 2596224 additions and 0 deletions

View File

@@ -0,0 +1,125 @@
# Microsoft Developer Studio Project File - Name="Vig" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 5.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Static Library" 0x0104
CFG=Vig - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "Vig.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "Vig.mak" CFG="Vig - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "Vig - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "Vig - Win32 Debug" (based on "Win32 (x86) Static Library")
!MESSAGE "Vig - Win32 Retail" (based on "Win32 (x86) Static Library")
!MESSAGE
# Begin Project
# PROP Scc_ProjName ""$/cpa/tempgrp/VIG", LNFAAAAA"
# PROP Scc_LocalPath "."
CPP=cl.exe
!IF "$(CFG)" == "Vig - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "x:\cpa\lib"
# PROP Intermediate_Dir "Tmp\Release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /G5 /W4 /GX /O2 /I "x:\Cpa\Public" /I "x:\Cpa\Public\Vig" /D "NDEBUG" /D "VISUAL" /D "WIN32" /D "USE_PROFILER" /D "SCR_DM_OptCFiles" /FD /c
# SUBTRACT CPP /Fr /YX
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"x:\cpa\lib\VIGP5_vr.lib"
!ELSEIF "$(CFG)" == "Vig - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "x:\cpa\lib"
# PROP Intermediate_Dir "Tmp\Debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /G5 /MD /W4 /GX /Z7 /Od /I "x:\Cpa\Public" /I "x:\Cpa\Public\Vig" /D "_DEBUG" /D "VISUAL" /D "WIN32" /D "USE_PROFILER" /D "MTH_CHECK" /D "CPA_WANTS_EXPORT" /D "SCR_DM_OptCFiles" /FD /c
# SUBTRACT CPP /Fr /YX
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"x:\cpa\lib\VIGP5_vd.lib"
!ELSEIF "$(CFG)" == "Vig - Win32 Retail"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Vig___Wi"
# PROP BASE Intermediate_Dir "Vig___Wi"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "x:\cpa\lib"
# PROP Intermediate_Dir "tmp\retail"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G5 /W4 /GX /O2 /I "x:\Cpa\Public" /I "x:\Cpa\Public\Vig" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "SCR_DM_OptCFiles" /FD /c
# SUBTRACT BASE CPP /Fr /YX
# ADD CPP /nologo /G5 /W4 /GX /O2 /I "x:\Cpa\Public" /I "x:\Cpa\Public\Vig" /D "NDEBUG" /D "VISUAL" /D "WIN32" /D "RETAIL" /D "SCR_DM_OptCFiles" /FD /c
# SUBTRACT CPP /Fr /YX
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo /out:"x:\cpa\lib\VIGP5_vr.lib"
# ADD LIB32 /nologo /out:"x:\cpa\lib\VIGP5_vf.lib"
!ENDIF
# Begin Target
# Name "Vig - Win32 Release"
# Name "Vig - Win32 Debug"
# Name "Vig - Win32 Retail"
# Begin Source File
SOURCE=..\..\Public\Vig\ErrVIG.h
# End Source File
# Begin Source File
SOURCE=..\..\Public\Vig.h
# End Source File
# Begin Source File
SOURCE=..\..\Public\Vig\VIG_Def.h
# End Source File
# Begin Source File
SOURCE=..\..\Public\Vig\VIG_Ver.h
# End Source File
# Begin Source File
SOURCE=.\Vignette.c
# End Source File
# End Target
# End Project

View File

@@ -0,0 +1,210 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="Vig"
ProjectGUID="{9E850991-DCA8-404E-A091-2D60CEE92588}"
SccProjectName="&quot;$/cpa/tempgrp/VIG&quot;, LNFAAAAA"
SccAuxPath=""
SccLocalPath="."
SccProvider="MSSCCI:NXN alienbrain">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="x:\cpa\libd"
IntermediateDirectory=".\Tmp\Debug"
ConfigurationType="4"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
OptimizeForProcessor="1"
AdditionalIncludeDirectories="x:\Cpa\Public,x:\Cpa\Public\Vig"
PreprocessorDefinitions="_DEBUG;VISUAL;WIN32;USE_PROFILER;MTH_CHECK;CPA_WANTS_EXPORT;SCR_DM_OptCFiles"
RuntimeLibrary="3"
PrecompiledHeaderFile=".\Tmp\Debug/Vig.pch"
AssemblerListingLocation=".\Tmp\Debug/"
ObjectFile=".\Tmp\Debug/"
ProgramDataBaseFileName=".\Tmp\Debug/"
WarningLevel="4"
SuppressStartupBanner="TRUE"
DebugInformationFormat="1"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
OutputFile="x:\cpa\libd\VIGP5_vd.lib"
SuppressStartupBanner="TRUE"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Retail|Win32"
OutputDirectory="x:\cpa\lib"
IntermediateDirectory=".\tmp\retail"
ConfigurationType="4"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
OptimizeForProcessor="1"
AdditionalIncludeDirectories="x:\Cpa\Public,x:\Cpa\Public\Vig"
PreprocessorDefinitions="NDEBUG;VISUAL;WIN32;RETAIL;SCR_DM_OptCFiles"
StringPooling="TRUE"
RuntimeLibrary="4"
EnableFunctionLevelLinking="TRUE"
PrecompiledHeaderFile=".\tmp\retail/Vig.pch"
AssemblerListingLocation=".\tmp\retail/"
ObjectFile=".\tmp\retail/"
ProgramDataBaseFileName=".\tmp\retail/"
WarningLevel="4"
SuppressStartupBanner="TRUE"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
OutputFile="x:\cpa\lib\VIGP5_vf.lib"
SuppressStartupBanner="TRUE"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="x:\cpa\lib"
IntermediateDirectory=".\Tmp\Release"
ConfigurationType="4"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
OptimizeForProcessor="1"
AdditionalIncludeDirectories="x:\Cpa\Public,x:\Cpa\Public\Vig"
PreprocessorDefinitions="NDEBUG;VISUAL;WIN32;USE_PROFILER;SCR_DM_OptCFiles"
StringPooling="TRUE"
RuntimeLibrary="4"
EnableFunctionLevelLinking="TRUE"
PrecompiledHeaderFile=".\Tmp\Release/Vig.pch"
AssemblerListingLocation=".\Tmp\Release/"
ObjectFile=".\Tmp\Release/"
ProgramDataBaseFileName=".\Tmp\Release/"
WarningLevel="4"
SuppressStartupBanner="TRUE"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
OutputFile="x:\cpa\lib\VIGP5_vr.lib"
SuppressStartupBanner="TRUE"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<File
RelativePath="..\..\Public\Vig\ErrVIG.h">
</File>
<File
RelativePath="..\..\Public\Vig.h">
</File>
<File
RelativePath="..\..\Public\Vig\VIG_Def.h">
</File>
<File
RelativePath="..\..\Public\Vig\VIG_Ver.h">
</File>
<File
RelativePath="Vignette.c">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Retail|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -0,0 +1,856 @@
/*=========================================================================
* Vignette.c : Load and display vignette
* This is a part of the Game project.
*
* Version 1.0
* Creation date 06/06/97
* Revision date
*
* That file needs to be compatible for all platforms.
*
* (c) Ubi Studios 1997
*=======================================================================*/
#pragma warning(disable:4032) /** formal parameter 1 has different type when promoted **/
#pragma warning(disable:4115) /** named type definition in parentheses **/
#pragma warning(disable:4127) /** conditional expression is constant **/
#pragma warning(disable:4201) /** nonstandard extension used : nameless struct/union **/
#pragma warning(disable:4214) /** nonstandard extension used : bit field types other than int **/
#pragma warning(disable:4514) /** unreferenced inline function has been removed **/
/**************************************************************************/
#define D_VIG_Input_VariableDefine
#define HieFriend
#include "ACP_Base.h"
#include "CPA_Expt.h"
#include "CPA_Std.h"
#include "DPT.h"
#include "GMT.h"
#include "GEO.h"
#include "GLI.h"
#include "LST.h"
#include "TMP.h"
#if !defined(U64)
#include "FIL.h"
#include "sna.h"
#endif /* U64 */
#include "VIG_Def.h"
#include "ErrVIG.h"
#include "acp_opfi.h"
extern void GLI_vWrite16bBitmapToBackBuffer( void *, long, long, long, long, long, long );
/**************************************************************************/
#define M_IsTitle (_eAction==SCR_EA_Anl_BeginSection)
#define M_IsEnd (_eAction==SCR_EA_Anl_EndSection)
#define M_IsBegSubSection (_eAction==SCR_EA_Anl_BeginSubSection)
#define M_IsEndSubSection (_eAction==SCR_EA_Anl_EndSubSection)
#define M_IsEntry (_eAction==SCR_EA_Anl_Entry)
#define M_ActionIs(szActionAsked) (!strcmpi(_p_szName,szActionAsked))
#define M_CheckScriptParamNumber(ulNumber) \
{ \
if (SCR_fn_uc_RdL0_GetNumberOfParameters(_ap_szParams)!=ulNumber) \
M_VIGFatalError(E_uwVIGScriptBadNumberOfArg); \
}
#if defined( WIN32 )
#define M_WIN32_WaitDrawSem() WaitForSingleObject(VIG_g_hDrawSem, INFINITE);
#define M_WIN32_ReleaseDrawSem() ReleaseSemaphore(VIG_g_hDrawSem,1, NULL);
#else
#define M_WIN32_WaitDrawSem()
#define M_WIN32_ReleaseDrawSem()
#endif
/**************************************************************************/
GLD_tdhDevice VIG_g_hGLDDevice = 0;
GLD_tdhViewport VIG_g_hGLDViewport = 0;
void * VIG_g_hDrawSem = NULL;
unsigned char *VIG_g_p_ucTmpBuffer = NULL;
#if !defined(U64)
FIL_tdxHandleToConcatFile VIG_g_hConcatVignetteFile = NULL;
#endif /* U64 */
/**************************************************************************/
struct VIG_tdstVignetteStructure_ *fn_p_stCreateVignette(void)
{
struct VIG_tdstVignetteStructure_ *p_stVignette=NULL;
MMG_fn_vAddMemoryInfo (MMG_C_lTypeVignette , MMG_C_lSubTypeVignette , NULL);
p_stVignette = (struct VIG_tdstVignetteStructure_ *)TMP_M_p_Malloc(sizeof(struct VIG_tdstVignetteStructure_));
p_stVignette->p_ucMemoryBuffer = NULL;
p_stVignette->ulMemoryBufferSize = 0;
return(p_stVignette);
}
/**************************************************************************/
void VIG_fn_vFirstInit(void)
{
Erm_M_InitErrMsg(VIG);
}
/**************************************************************************/
void VIG_fn_vInitVignette(void)
{
GLD_tdstViewportAttributes stViewportAttr;
M_WIN32_WaitDrawSem();
FIL_fn_vInitGlobalHandleToFileInConcatFile();
GLD_bGetViewportAttributes ( VIG_g_hGLDDevice, VIG_g_hGLDViewport, &stViewportAttr );
/* VIG_g_stActualVignette.ulMemoryBufferSize = stViewportAttr.dwWidth*stViewportAttr.dwHeight*2; /* a la porcho */
/*VIG_g_stActualVignette.ulMemoryBufferSize = 640 * 480 * 2; /* c'est moi le plus porcho, nanan<61>re ! */
VIG_g_stActualVignette.ulMemoryBufferSize = 640 * 480 * 3; /* je peux faire pire */
MMG_fn_vAddMemoryInfo (MMG_C_lTypeVignette , MMG_C_lSubTypeVignette , NULL);
VIG_g_stActualVignette.p_ucMemoryBuffer = (unsigned char *)TMP_M_p_Malloc(VIG_g_stActualVignette.ulMemoryBufferSize);
VIG_g_stActualVignette.ulWidth = 640; /*stViewportAttr.dwWidth;*/
VIG_g_stActualVignette.ulHeight = 480; /*stViewportAttr.dwHeight;*/
M_WIN32_ReleaseDrawSem();
}
#if !defined(U64)
/**************************************************************************/
void VIG_fn_vOpenBigFileVignette(char *p_szFileName)
{
/* Multi-install and Multi-language Open file */
ACP_M_OPENFILE(FIL_fn_vOpenConcatFile,VIG_g_hConcatVignetteFile,NULL,p_szFileName,(p_szFileName));
}
/**************************************************************************/
void VIG_fn_vCloseBigFileVignette(void)
{
FIL_fn_vCloseConcatFile(&VIG_g_hConcatVignetteFile);
FIL_fn_vFreeGlobalHandleToFileInConcatFile();
}
#endif /* U64 */
/**************************************************************************/
void VIG_fn_vInitDeviceVignette(GLD_tdhDevice _hGLDDevice,GLD_tdhViewport _hGLDViewport, void * _hDrawSem)
{
VIG_g_hGLDDevice = _hGLDDevice;
VIG_g_hGLDViewport = _hGLDViewport;
VIG_g_hDrawSem = _hDrawSem;
}
/**************************************************************************/
void VIG_fn_vRegisterSection(void)
{
#if !defined(U64)
SCR_fn_v_RdL0_RegisterCallback(VIG_C_SectionLoadVignettesDescription,VIG_fn_eScriptCallBackVignettesDescription,SCR_CRC_c_RdL0_ForSection);
#endif /* U64 */
}
/**************************************************************************/
void VIG_fn_vRefreshActualVignette(void)
{
/* if (VIG_g_stActualVignette.bDisplayBar)*/
if (VIG_g_stActualVignette.p_ucMemoryBuffer)
VIG_fn_vDisplayVignette(&VIG_g_stActualVignette);
}
/**************************************************************************/
void VIG_fn_vDisplayVignette(struct VIG_tdstVignetteStructure_ *_p_stVignette)
{
GLD_tdstViewportAttributes stViewportAttr;
if (stricmp(_p_stVignette->szVignetteFileName,VIG_g_stActualVignette.szVignetteFileName))
VIG_fn_vLoadVignetteInStructure(_p_stVignette,_p_stVignette->szVignetteFileName,_p_stVignette->eFormat);
M_WIN32_WaitDrawSem();
GLD_bGetViewportAttributes(VIG_g_hGLDDevice,VIG_g_hGLDViewport,&stViewportAttr);
GLI_vWrite16bBitmapToBackBuffer
(
_p_stVignette->p_ucMemoryBuffer,
_p_stVignette->ulWidth,
_p_stVignette->ulHeight,
stViewportAttr.dwLeftInPixForClip,
stViewportAttr.dwTopInPixForClip,
stViewportAttr.dwRightInPixForClip,
stViewportAttr.dwBottomInPixForClip
);
GLD_bFlipDevice ( VIG_g_hGLDDevice );
M_WIN32_ReleaseDrawSem();
}
/**************************************************************************/
void VIG_fn_vDisplayBarToVignette(struct VIG_tdstVignetteStructure_ *_p_stVignette)
{
unsigned char ucBytesNumber = 0;
GLD_tdstViewportAttributes stViewportAttr;
if (stricmp(_p_stVignette->szVignetteFileName,VIG_g_stActualVignette.szVignetteFileName))
VIG_fn_vLoadVignetteInStructure(_p_stVignette,_p_stVignette->szVignetteFileName,_p_stVignette->eFormat);
switch(_p_stVignette->eFormat)
{
case GLI_EVF_BGR1555_UL:
case GLI_EVF_BGR565_UL:
ucBytesNumber = 2;
break;
case GLI_EVF_RGB888_DL:
ucBytesNumber = 3;
break;
case GLI_EVF_BGRA8888_UL:
ucBytesNumber = 4;
break;
}
if (_p_stVignette->bDisplayBar&&_p_stVignette->ulNewBarValue>_p_stVignette->ulOldBarValue)
{
M_WIN32_WaitDrawSem();
GLD_bGetViewportAttributes(VIG_g_hGLDDevice,VIG_g_hGLDViewport,&stViewportAttr);
GLI_vWrite16bBitmapToBackBuffer
(
_p_stVignette->p_ucMemoryBuffer,
_p_stVignette->ulWidth,
_p_stVignette->ulHeight,
stViewportAttr.dwLeftInPixForClip,
stViewportAttr.dwTopInPixForClip,
stViewportAttr.dwRightInPixForClip,
stViewportAttr.dwBottomInPixForClip
);
GLD_bFlipDevice ( VIG_g_hGLDDevice );
M_WIN32_ReleaseDrawSem();
}
}
/**************************************************************************/
void VIG_fn_vCopyVignetteToBackBuffer(struct VIG_tdstVignetteStructure_ *_p_stVignette)
{
GLD_tdstViewportAttributes stViewportAttr;
if (stricmp(_p_stVignette->szVignetteFileName,VIG_g_stActualVignette.szVignetteFileName))
VIG_fn_vLoadVignetteInStructure(_p_stVignette,_p_stVignette->szVignetteFileName,_p_stVignette->eFormat);
GLD_bGetViewportAttributes(VIG_g_hGLDDevice,VIG_g_hGLDViewport,&stViewportAttr);
GLI_vWrite16bBitmapToBackBuffer
(
_p_stVignette->p_ucMemoryBuffer,
_p_stVignette->ulWidth,
_p_stVignette->ulHeight,
stViewportAttr.dwLeftInPixForClip,
stViewportAttr.dwTopInPixForClip,
stViewportAttr.dwRightInPixForClip,
stViewportAttr.dwBottomInPixForClip
);
}
/**************************************************************************/
void VIG_fn_vSetPointToMemoryBuffer(struct VIG_tdstVignetteStructure_ *_p_stVignette,long _lX,long _lY,struct GEO_tdstColor_ *p_stColor)
{
struct GEO_tdstColor_ stColor;
unsigned char a_ucColor16[2];
GLD_tdpstPixelFormat p_stVignetteFormat;
unsigned short usMonPixel;
unsigned short usRed;
unsigned short usGreen;
unsigned short usBlue;
long lRedSrcShift;
long lGreenSrcShift;
long lBlueSrcShift;
/**** Clipping ****/
if (_lX>=0&&_lX<(long)_p_stVignette->ulWidth&&_lY>=0&&_lY<(long)_p_stVignette->ulHeight)
{
if (_p_stVignette->eFormat==GLI_EVF_BGRA8888_UL)
{
stColor.xR = (GEO_tdxColorValue)(p_stColor->xR*(1-p_stColor->xA)+((GEO_tdxColorValue)_p_stVignette->p_ucMemoryBuffer[4*(_lX+_p_stVignette->ulWidth*_lY)+0]/255.0)*p_stColor->xA);
stColor.xG = (GEO_tdxColorValue)(p_stColor->xG*(1-p_stColor->xA)+((GEO_tdxColorValue)_p_stVignette->p_ucMemoryBuffer[4*(_lX+_p_stVignette->ulWidth*_lY)+1]/255.0)*p_stColor->xA);
stColor.xB = (GEO_tdxColorValue)(p_stColor->xB*(1-p_stColor->xA)+((GEO_tdxColorValue)_p_stVignette->p_ucMemoryBuffer[4*(_lX+_p_stVignette->ulWidth*_lY)+2]/255.0)*p_stColor->xA);
_p_stVignette->p_ucMemoryBuffer[4*(_lX+_p_stVignette->ulWidth*_lY)+0] = (unsigned char)(stColor.xR*255);
_p_stVignette->p_ucMemoryBuffer[4*(_lX+_p_stVignette->ulWidth*_lY)+1] = (unsigned char)(stColor.xG*255);
_p_stVignette->p_ucMemoryBuffer[4*(_lX+_p_stVignette->ulWidth*_lY)+2] = (unsigned char)(stColor.xB*255);
}
else if (_p_stVignette->eFormat==GLI_EVF_BGR565_UL)
{
p_stVignetteFormat = &(_p_stVignette->stVignetteFormat);
lRedSrcShift = 8-p_stVignetteFormat->lRedNbBits;
lGreenSrcShift = 8-p_stVignetteFormat->lGreenNbBits;
lBlueSrcShift = 8-p_stVignetteFormat->lBlueNbBits;
usMonPixel = ((unsigned short *)(_p_stVignette->p_ucMemoryBuffer))[_lX+_p_stVignette->ulWidth*_lY];
usBlue = (unsigned short)((usMonPixel & (unsigned short)(p_stVignetteFormat->ulBlueMask)) >> p_stVignetteFormat->lBlueShift);
usBlue = (unsigned short)(usBlue << lBlueSrcShift);
usGreen = (unsigned short)((usMonPixel & (unsigned short)(p_stVignetteFormat->ulGreenMask)) >> p_stVignetteFormat->lGreenShift);
usGreen = (unsigned short)(usGreen << lGreenSrcShift);
usRed = (unsigned short)((usMonPixel & (unsigned short)(p_stVignetteFormat->ulRedMask)) >> p_stVignetteFormat->lRedShift);
usRed = (unsigned short)(usRed << lRedSrcShift);
stColor.xR = (GEO_tdxColorValue)(255.0*p_stColor->xR*(1.0-p_stColor->xA)+usRed*p_stColor->xA);
stColor.xG = (GEO_tdxColorValue)(255.0*p_stColor->xG*(1.0-p_stColor->xA)+usGreen*p_stColor->xA);
stColor.xB = (GEO_tdxColorValue)(255.0*p_stColor->xB*(1.0-p_stColor->xA)+usBlue*p_stColor->xA);
usBlue = ((unsigned char)(stColor.xB));
usBlue = (unsigned short)(usBlue >> lBlueSrcShift);
usGreen = ((unsigned char)(stColor.xG));
usGreen = (unsigned short)(usGreen >> lGreenSrcShift);
usRed = ((unsigned char)(stColor.xR));
usRed = (unsigned short)(usRed >> lRedSrcShift);
usMonPixel = (unsigned short)((usRed << p_stVignetteFormat->lRedShift)
| (usGreen << p_stVignetteFormat->lGreenShift)
| (usBlue << p_stVignetteFormat->lBlueShift));
((unsigned short *)(_p_stVignette->p_ucMemoryBuffer))[_lX+_p_stVignette->ulWidth*_lY] = usMonPixel;
}
else if (_p_stVignette->eFormat==GLI_EVF_BGR1555_UL)
{
a_ucColor16[0] = _p_stVignette->p_ucMemoryBuffer[2*(_lX+_p_stVignette->ulWidth*_lY)+0];
a_ucColor16[1] = _p_stVignette->p_ucMemoryBuffer[2*(_lX+_p_stVignette->ulWidth*_lY)+1];
stColor.xB = (GEO_tdxColorValue)((GEO_tdxColorValue)(((*((unsigned short*)a_ucColor16))&0x7c00)>>7)/255.0);
stColor.xG = (GEO_tdxColorValue)((GEO_tdxColorValue)(((*((unsigned short*)a_ucColor16))&0x03e0)>>3)/255.0);
stColor.xR = (GEO_tdxColorValue)((GEO_tdxColorValue)(((*((unsigned short*)a_ucColor16))&0x001f)<<3)/255.0);
stColor.xR = (GEO_tdxColorValue)(p_stColor->xR*(1-p_stColor->xA)+stColor.xR*p_stColor->xA);
stColor.xG = (GEO_tdxColorValue)(p_stColor->xG*(1-p_stColor->xA)+stColor.xG*p_stColor->xA);
stColor.xB = (GEO_tdxColorValue)(p_stColor->xB*(1-p_stColor->xA)+stColor.xB*p_stColor->xA);
*((unsigned short*)(a_ucColor16)) = (unsigned short)((((unsigned char)(stColor.xB*255)>>3)<<10)+(((unsigned char)(stColor.xG*255)>>3)<<5)+((unsigned char)(stColor.xR*255)>>3));
_p_stVignette->p_ucMemoryBuffer[2*(_lX+_p_stVignette->ulWidth*_lY)+0] = a_ucColor16[0];
_p_stVignette->p_ucMemoryBuffer[2*(_lX+_p_stVignette->ulWidth*_lY)+1] = a_ucColor16[1];
}
}
}
/**************************************************************************/
void VIG_fn_vAddBarToVignette(struct VIG_tdstVignetteStructure_ *_p_stVignette)
{
unsigned long x,y;
if(VIG_g_stActualVignette.ulMaxBarValue==0)
VIG_g_stActualVignette.ulMaxBarValue = 100;
/**** Fill the inside ****/
for (y=_p_stVignette->ulBarYMinPos;y<=_p_stVignette->ulBarYMaxPos;y++)
for (x=_p_stVignette->ulBarXMinPos;x<=_p_stVignette->ulBarXMaxPos;x++)
VIG_fn_vSetPointToMemoryBuffer(_p_stVignette,x,y,&_p_stVignette->stInsideColor);
/**** Draw the outline ****/
for (x=_p_stVignette->ulBarXMinPos+1;x<=_p_stVignette->ulBarXMaxPos-1;x++)
{
VIG_fn_vSetPointToMemoryBuffer(_p_stVignette,x,_p_stVignette->ulBarYMinPos,&_p_stVignette->stOutsideColor);
VIG_fn_vSetPointToMemoryBuffer(_p_stVignette,x,_p_stVignette->ulBarYMaxPos,&_p_stVignette->stOutsideColor);
}
for (y=_p_stVignette->ulBarYMinPos;y<=_p_stVignette->ulBarYMaxPos;y++)
{
VIG_fn_vSetPointToMemoryBuffer(_p_stVignette,_p_stVignette->ulBarXMinPos,y,&_p_stVignette->stOutsideColor);
VIG_fn_vSetPointToMemoryBuffer(_p_stVignette,_p_stVignette->ulBarXMaxPos,y,&_p_stVignette->stOutsideColor);
}
VIG_fn_vRefreshBarToVignette(&VIG_g_stActualVignette,0,VIG_g_stActualVignette.ulNewBarValue);
}
/**************************************************************************/
void VIG_fn_vRefreshBarToVignette(struct VIG_tdstVignetteStructure_ *_p_stVignette,unsigned long ulXMin,unsigned long ulXMax)
{
struct GEO_tdstColor_ stColor;
unsigned long ulXFactor,ulYFactor;
unsigned long ulDeltaXLeft;
unsigned long ulDeltaXRight;
unsigned long ulDeltaYUp;
unsigned long ulDeltaYDown;
unsigned long x,y;
if (ulXMin<ulXMax)
{
ulXFactor = _p_stVignette->ulBarXMaxPos-_p_stVignette->ulBarXMinPos;
ulYFactor = _p_stVignette->ulBarYMaxPos-_p_stVignette->ulBarYMinPos;
for (y=_p_stVignette->ulBarYMinPos+2;y<=_p_stVignette->ulBarYMaxPos-2;y++)
{
ulDeltaYUp = y - _p_stVignette->ulBarYMinPos;
ulDeltaYDown = _p_stVignette->ulBarYMaxPos - y;
for (x=_p_stVignette->ulBarXMinPos+ulXMin+2;x<=_p_stVignette->ulBarXMinPos+ulXMax+1;x++)
{
ulDeltaXLeft = x - _p_stVignette->ulBarXMinPos;
ulDeltaXRight = _p_stVignette->ulBarXMaxPos - x;
stColor.xR = (GEO_tdxColorValue)(
_p_stVignette->stUpLeftColor.xR*((ulXFactor-ulDeltaXLeft)*(ulYFactor-ulDeltaYUp))/(ulXFactor*ulYFactor)
+_p_stVignette->stUpRightColor.xR*((ulXFactor-ulDeltaXRight)*(ulYFactor-ulDeltaYUp))/(ulXFactor*ulYFactor)
+_p_stVignette->stDownLeftColor.xR*((ulXFactor-ulDeltaXLeft)*(ulYFactor-ulDeltaYDown))/(ulXFactor*ulYFactor)
+_p_stVignette->stDownRightColor.xR*((ulXFactor-ulDeltaXRight)*(ulYFactor-ulDeltaYDown))/(ulXFactor*ulYFactor));
stColor.xG = (GEO_tdxColorValue)(
_p_stVignette->stUpLeftColor.xG*((ulXFactor-ulDeltaXLeft)*(ulYFactor-ulDeltaYUp))/(ulXFactor*ulYFactor)
+_p_stVignette->stUpRightColor.xG*((ulXFactor-ulDeltaXRight)*(ulYFactor-ulDeltaYUp))/(ulXFactor*ulYFactor)
+_p_stVignette->stDownLeftColor.xG*((ulXFactor-ulDeltaXLeft)*(ulYFactor-ulDeltaYDown))/(ulXFactor*ulYFactor)
+_p_stVignette->stDownRightColor.xG*((ulXFactor-ulDeltaXRight)*(ulYFactor-ulDeltaYDown))/(ulXFactor*ulYFactor));
stColor.xB = (GEO_tdxColorValue)(
_p_stVignette->stUpLeftColor.xB*((ulXFactor-ulDeltaXLeft)*(ulYFactor-ulDeltaYUp))/(ulXFactor*ulYFactor)
+_p_stVignette->stUpRightColor.xB*((ulXFactor-ulDeltaXRight)*(ulYFactor-ulDeltaYUp))/(ulXFactor*ulYFactor)
+_p_stVignette->stDownLeftColor.xB*((ulXFactor-ulDeltaXLeft)*(ulYFactor-ulDeltaYDown))/(ulXFactor*ulYFactor)
+_p_stVignette->stDownRightColor.xB*((ulXFactor-ulDeltaXRight)*(ulYFactor-ulDeltaYDown))/(ulXFactor*ulYFactor));
stColor.xA = (GEO_tdxColorValue)(
_p_stVignette->stUpLeftColor.xA*((ulXFactor-ulDeltaXLeft)*(ulYFactor-ulDeltaYUp))/(ulXFactor*ulYFactor)
+_p_stVignette->stUpRightColor.xA*((ulXFactor-ulDeltaXRight)*(ulYFactor-ulDeltaYUp))/(ulXFactor*ulYFactor)
+_p_stVignette->stDownLeftColor.xA*((ulXFactor-ulDeltaXLeft)*(ulYFactor-ulDeltaYDown))/(ulXFactor*ulYFactor)
+_p_stVignette->stDownRightColor.xA*((ulXFactor-ulDeltaXRight)*(ulYFactor-ulDeltaYDown))/(ulXFactor*ulYFactor));
if (x<=_p_stVignette->ulBarXMaxPos-2)
VIG_fn_vSetPointToMemoryBuffer(_p_stVignette,x,y,&stColor);
}
}
}
}
/**************************************************************************/
void VIG_fn_vAddToProgressBar(unsigned long _ulInc)
{
unsigned long ulStep = VIG_g_stActualVignette.ulBarXMaxPos-VIG_g_stActualVignette.ulBarXMinPos-3;
if (VIG_g_stActualVignette.bDisplayBar)
{
VIG_g_stActualVignette.ulActualBarValue += _ulInc;
VIG_g_stActualVignette.ulNewBarValue = (VIG_g_stActualVignette.ulActualBarValue * ulStep)/VIG_g_stActualVignette.ulMaxBarValue;
if (VIG_g_stActualVignette.ulNewBarValue > VIG_g_stActualVignette.ulOldBarValue)
{
if (VIG_g_stActualVignette.ulNewBarValue - VIG_g_stActualVignette.ulOldBarValue > ulStep / 10)
{
VIG_fn_vRefreshBarToVignette(&VIG_g_stActualVignette,VIG_g_stActualVignette.ulOldBarValue,VIG_g_stActualVignette.ulNewBarValue);
VIG_fn_vDisplayBarToVignette(&VIG_g_stActualVignette);
VIG_g_stActualVignette.ulOldBarValue = VIG_g_stActualVignette.ulNewBarValue;
}
}
}
}
/**************************************************************************/
void VIG_fn_vLoadBMPVignette(struct VIG_tdstVignetteStructure_ *_p_stVignette,char *_szFileName,GLI_tdeVignetteFormat _eFormat)
{
#if !defined(U64)
GLD_tdstPixelFormat stDevicePixelFormat;
char szCompleteName[_MAX_PATH];
struct FIL_tdstGF_ stGF;
if (_eFormat!=GLI_EVF_BGRA8888_UL&&_eFormat!=GLI_EVF_BGR565_UL&&_eFormat!=GLI_EVF_BGR1555_UL)
M_VIGFatalError(E_uwVIGBadConvertFormat);
strcpy(szCompleteName,_szFileName);
strcpy(strrchr(szCompleteName,'.'),".gf");
FIL_fn_vLoadGFFromConcatFileWithoutInvertPicture( VIG_g_hConcatVignetteFile, fn_szGetVignettesDataPath(), szCompleteName, &stGF);
if (stGF.p_ucBitMap != NULL)
{
VIG_g_p_ucTmpBuffer = stGF.p_ucBitMap;
#ifndef RETAIL
if ( stGF.stFileHeader.ulWidth!=640 || stGF.stFileHeader.ulHeight!=480 || stGF.stFileHeader.ucBpp!=3 )
M_VIGFatalError(E_uwVIGBadFormatBmp);
}
else
{
unsigned char ucNumberOfBytesInBMPFile;
unsigned long ulWidth,ulHeight;
FIL_fn_vLoadBMPFromConcatFileWithoutInvertPicture(VIG_g_hConcatVignetteFile,fn_szGetVignettesDataPath(),_szFileName,&VIG_g_p_ucTmpBuffer,&ucNumberOfBytesInBMPFile,&ulWidth,&ulHeight);
if (VIG_g_p_ucTmpBuffer==NULL)
M_VIGFatalError(E_uwVIGCantLoadBmp);
if ( ulWidth!=640 ||ulHeight!=480 ||ucNumberOfBytesInBMPFile!=3 )
M_VIGFatalError(E_uwVIGBadFormatBmp);
#endif /* RETAIL */
}
_p_stVignette->p_ucMemoryBuffer = VIG_g_stActualVignette.p_ucMemoryBuffer;
strcpy (VIG_g_stActualVignette.szVignetteFileName, _szFileName);
GLD_vYInvertBitmap24b ( VIG_g_p_ucTmpBuffer, 640, 480 );
GLD_bGetPixelFormatOfDevice ( &stDevicePixelFormat, VIG_g_hGLDDevice, VIG_g_hGLDViewport );
if (stDevicePixelFormat.lPixelNbBits == 32)
{
VIG_g_stActualVignette.eFormat = GLI_EVF_RGB888_DL;
GLD_vSetDefinedPixelFormat ( &(VIG_g_stActualVignette.stVignetteFormat), GLD_C_xB8G8R8PixelFormat );
memcpy( VIG_g_stActualVignette.p_ucMemoryBuffer, VIG_g_p_ucTmpBuffer, VIG_g_stActualVignette.ulMemoryBufferSize );
}
else if (stDevicePixelFormat.lPixelNbBits == 16)
{
if ( ( VIG_g_stActualVignette.ulWidth == 640 ) && ( VIG_g_stActualVignette.ulHeight == 480 ) )
GLD_vBitmapConvert24bTo16bPixelFormat ( (unsigned short *)(VIG_g_stActualVignette.p_ucMemoryBuffer), VIG_g_p_ucTmpBuffer, 640, 480 );
else
GLD_vBitmapConvert24bTo16bPixelFormatAndFiltre ( (unsigned short *)(VIG_g_stActualVignette.p_ucMemoryBuffer), VIG_g_stActualVignette.ulWidth, VIG_g_stActualVignette.ulHeight, VIG_g_p_ucTmpBuffer, 640, 480 );
VIG_g_stActualVignette.eFormat = GLI_EVF_BGR565_UL;
GLD_vSetDefinedPixelFormat ( &(VIG_g_stActualVignette.stVignetteFormat), GLD_C_xB5G6R5PixelFormat );
GLD_vBitmapConvert16bPixelFormat ( &stDevicePixelFormat, &(VIG_g_stActualVignette.stVignetteFormat), (unsigned short *)(VIG_g_stActualVignette.p_ucMemoryBuffer), VIG_g_stActualVignette.ulMemoryBufferSize );
}
GLD_vCopyPixelFormat ( &(VIG_g_stActualVignette.stVignetteFormat), &stDevicePixelFormat );
memcpy(_p_stVignette,&VIG_g_stActualVignette,sizeof(struct VIG_tdstVignetteStructure_));
FIL_fn_vFreeBMP(&VIG_g_p_ucTmpBuffer);
#endif /* U64 */
}
/**************************************************************************/
void VIG_fn_vLoadVignetteInStructure(struct VIG_tdstVignetteStructure_ *_p_stVignette,char *_szFileName,GLI_tdeVignetteFormat _eFormat)
{
VIG_fn_vFreeVignette(_p_stVignette);
VIG_fn_vLoadBMPVignette(_p_stVignette,_szFileName,_eFormat);
}
/**************************************************************************/
void VIG_fn_vPreLoadVignetteInStructure(struct VIG_tdstVignetteStructure_ *_p_stVignette,char *_szFileName,GLI_tdeVignetteFormat _eFormat)
{
if (stricmp(_p_stVignette->szVignetteFileName,_szFileName))
{
VIG_fn_vFreeVignette(_p_stVignette);
strcpy (_p_stVignette->szVignetteFileName, _szFileName);
_p_stVignette->eFormat = _eFormat;
}
}
/**************************************************************************/
void VIG_fn_vFreeVignette(struct VIG_tdstVignetteStructure_ *_p_stVignette) {
_p_stVignette->bDisplayBar = FALSE;
*VIG_g_stActualVignette.szVignetteFileName = 0;
}
/**************************************************************************/
void VIG_fn_vFreeMemoryVignette(struct VIG_tdstVignetteStructure_ *_p_stVignette) {
_p_stVignette->bDisplayBar = FALSE;
MMG_fn_vAddMemoryInfo (MMG_C_lTypeVignette , MMG_C_lSubTypeVignette , NULL);
TMP_M_Free(_p_stVignette->p_ucMemoryBuffer);
*VIG_g_stActualVignette.szVignetteFileName = 0;
}
/**************************************************************************/
#if !defined(U64)
/* Modif CuS 98/08/08 for binarization
* Les initialisations faites lors du parsing doivent etre les memes
* ici et dans SnaNoScr.c (projet SNA).
* Si vous modifiez VIG_fn_eScriptCallBackVignettesDescription
* il faudra aussi modifier SNA_fn_vReadVignetteDescFromFile.
*/
SCR_tde_Anl_ReturnValue VIG_fn_eScriptCallBackVignettesDescription(SCR_tdst_File_Description *_p_stFile,char *_p_szName,char *_ap_szParams[],SCR_tde_Anl_Action _eAction)
{
SCR_tde_Anl_ReturnValue eReturnValue = SCR_ERV_Anl_NormalReturn;
_p_stFile = _p_stFile;
if ( M_IsTitle )
{
#ifndef RETAIL
if ( SNA_M_bTestSaveGameDesc() || SNA_M_bTestSaveLevelDesc() )
SNA_fn_vWriteNoParamEntryToCurrentDscFile( SNA_C_ul_VignetteDescTitle );
#endif
}
else
if (M_IsEntry)
{
if (M_ActionIs("LoadLevelVignette"))
{
strcpy(VIG_g_stActualVignette.szLevelVignetteFileName,_ap_szParams[0]);
VIG_fn_vLoadVignetteInStructure(&VIG_g_stActualVignette,_ap_szParams[0],GLI_EVF_BGR565_UL);
#ifndef RETAIL
if ( SNA_M_bTestSaveLevelDesc() )
SNA_fn_vWriteStringEntryToCurrentDscFile( SNA_C_ul_LoadLevelVignette, _ap_szParams[0] );
#endif
}
else if (M_ActionIs("LoadVignette"))
{
VIG_fn_vFreeVignette(&VIG_g_stActualVignette);
VIG_fn_vLoadVignetteInStructure(&VIG_g_stActualVignette,_ap_szParams[0],GLI_EVF_BGR565_UL);
#ifndef RETAIL
if ( SNA_M_bTestSaveGameDesc() )
SNA_fn_vWriteStringEntryToCurrentDscFile( SNA_C_ul_LoadVignette, _ap_szParams[0] );
#endif
}
else if (M_ActionIs("InitVignette"))
{
VIG_fn_vInitVignette();
#ifndef RETAIL
if ( SNA_M_bTestSaveGameDesc() || SNA_M_bTestSaveLevelDesc() )
SNA_fn_vWriteNoParamEntryToCurrentDscFile( SNA_C_ul_InitVignette );
#endif
}
else if (M_ActionIs("FreeVignette"))
{
/* VIG_fn_vFreeMemoryVignette(&VIG_g_stActualVignette);*/
#ifndef RETAIL
if ( SNA_M_bTestSaveGameDesc() || SNA_M_bTestSaveLevelDesc() )
SNA_fn_vWriteNoParamEntryToCurrentDscFile( SNA_C_ul_FreeVignette );
#endif
}
else if (M_ActionIs("DisplayVignette"))
{
/**** To front buffer ****/
VIG_fn_vDisplayVignette(&VIG_g_stActualVignette);
/**** To back buffer ****/
/*VIG_fn_vDisplayVignette(&VIG_g_stActualVignette);*/
#ifndef RETAIL
if ( SNA_M_bTestSaveGameDesc() || SNA_M_bTestSaveLevelDesc() )
SNA_fn_vWriteNoParamEntryToCurrentDscFile( SNA_C_ul_DisplayVignette );
#endif
}
else if (M_ActionIs("InitBarOutlineColor"))
{
M_CheckScriptParamNumber(4);
VIG_g_stActualVignette.stOutsideColor.xR = (GEO_tdxColorValue)(atof(_ap_szParams[0])/255.0);
VIG_g_stActualVignette.stOutsideColor.xG = (GEO_tdxColorValue)(atof(_ap_szParams[1])/255.0);
VIG_g_stActualVignette.stOutsideColor.xB = (GEO_tdxColorValue)(atof(_ap_szParams[2])/255.0);
VIG_g_stActualVignette.stOutsideColor.xA = (GEO_tdxColorValue)(atof(_ap_szParams[3])/255.0);
#ifndef RETAIL
if ( SNA_M_bTestSaveGameDesc() || SNA_M_bTestSaveLevelDesc() )
{
SNA_fn_vWriteNoParamEntryToCurrentDscFile( SNA_C_ul_InitBarOutlineColor );
SNA_fn_vWriteBlockToCurrentDscFile
(
(char *)&VIG_g_stActualVignette.stOutsideColor,
sizeof( GEO_tdstColor )
);
}
#endif
}
else if (M_ActionIs("InitBarInsideColor"))
{
M_CheckScriptParamNumber(4);
VIG_g_stActualVignette.stInsideColor.xR = (GEO_tdxColorValue)(atof(_ap_szParams[0])/255.0);
VIG_g_stActualVignette.stInsideColor.xG = (GEO_tdxColorValue)(atof(_ap_szParams[1])/255.0);
VIG_g_stActualVignette.stInsideColor.xB = (GEO_tdxColorValue)(atof(_ap_szParams[2])/255.0);
VIG_g_stActualVignette.stInsideColor.xA = (GEO_tdxColorValue)(atof(_ap_szParams[3])/255.0);
#ifndef RETAIL
if ( SNA_M_bTestSaveGameDesc() || SNA_M_bTestSaveLevelDesc() )
{
SNA_fn_vWriteNoParamEntryToCurrentDscFile( SNA_C_ul_InitBarInsideColor );
SNA_fn_vWriteBlockToCurrentDscFile
( (char *)&VIG_g_stActualVignette.stInsideColor, sizeof( GEO_tdstColor ) );
}
#endif
}
else if (M_ActionIs("InitBarColor"))
{
M_CheckScriptParamNumber(4*4);
VIG_g_stActualVignette.stUpLeftColor.xR = (GEO_tdxColorValue)(atof(_ap_szParams[0])/255.0);
VIG_g_stActualVignette.stUpLeftColor.xG = (GEO_tdxColorValue)(atof(_ap_szParams[1])/255.0);
VIG_g_stActualVignette.stUpLeftColor.xB = (GEO_tdxColorValue)(atof(_ap_szParams[2])/255.0);
VIG_g_stActualVignette.stUpLeftColor.xA = (GEO_tdxColorValue)(atof(_ap_szParams[3])/255.0);
VIG_g_stActualVignette.stUpRightColor.xR = (GEO_tdxColorValue)(atof(_ap_szParams[4])/255.0);
VIG_g_stActualVignette.stUpRightColor.xG = (GEO_tdxColorValue)(atof(_ap_szParams[5])/255.0);
VIG_g_stActualVignette.stUpRightColor.xB = (GEO_tdxColorValue)(atof(_ap_szParams[6])/255.0);
VIG_g_stActualVignette.stUpRightColor.xA = (GEO_tdxColorValue)(atof(_ap_szParams[7])/255.0);
VIG_g_stActualVignette.stDownLeftColor.xR = (GEO_tdxColorValue)(atof(_ap_szParams[8])/255.0);
VIG_g_stActualVignette.stDownLeftColor.xG = (GEO_tdxColorValue)(atof(_ap_szParams[9])/255.0);
VIG_g_stActualVignette.stDownLeftColor.xB = (GEO_tdxColorValue)(atof(_ap_szParams[10])/255.0);
VIG_g_stActualVignette.stDownLeftColor.xA = (GEO_tdxColorValue)(atof(_ap_szParams[11])/255.0);
VIG_g_stActualVignette.stDownRightColor.xR = (GEO_tdxColorValue)(atof(_ap_szParams[12])/255.0);
VIG_g_stActualVignette.stDownRightColor.xG = (GEO_tdxColorValue)(atof(_ap_szParams[13])/255.0);
VIG_g_stActualVignette.stDownRightColor.xB = (GEO_tdxColorValue)(atof(_ap_szParams[14])/255.0);
VIG_g_stActualVignette.stDownRightColor.xA = (GEO_tdxColorValue)(atof(_ap_szParams[15])/255.0);
#ifndef RETAIL
if ( SNA_M_bTestSaveGameDesc() || SNA_M_bTestSaveLevelDesc() )
{
SNA_fn_vWriteNoParamEntryToCurrentDscFile( SNA_C_ul_InitBarColor );
SNA_fn_vWriteBlockToCurrentDscFile
( (char *)&VIG_g_stActualVignette.stUpLeftColor, sizeof( GEO_tdstColor ) );
SNA_fn_vWriteBlockToCurrentDscFile
( (char *)&VIG_g_stActualVignette.stUpRightColor, sizeof( GEO_tdstColor ) );
SNA_fn_vWriteBlockToCurrentDscFile
( (char *)&VIG_g_stActualVignette.stDownLeftColor, sizeof( GEO_tdstColor ) );
SNA_fn_vWriteBlockToCurrentDscFile
( (char *)&VIG_g_stActualVignette.stDownRightColor, sizeof( GEO_tdstColor ) );
}
#endif
}
else if (M_ActionIs("CreateBar"))
{
VIG_g_stActualVignette.ulOldBarValue = 0;
VIG_g_stActualVignette.ulNewBarValue = 0;
VIG_g_stActualVignette.ulBarXMinPos = (VIG_g_stActualVignette.ulWidth*atoi(_ap_szParams[0]))/640;
VIG_g_stActualVignette.ulBarYMinPos = (VIG_g_stActualVignette.ulHeight*atoi(_ap_szParams[1]))/480;
VIG_g_stActualVignette.ulBarXMaxPos = (VIG_g_stActualVignette.ulWidth*atoi(_ap_szParams[2]))/640;
VIG_g_stActualVignette.ulBarYMaxPos = (VIG_g_stActualVignette.ulHeight*atoi(_ap_szParams[3]))/480;
#ifndef RETAIL
if ( SNA_M_bTestSaveGameDesc() || SNA_M_bTestSaveLevelDesc() )
{
SNA_fn_vWriteNoParamEntryToCurrentDscFile( SNA_C_ul_CreateBar );
SNA_fn_vWriteLongToCurrentDscFile( atoi(_ap_szParams[0]) );
SNA_fn_vWriteLongToCurrentDscFile( atoi(_ap_szParams[1]) );
SNA_fn_vWriteLongToCurrentDscFile( atoi(_ap_szParams[2]) );
SNA_fn_vWriteLongToCurrentDscFile( atoi(_ap_szParams[3]) );
}
#endif
}
else if (M_ActionIs("AddBar"))
{
VIG_fn_vAddBarToVignette(&VIG_g_stActualVignette);
VIG_g_stActualVignette.bDisplayBar = TRUE;
#ifndef RETAIL
if ( SNA_M_bTestSaveGameDesc() || SNA_M_bTestSaveLevelDesc() )
SNA_fn_vWriteNoParamEntryToCurrentDscFile( SNA_C_ul_AddBar );
#endif
}
else if (M_ActionIs("MaxValueBar"))
{
VIG_g_stActualVignette.ulMaxBarValue = atoi(_ap_szParams[0]);
VIG_g_stActualVignette.ulActualBarValue = 0;
#ifndef RETAIL
if ( SNA_M_bTestSaveGameDesc() || SNA_M_bTestSaveLevelDesc() )
SNA_fn_vWriteLongEntryToCurrentDscFile( SNA_C_ul_MaxValueBar, atoi(_ap_szParams[0]) );
#endif
}
}
else if ( M_IsEnd )
{
#ifndef RETAIL
if ( SNA_M_bTestSaveGameDesc() || SNA_M_bTestSaveLevelDesc() )
SNA_fn_vWriteNoParamEntryToCurrentDscFile( SNA_C_ulEndOfDescSection );
#endif
}
return(eReturnValue);
}
#endif /* U64 */
/**************************************************************************/
void VIG_fn_vConvertAllVignette ( GLD_tdpstPixelFormat p_stDstPixelFormat )
{
GLD_vBitmapConvert16bPixelFormat ( p_stDstPixelFormat, &(VIG_g_stActualVignette.stVignetteFormat), (unsigned short *)(VIG_g_stActualVignette.p_ucMemoryBuffer), VIG_g_stActualVignette.ulMemoryBufferSize );
GLD_vCopyPixelFormat ( &(VIG_g_stActualVignette.stVignetteFormat), p_stDstPixelFormat );
}
/**************************************************************************/
/*
=======================================================================================
Saving progress bar information
=======================================================================================
*/
#if !defined(U64)
void VIG_fn_vSaveProgressBarInfo( struct VIG_tdstVignetteStructure_ *_p_stVignette, char *_szFileName, BOOL _bStandardProgressBar )
{
SCR_tdst_File_Description stFile;
char szText[200];
int hFile;
if (_p_stVignette->ulMaxBarValue == _p_stVignette->ulActualBarValue)
return;
_p_stVignette->ulMaxBarValue = _p_stVignette->ulActualBarValue;
FIL_fn_bValidatePath(".",_szFileName);
hFile = SCR_M_p_x_File_OpenWrite(_szFileName);
if (hFile == -1)
return;
SCR_fn_v_File_InitFileDes(&stFile,_szFileName, hFile);
if(stFile.p_stHandle == NULL)
return;
SCR_M_SvL0_SaveScriptFileHeader(&stFile);
sprintf( szText, "%s:", VIG_C_SectionLoadVignettesDescription );
SCR_M_SvL0_SaveBeginSection( &stFile, szText, SCR_CC_C_Cfg_EOL);
if (_bStandardProgressBar)
{
SCR_M_SvL0_SaveEntry(&stFile,"LoadVignette",SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(&stFile, SCR_EF_SvL0_Normal,1,_p_stVignette->szVignetteFileName);
}
else
{
SCR_M_SvL0_SaveEntry( &stFile, "LoadLevelVignette", SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP( &stFile, SCR_EF_SvL0_Normal, 1, _p_stVignette->szLevelVignetteFileName);
}
SCR_M_SvL0_SaveEntry( &stFile, "InitBarOutlineColor", SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP
(
&stFile, SCR_EF_SvL0_Scanf,5,"%d,%d,%d,%d",
(unsigned char)(_p_stVignette->stOutsideColor.xR*255.0),
(unsigned char)(_p_stVignette->stOutsideColor.xG*255.0),
(unsigned char)(_p_stVignette->stOutsideColor.xB*255.0),
(unsigned char)(_p_stVignette->stOutsideColor.xA*255.0)
);
SCR_M_SvL0_SaveEntry( &stFile, "InitBarInsideColor", SCR_CC_C_Cfg_NoChar );
SCR_fn_v_SvL0_SaveParameters_MP
(
&stFile, SCR_EF_SvL0_Scanf,5,"%d,%d,%d,%d",
(unsigned char)(_p_stVignette->stInsideColor.xR*255.0),
(unsigned char)(_p_stVignette->stInsideColor.xG*255.0),
(unsigned char)(_p_stVignette->stInsideColor.xB*255.0),
(unsigned char)(_p_stVignette->stInsideColor.xA*255.0)
);
SCR_M_SvL0_SaveEntry( &stFile, "InitBarColor", SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP
(
&stFile, SCR_EF_SvL0_Scanf,17,
"%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",
(unsigned char)(_p_stVignette->stUpLeftColor.xR*255.0),
(unsigned char)(_p_stVignette->stUpLeftColor.xG*255.0),
(unsigned char)(_p_stVignette->stUpLeftColor.xB*255.0),
(unsigned char)(_p_stVignette->stUpLeftColor.xA*255.0),
(unsigned char)(_p_stVignette->stUpRightColor.xR*255.0),
(unsigned char)(_p_stVignette->stUpRightColor.xG*255.0),
(unsigned char)(_p_stVignette->stUpRightColor.xB*255.0),
(unsigned char)(_p_stVignette->stUpRightColor.xA*255.0),
(unsigned char)(_p_stVignette->stDownLeftColor.xR*255.0),
(unsigned char)(_p_stVignette->stDownLeftColor.xG*255.0),
(unsigned char)(_p_stVignette->stDownLeftColor.xB*255.0),
(unsigned char)(_p_stVignette->stDownLeftColor.xA*255.0),
(unsigned char)(_p_stVignette->stDownRightColor.xR*255.0),
(unsigned char)(_p_stVignette->stDownRightColor.xG*255.0),
(unsigned char)(_p_stVignette->stDownRightColor.xB*255.0),
(unsigned char)(_p_stVignette->stDownRightColor.xA*255.0)
);
SCR_M_SvL0_SaveEntry( &stFile, "CreateBar", SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP
(
&stFile, SCR_EF_SvL0_Scanf, 5, "%d,%d,%d,%d",
(640*_p_stVignette->ulBarXMinPos)/_p_stVignette->ulWidth,
(480*_p_stVignette->ulBarYMinPos)/_p_stVignette->ulHeight,
(640*_p_stVignette->ulBarXMaxPos)/_p_stVignette->ulWidth,
(480*_p_stVignette->ulBarYMaxPos)/_p_stVignette->ulHeight
);
SCR_M_SvL0_SaveEntry( &stFile, "MaxValueBar", SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP( &stFile, SCR_EF_SvL0_Scanf, 2, "%d", _p_stVignette->ulMaxBarValue);
SCR_M_SvL0_SaveEntry( &stFile, "AddBar", SCR_CC_C_Cfg_EOL);
SCR_M_SvL0_SaveEntry( &stFile, "DisplayVignette", SCR_CC_C_Cfg_EOL);
SCR_M_SvL0_SaveEndSection( &stFile, SCR_CC_C_Cfg_EOL )
SCR_fn_v_File_CloseFileDes( &stFile );
}
void VIG_fn_vSaveProgressBarLevelInfo(struct VIG_tdstVignetteStructure_ *_p_stVignette,char *_szFileName)
{
VIG_fn_vSaveProgressBarInfo( _p_stVignette, _szFileName, FALSE );
}
void VIG_fn_vSaveProgressBarStandardInfo(struct VIG_tdstVignetteStructure_ *_p_stVignette,char *_szFileName)
{
VIG_fn_vSaveProgressBarInfo( _p_stVignette, _szFileName, TRUE );
}
#endif /* U64 */

View File

@@ -0,0 +1,5 @@
SCC = This is a source code control file
[Vig.vcproj]
SCC_Aux_Path = "P4SCC#srvperforce-ma:1666##raymandata##Editor"
SCC_Project_Name = Perforce Project

View File

@@ -0,0 +1,272 @@
/*=========================================================================
* Vignette.c : Load and display vignette (LDT)
* This is a part of the Game project.
*
* (c) Ubi Studios 1998
*=======================================================================*/
/*#define D_VIG_Input_VariableDefine*/
#define HieFriend
#include "ACP_Base.h"
#include "CPA_Expt.h"
#include "CPA_Std.h"
#include "DPT.h"
#include "GMT.h"
#include "GEO.h"
#include "GLI.h"
#include "LST.h"
#include "TMP.h"
#if !defined(U64)
#include "FIL.h"
#include "sna.h"
#endif /* U64 */
#include "VIG_Def.h"
#include "ErrVIG.h"
#include "acp_opfi.h"
#include "ldt.h"
#define lTagLoadLevelVignette 'eLda'
#define lTagLoadVignette 'iVda'
#define lTagInitVignette 'iVti'
#define lTagFreeVignette 'iVee'
#define lTagDisplayVignette 'alps'
#define lTagInitBar 'aBti'
#define lTagInitBarOutlineColor 'ltuO'
#define lTagInitBarInsideColor 'isnI'
#define lTagInitBarColor 'oloC'
#define lTagCreateBar 'etae'
#define lTagAddBar 'raBd'
#define lTagMaxValueBar 'laVx'
#if !defined(U64)
extern FIL_tdxHandleToConcatFile VIG_g_hConcatVignetteFile ;
#endif /* U64 */
extern void VIG_fn_vLoadVignetteInStructure(struct VIG_tdstVignetteStructure_ *_p_stVignette,char *_szFileName,GLI_tdeVignetteFormat _eFormat);
extern void VIG_fn_vDisplayVignette(struct VIG_tdstVignetteStructure_ *_p_stVignette);
extern void VIG_fn_vInitVignette(void);
extern void VIG_fn_vAddBarToVignette(struct VIG_tdstVignetteStructure_ *_p_stVignette);
/*****************************************************************
Function name : fn_iLoadVignette
Description :
Author : Ovidiu Scripa (oscripa@ubisoft.ro) - ROMTEAM
Creation Date : 14-Oct-98
Modified :
Return type : int
Argument : LDT_tdst_Link *pLink
*****************************************************************/
int fn_iLoadVignette( LDT_tdst_Link *pLink )
{
LDT_tdeParseResult result=ParseResult_BeginSection;
if ( SNA_M_bTestSaveGameDesc() || SNA_M_bTestSaveLevelDesc() )
SNA_fn_vWriteNoParamEntryToCurrentDscFile( SNA_C_ul_VignetteDescTitle );
while( result!=ParseResult_EndSection )
{
result=LDT_GetNextEntry();
switch( result )
{
case ParseResult_Entry: /* an entry */
{
char *szEntry=LDT_szGetEntryName();
switch (*(long*)(szEntry+2))
{
case lTagLoadLevelVignette : /* */
{
strcpy(VIG_g_stActualVignette.szLevelVignetteFileName,LDT_szGetParam(1));
VIG_fn_vLoadVignetteInStructure(&VIG_g_stActualVignette,LDT_szGetParam(1),GLI_EVF_BGR565_UL);
if ( SNA_M_bTestSaveLevelDesc() )
SNA_fn_vWriteStringEntryToCurrentDscFile( SNA_C_ul_LoadLevelVignette, LDT_szGetParam(1) );
}
break;
case lTagLoadVignette : /* */
{
VIG_fn_vFreeVignette(&VIG_g_stActualVignette);
VIG_fn_vLoadVignetteInStructure(&VIG_g_stActualVignette,LDT_szGetParam(1),GLI_EVF_BGR565_UL);
if ( SNA_M_bTestSaveGameDesc() )
SNA_fn_vWriteStringEntryToCurrentDscFile( SNA_C_ul_LoadVignette, LDT_szGetParam(1) );
}
break;
case lTagInitVignette : /* */
{
VIG_fn_vInitVignette();
if ( SNA_M_bTestSaveGameDesc() || SNA_M_bTestSaveLevelDesc() )
SNA_fn_vWriteNoParamEntryToCurrentDscFile( SNA_C_ul_InitVignette );
}
break;
case lTagFreeVignette : /* */
{
/* VIG_fn_vFreeMemoryVignette(&VIG_g_stActualVignette);*/
if ( SNA_M_bTestSaveGameDesc() || SNA_M_bTestSaveLevelDesc() )
SNA_fn_vWriteNoParamEntryToCurrentDscFile( SNA_C_ul_FreeVignette );
}
break;
case lTagDisplayVignette : /* */
{
/**** To front buffer ****/
VIG_fn_vDisplayVignette(&VIG_g_stActualVignette);
/**** To back buffer ****/
VIG_fn_vDisplayVignette(&VIG_g_stActualVignette);
if ( SNA_M_bTestSaveGameDesc() || SNA_M_bTestSaveLevelDesc() )
SNA_fn_vWriteNoParamEntryToCurrentDscFile( SNA_C_ul_DisplayVignette );
}
break;
case lTagInitBar : /* */
{
switch (*(long*)(szEntry+7))
{
case lTagInitBarOutlineColor : /* */
{
VIG_g_stActualVignette.stOutsideColor.xR = (GEO_tdxColorValue)(atof(LDT_szGetParam(1))/255.0);
VIG_g_stActualVignette.stOutsideColor.xG = (GEO_tdxColorValue)(atof(LDT_szGetParam(2))/255.0);
VIG_g_stActualVignette.stOutsideColor.xB = (GEO_tdxColorValue)(atof(LDT_szGetParam(3))/255.0);
VIG_g_stActualVignette.stOutsideColor.xA = (GEO_tdxColorValue)(atof(LDT_szGetParam(4))/255.0);
if ( SNA_M_bTestSaveGameDesc() || SNA_M_bTestSaveLevelDesc() )
{
SNA_fn_vWriteNoParamEntryToCurrentDscFile( SNA_C_ul_InitBarOutlineColor );
SNA_fn_vWriteBlockToCurrentDscFile
(
(char *)&VIG_g_stActualVignette.stOutsideColor,
sizeof( GEO_tdstColor )
);
}
}
break;
case lTagInitBarInsideColor : /* */
{
VIG_g_stActualVignette.stInsideColor.xR = (GEO_tdxColorValue)(atof(LDT_szGetParam(1))/255.0);
VIG_g_stActualVignette.stInsideColor.xG = (GEO_tdxColorValue)(atof(LDT_szGetParam(2))/255.0);
VIG_g_stActualVignette.stInsideColor.xB = (GEO_tdxColorValue)(atof(LDT_szGetParam(3))/255.0);
VIG_g_stActualVignette.stInsideColor.xA = (GEO_tdxColorValue)(atof(LDT_szGetParam(4))/255.0);
if ( SNA_M_bTestSaveGameDesc() || SNA_M_bTestSaveLevelDesc() )
{
SNA_fn_vWriteNoParamEntryToCurrentDscFile( SNA_C_ul_InitBarInsideColor );
SNA_fn_vWriteBlockToCurrentDscFile
( (char *)&VIG_g_stActualVignette.stInsideColor, sizeof( GEO_tdstColor ) );
}
}
break;
case lTagInitBarColor : /* */
{
VIG_g_stActualVignette.stUpLeftColor.xR = (GEO_tdxColorValue)(atof(LDT_szGetParam(1))/255.0);
VIG_g_stActualVignette.stUpLeftColor.xG = (GEO_tdxColorValue)(atof(LDT_szGetParam(2))/255.0);
VIG_g_stActualVignette.stUpLeftColor.xB = (GEO_tdxColorValue)(atof(LDT_szGetParam(3))/255.0);
VIG_g_stActualVignette.stUpLeftColor.xA = (GEO_tdxColorValue)(atof(LDT_szGetParam(4))/255.0);
VIG_g_stActualVignette.stUpRightColor.xR = (GEO_tdxColorValue)(atof(LDT_szGetParam(5))/255.0);
VIG_g_stActualVignette.stUpRightColor.xG = (GEO_tdxColorValue)(atof(LDT_szGetParam(6))/255.0);
VIG_g_stActualVignette.stUpRightColor.xB = (GEO_tdxColorValue)(atof(LDT_szGetParam(7))/255.0);
VIG_g_stActualVignette.stUpRightColor.xA = (GEO_tdxColorValue)(atof(LDT_szGetParam(8))/255.0);
VIG_g_stActualVignette.stDownLeftColor.xR = (GEO_tdxColorValue)(atof(LDT_szGetParam(9))/255.0);
VIG_g_stActualVignette.stDownLeftColor.xG = (GEO_tdxColorValue)(atof(LDT_szGetParam(10))/255.0);
VIG_g_stActualVignette.stDownLeftColor.xB = (GEO_tdxColorValue)(atof(LDT_szGetParam(11))/255.0);
VIG_g_stActualVignette.stDownLeftColor.xA = (GEO_tdxColorValue)(atof(LDT_szGetParam(12))/255.0);
VIG_g_stActualVignette.stDownRightColor.xR = (GEO_tdxColorValue)(atof(LDT_szGetParam(13))/255.0);
VIG_g_stActualVignette.stDownRightColor.xG = (GEO_tdxColorValue)(atof(LDT_szGetParam(14))/255.0);
VIG_g_stActualVignette.stDownRightColor.xB = (GEO_tdxColorValue)(atof(LDT_szGetParam(15))/255.0);
VIG_g_stActualVignette.stDownRightColor.xA = (GEO_tdxColorValue)(atof(LDT_szGetParam(16))/255.0);
if ( SNA_M_bTestSaveGameDesc() || SNA_M_bTestSaveLevelDesc() )
{
SNA_fn_vWriteNoParamEntryToCurrentDscFile( SNA_C_ul_InitBarColor );
SNA_fn_vWriteBlockToCurrentDscFile
( (char *)&VIG_g_stActualVignette.stUpLeftColor, sizeof( GEO_tdstColor ) );
SNA_fn_vWriteBlockToCurrentDscFile
( (char *)&VIG_g_stActualVignette.stUpRightColor, sizeof( GEO_tdstColor ) );
SNA_fn_vWriteBlockToCurrentDscFile
( (char *)&VIG_g_stActualVignette.stDownLeftColor, sizeof( GEO_tdstColor ) );
SNA_fn_vWriteBlockToCurrentDscFile
( (char *)&VIG_g_stActualVignette.stDownRightColor, sizeof( GEO_tdstColor ) );
}
}
break;
}
}
break;
case lTagCreateBar : /* */
{
VIG_g_stActualVignette.ulOldBarValue = 0;
VIG_g_stActualVignette.ulNewBarValue = 0;
VIG_g_stActualVignette.ulBarXMinPos = (VIG_g_stActualVignette.ulWidth*atoi(LDT_szGetParam(1)))/640;
VIG_g_stActualVignette.ulBarYMinPos = (VIG_g_stActualVignette.ulHeight*atoi(LDT_szGetParam(2)))/480;
VIG_g_stActualVignette.ulBarXMaxPos = (VIG_g_stActualVignette.ulWidth*atoi(LDT_szGetParam(3)))/640;
VIG_g_stActualVignette.ulBarYMaxPos = (VIG_g_stActualVignette.ulHeight*atoi(LDT_szGetParam(4)))/480;
if ( SNA_M_bTestSaveGameDesc() || SNA_M_bTestSaveLevelDesc() )
{
SNA_fn_vWriteNoParamEntryToCurrentDscFile( SNA_C_ul_CreateBar );
SNA_fn_vWriteLongToCurrentDscFile( atoi(LDT_szGetParam(1)) );
SNA_fn_vWriteLongToCurrentDscFile( atoi(LDT_szGetParam(2)) );
SNA_fn_vWriteLongToCurrentDscFile( atoi(LDT_szGetParam(3)) );
SNA_fn_vWriteLongToCurrentDscFile( atoi(LDT_szGetParam(4)) );
}
}
break;
case lTagAddBar : /* */
{
VIG_fn_vAddBarToVignette(&VIG_g_stActualVignette);
VIG_g_stActualVignette.bDisplayBar = TRUE;
if ( SNA_M_bTestSaveGameDesc() || SNA_M_bTestSaveLevelDesc() )
SNA_fn_vWriteNoParamEntryToCurrentDscFile( SNA_C_ul_AddBar );
}
break;
case lTagMaxValueBar : /* */
{
VIG_g_stActualVignette.ulMaxBarValue = atoi(LDT_szGetParam(1));
VIG_g_stActualVignette.ulActualBarValue = 0;
if ( SNA_M_bTestSaveGameDesc() || SNA_M_bTestSaveLevelDesc() )
SNA_fn_vWriteLongEntryToCurrentDscFile( SNA_C_ul_MaxValueBar, atoi(LDT_szGetParam(1)) );
}
break;
}
}
}
}
if ( SNA_M_bTestSaveGameDesc() || SNA_M_bTestSaveLevelDesc() )
SNA_fn_vWriteNoParamEntryToCurrentDscFile( SNA_C_ulEndOfDescSection );
return 0;
}