mirror of
https://github.com/ENSL/NS.git
synced 2024-11-22 20:51:35 +00:00
Merge pull request #62 from brcaswell/patch-61
Attempts to resolve Travis CI build failures
This commit is contained in:
commit
3e5f3c5c22
22 changed files with 1157 additions and 1142 deletions
38
.travis.yml
38
.travis.yml
|
@ -3,7 +3,25 @@ language: cpp
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- os: linux
|
- os: linux
|
||||||
|
dist: xenial
|
||||||
compiler: gcc
|
compiler: gcc
|
||||||
|
name: "Ubuntu xenial"
|
||||||
|
script: cd main/source/linux && make
|
||||||
|
env: OPJ_CI_ARCH=i386
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- gcc-multilib
|
||||||
|
- g++-multilib
|
||||||
|
- libc6-i386
|
||||||
|
- mesa-common-dev
|
||||||
|
- libcurl4-openssl-dev:i386
|
||||||
|
- libpng12-dev:i386
|
||||||
|
|
||||||
|
- os: linux
|
||||||
|
dist: trusty
|
||||||
|
compiler: gcc
|
||||||
|
name: "Ubuntu trusty"
|
||||||
script: cd main/source/linux && make
|
script: cd main/source/linux && make
|
||||||
env: OPJ_CI_ARCH=i386
|
env: OPJ_CI_ARCH=i386
|
||||||
addons:
|
addons:
|
||||||
|
@ -14,10 +32,28 @@ matrix:
|
||||||
- libc6-i386
|
- libc6-i386
|
||||||
- libcurl4-openssl-dev:i386
|
- libcurl4-openssl-dev:i386
|
||||||
- libpng12-dev:i386
|
- libpng12-dev:i386
|
||||||
|
|
||||||
- os: osx
|
- os: osx
|
||||||
compiler: clang
|
compiler: clang
|
||||||
before_script:
|
before_script:
|
||||||
- export CC=clang
|
- export CC=clang
|
||||||
- export CPLUS=clang++
|
- export CPLUS=clang++
|
||||||
|
- export MACOSX_DEPLOYMENT_TARGET=10.10
|
||||||
script: cd main/source/linux && make
|
script: cd main/source/linux && make
|
||||||
|
|
||||||
|
allow_failures:
|
||||||
|
- os: linux
|
||||||
|
dist: bionic
|
||||||
|
compiler: gcc
|
||||||
|
name: "Ubuntu bionic"
|
||||||
|
script: cd main/source/linux && make
|
||||||
|
env: OPJ_CI_ARCH=i386
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- gcc-multilib
|
||||||
|
- g++-multilib
|
||||||
|
- libc6-i386
|
||||||
|
- mesa-common-dev
|
||||||
|
- libcurl4-openssl-dev
|
||||||
|
- libpng-dev
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
<SccLocalPath />
|
<SccLocalPath />
|
||||||
<SccProvider />
|
<SccProvider />
|
||||||
<ProjectGuid>{665C1DAF-9248-E06F-4E5C-A664BAFDE9D8}</ProjectGuid>
|
<ProjectGuid>{665C1DAF-9248-E06F-4E5C-A664BAFDE9D8}</ProjectGuid>
|
||||||
<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
|
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Playtest|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Playtest|Win32'" Label="Configuration">
|
||||||
|
@ -22,7 +22,7 @@
|
||||||
<UseOfMfc>false</UseOfMfc>
|
<UseOfMfc>false</UseOfMfc>
|
||||||
<UseOfAtl>false</UseOfAtl>
|
<UseOfAtl>false</UseOfAtl>
|
||||||
<CharacterSet>MultiByte</CharacterSet>
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
<PlatformToolset>v141</PlatformToolset>
|
<PlatformToolset>v142</PlatformToolset>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
<ImportGroup Label="ExtensionSettings">
|
<ImportGroup Label="ExtensionSettings">
|
||||||
|
|
|
@ -107,17 +107,6 @@ int EV_TFC_IsAllyTeam( int iTeam1, int iTeam2 );
|
||||||
void LoadData(void* inBuffer, const unsigned char* inData, int inSizeToCopy, int& inSizeVariable);
|
void LoadData(void* inBuffer, const unsigned char* inData, int inSizeToCopy, int& inSizeVariable);
|
||||||
void SaveData(unsigned char* inBuffer, const void* inData, int inSizeToCopy, int& inSizeVariable);
|
void SaveData(unsigned char* inBuffer, const void* inData, int inSizeToCopy, int& inSizeVariable);
|
||||||
|
|
||||||
void Output(const char* szFormat, ...)
|
|
||||||
{
|
|
||||||
char szBuff[1024];
|
|
||||||
va_list arg;
|
|
||||||
va_start(arg, szFormat);
|
|
||||||
_vsnprintf(szBuff, sizeof(szBuff), szFormat, arg);
|
|
||||||
va_end(arg);
|
|
||||||
|
|
||||||
OutputDebugString(szBuff);
|
|
||||||
}
|
|
||||||
|
|
||||||
int ScorePanel_InitializeDemoPlayback(int inSize, unsigned char* inBuffer)
|
int ScorePanel_InitializeDemoPlayback(int inSize, unsigned char* inBuffer)
|
||||||
{
|
{
|
||||||
int theBytesRead = 0;
|
int theBytesRead = 0;
|
||||||
|
@ -398,6 +387,7 @@ ScorePanel::ScorePanel(int x, int y, int wide, int tall) : Panel(x, y, wide, tal
|
||||||
m_pCloseButton->setFont(tfont);
|
m_pCloseButton->setFont(tfont);
|
||||||
m_pCloseButton->setBoundKey( (char)255 );
|
m_pCloseButton->setBoundKey( (char)255 );
|
||||||
m_pCloseButton->setContentAlignment(Label::a_center);
|
m_pCloseButton->setContentAlignment(Label::a_center);
|
||||||
|
|
||||||
Initialize();
|
Initialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1100,9 +1090,6 @@ void ScorePanel::FillGrid()
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
// set Player Color
|
// set Player Color
|
||||||
//Output((to_string(thePlayerId)+ string("\n")).c_str());
|
|
||||||
//ConsolePrint((to_string(thePlayerId)+ string("\n")).c_str());
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
switch (theTeamNumber) {
|
switch (theTeamNumber) {
|
||||||
|
@ -1327,13 +1314,16 @@ void ScorePanel::FillGrid()
|
||||||
pLabel->setFgColorAsImageColor(false);
|
pLabel->setFgColorAsImageColor(false);
|
||||||
|
|
||||||
// Parse color (last 3 bytes are the RGB values 1-9)
|
// Parse color (last 3 bytes are the RGB values 1-9)
|
||||||
string theColor = theCustomIcon.substr( strlen(theCustomIcon.c_str())-3, 3);
|
string theColor = theCustomIcon.substr( strlen(theCustomIcon.c_str()) - 3, 3);
|
||||||
|
|
||||||
|
string rStr = theColor.substr(0, 1);
|
||||||
|
string bStr = theColor.substr(1, 1);
|
||||||
|
string gStr = theColor.substr(2, 1);
|
||||||
|
|
||||||
|
//pass reference type
|
||||||
int theRed = (MakeIntFromString(theColor.substr(0, 1))/9.0f)*255;
|
int theRed = (MakeIntFromString(rStr) / 9.0f) * 255;
|
||||||
int theGreen = (MakeIntFromString(theColor.substr(1, 1))/9.0f)*255;
|
int theGreen = (MakeIntFromString(bStr) / 9.0f) * 255;
|
||||||
int theBlue = (MakeIntFromString(theColor.substr(2, 1))/9.0f)*255;
|
int theBlue = (MakeIntFromString(gStr) / 9.0f) * 255;
|
||||||
|
|
||||||
|
|
||||||
pIcon->setColor(BuildColor(theRed, theGreen, theBlue, gHUD.GetGammaSlope()));
|
pIcon->setColor(BuildColor(theRed, theGreen, theBlue, gHUD.GetGammaSlope()));
|
||||||
|
@ -1364,12 +1354,6 @@ void ScorePanel::FillGrid()
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
/* case COLUMN_PLAYER_COLOR:
|
|
||||||
Preparation for Player Color in own column
|
|
||||||
pLabel->setImage(m_pCYellow);
|
|
||||||
pLabel->setFgColorAsImageColor(false);
|
|
||||||
m_pCYellow->setColor(BuildColor(255, 255, 255, gHUD.GetGammaSlope()));
|
|
||||||
break;*/
|
|
||||||
case COLUMN_SCORE:
|
case COLUMN_SCORE:
|
||||||
if(!theIsForEnemy && theLocalPlayerTeam != TEAM_IND || (gHUD.GetPlayMode() == PLAYMODE_OBSERVER))
|
if(!theIsForEnemy && theLocalPlayerTeam != TEAM_IND || (gHUD.GetPlayMode() == PLAYMODE_OBSERVER))
|
||||||
{
|
{
|
||||||
|
|
Binary file not shown.
BIN
main/source/dlls/Playtest/vc142.idb
Normal file
BIN
main/source/dlls/Playtest/vc142.idb
Normal file
Binary file not shown.
|
@ -26,29 +26,29 @@
|
||||||
<SccLocalPath />
|
<SccLocalPath />
|
||||||
<SccProvider />
|
<SccProvider />
|
||||||
<ProjectGuid>{BC87A180-F17B-83FC-5D7D-470FAD003ABC}</ProjectGuid>
|
<ProjectGuid>{BC87A180-F17B-83FC-5D7D-470FAD003ABC}</ProjectGuid>
|
||||||
<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
|
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Playtest - balance disabled|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Playtest - balance disabled|Win32'" Label="Configuration">
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
<UseOfMfc>false</UseOfMfc>
|
<UseOfMfc>false</UseOfMfc>
|
||||||
<PlatformToolset>v141</PlatformToolset>
|
<PlatformToolset>v142</PlatformToolset>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Playtest|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Playtest|Win32'" Label="Configuration">
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
<UseOfMfc>false</UseOfMfc>
|
<UseOfMfc>false</UseOfMfc>
|
||||||
<CharacterSet>MultiByte</CharacterSet>
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
<PlatformToolset>v141</PlatformToolset>
|
<PlatformToolset>v142</PlatformToolset>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Developer - debug|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Developer - debug|Win32'" Label="Configuration">
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
<UseOfMfc>false</UseOfMfc>
|
<UseOfMfc>false</UseOfMfc>
|
||||||
<PlatformToolset>v141</PlatformToolset>
|
<PlatformToolset>v142</PlatformToolset>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Developer - release|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Developer - release|Win32'" Label="Configuration">
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
<UseOfMfc>false</UseOfMfc>
|
<UseOfMfc>false</UseOfMfc>
|
||||||
<PlatformToolset>v141</PlatformToolset>
|
<PlatformToolset>v142</PlatformToolset>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
<ImportGroup Label="ExtensionSettings">
|
<ImportGroup Label="ExtensionSettings">
|
||||||
|
|
|
@ -49,7 +49,7 @@ ifeq ($(OS),Darwin)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
#SDKROOT ?= $(SDK_DIR)/MacOSX10.6.sdk
|
#SDKROOT ?= $(SDK_DIR)/MacOSX10.6.sdk
|
||||||
SDKROOT ?= $(SDK_DIR)/MacOSX10.8.sdk
|
SDKROOT ?= $(SDK_DIR)/MacOSX10.10.sdk
|
||||||
|
|
||||||
ARCH_FLAGS ?= -arch i386 -m32 -march=prescott -gdwarf-2 -g2 -Wno-typedef-redefinition -momit-leaf-frame-pointer -mtune=core2
|
ARCH_FLAGS ?= -arch i386 -m32 -march=prescott -gdwarf-2 -g2 -Wno-typedef-redefinition -momit-leaf-frame-pointer -mtune=core2
|
||||||
CPP_LIB=-lstdc++ -lpthread
|
CPP_LIB=-lstdc++ -lpthread
|
||||||
|
@ -58,10 +58,10 @@ ifeq ($(OS),Darwin)
|
||||||
AR = libtool -static -o
|
AR = libtool -static -o
|
||||||
endif
|
endif
|
||||||
ifeq ($(origin CC), default)
|
ifeq ($(origin CC), default)
|
||||||
CC ="$(COMPILER_BIN_DIR)/clang -Qunused-arguments -isysroot $(SDKROOT) -mmacosx-version-min=10.5 -fasm-blocks -I$(SDKROOT)/usr/include/malloc $(ARCH_FLAGS)"
|
CC ="$(COMPILER_BIN_DIR)/clang -Qunused-arguments -isysroot $(SDKROOT) -mmacosx-version-min=10.7 -fasm-blocks -I$(SDKROOT)/usr/include/malloc $(ARCH_FLAGS)"
|
||||||
endif
|
endif
|
||||||
ifeq ($(origin CPLUS), default)
|
ifeq ($(origin CPLUS), default)
|
||||||
CPLUS ="$(COMPILER_BIN_DIR)/clang++ -Qunused-arguments -isysroot $(SDKROOT) -mmacosx-version-min=10.5 -fasm-blocks -I$(SDKROOT)/usr/include/malloc $(ARCH_FLAGS)"
|
CPLUS ="$(COMPILER_BIN_DIR)/clang++ -std=c++11 -Qunused-arguments -isysroot $(SDKROOT) -mmacosx-version-min=10.7 -fasm-blocks -I$(SDKROOT)/usr/include/malloc $(ARCH_FLAGS)"
|
||||||
endif
|
endif
|
||||||
LINK ?= $(CPLUS)
|
LINK ?= $(CPLUS)
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -32,14 +32,21 @@ INCLUDEDIRS= -I$(HL_SRC_DIR) -I$(NS_MOD_SRC_DIR) -I$(COMMON_SRC_DIR) -I$(PUBLIC_
|
||||||
|
|
||||||
ifeq ($(OS),Darwin)
|
ifeq ($(OS),Darwin)
|
||||||
LDFLAGS=$(SHLIBLDFLAGS) $(CPP_LIB) -L. libpng12.dylib -lz -framework Carbon -framework OpenGL vgui.dylib -L. -lSDL2-2.0.0 -L. libparticleMP.a
|
LDFLAGS=$(SHLIBLDFLAGS) $(CPP_LIB) -L. libpng12.dylib -lz -framework Carbon -framework OpenGL vgui.dylib -L. -lSDL2-2.0.0 -L. libparticleMP.a
|
||||||
|
DO_CC=$(CPLUS) -std=c++11 -stdlib=libc++ $(INCLUDEDIRS) $(CFLAGS) -o $@ -c $<
|
||||||
|
DO_PUBLIC_CC=$(CPLUS) -std=c++11 -stdlib=libc++ $(COMMON_INCLUDEDIRS) $(CFLAGS) $(SHLIBCFLAGS) -o $@ -c $<
|
||||||
|
DO_COMMON_CC=$(CPLUS) -std=c++11 -stdlib=libc++ $(INCLUDEDIRS) $(CFLAGS) $(SHLIBCFLAGS) -o $@ -c $<
|
||||||
|
DO_PM_SHARED_CC=$(CPLUS) -std=c++11 -stdlib=libc++ $(INCLUDEDIRS) $(CFLAGS) $(SHLIBCFLAGS) -o $@ -c $<
|
||||||
|
|
||||||
else
|
else
|
||||||
LDFLAGS=$(SHLIBLDFLAGS) $(CPP_LIB) -lpng -lz -lfmod-3.75 -L$(CFG) vgui.so -L. libSDL2-2.0.so.0 -L. libparticleMP.a
|
LDFLAGS=$(SHLIBLDFLAGS) $(CPP_LIB) -lpng -lz -lfmod-3.75 -L$(CFG) vgui.so -L. libSDL2-2.0.so.0 -L. libparticleMP.a
|
||||||
endif
|
|
||||||
|
|
||||||
DO_CC=$(CPLUS) $(INCLUDEDIRS) $(CFLAGS) -o $@ -c $<
|
DO_CC=$(CPLUS) $(INCLUDEDIRS) $(CFLAGS) -o $@ -c $<
|
||||||
DO_PUBLIC_CC=$(CPLUS) $(COMMON_INCLUDEDIRS) $(CFLAGS) $(SHLIBCFLAGS) -o $@ -c $<
|
DO_PUBLIC_CC=$(CPLUS) $(COMMON_INCLUDEDIRS) $(CFLAGS) $(SHLIBCFLAGS) -o $@ -c $<
|
||||||
DO_COMMON_CC=$(CPLUS) $(INCLUDEDIRS) $(CFLAGS) $(SHLIBCFLAGS) -o $@ -c $<
|
DO_COMMON_CC=$(CPLUS) $(INCLUDEDIRS) $(CFLAGS) $(SHLIBCFLAGS) -o $@ -c $<
|
||||||
DO_PM_SHARED_CC=$(CPLUS) $(INCLUDEDIRS) $(CFLAGS) $(SHLIBCFLAGS) -o $@ -c $<
|
DO_PM_SHARED_CC=$(CPLUS) $(INCLUDEDIRS) $(CFLAGS) $(SHLIBCFLAGS) -o $@ -c $<
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
HL1_OBJS = \
|
HL1_OBJS = \
|
||||||
|
|
|
@ -8,11 +8,11 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//#include <GL/gl.h>
|
//#include <GL/gl.h>
|
||||||
#include "common/triangleapi.h"
|
#include "../common/triangleapi.h"
|
||||||
#include "cl_dll/wrect.h"
|
#include "../cl_dll/wrect.h"
|
||||||
#include "cl_dll/cl_dll.h"
|
#include "../cl_dll/cl_dll.h"
|
||||||
#include "common/renderingconst.h"
|
#include "../common/renderingconst.h"
|
||||||
#include "particles/papi.h"
|
#include "papi.h"
|
||||||
|
|
||||||
// XXX #include <iostream.h>
|
// XXX #include <iostream.h>
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#
|
#
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
C++ = g++ -m32
|
C++ = g++ -std=c++11 -m32
|
||||||
|
|
||||||
GLUT_HOME =/usr/local/contrib/unmoderated
|
GLUT_HOME =/usr/local/contrib/unmoderated
|
||||||
|
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
#v4.0:v100
|
|
||||||
Release|Win32|C:\Users\fabian\Downloads\NS\main\source\particles\|
|
|
Binary file not shown.
|
@ -7,7 +7,7 @@
|
||||||
// added to an action list.
|
// added to an action list.
|
||||||
|
|
||||||
#include "general.h"
|
#include "general.h"
|
||||||
#include "particles/papi.h"
|
#include "papi.h"
|
||||||
|
|
||||||
extern void _pAddActionToList(ParticleAction *S, int size);
|
extern void _pAddActionToList(ParticleAction *S, int size);
|
||||||
extern void _pCallActionList(ParticleAction *pa, int num_actions,
|
extern void _pCallActionList(ParticleAction *pa, int num_actions,
|
||||||
|
@ -33,12 +33,13 @@ void _pSendAction(ParticleAction *S, PActionEnum type, int size)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PARTICLEDLL_API void pAvoid(float magnitude, float epsilon, float look_ahead,
|
extern "C" {
|
||||||
|
void pAvoid(float magnitude, float epsilon, float look_ahead,
|
||||||
PDomainEnum dtype,
|
PDomainEnum dtype,
|
||||||
float a0, float a1, float a2,
|
float a0, float a1, float a2,
|
||||||
float a3, float a4, float a5,
|
float a3, float a4, float a5,
|
||||||
float a6, float a7, float a8)
|
float a6, float a7, float a8)
|
||||||
{
|
{
|
||||||
PAAvoid S;
|
PAAvoid S;
|
||||||
|
|
||||||
S.position = pDomain(dtype, a0, a1, a2, a3, a4, a5, a6, a7, a8);
|
S.position = pDomain(dtype, a0, a1, a2, a3, a4, a5, a6, a7, a8);
|
||||||
|
@ -47,14 +48,14 @@ PARTICLEDLL_API void pAvoid(float magnitude, float epsilon, float look_ahead,
|
||||||
S.look_ahead = look_ahead;
|
S.look_ahead = look_ahead;
|
||||||
|
|
||||||
_pSendAction(&S, PAAvoidID, sizeof(PAAvoid));
|
_pSendAction(&S, PAAvoidID, sizeof(PAAvoid));
|
||||||
}
|
}
|
||||||
|
|
||||||
PARTICLEDLL_API void pBounce(float friction, float resilience, float cutoff,
|
void pBounce(float friction, float resilience, float cutoff,
|
||||||
PDomainEnum dtype,
|
PDomainEnum dtype,
|
||||||
float a0, float a1, float a2,
|
float a0, float a1, float a2,
|
||||||
float a3, float a4, float a5,
|
float a3, float a4, float a5,
|
||||||
float a6, float a7, float a8)
|
float a6, float a7, float a8)
|
||||||
{
|
{
|
||||||
PABounce S;
|
PABounce S;
|
||||||
|
|
||||||
S.position = pDomain(dtype, a0, a1, a2, a3, a4, a5, a6, a7, a8);
|
S.position = pDomain(dtype, a0, a1, a2, a3, a4, a5, a6, a7, a8);
|
||||||
|
@ -63,21 +64,21 @@ PARTICLEDLL_API void pBounce(float friction, float resilience, float cutoff,
|
||||||
S.cutoffSqr = fsqr(cutoff);
|
S.cutoffSqr = fsqr(cutoff);
|
||||||
|
|
||||||
_pSendAction(&S, PABounceID, sizeof(PABounce));
|
_pSendAction(&S, PABounceID, sizeof(PABounce));
|
||||||
}
|
}
|
||||||
|
|
||||||
PARTICLEDLL_API void pCopyVertexB(bool copy_pos, bool copy_vel)
|
void pCopyVertexB(bool copy_pos, bool copy_vel)
|
||||||
{
|
{
|
||||||
PACopyVertexB S;
|
PACopyVertexB S;
|
||||||
|
|
||||||
S.copy_pos = copy_pos;
|
S.copy_pos = copy_pos;
|
||||||
S.copy_vel = copy_vel;
|
S.copy_vel = copy_vel;
|
||||||
|
|
||||||
_pSendAction(&S, PACopyVertexBID, sizeof(PACopyVertexB));
|
_pSendAction(&S, PACopyVertexBID, sizeof(PACopyVertexB));
|
||||||
}
|
}
|
||||||
|
|
||||||
PARTICLEDLL_API void pDamping(float damping_x, float damping_y, float damping_z,
|
void pDamping(float damping_x, float damping_y, float damping_z,
|
||||||
float vlow, float vhigh)
|
float vlow, float vhigh)
|
||||||
{
|
{
|
||||||
PADamping S;
|
PADamping S;
|
||||||
|
|
||||||
S.damping = pVector(damping_x, damping_y, damping_z);
|
S.damping = pVector(damping_x, damping_y, damping_z);
|
||||||
|
@ -85,11 +86,11 @@ PARTICLEDLL_API void pDamping(float damping_x, float damping_y, float damping_z,
|
||||||
S.vhighSqr = fsqr(vhigh);
|
S.vhighSqr = fsqr(vhigh);
|
||||||
|
|
||||||
_pSendAction(&S, PADampingID, sizeof(PADamping));
|
_pSendAction(&S, PADampingID, sizeof(PADamping));
|
||||||
}
|
}
|
||||||
|
|
||||||
PARTICLEDLL_API void pExplosion(float center_x, float center_y, float center_z, float velocity,
|
void pExplosion(float center_x, float center_y, float center_z, float velocity,
|
||||||
float magnitude, float stdev, float epsilon, float age)
|
float magnitude, float stdev, float epsilon, float age)
|
||||||
{
|
{
|
||||||
PAExplosion S;
|
PAExplosion S;
|
||||||
|
|
||||||
S.center = pVector(center_x, center_y, center_z);
|
S.center = pVector(center_x, center_y, center_z);
|
||||||
|
@ -99,14 +100,14 @@ PARTICLEDLL_API void pExplosion(float center_x, float center_y, float center_z,
|
||||||
S.epsilon = epsilon;
|
S.epsilon = epsilon;
|
||||||
S.age = age;
|
S.age = age;
|
||||||
|
|
||||||
if(S.epsilon < 0.0f)
|
if (S.epsilon < 0.0f)
|
||||||
S.epsilon = P_EPS;
|
S.epsilon = P_EPS;
|
||||||
|
|
||||||
_pSendAction(&S, PAExplosionID, sizeof(PAExplosion));
|
_pSendAction(&S, PAExplosionID, sizeof(PAExplosion));
|
||||||
}
|
}
|
||||||
|
|
||||||
PARTICLEDLL_API void pFollow(float magnitude, float epsilon, float max_radius)
|
void pFollow(float magnitude, float epsilon, float max_radius)
|
||||||
{
|
{
|
||||||
PAFollow S;
|
PAFollow S;
|
||||||
|
|
||||||
S.magnitude = magnitude;
|
S.magnitude = magnitude;
|
||||||
|
@ -114,10 +115,10 @@ PARTICLEDLL_API void pFollow(float magnitude, float epsilon, float max_radius)
|
||||||
S.max_radius = max_radius;
|
S.max_radius = max_radius;
|
||||||
|
|
||||||
_pSendAction(&S, PAFollowID, sizeof(PAFollow));
|
_pSendAction(&S, PAFollowID, sizeof(PAFollow));
|
||||||
}
|
}
|
||||||
|
|
||||||
PARTICLEDLL_API void pGravitate(float magnitude, float epsilon, float max_radius)
|
void pGravitate(float magnitude, float epsilon, float max_radius)
|
||||||
{
|
{
|
||||||
PAGravitate S;
|
PAGravitate S;
|
||||||
|
|
||||||
S.magnitude = magnitude;
|
S.magnitude = magnitude;
|
||||||
|
@ -125,21 +126,21 @@ PARTICLEDLL_API void pGravitate(float magnitude, float epsilon, float max_radius
|
||||||
S.max_radius = max_radius;
|
S.max_radius = max_radius;
|
||||||
|
|
||||||
_pSendAction(&S, PAGravitateID, sizeof(PAGravitate));
|
_pSendAction(&S, PAGravitateID, sizeof(PAGravitate));
|
||||||
}
|
}
|
||||||
|
|
||||||
PARTICLEDLL_API void pGravity(float dir_x, float dir_y, float dir_z)
|
void pGravity(float dir_x, float dir_y, float dir_z)
|
||||||
{
|
{
|
||||||
PAGravity S;
|
PAGravity S;
|
||||||
|
|
||||||
S.direction = pVector(dir_x, dir_y, dir_z);
|
S.direction = pVector(dir_x, dir_y, dir_z);
|
||||||
|
|
||||||
_pSendAction(&S, PAGravityID, sizeof(PAGravity));
|
_pSendAction(&S, PAGravityID, sizeof(PAGravity));
|
||||||
}
|
}
|
||||||
|
|
||||||
PARTICLEDLL_API void pJet(float center_x, float center_y, float center_z,
|
void pJet(float center_x, float center_y, float center_z,
|
||||||
float magnitude, float epsilon, float max_radius)
|
float magnitude, float epsilon, float max_radius)
|
||||||
{
|
{
|
||||||
_ParticleState &_ps = _GetPState();
|
_ParticleState& _ps = _GetPState();
|
||||||
|
|
||||||
PAJet S;
|
PAJet S;
|
||||||
|
|
||||||
|
@ -150,20 +151,20 @@ PARTICLEDLL_API void pJet(float center_x, float center_y, float center_z,
|
||||||
S.max_radius = max_radius;
|
S.max_radius = max_radius;
|
||||||
|
|
||||||
_pSendAction(&S, PAJetID, sizeof(PAJet));
|
_pSendAction(&S, PAJetID, sizeof(PAJet));
|
||||||
}
|
}
|
||||||
|
|
||||||
PARTICLEDLL_API void pKillOld(float age_limit, bool kill_less_than)
|
void pKillOld(float age_limit, bool kill_less_than)
|
||||||
{
|
{
|
||||||
PAKillOld S;
|
PAKillOld S;
|
||||||
|
|
||||||
S.age_limit = age_limit;
|
S.age_limit = age_limit;
|
||||||
S.kill_less_than = kill_less_than;
|
S.kill_less_than = kill_less_than;
|
||||||
|
|
||||||
_pSendAction(&S, PAKillOldID, sizeof(PAKillOld));
|
_pSendAction(&S, PAKillOldID, sizeof(PAKillOld));
|
||||||
}
|
}
|
||||||
|
|
||||||
PARTICLEDLL_API void pMatchVelocity(float magnitude, float epsilon, float max_radius)
|
void pMatchVelocity(float magnitude, float epsilon, float max_radius)
|
||||||
{
|
{
|
||||||
PAMatchVelocity S;
|
PAMatchVelocity S;
|
||||||
|
|
||||||
S.magnitude = magnitude;
|
S.magnitude = magnitude;
|
||||||
|
@ -171,19 +172,19 @@ PARTICLEDLL_API void pMatchVelocity(float magnitude, float epsilon, float max_ra
|
||||||
S.max_radius = max_radius;
|
S.max_radius = max_radius;
|
||||||
|
|
||||||
_pSendAction(&S, PAMatchVelocityID, sizeof(PAMatchVelocity));
|
_pSendAction(&S, PAMatchVelocityID, sizeof(PAMatchVelocity));
|
||||||
}
|
}
|
||||||
|
|
||||||
PARTICLEDLL_API void pMove()
|
void pMove()
|
||||||
{
|
{
|
||||||
PAMove S;
|
PAMove S;
|
||||||
|
|
||||||
_pSendAction(&S, PAMoveID, sizeof(PAMove));
|
_pSendAction(&S, PAMoveID, sizeof(PAMove));
|
||||||
}
|
}
|
||||||
|
|
||||||
PARTICLEDLL_API void pOrbitLine(float p_x, float p_y, float p_z,
|
void pOrbitLine(float p_x, float p_y, float p_z,
|
||||||
float axis_x, float axis_y, float axis_z,
|
float axis_x, float axis_y, float axis_z,
|
||||||
float magnitude, float epsilon, float max_radius)
|
float magnitude, float epsilon, float max_radius)
|
||||||
{
|
{
|
||||||
PAOrbitLine S;
|
PAOrbitLine S;
|
||||||
|
|
||||||
S.p = pVector(p_x, p_y, p_z);
|
S.p = pVector(p_x, p_y, p_z);
|
||||||
|
@ -194,11 +195,11 @@ PARTICLEDLL_API void pOrbitLine(float p_x, float p_y, float p_z,
|
||||||
S.max_radius = max_radius;
|
S.max_radius = max_radius;
|
||||||
|
|
||||||
_pSendAction(&S, PAOrbitLineID, sizeof(PAOrbitLine));
|
_pSendAction(&S, PAOrbitLineID, sizeof(PAOrbitLine));
|
||||||
}
|
}
|
||||||
|
|
||||||
PARTICLEDLL_API void pOrbitPoint(float center_x, float center_y, float center_z,
|
void pOrbitPoint(float center_x, float center_y, float center_z,
|
||||||
float magnitude, float epsilon, float max_radius)
|
float magnitude, float epsilon, float max_radius)
|
||||||
{
|
{
|
||||||
PAOrbitPoint S;
|
PAOrbitPoint S;
|
||||||
|
|
||||||
S.center = pVector(center_x, center_y, center_z);
|
S.center = pVector(center_x, center_y, center_z);
|
||||||
|
@ -207,85 +208,85 @@ PARTICLEDLL_API void pOrbitPoint(float center_x, float center_y, float center_z,
|
||||||
S.max_radius = max_radius;
|
S.max_radius = max_radius;
|
||||||
|
|
||||||
_pSendAction(&S, PAOrbitPointID, sizeof(PAOrbitPoint));
|
_pSendAction(&S, PAOrbitPointID, sizeof(PAOrbitPoint));
|
||||||
}
|
}
|
||||||
|
|
||||||
PARTICLEDLL_API void pRandomAccel(PDomainEnum dtype,
|
void pRandomAccel(PDomainEnum dtype,
|
||||||
float a0, float a1, float a2,
|
float a0, float a1, float a2,
|
||||||
float a3, float a4, float a5,
|
float a3, float a4, float a5,
|
||||||
float a6, float a7, float a8)
|
float a6, float a7, float a8)
|
||||||
{
|
{
|
||||||
PARandomAccel S;
|
PARandomAccel S;
|
||||||
|
|
||||||
S.gen_acc = pDomain(dtype, a0, a1, a2, a3, a4, a5, a6, a7, a8);
|
S.gen_acc = pDomain(dtype, a0, a1, a2, a3, a4, a5, a6, a7, a8);
|
||||||
|
|
||||||
_pSendAction(&S, PARandomAccelID, sizeof(PARandomAccel));
|
_pSendAction(&S, PARandomAccelID, sizeof(PARandomAccel));
|
||||||
}
|
}
|
||||||
|
|
||||||
PARTICLEDLL_API void pRandomDisplace(PDomainEnum dtype,
|
void pRandomDisplace(PDomainEnum dtype,
|
||||||
float a0, float a1, float a2,
|
float a0, float a1, float a2,
|
||||||
float a3, float a4, float a5,
|
float a3, float a4, float a5,
|
||||||
float a6, float a7, float a8)
|
float a6, float a7, float a8)
|
||||||
{
|
{
|
||||||
PARandomDisplace S;
|
PARandomDisplace S;
|
||||||
|
|
||||||
S.gen_disp = pDomain(dtype, a0, a1, a2, a3, a4, a5, a6, a7, a8);
|
S.gen_disp = pDomain(dtype, a0, a1, a2, a3, a4, a5, a6, a7, a8);
|
||||||
|
|
||||||
_pSendAction(&S, PARandomDisplaceID, sizeof(PARandomDisplace));
|
_pSendAction(&S, PARandomDisplaceID, sizeof(PARandomDisplace));
|
||||||
}
|
}
|
||||||
|
|
||||||
PARTICLEDLL_API void pRandomVelocity(PDomainEnum dtype,
|
void pRandomVelocity(PDomainEnum dtype,
|
||||||
float a0, float a1, float a2,
|
float a0, float a1, float a2,
|
||||||
float a3, float a4, float a5,
|
float a3, float a4, float a5,
|
||||||
float a6, float a7, float a8)
|
float a6, float a7, float a8)
|
||||||
{
|
{
|
||||||
PARandomVelocity S;
|
PARandomVelocity S;
|
||||||
|
|
||||||
S.gen_vel = pDomain(dtype, a0, a1, a2, a3, a4, a5, a6, a7, a8);
|
S.gen_vel = pDomain(dtype, a0, a1, a2, a3, a4, a5, a6, a7, a8);
|
||||||
|
|
||||||
_pSendAction(&S, PARandomVelocityID, sizeof(PARandomVelocity));
|
_pSendAction(&S, PARandomVelocityID, sizeof(PARandomVelocity));
|
||||||
}
|
}
|
||||||
|
|
||||||
PARTICLEDLL_API void pRestore(float time_left)
|
void pRestore(float time_left)
|
||||||
{
|
{
|
||||||
PARestore S;
|
PARestore S;
|
||||||
|
|
||||||
S.time_left = time_left;
|
S.time_left = time_left;
|
||||||
|
|
||||||
_pSendAction(&S, PARestoreID, sizeof(PARestore));
|
_pSendAction(&S, PARestoreID, sizeof(PARestore));
|
||||||
}
|
}
|
||||||
|
|
||||||
PARTICLEDLL_API void pSink(bool kill_inside, PDomainEnum dtype,
|
void pSink(bool kill_inside, PDomainEnum dtype,
|
||||||
float a0, float a1, float a2,
|
float a0, float a1, float a2,
|
||||||
float a3, float a4, float a5,
|
float a3, float a4, float a5,
|
||||||
float a6, float a7, float a8)
|
float a6, float a7, float a8)
|
||||||
{
|
{
|
||||||
PASink S;
|
PASink S;
|
||||||
|
|
||||||
S.kill_inside = kill_inside;
|
S.kill_inside = kill_inside;
|
||||||
S.position = pDomain(dtype, a0, a1, a2, a3, a4, a5, a6, a7, a8);
|
S.position = pDomain(dtype, a0, a1, a2, a3, a4, a5, a6, a7, a8);
|
||||||
|
|
||||||
_pSendAction(&S, PASinkID, sizeof(PASink));
|
_pSendAction(&S, PASinkID, sizeof(PASink));
|
||||||
}
|
}
|
||||||
|
|
||||||
PARTICLEDLL_API void pSinkVelocity(bool kill_inside, PDomainEnum dtype,
|
void pSinkVelocity(bool kill_inside, PDomainEnum dtype,
|
||||||
float a0, float a1, float a2,
|
float a0, float a1, float a2,
|
||||||
float a3, float a4, float a5,
|
float a3, float a4, float a5,
|
||||||
float a6, float a7, float a8)
|
float a6, float a7, float a8)
|
||||||
{
|
{
|
||||||
PASinkVelocity S;
|
PASinkVelocity S;
|
||||||
|
|
||||||
S.kill_inside = kill_inside;
|
S.kill_inside = kill_inside;
|
||||||
S.velocity = pDomain(dtype, a0, a1, a2, a3, a4, a5, a6, a7, a8);
|
S.velocity = pDomain(dtype, a0, a1, a2, a3, a4, a5, a6, a7, a8);
|
||||||
|
|
||||||
_pSendAction(&S, PASinkVelocityID, sizeof(PASinkVelocity));
|
_pSendAction(&S, PASinkVelocityID, sizeof(PASinkVelocity));
|
||||||
}
|
}
|
||||||
|
|
||||||
PARTICLEDLL_API void pSource(float particle_rate, PDomainEnum dtype,
|
void pSource(float particle_rate, PDomainEnum dtype,
|
||||||
float a0, float a1, float a2,
|
float a0, float a1, float a2,
|
||||||
float a3, float a4, float a5,
|
float a3, float a4, float a5,
|
||||||
float a6, float a7, float a8)
|
float a6, float a7, float a8)
|
||||||
{
|
{
|
||||||
_ParticleState &_ps = _GetPState();
|
_ParticleState& _ps = _GetPState();
|
||||||
|
|
||||||
PASource S;
|
PASource S;
|
||||||
|
|
||||||
|
@ -301,21 +302,21 @@ PARTICLEDLL_API void pSource(float particle_rate, PDomainEnum dtype,
|
||||||
S.vertexB_tracks = _ps.vertexB_tracks;
|
S.vertexB_tracks = _ps.vertexB_tracks;
|
||||||
|
|
||||||
_pSendAction(&S, PASourceID, sizeof(PASource));
|
_pSendAction(&S, PASourceID, sizeof(PASource));
|
||||||
}
|
}
|
||||||
|
|
||||||
PARTICLEDLL_API void pSpeedLimit(float min_speed, float max_speed)
|
void pSpeedLimit(float min_speed, float max_speed)
|
||||||
{
|
{
|
||||||
PASpeedLimit S;
|
PASpeedLimit S;
|
||||||
|
|
||||||
S.min_speed = min_speed;
|
S.min_speed = min_speed;
|
||||||
S.max_speed = max_speed;
|
S.max_speed = max_speed;
|
||||||
|
|
||||||
_pSendAction(&S, PASpeedLimitID, sizeof(PASpeedLimit));
|
_pSendAction(&S, PASpeedLimitID, sizeof(PASpeedLimit));
|
||||||
}
|
}
|
||||||
|
|
||||||
PARTICLEDLL_API void pTargetColor(float color_x, float color_y, float color_z,
|
void pTargetColor(float color_x, float color_y, float color_z,
|
||||||
float alpha, float scale)
|
float alpha, float scale)
|
||||||
{
|
{
|
||||||
PATargetColor S;
|
PATargetColor S;
|
||||||
|
|
||||||
S.color = pVector(color_x, color_y, color_z);
|
S.color = pVector(color_x, color_y, color_z);
|
||||||
|
@ -323,48 +324,48 @@ PARTICLEDLL_API void pTargetColor(float color_x, float color_y, float color_z,
|
||||||
S.scale = scale;
|
S.scale = scale;
|
||||||
|
|
||||||
_pSendAction(&S, PATargetColorID, sizeof(PATargetColor));
|
_pSendAction(&S, PATargetColorID, sizeof(PATargetColor));
|
||||||
}
|
}
|
||||||
|
|
||||||
PARTICLEDLL_API void pTargetSize(float size_x, float size_y, float size_z,
|
void pTargetSize(float size_x, float size_y, float size_z,
|
||||||
float scale_x, float scale_y, float scale_z)
|
float scale_x, float scale_y, float scale_z)
|
||||||
{
|
{
|
||||||
PATargetSize S;
|
PATargetSize S;
|
||||||
|
|
||||||
S.size = pVector(size_x, size_y, size_z);
|
S.size = pVector(size_x, size_y, size_z);
|
||||||
S.scale = pVector(scale_x, scale_y, scale_z);
|
S.scale = pVector(scale_x, scale_y, scale_z);
|
||||||
|
|
||||||
_pSendAction(&S, PATargetSizeID, sizeof(PATargetSize));
|
_pSendAction(&S, PATargetSizeID, sizeof(PATargetSize));
|
||||||
}
|
}
|
||||||
|
|
||||||
PARTICLEDLL_API void pTargetVelocity(float vel_x, float vel_y, float vel_z, float scale)
|
void pTargetVelocity(float vel_x, float vel_y, float vel_z, float scale)
|
||||||
{
|
{
|
||||||
PATargetVelocity S;
|
PATargetVelocity S;
|
||||||
|
|
||||||
S.velocity = pVector(vel_x, vel_y, vel_z);
|
S.velocity = pVector(vel_x, vel_y, vel_z);
|
||||||
S.scale = scale;
|
S.scale = scale;
|
||||||
|
|
||||||
_pSendAction(&S, PATargetVelocityID, sizeof(PATargetVelocity));
|
_pSendAction(&S, PATargetVelocityID, sizeof(PATargetVelocity));
|
||||||
}
|
}
|
||||||
|
|
||||||
// If in immediate mode, quickly add a vertex.
|
// If in immediate mode, quickly add a vertex.
|
||||||
// If building an action list, call pSource.
|
// If building an action list, call pSource.
|
||||||
PARTICLEDLL_API void pVertex(float x, float y, float z)
|
void pVertex(float x, float y, float z)
|
||||||
{
|
{
|
||||||
_ParticleState &_ps = _GetPState();
|
_ParticleState& _ps = _GetPState();
|
||||||
|
|
||||||
if(_ps.in_new_list)
|
if (_ps.in_new_list)
|
||||||
{
|
{
|
||||||
pSource(1, PDPoint, x, y, z);
|
pSource(1, PDPoint, x, y, z);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Immediate mode. Quickly add the vertex.
|
// Immediate mode. Quickly add the vertex.
|
||||||
if(_ps.pgrp == NULL)
|
if (_ps.pgrp == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
pVector pos(x, y, z);
|
pVector pos(x, y, z);
|
||||||
pVector siz, vel, col, posB;
|
pVector siz, vel, col, posB;
|
||||||
if(_ps.vertexB_tracks)
|
if (_ps.vertexB_tracks)
|
||||||
posB = pos;
|
posB = pos;
|
||||||
else
|
else
|
||||||
_ps.VertexB.Generate(posB);
|
_ps.VertexB.Generate(posB);
|
||||||
|
@ -372,12 +373,12 @@ PARTICLEDLL_API void pVertex(float x, float y, float z)
|
||||||
_ps.Vel.Generate(vel);
|
_ps.Vel.Generate(vel);
|
||||||
_ps.Color.Generate(col);
|
_ps.Color.Generate(col);
|
||||||
_ps.pgrp->Add(pos, posB, siz, vel, col, _ps.Alpha, _ps.Age);
|
_ps.pgrp->Add(pos, posB, siz, vel, col, _ps.Alpha, _ps.Age);
|
||||||
}
|
}
|
||||||
|
|
||||||
PARTICLEDLL_API void pVortex(float center_x, float center_y, float center_z,
|
void pVortex(float center_x, float center_y, float center_z,
|
||||||
float axis_x, float axis_y, float axis_z,
|
float axis_x, float axis_y, float axis_z,
|
||||||
float magnitude, float epsilon, float max_radius)
|
float magnitude, float epsilon, float max_radius)
|
||||||
{
|
{
|
||||||
PAVortex S;
|
PAVortex S;
|
||||||
|
|
||||||
S.center = pVector(center_x, center_y, center_z);
|
S.center = pVector(center_x, center_y, center_z);
|
||||||
|
@ -388,4 +389,5 @@ PARTICLEDLL_API void pVortex(float center_x, float center_y, float center_z,
|
||||||
S.max_radius = max_radius;
|
S.max_radius = max_radius;
|
||||||
|
|
||||||
_pSendAction(&S, PAVortexID, sizeof(PAVortex));
|
_pSendAction(&S, PAVortexID, sizeof(PAVortex));
|
||||||
|
}
|
||||||
}
|
}
|
4
main/source/particles/cpp.hint
Normal file
4
main/source/particles/cpp.hint
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
// Hint files help the Visual Studio IDE interpret Visual C++ identifiers
|
||||||
|
// such as names of functions and macros.
|
||||||
|
// For more information see https://go.microsoft.com/fwlink/?linkid=865984
|
||||||
|
#define PARTICLEDLL_API
|
|
@ -21,29 +21,31 @@
|
||||||
|
|
||||||
// XXX #include <iostream.h>
|
// XXX #include <iostream.h>
|
||||||
|
|
||||||
// Emit OpenGL calls to draw the particles. These are drawn with
|
extern "C" {
|
||||||
// whatever primitive type the user specified(GL_POINTS, for
|
|
||||||
// example). The color and radius are set per primitive, by default.
|
// Emit OpenGL calls to draw the particles. These are drawn with
|
||||||
// For GL_LINES, the other vertex of the line is the velocity vector.
|
// whatever primitive type the user specified(GL_POINTS, for
|
||||||
// XXX const_size is ignored.
|
// example). The color and radius are set per primitive, by default.
|
||||||
PARTICLEDLL_API void pDrawGroupp(int primitive, bool const_size, bool const_color)
|
// For GL_LINES, the other vertex of the line is the velocity vector.
|
||||||
{
|
// XXX const_size is ignored.
|
||||||
_ParticleState &_ps = _GetPState();
|
void pDrawGroupp(int primitive, bool const_size, bool const_color)
|
||||||
|
{
|
||||||
|
_ParticleState& _ps = _GetPState();
|
||||||
|
|
||||||
// Get a pointer to the particles in gp memory
|
// Get a pointer to the particles in gp memory
|
||||||
ParticleGroup *pg = _ps.pgrp;
|
ParticleGroup* pg = _ps.pgrp;
|
||||||
|
|
||||||
if(pg == NULL)
|
if (pg == NULL)
|
||||||
return; // ERROR
|
return; // ERROR
|
||||||
|
|
||||||
if(pg->p_count < 1)
|
if (pg->p_count < 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(primitive == GL_POINTS)
|
if (primitive == GL_POINTS)
|
||||||
{
|
{
|
||||||
glPushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT);
|
glPushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT);
|
||||||
glEnableClientState(GL_VERTEX_ARRAY);
|
glEnableClientState(GL_VERTEX_ARRAY);
|
||||||
if(!const_color)
|
if (!const_color)
|
||||||
{
|
{
|
||||||
glEnableClientState(GL_COLOR_ARRAY);
|
glEnableClientState(GL_COLOR_ARRAY);
|
||||||
glColorPointer(4, GL_FLOAT, sizeof(Particle), &pg->list[0].color);
|
glColorPointer(4, GL_FLOAT, sizeof(Particle), &pg->list[0].color);
|
||||||
|
@ -60,68 +62,68 @@ PARTICLEDLL_API void pDrawGroupp(int primitive, bool const_size, bool const_colo
|
||||||
// Assume GL_LINES
|
// Assume GL_LINES
|
||||||
glBegin((GLenum)primitive);
|
glBegin((GLenum)primitive);
|
||||||
|
|
||||||
if(!const_color)
|
if (!const_color)
|
||||||
{
|
{
|
||||||
for(int i = 0; i < pg->p_count; i++)
|
for (int i = 0; i < pg->p_count; i++)
|
||||||
{
|
{
|
||||||
Particle &m = pg->list[i];
|
Particle& m = pg->list[i];
|
||||||
|
|
||||||
// Warning: this depends on alpha following color in the Particle struct.
|
// Warning: this depends on alpha following color in the Particle struct.
|
||||||
glColor4fv((GLfloat *)&m.color);
|
glColor4fv((GLfloat*)&m.color);
|
||||||
glVertex3fv((GLfloat *)&m.pos);
|
glVertex3fv((GLfloat*)&m.pos);
|
||||||
|
|
||||||
// For lines, make a tail with the velocity vector's direction and
|
// For lines, make a tail with the velocity vector's direction and
|
||||||
// a length of radius.
|
// a length of radius.
|
||||||
pVector tail = m.pos - m.vel;
|
pVector tail = m.pos - m.vel;
|
||||||
glVertex3fv((GLfloat *)&tail);
|
glVertex3fv((GLfloat*)&tail);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for(int i = 0; i < pg->p_count; i++)
|
for (int i = 0; i < pg->p_count; i++)
|
||||||
{
|
{
|
||||||
Particle &m = pg->list[i];
|
Particle& m = pg->list[i];
|
||||||
glVertex3fv((GLfloat *)&m.pos);
|
glVertex3fv((GLfloat*)&m.pos);
|
||||||
|
|
||||||
// For lines, make a tail with the velocity vector's direction and
|
// For lines, make a tail with the velocity vector's direction and
|
||||||
// a length of radius.
|
// a length of radius.
|
||||||
pVector tail = m.pos - m.vel;
|
pVector tail = m.pos - m.vel;
|
||||||
glVertex3fv((GLfloat *)&tail);
|
glVertex3fv((GLfloat*)&tail);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
glEnd();
|
glEnd();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PARTICLEDLL_API void pDrawGroupl(int dlist, bool const_size, bool const_color, bool const_rotation)
|
void pDrawGroupl(int dlist, bool const_size, bool const_color, bool const_rotation)
|
||||||
{
|
{
|
||||||
_ParticleState &_ps = _GetPState();
|
_ParticleState& _ps = _GetPState();
|
||||||
|
|
||||||
// Get a pointer to the particles in gp memory
|
// Get a pointer to the particles in gp memory
|
||||||
ParticleGroup *pg = _ps.pgrp;
|
ParticleGroup* pg = _ps.pgrp;
|
||||||
if(pg == NULL)
|
if (pg == NULL)
|
||||||
return; // ERROR
|
return; // ERROR
|
||||||
|
|
||||||
if(pg->p_count < 1)
|
if (pg->p_count < 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//if(const_color)
|
//if(const_color)
|
||||||
// glColor4fv((GLfloat *)&pg->list[0].color);
|
// glColor4fv((GLfloat *)&pg->list[0].color);
|
||||||
|
|
||||||
for(int i = 0; i < pg->p_count; i++)
|
for (int i = 0; i < pg->p_count; i++)
|
||||||
{
|
{
|
||||||
Particle &m = pg->list[i];
|
Particle& m = pg->list[i];
|
||||||
|
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
glTranslatef(m.pos.x, m.pos.y, m.pos.z);
|
glTranslatef(m.pos.x, m.pos.y, m.pos.z);
|
||||||
|
|
||||||
if(!const_size)
|
if (!const_size)
|
||||||
glScalef(m.size.x, m.size.y, m.size.z);
|
glScalef(m.size.x, m.size.y, m.size.z);
|
||||||
else
|
else
|
||||||
glScalef(pg->list[i].size.x, pg->list[i].size.y, pg->list[i].size.z);
|
glScalef(pg->list[i].size.x, pg->list[i].size.y, pg->list[i].size.z);
|
||||||
|
|
||||||
// Expensive! A sqrt, cross prod and acos. Yow.
|
// Expensive! A sqrt, cross prod and acos. Yow.
|
||||||
if(!const_rotation)
|
if (!const_rotation)
|
||||||
{
|
{
|
||||||
pVector vN(m.vel);
|
pVector vN(m.vel);
|
||||||
vN.normalize();
|
vN.normalize();
|
||||||
|
@ -129,7 +131,7 @@ PARTICLEDLL_API void pDrawGroupl(int dlist, bool const_size, bool const_color, b
|
||||||
voN.normalize();
|
voN.normalize();
|
||||||
|
|
||||||
pVector biN;
|
pVector biN;
|
||||||
if(voN.x == vN.x && voN.y == vN.y && voN.z == vN.z)
|
if (voN.x == vN.x && voN.y == vN.y && voN.z == vN.z)
|
||||||
biN = pVector(0, 1, 0);
|
biN = pVector(0, 1, 0);
|
||||||
else
|
else
|
||||||
biN = vN ^ voN;
|
biN = vN ^ voN;
|
||||||
|
@ -146,11 +148,12 @@ PARTICLEDLL_API void pDrawGroupl(int dlist, bool const_size, bool const_color, b
|
||||||
}
|
}
|
||||||
|
|
||||||
// Warning: this depends on alpha following color in the Particle struct.
|
// Warning: this depends on alpha following color in the Particle struct.
|
||||||
if(!const_color)
|
if (!const_color)
|
||||||
glColor4fv((GLfloat *)&m.color);
|
glColor4fv((GLfloat*)&m.color);
|
||||||
|
|
||||||
glCallList(dlist);
|
glCallList(dlist);
|
||||||
|
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -22,8 +22,6 @@
|
||||||
#define drand48() (((float) rand())/((float) RAND_MAX))
|
#define drand48() (((float) rand())/((float) RAND_MAX))
|
||||||
#define srand48(x) srand(x)
|
#define srand48(x) srand(x)
|
||||||
|
|
||||||
// This is because their stupid compiler thinks it's smart.
|
|
||||||
#define inline __forceinline
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class pVector
|
class pVector
|
||||||
|
|
|
@ -14,188 +14,189 @@
|
||||||
#define P_VERSION 120
|
#define P_VERSION 120
|
||||||
|
|
||||||
// added <<< cgc >>>
|
// added <<< cgc >>>
|
||||||
#include <p_vector.h>
|
#include "p_vector.h"
|
||||||
#include <general.h>
|
#include "general.h"
|
||||||
#include <particledefs.h>
|
#include "particledefs.h"
|
||||||
|
|
||||||
// State setting calls
|
// State setting calls
|
||||||
|
|
||||||
PARTICLEDLL_API void pColor(float red, float green, float blue, float alpha = 1.0f);
|
extern "C" {
|
||||||
|
void pColor(float red, float green, float blue, float alpha = 1.0f);
|
||||||
|
|
||||||
PARTICLEDLL_API void pColorD(float alpha, PDomainEnum dtype,
|
void pColorD(float alpha, PDomainEnum dtype,
|
||||||
float a0 = 0.0f, float a1 = 0.0f, float a2 = 0.0f,
|
float a0 = 0.0f, float a1 = 0.0f, float a2 = 0.0f,
|
||||||
float a3 = 0.0f, float a4 = 0.0f, float a5 = 0.0f,
|
float a3 = 0.0f, float a4 = 0.0f, float a5 = 0.0f,
|
||||||
float a6 = 0.0f, float a7 = 0.0f, float a8 = 0.0f);
|
float a6 = 0.0f, float a7 = 0.0f, float a8 = 0.0f);
|
||||||
|
|
||||||
PARTICLEDLL_API void pSize(float size_x, float size_y = 1.0f, float size_z = 1.0f);
|
void pSize(float size_x, float size_y = 1.0f, float size_z = 1.0f);
|
||||||
|
|
||||||
PARTICLEDLL_API void pSizeD(PDomainEnum dtype,
|
void pSizeD(PDomainEnum dtype,
|
||||||
float a0 = 0.0f, float a1 = 0.0f, float a2 = 0.0f,
|
float a0 = 0.0f, float a1 = 0.0f, float a2 = 0.0f,
|
||||||
float a3 = 0.0f, float a4 = 0.0f, float a5 = 0.0f,
|
float a3 = 0.0f, float a4 = 0.0f, float a5 = 0.0f,
|
||||||
float a6 = 0.0f, float a7 = 0.0f, float a8 = 0.0f);
|
float a6 = 0.0f, float a7 = 0.0f, float a8 = 0.0f);
|
||||||
|
|
||||||
PARTICLEDLL_API void pStartingAge(float age, float sigma = 1.0f);
|
void pStartingAge(float age, float sigma = 1.0f);
|
||||||
|
|
||||||
PARTICLEDLL_API void pTimeStep(float new_dt);
|
void pTimeStep(float new_dt);
|
||||||
|
|
||||||
PARTICLEDLL_API void pVelocity(float x, float y, float z);
|
void pVelocity(float x, float y, float z);
|
||||||
|
|
||||||
PARTICLEDLL_API void pVelocityD(PDomainEnum dtype,
|
void pVelocityD(PDomainEnum dtype,
|
||||||
float a0 = 0.0f, float a1 = 0.0f, float a2 = 0.0f,
|
float a0 = 0.0f, float a1 = 0.0f, float a2 = 0.0f,
|
||||||
float a3 = 0.0f, float a4 = 0.0f, float a5 = 0.0f,
|
float a3 = 0.0f, float a4 = 0.0f, float a5 = 0.0f,
|
||||||
float a6 = 0.0f, float a7 = 0.0f, float a8 = 0.0f);
|
float a6 = 0.0f, float a7 = 0.0f, float a8 = 0.0f);
|
||||||
|
|
||||||
PARTICLEDLL_API void pVertexB(float x, float y, float z);
|
void pVertexB(float x, float y, float z);
|
||||||
|
|
||||||
PARTICLEDLL_API void pVertexBD(PDomainEnum dtype,
|
void pVertexBD(PDomainEnum dtype,
|
||||||
float a0 = 0.0f, float a1 = 0.0f, float a2 = 0.0f,
|
float a0 = 0.0f, float a1 = 0.0f, float a2 = 0.0f,
|
||||||
float a3 = 0.0f, float a4 = 0.0f, float a5 = 0.0f,
|
float a3 = 0.0f, float a4 = 0.0f, float a5 = 0.0f,
|
||||||
float a6 = 0.0f, float a7 = 0.0f, float a8 = 0.0f);
|
float a6 = 0.0f, float a7 = 0.0f, float a8 = 0.0f);
|
||||||
|
|
||||||
PARTICLEDLL_API void pVertexBTracks(bool track_vertex = true);
|
void pVertexBTracks(bool track_vertex = true);
|
||||||
|
|
||||||
|
|
||||||
// Action List Calls
|
// Action List Calls
|
||||||
|
|
||||||
PARTICLEDLL_API void pCallActionList(int action_list_num);
|
void pCallActionList(int action_list_num);
|
||||||
|
|
||||||
PARTICLEDLL_API void pDeleteActionLists(int action_list_num, int action_list_count = 1);
|
void pDeleteActionLists(int action_list_num, int action_list_count = 1);
|
||||||
|
|
||||||
PARTICLEDLL_API void pEndActionList();
|
void pEndActionList();
|
||||||
|
|
||||||
PARTICLEDLL_API int pGenActionLists(int action_list_count = 1);
|
int pGenActionLists(int action_list_count = 1);
|
||||||
|
|
||||||
PARTICLEDLL_API void pNewActionList(int action_list_num);
|
void pNewActionList(int action_list_num);
|
||||||
|
|
||||||
|
|
||||||
// Particle Group Calls
|
// Particle Group Calls
|
||||||
|
|
||||||
PARTICLEDLL_API ParticleGroup* pGetParticleGroupRef(int p_group_num);
|
ParticleGroup* pGetParticleGroupRef(int p_group_num);
|
||||||
|
|
||||||
PARTICLEDLL_API void pCopyGroup(int p_src_group_num, int index = 0, int copy_count = P_MAXINT);
|
void pCopyGroup(int p_src_group_num, int index = 0, int copy_count = P_MAXINT);
|
||||||
|
|
||||||
PARTICLEDLL_API void pCurrentGroup(int p_group_num);
|
void pCurrentGroup(int p_group_num);
|
||||||
|
|
||||||
PARTICLEDLL_API ParticleGroup* pGetCurrentGroup(void);
|
ParticleGroup* pGetCurrentGroup(void);
|
||||||
|
|
||||||
PARTICLEDLL_API void pDeleteParticleGroups(int p_group_num, int p_group_count = 1);
|
void pDeleteParticleGroups(int p_group_num, int p_group_count = 1);
|
||||||
|
|
||||||
PARTICLEDLL_API void pDrawGroupl(int dlist, bool const_size = false,
|
void pDrawGroupl(int dlist, bool const_size = false,
|
||||||
bool const_color = false, bool const_rotation = false);
|
bool const_color = false, bool const_rotation = false);
|
||||||
|
|
||||||
PARTICLEDLL_API void pDrawGroupp(int primitive, bool const_size = false,
|
void pDrawGroupp(int primitive, bool const_size = false,
|
||||||
bool const_color = false);
|
bool const_color = false);
|
||||||
|
|
||||||
// Added <<< cgc >>>
|
// Added <<< cgc >>>
|
||||||
PARTICLEDLL_API void DrawGroupTriSplat(const pVector &view, const pVector &up, float size_scale = 1.0f, bool draw_tex=false, bool const_size=false, bool const_color=false);
|
void DrawGroupTriSplat(const pVector& view, const pVector& up, float size_scale = 1.0f, bool draw_tex = false, bool const_size = false, bool const_color = false);
|
||||||
// end
|
// end
|
||||||
|
|
||||||
PARTICLEDLL_API int pGenParticleGroups(int p_group_count = 1, int max_particles = 0);
|
int pGenParticleGroups(int p_group_count = 1, int max_particles = 0);
|
||||||
|
|
||||||
PARTICLEDLL_API int pGetGroupCount();
|
int pGetGroupCount();
|
||||||
|
|
||||||
PARTICLEDLL_API int pGetParticles(int index, int count, float *position = NULL, float *color = NULL,
|
int pGetParticles(int index, int count, float* position = NULL, float* color = NULL,
|
||||||
float *vel = NULL, float *size = NULL, float *age = NULL);
|
float* vel = NULL, float* size = NULL, float* age = NULL);
|
||||||
|
|
||||||
PARTICLEDLL_API int pSetMaxParticles(int max_count);
|
int pSetMaxParticles(int max_count);
|
||||||
|
|
||||||
|
|
||||||
// Actions
|
// Actions
|
||||||
|
|
||||||
PARTICLEDLL_API void pAvoid(float magnitude, float epsilon, float look_ahead,
|
void pAvoid(float magnitude, float epsilon, float look_ahead,
|
||||||
PDomainEnum dtype,
|
PDomainEnum dtype,
|
||||||
float a0 = 0.0f, float a1 = 0.0f, float a2 = 0.0f,
|
float a0 = 0.0f, float a1 = 0.0f, float a2 = 0.0f,
|
||||||
float a3 = 0.0f, float a4 = 0.0f, float a5 = 0.0f,
|
float a3 = 0.0f, float a4 = 0.0f, float a5 = 0.0f,
|
||||||
float a6 = 0.0f, float a7 = 0.0f, float a8 = 0.0f);
|
float a6 = 0.0f, float a7 = 0.0f, float a8 = 0.0f);
|
||||||
|
|
||||||
PARTICLEDLL_API void pBounce(float friction, float resilience, float cutoff,
|
void pBounce(float friction, float resilience, float cutoff,
|
||||||
PDomainEnum dtype,
|
PDomainEnum dtype,
|
||||||
float a0 = 0.0f, float a1 = 0.0f, float a2 = 0.0f,
|
float a0 = 0.0f, float a1 = 0.0f, float a2 = 0.0f,
|
||||||
float a3 = 0.0f, float a4 = 0.0f, float a5 = 0.0f,
|
float a3 = 0.0f, float a4 = 0.0f, float a5 = 0.0f,
|
||||||
float a6 = 0.0f, float a7 = 0.0f, float a8 = 0.0f);
|
float a6 = 0.0f, float a7 = 0.0f, float a8 = 0.0f);
|
||||||
|
|
||||||
PARTICLEDLL_API void pCopyVertexB(bool copy_pos = true, bool copy_vel = false);
|
void pCopyVertexB(bool copy_pos = true, bool copy_vel = false);
|
||||||
|
|
||||||
PARTICLEDLL_API void pDamping(float damping_x, float damping_y, float damping_z,
|
void pDamping(float damping_x, float damping_y, float damping_z,
|
||||||
float vlow = 0.0f, float vhigh = P_MAXFLOAT);
|
float vlow = 0.0f, float vhigh = P_MAXFLOAT);
|
||||||
|
|
||||||
PARTICLEDLL_API void pExplosion(float center_x, float center_y, float center_z, float velocity,
|
void pExplosion(float center_x, float center_y, float center_z, float velocity,
|
||||||
float magnitude, float stdev, float epsilon = P_EPS, float age = 0.0f);
|
float magnitude, float stdev, float epsilon = P_EPS, float age = 0.0f);
|
||||||
|
|
||||||
PARTICLEDLL_API void pFollow(float magnitude = 1.0f, float epsilon = P_EPS, float max_radius = P_MAXFLOAT);
|
void pFollow(float magnitude = 1.0f, float epsilon = P_EPS, float max_radius = P_MAXFLOAT);
|
||||||
|
|
||||||
PARTICLEDLL_API void pGravitate(float magnitude = 1.0f, float epsilon = P_EPS, float max_radius = P_MAXFLOAT);
|
void pGravitate(float magnitude = 1.0f, float epsilon = P_EPS, float max_radius = P_MAXFLOAT);
|
||||||
|
|
||||||
PARTICLEDLL_API void pGravity(float dir_x, float dir_y, float dir_z);
|
void pGravity(float dir_x, float dir_y, float dir_z);
|
||||||
|
|
||||||
PARTICLEDLL_API void pJet(float center_x, float center_y, float center_z, float magnitude = 1.0f,
|
void pJet(float center_x, float center_y, float center_z, float magnitude = 1.0f,
|
||||||
float epsilon = P_EPS, float max_radius = P_MAXFLOAT);
|
float epsilon = P_EPS, float max_radius = P_MAXFLOAT);
|
||||||
|
|
||||||
PARTICLEDLL_API void pKillOld(float age_limit, bool kill_less_than = false);
|
void pKillOld(float age_limit, bool kill_less_than = false);
|
||||||
|
|
||||||
PARTICLEDLL_API void pMatchVelocity(float magnitude = 1.0f, float epsilon = P_EPS,
|
void pMatchVelocity(float magnitude = 1.0f, float epsilon = P_EPS,
|
||||||
float max_radius = P_MAXFLOAT);
|
float max_radius = P_MAXFLOAT);
|
||||||
|
|
||||||
PARTICLEDLL_API void pMove();
|
void pMove();
|
||||||
|
|
||||||
PARTICLEDLL_API void pOrbitLine(float p_x, float p_y, float p_z,
|
void pOrbitLine(float p_x, float p_y, float p_z,
|
||||||
float axis_x, float axis_y, float axis_z, float magnitude = 1.0f,
|
float axis_x, float axis_y, float axis_z, float magnitude = 1.0f,
|
||||||
float epsilon = P_EPS, float max_radius = P_MAXFLOAT);
|
float epsilon = P_EPS, float max_radius = P_MAXFLOAT);
|
||||||
|
|
||||||
PARTICLEDLL_API void pOrbitPoint(float center_x, float center_y, float center_z,
|
void pOrbitPoint(float center_x, float center_y, float center_z,
|
||||||
float magnitude = 1.0f, float epsilon = P_EPS,
|
float magnitude = 1.0f, float epsilon = P_EPS,
|
||||||
float max_radius = P_MAXFLOAT);
|
float max_radius = P_MAXFLOAT);
|
||||||
|
|
||||||
PARTICLEDLL_API void pRandomAccel(PDomainEnum dtype,
|
void pRandomAccel(PDomainEnum dtype,
|
||||||
float a0 = 0.0f, float a1 = 0.0f, float a2 = 0.0f,
|
float a0 = 0.0f, float a1 = 0.0f, float a2 = 0.0f,
|
||||||
float a3 = 0.0f, float a4 = 0.0f, float a5 = 0.0f,
|
float a3 = 0.0f, float a4 = 0.0f, float a5 = 0.0f,
|
||||||
float a6 = 0.0f, float a7 = 0.0f, float a8 = 0.0f);
|
float a6 = 0.0f, float a7 = 0.0f, float a8 = 0.0f);
|
||||||
|
|
||||||
PARTICLEDLL_API void pRandomDisplace(PDomainEnum dtype,
|
void pRandomDisplace(PDomainEnum dtype,
|
||||||
float a0 = 0.0f, float a1 = 0.0f, float a2 = 0.0f,
|
float a0 = 0.0f, float a1 = 0.0f, float a2 = 0.0f,
|
||||||
float a3 = 0.0f, float a4 = 0.0f, float a5 = 0.0f,
|
float a3 = 0.0f, float a4 = 0.0f, float a5 = 0.0f,
|
||||||
float a6 = 0.0f, float a7 = 0.0f, float a8 = 0.0f);
|
float a6 = 0.0f, float a7 = 0.0f, float a8 = 0.0f);
|
||||||
|
|
||||||
PARTICLEDLL_API void pRandomVelocity(PDomainEnum dtype,
|
void pRandomVelocity(PDomainEnum dtype,
|
||||||
float a0 = 0.0f, float a1 = 0.0f, float a2 = 0.0f,
|
float a0 = 0.0f, float a1 = 0.0f, float a2 = 0.0f,
|
||||||
float a3 = 0.0f, float a4 = 0.0f, float a5 = 0.0f,
|
float a3 = 0.0f, float a4 = 0.0f, float a5 = 0.0f,
|
||||||
float a6 = 0.0f, float a7 = 0.0f, float a8 = 0.0f);
|
float a6 = 0.0f, float a7 = 0.0f, float a8 = 0.0f);
|
||||||
|
|
||||||
PARTICLEDLL_API void pRestore(float time);
|
void pRestore(float time);
|
||||||
|
|
||||||
PARTICLEDLL_API void pShade(float color_x, float color_y, float color_z,
|
void pShade(float color_x, float color_y, float color_z,
|
||||||
float alpha, float scale);
|
float alpha, float scale);
|
||||||
|
|
||||||
PARTICLEDLL_API void pSink(bool kill_inside, PDomainEnum dtype,
|
void pSink(bool kill_inside, PDomainEnum dtype,
|
||||||
float a0 = 0.0f, float a1 = 0.0f, float a2 = 0.0f,
|
float a0 = 0.0f, float a1 = 0.0f, float a2 = 0.0f,
|
||||||
float a3 = 0.0f, float a4 = 0.0f, float a5 = 0.0f,
|
float a3 = 0.0f, float a4 = 0.0f, float a5 = 0.0f,
|
||||||
float a6 = 0.0f, float a7 = 0.0f, float a8 = 0.0f);
|
float a6 = 0.0f, float a7 = 0.0f, float a8 = 0.0f);
|
||||||
|
|
||||||
PARTICLEDLL_API void pSinkVelocity(bool kill_inside, PDomainEnum dtype,
|
void pSinkVelocity(bool kill_inside, PDomainEnum dtype,
|
||||||
float a0 = 0.0f, float a1 = 0.0f, float a2 = 0.0f,
|
float a0 = 0.0f, float a1 = 0.0f, float a2 = 0.0f,
|
||||||
float a3 = 0.0f, float a4 = 0.0f, float a5 = 0.0f,
|
float a3 = 0.0f, float a4 = 0.0f, float a5 = 0.0f,
|
||||||
float a6 = 0.0f, float a7 = 0.0f, float a8 = 0.0f);
|
float a6 = 0.0f, float a7 = 0.0f, float a8 = 0.0f);
|
||||||
|
|
||||||
PARTICLEDLL_API void pSource(float particle_rate, PDomainEnum dtype,
|
void pSource(float particle_rate, PDomainEnum dtype,
|
||||||
float a0 = 0.0f, float a1 = 0.0f, float a2 = 0.0f,
|
float a0 = 0.0f, float a1 = 0.0f, float a2 = 0.0f,
|
||||||
float a3 = 0.0f, float a4 = 0.0f, float a5 = 0.0f,
|
float a3 = 0.0f, float a4 = 0.0f, float a5 = 0.0f,
|
||||||
float a6 = 0.0f, float a7 = 0.0f, float a8 = 0.0f);
|
float a6 = 0.0f, float a7 = 0.0f, float a8 = 0.0f);
|
||||||
|
|
||||||
PARTICLEDLL_API void pSpeedLimit(float min_speed, float max_speed = P_MAXFLOAT);
|
void pSpeedLimit(float min_speed, float max_speed = P_MAXFLOAT);
|
||||||
|
|
||||||
PARTICLEDLL_API void pTargetColor(float color_x, float color_y, float color_z,
|
void pTargetColor(float color_x, float color_y, float color_z,
|
||||||
float alpha, float scale);
|
float alpha, float scale);
|
||||||
|
|
||||||
PARTICLEDLL_API void pTargetSize(float size_x, float size_y, float size_z,
|
void pTargetSize(float size_x, float size_y, float size_z,
|
||||||
float scale_x = 0.0f, float scale_y = 0.0f, float scale_z = 0.0f);
|
float scale_x = 0.0f, float scale_y = 0.0f, float scale_z = 0.0f);
|
||||||
|
|
||||||
PARTICLEDLL_API void pTargetVelocity(float vel_x, float vel_y, float vel_z, float scale);
|
void pTargetVelocity(float vel_x, float vel_y, float vel_z, float scale);
|
||||||
|
|
||||||
PARTICLEDLL_API void pVertex(float x, float y, float z);
|
void pVertex(float x, float y, float z);
|
||||||
|
|
||||||
PARTICLEDLL_API void pVortex(float center_x, float center_y, float center_z,
|
void pVortex(float center_x, float center_y, float center_z,
|
||||||
float axis_x, float axis_y, float axis_z,
|
float axis_x, float axis_y, float axis_z,
|
||||||
float magnitude = 1.0f, float epsilon = P_EPS,
|
float magnitude = 1.0f, float epsilon = P_EPS,
|
||||||
float max_radius = P_MAXFLOAT);
|
float max_radius = P_MAXFLOAT);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -11,22 +11,6 @@
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
// removed <<< cgc >>>
|
|
||||||
//#ifdef PARTICLEDLL_EXPORTS
|
|
||||||
//#define PARTICLEDLL_API __declspec(dllexport)
|
|
||||||
//#else
|
|
||||||
//#define PARTICLEDLL_API __declspec(dllimport)
|
|
||||||
//#endif
|
|
||||||
#define PARTICLEDLL_API extern "C"
|
|
||||||
|
|
||||||
// removed <<< cgc >>>
|
|
||||||
#else
|
|
||||||
#define PARTICLEDLL_API
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
#pragma warning (disable:4244)
|
#pragma warning (disable:4244)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -43,8 +27,9 @@
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
// Type codes for domains
|
// Type codes for domains
|
||||||
PARTICLEDLL_API enum PDomainEnum
|
extern "C" {
|
||||||
{
|
enum PDomainEnum
|
||||||
|
{
|
||||||
PDPoint = 0, // Single point
|
PDPoint = 0, // Single point
|
||||||
PDLine = 1, // Line segment
|
PDLine = 1, // Line segment
|
||||||
PDTriangle = 2, // Triangle
|
PDTriangle = 2, // Triangle
|
||||||
|
@ -56,8 +41,8 @@ PARTICLEDLL_API enum PDomainEnum
|
||||||
PDBlob = 8, // Gaussian blob
|
PDBlob = 8, // Gaussian blob
|
||||||
PDDisc = 9, // Arbitrarily-oriented disc
|
PDDisc = 9, // Arbitrarily-oriented disc
|
||||||
PDRectangle = 10 // Rhombus-shaped planar region
|
PDRectangle = 10 // Rhombus-shaped planar region
|
||||||
};
|
};
|
||||||
|
}
|
||||||
// A single particle
|
// A single particle
|
||||||
struct Particle
|
struct Particle
|
||||||
{
|
{
|
||||||
|
|
|
@ -12,25 +12,22 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<PropertyGroup Label="Globals">
|
<PropertyGroup Label="Globals">
|
||||||
<ProjectGuid>{5AADD469-7488-4B34-A9FD-01CFAC5972FD}</ProjectGuid>
|
<ProjectGuid>{5AADD469-7488-4B34-A9FD-01CFAC5972FD}</ProjectGuid>
|
||||||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
|
||||||
<Keyword>ManagedCProj</Keyword>
|
<Keyword>ManagedCProj</Keyword>
|
||||||
<RootNamespace>particles</RootNamespace>
|
<RootNamespace>particles</RootNamespace>
|
||||||
<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
|
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||||
|
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
|
||||||
<CLRSupport>true</CLRSupport>
|
<CLRSupport>true</CLRSupport>
|
||||||
<CharacterSet>Unicode</CharacterSet>
|
<PlatformToolset>v142</PlatformToolset>
|
||||||
<PlatformToolset>v141</PlatformToolset>
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
|
||||||
<CLRSupport>true</CLRSupport>
|
<CLRSupport>true</CLRSupport>
|
||||||
<CharacterSet>Unicode</CharacterSet>
|
<PlatformToolset>v142</PlatformToolset>
|
||||||
<PlatformToolset>v141</PlatformToolset>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
<ImportGroup Label="ExtensionSettings">
|
<ImportGroup Label="ExtensionSettings">
|
||||||
|
@ -44,18 +41,16 @@
|
||||||
<PropertyGroup Label="UserMacros" />
|
<PropertyGroup Label="UserMacros" />
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
<LinkIncremental>true</LinkIncremental>
|
<LinkIncremental>true</LinkIncremental>
|
||||||
<IncludePath>$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(FrameworkSDKDir)\include;..;</IncludePath>
|
<IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);../common;../public</IncludePath>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
<LinkIncremental>false</LinkIncremental>
|
<LinkIncremental>false</LinkIncremental>
|
||||||
<IncludePath>$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(FrameworkSDKDir)\include;.;$(VCToolsInstallDir)\include;C:\Program Files (x86)\Windows Kits\10\Include\10.0.16299.0\ucrt;C:\Program Files (x86)\Windows Kits\10\Include\10.0.16299.0\um;C:\Program Files (x86)\Windows Kits\10\Include\10.0.16299.0\shared;..;../common;../public</IncludePath>
|
<IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);../common;../public</IncludePath>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<Optimization>Disabled</Optimization>
|
|
||||||
<PreprocessorDefinitions>WIN32;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>WIN32;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
@ -67,10 +62,7 @@
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<PreprocessorDefinitions>WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
|
||||||
<AdditionalIncludeDirectories>$(VCInstallDir)</AdditionalIncludeDirectories>
|
|
||||||
<AdditionalUsingDirectories>$(FrameworkPathOverride)</AdditionalUsingDirectories>
|
<AdditionalUsingDirectories>$(FrameworkPathOverride)</AdditionalUsingDirectories>
|
||||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
@ -84,6 +76,7 @@
|
||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<None Include="cpp.hint" />
|
||||||
<None Include="Overview.txt" />
|
<None Include="Overview.txt" />
|
||||||
<None Include="PS Docs.htm">
|
<None Include="PS Docs.htm">
|
||||||
<DeploymentContent>true</DeploymentContent>
|
<DeploymentContent>true</DeploymentContent>
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
<None Include="PS Docs.htm" />
|
<None Include="PS Docs.htm" />
|
||||||
<None Include="Overview.txt" />
|
<None Include="Overview.txt" />
|
||||||
<None Include="Readme.txt" />
|
<None Include="Readme.txt" />
|
||||||
|
<None Include="cpp.hint" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="general.h">
|
<ClInclude Include="general.h">
|
||||||
|
|
|
@ -417,114 +417,116 @@ void _pAddActionToList(ParticleAction *S, int size)
|
||||||
////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////
|
||||||
// State setting calls
|
// State setting calls
|
||||||
|
|
||||||
PARTICLEDLL_API void pColor(float red, float green, float blue, float alpha)
|
extern "C" {
|
||||||
{
|
|
||||||
_ParticleState &_ps = _GetPState();
|
void pColor(float red, float green, float blue, float alpha)
|
||||||
|
{
|
||||||
|
_ParticleState& _ps = _GetPState();
|
||||||
|
|
||||||
_ps.Alpha = alpha;
|
_ps.Alpha = alpha;
|
||||||
_ps.Color = pDomain(PDPoint, red, green, blue);
|
_ps.Color = pDomain(PDPoint, red, green, blue);
|
||||||
}
|
}
|
||||||
|
|
||||||
PARTICLEDLL_API void pColorD(float alpha, PDomainEnum dtype,
|
void pColorD(float alpha, PDomainEnum dtype,
|
||||||
float a0, float a1, float a2,
|
float a0, float a1, float a2,
|
||||||
float a3, float a4, float a5,
|
float a3, float a4, float a5,
|
||||||
float a6, float a7, float a8)
|
float a6, float a7, float a8)
|
||||||
{
|
{
|
||||||
_ParticleState &_ps = _GetPState();
|
_ParticleState& _ps = _GetPState();
|
||||||
|
|
||||||
_ps.Alpha = alpha;
|
_ps.Alpha = alpha;
|
||||||
_ps.Color = pDomain(dtype, a0, a1, a2, a3, a4, a5, a6, a7, a8);
|
_ps.Color = pDomain(dtype, a0, a1, a2, a3, a4, a5, a6, a7, a8);
|
||||||
}
|
}
|
||||||
|
|
||||||
PARTICLEDLL_API void pVelocity(float x, float y, float z)
|
void pVelocity(float x, float y, float z)
|
||||||
{
|
{
|
||||||
_ParticleState &_ps = _GetPState();
|
_ParticleState& _ps = _GetPState();
|
||||||
|
|
||||||
_ps.Vel = pDomain(PDPoint, x, y, z);
|
_ps.Vel = pDomain(PDPoint, x, y, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
PARTICLEDLL_API void pVelocityD(PDomainEnum dtype,
|
void pVelocityD(PDomainEnum dtype,
|
||||||
float a0, float a1, float a2,
|
float a0, float a1, float a2,
|
||||||
float a3, float a4, float a5,
|
float a3, float a4, float a5,
|
||||||
float a6, float a7, float a8)
|
float a6, float a7, float a8)
|
||||||
{
|
{
|
||||||
_ParticleState &_ps = _GetPState();
|
_ParticleState& _ps = _GetPState();
|
||||||
|
|
||||||
_ps.Vel = pDomain(dtype, a0, a1, a2, a3, a4, a5, a6, a7, a8);
|
_ps.Vel = pDomain(dtype, a0, a1, a2, a3, a4, a5, a6, a7, a8);
|
||||||
}
|
}
|
||||||
|
|
||||||
PARTICLEDLL_API void pVertexB(float x, float y, float z)
|
void pVertexB(float x, float y, float z)
|
||||||
{
|
{
|
||||||
_ParticleState &_ps = _GetPState();
|
_ParticleState& _ps = _GetPState();
|
||||||
|
|
||||||
_ps.VertexB = pDomain(PDPoint, x, y, z);
|
_ps.VertexB = pDomain(PDPoint, x, y, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
PARTICLEDLL_API void pVertexBD(PDomainEnum dtype,
|
void pVertexBD(PDomainEnum dtype,
|
||||||
float a0, float a1, float a2,
|
float a0, float a1, float a2,
|
||||||
float a3, float a4, float a5,
|
float a3, float a4, float a5,
|
||||||
float a6, float a7, float a8)
|
float a6, float a7, float a8)
|
||||||
{
|
{
|
||||||
_ParticleState &_ps = _GetPState();
|
_ParticleState& _ps = _GetPState();
|
||||||
|
|
||||||
_ps.VertexB = pDomain(dtype, a0, a1, a2, a3, a4, a5, a6, a7, a8);
|
_ps.VertexB = pDomain(dtype, a0, a1, a2, a3, a4, a5, a6, a7, a8);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
PARTICLEDLL_API void pVertexBTracks(bool trackVertex)
|
void pVertexBTracks(bool trackVertex)
|
||||||
{
|
{
|
||||||
_ParticleState &_ps = _GetPState();
|
_ParticleState& _ps = _GetPState();
|
||||||
|
|
||||||
_ps.vertexB_tracks = trackVertex;
|
_ps.vertexB_tracks = trackVertex;
|
||||||
}
|
}
|
||||||
|
|
||||||
PARTICLEDLL_API void pSize(float size_x, float size_y, float size_z)
|
void pSize(float size_x, float size_y, float size_z)
|
||||||
{
|
{
|
||||||
_ParticleState &_ps = _GetPState();
|
_ParticleState& _ps = _GetPState();
|
||||||
|
|
||||||
_ps.Size = pDomain(PDPoint, size_x, size_y, size_z);
|
_ps.Size = pDomain(PDPoint, size_x, size_y, size_z);
|
||||||
}
|
}
|
||||||
|
|
||||||
PARTICLEDLL_API void pSizeD(PDomainEnum dtype,
|
void pSizeD(PDomainEnum dtype,
|
||||||
float a0, float a1, float a2,
|
float a0, float a1, float a2,
|
||||||
float a3, float a4, float a5,
|
float a3, float a4, float a5,
|
||||||
float a6, float a7, float a8)
|
float a6, float a7, float a8)
|
||||||
{
|
{
|
||||||
_ParticleState &_ps = _GetPState();
|
_ParticleState& _ps = _GetPState();
|
||||||
|
|
||||||
_ps.Size = pDomain(dtype, a0, a1, a2, a3, a4, a5, a6, a7, a8);
|
_ps.Size = pDomain(dtype, a0, a1, a2, a3, a4, a5, a6, a7, a8);
|
||||||
}
|
}
|
||||||
|
|
||||||
PARTICLEDLL_API void pStartingAge(float age, float sigma)
|
void pStartingAge(float age, float sigma)
|
||||||
{
|
{
|
||||||
_ParticleState &_ps = _GetPState();
|
_ParticleState& _ps = _GetPState();
|
||||||
|
|
||||||
_ps.Age = age;
|
_ps.Age = age;
|
||||||
_ps.AgeSigma = sigma;
|
_ps.AgeSigma = sigma;
|
||||||
}
|
}
|
||||||
|
|
||||||
PARTICLEDLL_API void pTimeStep(float newDT)
|
void pTimeStep(float newDT)
|
||||||
{
|
{
|
||||||
_ParticleState &_ps = _GetPState();
|
_ParticleState& _ps = _GetPState();
|
||||||
|
|
||||||
_ps.dt = newDT;
|
_ps.dt = newDT;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////
|
||||||
// Action List Calls
|
// Action List Calls
|
||||||
|
|
||||||
PARTICLEDLL_API int pGenActionLists(int action_list_count)
|
int pGenActionLists(int action_list_count)
|
||||||
{
|
{
|
||||||
_ParticleState &_ps = _GetPState();
|
_ParticleState& _ps = _GetPState();
|
||||||
|
|
||||||
if(_ps.in_new_list)
|
if (_ps.in_new_list)
|
||||||
return -1; // ERROR
|
return -1; // ERROR
|
||||||
|
|
||||||
_PLock();
|
_PLock();
|
||||||
|
|
||||||
int ind = _ps.GenerateLists(action_list_count);
|
int ind = _ps.GenerateLists(action_list_count);
|
||||||
|
|
||||||
for(int i=ind; i<ind+action_list_count; i++)
|
for (int i = ind; i < ind + action_list_count; i++)
|
||||||
{
|
{
|
||||||
_ps.alist_list[i] = new PAHeader[8];
|
_ps.alist_list[i] = new PAHeader[8];
|
||||||
_ps.alist_list[i]->actions_allocated = 8;
|
_ps.alist_list[i]->actions_allocated = 8;
|
||||||
|
@ -535,18 +537,18 @@ PARTICLEDLL_API int pGenActionLists(int action_list_count)
|
||||||
_PUnLock();
|
_PUnLock();
|
||||||
|
|
||||||
return ind;
|
return ind;
|
||||||
}
|
}
|
||||||
|
|
||||||
PARTICLEDLL_API void pNewActionList(int action_list_num)
|
void pNewActionList(int action_list_num)
|
||||||
{
|
{
|
||||||
_ParticleState &_ps = _GetPState();
|
_ParticleState& _ps = _GetPState();
|
||||||
|
|
||||||
if(_ps.in_new_list)
|
if (_ps.in_new_list)
|
||||||
return; // ERROR
|
return; // ERROR
|
||||||
|
|
||||||
_ps.pact = _ps.GetListPtr(action_list_num);
|
_ps.pact = _ps.GetListPtr(action_list_num);
|
||||||
|
|
||||||
if(_ps.pact == NULL)
|
if (_ps.pact == NULL)
|
||||||
return; // ERROR
|
return; // ERROR
|
||||||
|
|
||||||
_ps.list_id = action_list_num;
|
_ps.list_id = action_list_num;
|
||||||
|
@ -554,41 +556,41 @@ PARTICLEDLL_API void pNewActionList(int action_list_num)
|
||||||
|
|
||||||
// Remove whatever used to be in the list.
|
// Remove whatever used to be in the list.
|
||||||
_ps.pact->count = 1;
|
_ps.pact->count = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
PARTICLEDLL_API void pEndActionList()
|
void pEndActionList()
|
||||||
{
|
{
|
||||||
_ParticleState &_ps = _GetPState();
|
_ParticleState& _ps = _GetPState();
|
||||||
|
|
||||||
if(!_ps.in_new_list)
|
if (!_ps.in_new_list)
|
||||||
return; // ERROR
|
return; // ERROR
|
||||||
|
|
||||||
_ps.in_new_list = false;
|
_ps.in_new_list = false;
|
||||||
|
|
||||||
_ps.pact = NULL;
|
_ps.pact = NULL;
|
||||||
_ps.list_id = -1;
|
_ps.list_id = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
PARTICLEDLL_API void pDeleteActionLists(int action_list_num, int action_list_count)
|
void pDeleteActionLists(int action_list_num, int action_list_count)
|
||||||
{
|
{
|
||||||
_ParticleState &_ps = _GetPState();
|
_ParticleState& _ps = _GetPState();
|
||||||
|
|
||||||
if(_ps.in_new_list)
|
if (_ps.in_new_list)
|
||||||
return; // ERROR
|
return; // ERROR
|
||||||
|
|
||||||
if(action_list_num < 0)
|
if (action_list_num < 0)
|
||||||
return; // ERROR
|
return; // ERROR
|
||||||
|
|
||||||
if(action_list_num + action_list_count > _ps.alist_count)
|
if (action_list_num + action_list_count > _ps.alist_count)
|
||||||
return; // ERROR
|
return; // ERROR
|
||||||
|
|
||||||
_PLock();
|
_PLock();
|
||||||
|
|
||||||
for(int i = action_list_num; i < action_list_num + action_list_count; i++)
|
for (int i = action_list_num; i < action_list_num + action_list_count; i++)
|
||||||
{
|
{
|
||||||
if(_ps.alist_list[i])
|
if (_ps.alist_list[i])
|
||||||
{
|
{
|
||||||
delete [] _ps.alist_list[i];
|
delete[] _ps.alist_list[i];
|
||||||
_ps.alist_list[i] = NULL;
|
_ps.alist_list[i] = NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -599,13 +601,13 @@ PARTICLEDLL_API void pDeleteActionLists(int action_list_num, int action_list_cou
|
||||||
}
|
}
|
||||||
|
|
||||||
_PUnLock();
|
_PUnLock();
|
||||||
}
|
}
|
||||||
|
|
||||||
PARTICLEDLL_API void pCallActionList(int action_list_num)
|
void pCallActionList(int action_list_num)
|
||||||
{
|
{
|
||||||
_ParticleState &_ps = _GetPState();
|
_ParticleState& _ps = _GetPState();
|
||||||
|
|
||||||
if(_ps.in_new_list)
|
if (_ps.in_new_list)
|
||||||
{
|
{
|
||||||
// Add this call as an action to the current list.
|
// Add this call as an action to the current list.
|
||||||
// <<< cgc >>> commented out predeclaration
|
// <<< cgc >>> commented out predeclaration
|
||||||
|
@ -619,9 +621,9 @@ PARTICLEDLL_API void pCallActionList(int action_list_num)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Execute the specified action list.
|
// Execute the specified action list.
|
||||||
PAHeader *pa = _ps.GetListPtr(action_list_num);
|
PAHeader* pa = _ps.GetListPtr(action_list_num);
|
||||||
|
|
||||||
if(pa == NULL)
|
if (pa == NULL)
|
||||||
return; // ERRROR
|
return; // ERRROR
|
||||||
|
|
||||||
// XXX A temporary hack.
|
// XXX A temporary hack.
|
||||||
|
@ -629,21 +631,21 @@ PARTICLEDLL_API void pCallActionList(int action_list_num)
|
||||||
|
|
||||||
_ps.in_call_list = true;
|
_ps.in_call_list = true;
|
||||||
|
|
||||||
_pCallActionList(pa+1, pa->count-1, _ps.pgrp);
|
_pCallActionList(pa + 1, pa->count - 1, _ps.pgrp);
|
||||||
|
|
||||||
_ps.in_call_list = false;
|
_ps.in_call_list = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////
|
||||||
// Particle Group Calls
|
// Particle Group Calls
|
||||||
|
|
||||||
// Create particle groups, each with max_particles allocated.
|
// Create particle groups, each with max_particles allocated.
|
||||||
PARTICLEDLL_API int pGenParticleGroups(int p_group_count, int max_particles)
|
int pGenParticleGroups(int p_group_count, int max_particles)
|
||||||
{
|
{
|
||||||
_ParticleState &_ps = _GetPState();
|
_ParticleState& _ps = _GetPState();
|
||||||
|
|
||||||
if(_ps.in_new_list)
|
if (_ps.in_new_list)
|
||||||
return -1; // ERROR
|
return -1; // ERROR
|
||||||
|
|
||||||
_PLock();
|
_PLock();
|
||||||
|
@ -651,9 +653,9 @@ PARTICLEDLL_API int pGenParticleGroups(int p_group_count, int max_particles)
|
||||||
|
|
||||||
int ind = _ps.GenerateGroups(p_group_count);
|
int ind = _ps.GenerateGroups(p_group_count);
|
||||||
|
|
||||||
for(int i=ind; i<ind+p_group_count; i++)
|
for (int i = ind; i < ind + p_group_count; i++)
|
||||||
{
|
{
|
||||||
_ps.group_list[i] = (ParticleGroup *)new
|
_ps.group_list[i] = (ParticleGroup*)new
|
||||||
Particle[max_particles + 2];
|
Particle[max_particles + 2];
|
||||||
_ps.group_list[i]->max_particles = max_particles;
|
_ps.group_list[i]->max_particles = max_particles;
|
||||||
_ps.group_list[i]->particles_allocated = max_particles;
|
_ps.group_list[i]->particles_allocated = max_particles;
|
||||||
|
@ -663,25 +665,25 @@ PARTICLEDLL_API int pGenParticleGroups(int p_group_count, int max_particles)
|
||||||
_PUnLock();
|
_PUnLock();
|
||||||
|
|
||||||
return ind;
|
return ind;
|
||||||
}
|
}
|
||||||
|
|
||||||
PARTICLEDLL_API void pDeleteParticleGroups(int p_group_num, int p_group_count)
|
void pDeleteParticleGroups(int p_group_num, int p_group_count)
|
||||||
{
|
{
|
||||||
_ParticleState &_ps = _GetPState();
|
_ParticleState& _ps = _GetPState();
|
||||||
|
|
||||||
if(p_group_num < 0)
|
if (p_group_num < 0)
|
||||||
return; // ERROR
|
return; // ERROR
|
||||||
|
|
||||||
if(p_group_num + p_group_count > _ps.group_count)
|
if (p_group_num + p_group_count > _ps.group_count)
|
||||||
return; // ERROR
|
return; // ERROR
|
||||||
|
|
||||||
_PLock();
|
_PLock();
|
||||||
|
|
||||||
for(int i = p_group_num; i < p_group_num + p_group_count; i++)
|
for (int i = p_group_num; i < p_group_num + p_group_count; i++)
|
||||||
{
|
{
|
||||||
if(_ps.group_list[i])
|
if (_ps.group_list[i])
|
||||||
{
|
{
|
||||||
delete [] _ps.group_list[i];
|
delete[] _ps.group_list[i];
|
||||||
_ps.group_list[i] = NULL;
|
_ps.group_list[i] = NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -692,52 +694,52 @@ PARTICLEDLL_API void pDeleteParticleGroups(int p_group_num, int p_group_count)
|
||||||
}
|
}
|
||||||
|
|
||||||
_PUnLock();
|
_PUnLock();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Change which group is current.
|
// Change which group is current.
|
||||||
PARTICLEDLL_API void pCurrentGroup(int p_group_num)
|
void pCurrentGroup(int p_group_num)
|
||||||
{
|
{
|
||||||
_ParticleState &_ps = _GetPState();
|
_ParticleState& _ps = _GetPState();
|
||||||
|
|
||||||
if(_ps.in_new_list)
|
if (_ps.in_new_list)
|
||||||
return; // ERROR
|
return; // ERROR
|
||||||
|
|
||||||
_ps.pgrp = _ps.GetGroupPtr(p_group_num);
|
_ps.pgrp = _ps.GetGroupPtr(p_group_num);
|
||||||
if(_ps.pgrp)
|
if (_ps.pgrp)
|
||||||
_ps.group_id = p_group_num;
|
_ps.group_id = p_group_num;
|
||||||
else
|
else
|
||||||
_ps.group_id = -1;
|
_ps.group_id = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
PARTICLEDLL_API ParticleGroup* pGetCurrentGroup(void)
|
ParticleGroup* pGetCurrentGroup(void)
|
||||||
{
|
{
|
||||||
_ParticleState &_ps = _GetPState();
|
_ParticleState& _ps = _GetPState();
|
||||||
ParticleGroup *pg = _ps.pgrp;
|
ParticleGroup* pg = _ps.pgrp;
|
||||||
return pg;
|
return pg;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Change the maximum number of particles in the current group.
|
// Change the maximum number of particles in the current group.
|
||||||
PARTICLEDLL_API int pSetMaxParticles(int max_count)
|
int pSetMaxParticles(int max_count)
|
||||||
{
|
{
|
||||||
_ParticleState &_ps = _GetPState();
|
_ParticleState& _ps = _GetPState();
|
||||||
|
|
||||||
if(_ps.in_new_list)
|
if (_ps.in_new_list)
|
||||||
return 0; // ERROR
|
return 0; // ERROR
|
||||||
|
|
||||||
ParticleGroup *pg = _ps.pgrp;
|
ParticleGroup* pg = _ps.pgrp;
|
||||||
if(pg == NULL)
|
if (pg == NULL)
|
||||||
return 0; // ERROR
|
return 0; // ERROR
|
||||||
|
|
||||||
if(max_count < 0)
|
if (max_count < 0)
|
||||||
return 0; // ERROR
|
return 0; // ERROR
|
||||||
|
|
||||||
// Reducing max.
|
// Reducing max.
|
||||||
if(pg->particles_allocated >= max_count)
|
if (pg->particles_allocated >= max_count)
|
||||||
{
|
{
|
||||||
pg->max_particles = max_count;
|
pg->max_particles = max_count;
|
||||||
|
|
||||||
// May have to kill particles.
|
// May have to kill particles.
|
||||||
if(pg->p_count > pg->max_particles)
|
if (pg->p_count > pg->max_particles)
|
||||||
pg->p_count = pg->max_particles;
|
pg->p_count = pg->max_particles;
|
||||||
|
|
||||||
return max_count;
|
return max_count;
|
||||||
|
@ -746,8 +748,8 @@ PARTICLEDLL_API int pSetMaxParticles(int max_count)
|
||||||
_PLock();
|
_PLock();
|
||||||
|
|
||||||
// Allocate particles.
|
// Allocate particles.
|
||||||
ParticleGroup *pg2 =(ParticleGroup *)new Particle[max_count + 2];
|
ParticleGroup* pg2 = (ParticleGroup*)new Particle[max_count + 2];
|
||||||
if(pg2 == NULL)
|
if (pg2 == NULL)
|
||||||
{
|
{
|
||||||
// Not enough memory. Just give all we've got.
|
// Not enough memory. Just give all we've got.
|
||||||
// ERROR
|
// ERROR
|
||||||
|
@ -760,7 +762,7 @@ PARTICLEDLL_API int pSetMaxParticles(int max_count)
|
||||||
|
|
||||||
memcpy(pg2, pg, (pg->p_count + 2) * sizeof(Particle));
|
memcpy(pg2, pg, (pg->p_count + 2) * sizeof(Particle));
|
||||||
|
|
||||||
delete [] pg;
|
delete[] pg;
|
||||||
|
|
||||||
_ps.group_list[_ps.group_id] = _ps.pgrp = pg2;
|
_ps.group_list[_ps.group_id] = _ps.pgrp = pg2;
|
||||||
pg2->max_particles = max_count;
|
pg2->max_particles = max_count;
|
||||||
|
@ -769,100 +771,100 @@ PARTICLEDLL_API int pSetMaxParticles(int max_count)
|
||||||
_PUnLock();
|
_PUnLock();
|
||||||
|
|
||||||
return max_count;
|
return max_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Copy from the specified group to the current group.
|
// Copy from the specified group to the current group.
|
||||||
PARTICLEDLL_API void pCopyGroup(int p_src_group_num, int index, int copy_count)
|
void pCopyGroup(int p_src_group_num, int index, int copy_count)
|
||||||
{
|
{
|
||||||
_ParticleState &_ps = _GetPState();
|
_ParticleState& _ps = _GetPState();
|
||||||
|
|
||||||
if(_ps.in_new_list)
|
if (_ps.in_new_list)
|
||||||
return; // ERROR
|
return; // ERROR
|
||||||
|
|
||||||
ParticleGroup *srcgrp = _ps.GetGroupPtr(p_src_group_num);
|
ParticleGroup* srcgrp = _ps.GetGroupPtr(p_src_group_num);
|
||||||
if(srcgrp == NULL)
|
if (srcgrp == NULL)
|
||||||
return; // ERROR
|
return; // ERROR
|
||||||
|
|
||||||
ParticleGroup *destgrp = _ps.pgrp;
|
ParticleGroup* destgrp = _ps.pgrp;
|
||||||
if(destgrp == NULL)
|
if (destgrp == NULL)
|
||||||
return; // ERROR
|
return; // ERROR
|
||||||
|
|
||||||
// Find out exactly how many to copy.
|
// Find out exactly how many to copy.
|
||||||
int ccount = copy_count;
|
int ccount = copy_count;
|
||||||
if(ccount > srcgrp->p_count - index)
|
if (ccount > srcgrp->p_count - index)
|
||||||
ccount = srcgrp->p_count - index;
|
ccount = srcgrp->p_count - index;
|
||||||
if(ccount > destgrp->max_particles - destgrp->p_count)
|
if (ccount > destgrp->max_particles - destgrp->p_count)
|
||||||
ccount = destgrp->max_particles - destgrp->p_count;
|
ccount = destgrp->max_particles - destgrp->p_count;
|
||||||
|
|
||||||
// #pragma critical
|
// #pragma critical
|
||||||
// cerr << p_src_group_num << ": " << ccount << " " << srcgrp->p_count << " " << index << endl;
|
// cerr << p_src_group_num << ": " << ccount << " " << srcgrp->p_count << " " << index << endl;
|
||||||
|
|
||||||
if(ccount<0)
|
if (ccount < 0)
|
||||||
ccount = 0;
|
ccount = 0;
|
||||||
|
|
||||||
// Directly copy the particles to the current list.
|
// Directly copy the particles to the current list.
|
||||||
for(int i=0; i<ccount; i++)
|
for (int i = 0; i < ccount; i++)
|
||||||
{
|
{
|
||||||
destgrp->list[destgrp->p_count+i] =
|
destgrp->list[destgrp->p_count + i] =
|
||||||
srcgrp->list[index+i];
|
srcgrp->list[index + i];
|
||||||
}
|
}
|
||||||
destgrp->p_count += ccount;
|
destgrp->p_count += ccount;
|
||||||
}
|
}
|
||||||
|
|
||||||
PARTICLEDLL_API ParticleGroup* pGetParticleGroupRef(int p_group_num)
|
ParticleGroup* pGetParticleGroupRef(int p_group_num)
|
||||||
{
|
{
|
||||||
ParticleGroup* theGroup = NULL;
|
ParticleGroup* theGroup = NULL;
|
||||||
|
|
||||||
_ParticleState &_ps = _GetPState();
|
_ParticleState& _ps = _GetPState();
|
||||||
|
|
||||||
if(!_ps.in_new_list)
|
if (!_ps.in_new_list)
|
||||||
{
|
{
|
||||||
theGroup = _ps.GetGroupPtr(p_group_num);
|
theGroup = _ps.GetGroupPtr(p_group_num);
|
||||||
}
|
}
|
||||||
return theGroup;
|
return theGroup;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Copy from the current group to application memory.
|
// Copy from the current group to application memory.
|
||||||
PARTICLEDLL_API int pGetParticles(int index, int count, float *verts,
|
int pGetParticles(int index, int count, float* verts,
|
||||||
float *color, float *vel, float *size, float *age)
|
float* color, float* vel, float* size, float* age)
|
||||||
{
|
{
|
||||||
_ParticleState &_ps = _GetPState();
|
_ParticleState& _ps = _GetPState();
|
||||||
|
|
||||||
// XXX I should think about whether color means color3, color4, or what.
|
// XXX I should think about whether color means color3, color4, or what.
|
||||||
// For now, it means color4.
|
// For now, it means color4.
|
||||||
|
|
||||||
if(_ps.in_new_list)
|
if (_ps.in_new_list)
|
||||||
return -1; // ERROR
|
return -1; // ERROR
|
||||||
|
|
||||||
ParticleGroup *pg = _ps.pgrp;
|
ParticleGroup* pg = _ps.pgrp;
|
||||||
if(pg == NULL)
|
if (pg == NULL)
|
||||||
return -2; // ERROR
|
return -2; // ERROR
|
||||||
|
|
||||||
if(index < 0 || count < 0)
|
if (index < 0 || count < 0)
|
||||||
return -3; // ERROR
|
return -3; // ERROR
|
||||||
|
|
||||||
if(index + count > pg->p_count)
|
if (index + count > pg->p_count)
|
||||||
{
|
{
|
||||||
count = pg->p_count - index;
|
count = pg->p_count - index;
|
||||||
if(count <= 0)
|
if (count <= 0)
|
||||||
return -4; // ERROR index out of bounds.
|
return -4; // ERROR index out of bounds.
|
||||||
}
|
}
|
||||||
|
|
||||||
int vi = 0, ci = 0, li = 0, si = 0, ai = 0;
|
int vi = 0, ci = 0, li = 0, si = 0, ai = 0;
|
||||||
|
|
||||||
// This could be optimized.
|
// This could be optimized.
|
||||||
for(int i=0; i<count; i++)
|
for (int i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
Particle &m = pg->list[index + i];
|
Particle& m = pg->list[index + i];
|
||||||
|
|
||||||
if(verts)
|
if (verts)
|
||||||
{
|
{
|
||||||
verts[vi++] = m.pos.x;
|
verts[vi++] = m.pos.x;
|
||||||
verts[vi++] = m.pos.y;
|
verts[vi++] = m.pos.y;
|
||||||
verts[vi++] = m.pos.z;
|
verts[vi++] = m.pos.z;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(color)
|
if (color)
|
||||||
{
|
{
|
||||||
color[ci++] = m.color.x;
|
color[ci++] = m.color.x;
|
||||||
color[ci++] = m.color.y;
|
color[ci++] = m.color.y;
|
||||||
|
@ -870,39 +872,40 @@ PARTICLEDLL_API int pGetParticles(int index, int count, float *verts,
|
||||||
color[ci++] = m.alpha;
|
color[ci++] = m.alpha;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(vel)
|
if (vel)
|
||||||
{
|
{
|
||||||
vel[li++] = m.vel.x;
|
vel[li++] = m.vel.x;
|
||||||
vel[li++] = m.vel.y;
|
vel[li++] = m.vel.y;
|
||||||
vel[li++] = m.vel.z;
|
vel[li++] = m.vel.z;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(size)
|
if (size)
|
||||||
{
|
{
|
||||||
size[si++] = m.size.x;
|
size[si++] = m.size.x;
|
||||||
size[si++] = m.size.y;
|
size[si++] = m.size.y;
|
||||||
size[si++] = m.size.z;
|
size[si++] = m.size.z;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(age)
|
if (age)
|
||||||
{
|
{
|
||||||
age[ai++] = m.age;
|
age[ai++] = m.age;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns the number of particles currently in the group.
|
// Returns the number of particles currently in the group.
|
||||||
PARTICLEDLL_API int pGetGroupCount()
|
int pGetGroupCount()
|
||||||
{
|
{
|
||||||
_ParticleState &_ps = _GetPState();
|
_ParticleState& _ps = _GetPState();
|
||||||
|
|
||||||
if(_ps.in_new_list)
|
if (_ps.in_new_list)
|
||||||
return 0; // ERROR
|
return 0; // ERROR
|
||||||
|
|
||||||
if(_ps.pgrp == NULL)
|
if (_ps.pgrp == NULL)
|
||||||
return 0; // ERROR
|
return 0; // ERROR
|
||||||
|
|
||||||
return _ps.pgrp->p_count;
|
return _ps.pgrp->p_count;
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue