DCDecomp
A decompilation of Dark Cloud for the PlayStation 2
Loading...
Searching...
No Matches
CWater Class Reference

#include <water.hpp>

Public Member Functions

void SetVertex (float *corner0, float *corner1, float *corner2, float *corner3)
 
void SetSize (int rows, int columns, CDataAlloc2< 1 > *arena)
 
void SetParam (float wave_speed, float damping, float height_scale, float distortion)
 
void SetColor (u_char red, u_char green, u_char blue, u_char alpha)
 
void Shake (int x, int y, float height_change)
 
void Hamon ()
 
void DrawVu1 (RenderInfo *info, sceVif1Packet *packet, u_long128 *buffer)
 
void SetVertex (float *v0, float *v1, float *v2, float *v3)
 
void SetSize (int x, int y, CDataAlloc2< 1 > *buffer)
 
void SetParam (float wave_speed, float damping, float height_scale, float distortion)
 
void SetColor (u_char r, u_char g, u_char b, u_char a)
 
void Shake (int x, int y, float power)
 
void Hamon ()
 
int DrawVu1 (RenderInfo *info, sceVif1Packet *packet, u_long128 *parent_info)
 
void SetVertex (float *corner0, float *corner1, float *corner2, float *corner3)
 
void SetSize (int row_count, int column_count, CDataAlloc2< 1 > *arena)
 
void SetParam (float speed, float damping_rate, float scale, float shift)
 
void SetColor (u_char red, u_char green, u_char blue, u_char alpha)
 
void Shake (int x, int y, float height_change)
 
void Hamon ()
 
int DrawVu1 (RenderInfo *info, sceVif1Packet *packet, u_long128 *parent_info)
 
CWater & operator= (CWater &src)
 
void SetParam (float speed, float damping_rate, float scale, float shift)
 
void SetColor (unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha)
 
int CreateVUData (unsigned int *output, RenderInfo *info)
 
int DrawVu1 (RenderInfo *info, sceVif1Packet *packet, RenderInfo *parent_info)
 
int CheckClip ()
 
void Hamon ()
 
void SetVertex (float *corner0, float *corner1, float *corner2, float *corner3)
 
void Shake (int row, int column, float height_change)
 
void SetSize (int row_count, int column_count, CDataAlloc2< 1 > *arena)
 
 CWater ()
 

Public Attributes

s32 rows
 
s32 columns
 
float * height
 
float * height_a
 
float * height_b
 
sceVu0FVECTOR vertex [4]
 
u_int * packet [3]
 
CVisualPolyVu1 visual
 
u8 color [4]
 
float wave_speed
 
float damping
 
float height_scale
 
float distortion
 
s32 tags_built
 
CFrameVu1 frame
 
char unk_00 [176]
 

Detailed Description

Draws the water surface of one map part.

Definition at line 135 of file op_c.cpp.

Constructor & Destructor Documentation

◆ CWater() [1/2]

CWater::CWater ( )

Definition at line 410 of file water.cpp.

◆ CWater() [2/2]

CWater::CWater ( )

Clears the grid, gives the surface a half-bright white and sets the ripple constants.

Mangled name:
__ct__6CWaterFv
Address:
0x1615C0
Size:
0x8C

Member Function Documentation

◆ SetVertex() [1/2]

void CWater::SetVertex ( float *  corner0,
float *  corner1,
float *  corner2,
float *  corner3 
)

Definition at line 349 of file water.cpp.

◆ SetSize() [1/2]

void CWater::SetSize ( int  rows,
int  columns,
CDataAlloc2< 1 > *  arena 
)

Definition at line 381 of file water.cpp.

◆ SetParam() [1/2]

void CWater::SetParam ( float  wave_speed,
float  damping,
float  height_scale,
float  distortion 
)

Definition at line 50 of file water.cpp.

◆ SetColor() [1/2]

void CWater::SetColor ( u_char  red,
u_char  green,
u_char  blue,
u_char  alpha 
)

Definition at line 57 of file water.cpp.

◆ Shake() [1/2]

void CWater::Shake ( int  x,
int  y,
float  height_change 
)

Definition at line 356 of file water.cpp.

◆ Hamon() [1/2]

void CWater::Hamon ( )

Definition at line 315 of file water.cpp.

◆ operator=()

CWater & CWater::operator= ( CWater &  src)

Copies one surface over another, field by field.

Mangled name:
__as__6CWaterFR6CWater
Address:
0x143260
Size:
0xF4
Return type:
Not recovered.

Definition at line 1656 of file main.cpp.

◆ SetParam() [2/2]

void CWater::SetParam ( float  speed,
float  damping_rate,
float  scale,
float  shift 
)

Stores the ripple speed and damping and the two scales the surface is drawn with.

Mangled name:
SetParam__6CWaterFffff
Address:
0x1607A0
Size:
0x18

◆ SetColor() [2/2]

void CWater::SetColor ( unsigned char  red,
unsigned char  green,
unsigned char  blue,
unsigned char  alpha 
)

Sets the red, green, blue and alpha channels of the surface.

Mangled name:
SetColor__6CWaterFUcUcUcUc
Address:
0x1607C0
Size:
0x18

◆ CreateVUData()

int CWater::CreateVUData ( unsigned int *  output,
RenderInfo *  info 
)

Builds the vector-unit packet that draws the surface, one quad per grid cell.

Mangled name:
CreateVUData__6CWaterFPUiP10RenderInfo
Address:
0x1607E0
Size:
0x740

Definition at line 64 of file water.cpp.

◆ DrawVu1()

int CWater::DrawVu1 ( RenderInfo *  info,
sceVif1Packet *  packet,
RenderInfo *  parent_info 
)

Draws the surface through the vector unit.

Mangled name:
DrawVu1__6CWaterFP10RenderInfoP13sceVif1PacketP1
Address:
0x160F20
Size:
0x1DC

◆ CheckClip()

int CWater::CheckClip ( )

Clips the surface against the view using the world-space box its four corners span.

Mangled name:
CheckClip__6CWaterFv
Address:
0x161100
Size:
0xC4

Definition at line 303 of file water.cpp.

◆ Hamon() [2/2]

void CWater::Hamon ( )

Advances the ripples one step, writing into whichever of the two height buffers is not being drawn.

Mangled name:
Hamon__6CWaterFv
Address:
0x1611D0
Size:
0x108

◆ SetVertex() [2/2]

void CWater::SetVertex ( float *  corner0,
float *  corner1,
float *  corner2,
float *  corner3 
)

Copies four corner positions into the water surface.

Mangled name:
SetVertex__6CWaterFPfPfPfPf
Address:
0x1612E0
Size:
0x84

◆ Shake() [2/2]

void CWater::Shake ( int  row,
int  column,
float  height_change 
)

Raises one interior grid cell, starting a ripple from it.

Mangled name:
Shake__6CWaterFiif
Address:
0x161370
Size:
0x9C

◆ SetSize() [2/2]

void CWater::SetSize ( int  row_count,
int  column_count,
CDataAlloc2< 1 > *  arena 
)

Gives the surface its grid size and takes the two height buffers out of an arena.

Mangled name:
SetSize__6CWaterFiiP14CDataAlloc2_1_
Address:
0x161410
Size:
0x1A4

Member Data Documentation

◆ rows

s32 CWater::rows

Grid rows the surface is divided into.

Definition at line 137 of file op_c.cpp.

◆ columns

s32 CWater::columns

Grid columns the surface is divided into.

Definition at line 138 of file op_c.cpp.

◆ height

float * CWater::height

Wave heights the surface currently draws from.

Definition at line 139 of file op_c.cpp.

◆ height_a

float * CWater::height_a

First of the two wave-height buffers.

Definition at line 140 of file op_c.cpp.

◆ height_b

float * CWater::height_b

Second of the two wave-height buffers.

Definition at line 141 of file op_c.cpp.

◆ vertex

sceVu0FVECTOR CWater::vertex

The four corners of the surface.

Definition at line 142 of file op_c.cpp.

◆ packet

u_int * CWater::packet

VU packets, including one for each display buffer.

Definition at line 143 of file op_c.cpp.

◆ visual

CVisualPolyVu1 CWater::visual

Draws the polygons of the surface.

Definition at line 144 of file op_c.cpp.

◆ color

u8 CWater::color

Red, green, blue and alpha channels of the surface.

Definition at line 145 of file op_c.cpp.

◆ wave_speed

float CWater::wave_speed

Speed the ripples travel across the grid at.

Definition at line 146 of file op_c.cpp.

◆ damping

float CWater::damping

Rate the ripples lose height at.

Definition at line 147 of file op_c.cpp.

◆ height_scale

float CWater::height_scale

Scale from a wave height to the vertical displacement of its vertex.

Definition at line 148 of file op_c.cpp.

◆ distortion

float CWater::distortion

Scale from a height difference to the texture-coordinate shift it causes.

Definition at line 149 of file op_c.cpp.

◆ tags_built

s32 CWater::tags_built

Set once both packets hold their tags, so rebuilds write only vertex data.

Definition at line 150 of file op_c.cpp.

◆ frame

CFrameVu1 CWater::frame

Places and draws the water surface.

Frame that places the plane in the world.

Definition at line 151 of file op_c.cpp.

◆ unk_00

char CWater::unk_00

Definition at line 82 of file rushmovi.cpp.