Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 0 additions & 60 deletions Core/Libraries/Source/WWVegas/WW3D2/sortingrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -659,63 +659,3 @@ void SortingRendererClass::Deinit()
temp_index_array=nullptr;
temp_index_array_count=0;
}


// ----------------------------------------------------------------------------
//
// Insert a VolumeParticle triangle into the sorting system.
//
// ----------------------------------------------------------------------------

void SortingRendererClass::Insert_VolumeParticle(
const SphereClass& bounding_sphere,
unsigned short start_index,
unsigned short polygon_count,
unsigned short min_vertex_index,
unsigned short vertex_count,
unsigned short layerCount)
{
if (!WW3D::Is_Sorting_Enabled()) {
DX8Wrapper::Draw_Triangles(start_index,polygon_count,min_vertex_index,vertex_count);
return;
}

//FOR VOLUME_PARTICLE LOGIC:
// WE MUST MULTIPLY THE VERTCOUNT AND POLYCOUNT BY THE VOLUME_PARTICLE DEPTH
DX8_RECORD_SORTING_RENDER( polygon_count * layerCount,vertex_count * layerCount);//THIS IS VOLUME_PARTICLE SPECIFIC

SortingNodeStruct* state=Get_Sorting_Struct();
DX8Wrapper::Get_Render_State(state->sorting_state);

WWASSERT(
((state->sorting_state.index_buffer_type==BUFFER_TYPE_SORTING || state->sorting_state.index_buffer_type==BUFFER_TYPE_DYNAMIC_SORTING) &&
(state->sorting_state.vertex_buffer_types[0]==BUFFER_TYPE_SORTING || state->sorting_state.vertex_buffer_types[0]==BUFFER_TYPE_DYNAMIC_SORTING)));

state->bounding_sphere=bounding_sphere;
state->start_index=start_index;
state->min_vertex_index=min_vertex_index;
state->polygon_count=polygon_count * layerCount;//THIS IS VOLUME_PARTICLE SPECIFIC
state->vertex_count=vertex_count * layerCount;//THIS IS VOLUME_PARTICLE SPECIFIC

SortingVertexBufferClass* vertex_buffer=static_cast<SortingVertexBufferClass*>(state->sorting_state.vertex_buffers[0]);
WWASSERT(vertex_buffer);
WWASSERT(state->vertex_count<=vertex_buffer->Get_Vertex_Count());

// Transform the center point to view space for sorting

D3DXMATRIX mtx=(D3DXMATRIX&)state->sorting_state.world*(D3DXMATRIX&)state->sorting_state.view;
D3DXVECTOR3 vec=(D3DXVECTOR3&)state->bounding_sphere.Center;
D3DXVECTOR4 transformed_vec;
D3DXVec3Transform(
&transformed_vec,
&vec,
&mtx);
state->transformed_center=Vector3(transformed_vec[0],transformed_vec[1],transformed_vec[2]);


// BUT WHAT IS THE DEAL WITH THE VERTCOUNT AND POLYCOUNT BEING N BUT TRANSFORMED CENTER COUNT == 1

//THE TRANSFORMED CENTER[2] IS THE ZBUFFER DEPTH

Insert_To_Sorted_List(state);
}
8 changes: 0 additions & 8 deletions Core/Libraries/Source/WWVegas/WW3D2/sortingrenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,6 @@ class SortingRendererClass
unsigned short min_vertex_index,
unsigned short vertex_count);

static void Insert_VolumeParticle(
const SphereClass& bounding_sphere,
unsigned short start_index,
unsigned short polygon_count,
unsigned short min_vertex_index,
unsigned short vertex_count,
unsigned short layerCount);

static void Flush();
static void Deinit();

Expand Down
Loading