fixed access method
This commit is contained in:
parent
1dbf8ae5c7
commit
6a7f8e7754
@ -151,11 +151,9 @@ private:
|
|||||||
{
|
{
|
||||||
struct PlaneGridCreateInfo pgci;
|
struct PlaneGridCreateInfo pgci;
|
||||||
|
|
||||||
pgci.grid_size.width =32;
|
pgci.grid_size.Set(32,32);
|
||||||
pgci.grid_size.height=32;
|
|
||||||
|
|
||||||
pgci.sub_count.width =8;
|
pgci.sub_count.Set(8,8);
|
||||||
pgci.sub_count.height=8;
|
|
||||||
|
|
||||||
pgci.lum=0.5;
|
pgci.lum=0.5;
|
||||||
pgci.sub_lum=0.75;
|
pgci.sub_lum=0.75;
|
||||||
@ -206,7 +204,7 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
bool Init(int w,int h) override
|
bool Init(uint w,uint h) override
|
||||||
{
|
{
|
||||||
if(!SceneAppFramework::Init(w,h))
|
if(!SceneAppFramework::Init(w,h))
|
||||||
return(false);
|
return(false);
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#define HGL_GRAPH_LIGHT_INCLUDE
|
#define HGL_GRAPH_LIGHT_INCLUDE
|
||||||
|
|
||||||
#include<hgl/math/Math.h>
|
#include<hgl/math/Math.h>
|
||||||
#include<hgl/type/Color4f.h>
|
#include<hgl/color/Color4f.h>
|
||||||
namespace hgl
|
namespace hgl
|
||||||
{
|
{
|
||||||
namespace graph
|
namespace graph
|
||||||
|
@ -166,24 +166,24 @@ namespace hgl
|
|||||||
{
|
{
|
||||||
PrimitiveCreater rc(db,vil);
|
PrimitiveCreater rc(db,vil);
|
||||||
|
|
||||||
if(!rc.Init(((pgci->grid_size.width+1)+(pgci->grid_size.height+1))*2))
|
if(!rc.Init(((pgci->grid_size.Width()+1)+(pgci->grid_size.Height()+1))*2))
|
||||||
return(nullptr);
|
return(nullptr);
|
||||||
|
|
||||||
AutoDelete<VB3f> vertex=rc.AccessVAD<VB3f>(VAN::Position);
|
AutoDelete<VB3f> vertex=rc.AccessVAD<VB3f>(VAN::Position);
|
||||||
|
|
||||||
const float right=float(pgci->grid_size.width)/2.0f;
|
const float right=float(pgci->grid_size.Width())/2.0f;
|
||||||
const float left =-right;
|
const float left =-right;
|
||||||
|
|
||||||
const float bottom=float(pgci->grid_size.height)/2.0f;
|
const float bottom=float(pgci->grid_size.Height())/2.0f;
|
||||||
const float top =-bottom;
|
const float top =-bottom;
|
||||||
|
|
||||||
for(int row=0;row<=pgci->grid_size.height;row++)
|
for(int row=0;row<=pgci->grid_size.Height();row++)
|
||||||
{
|
{
|
||||||
vertex->WriteLine( Vector3f(left ,top+row,0),
|
vertex->WriteLine( Vector3f(left ,top+row,0),
|
||||||
Vector3f(right,top+row,0));
|
Vector3f(right,top+row,0));
|
||||||
}
|
}
|
||||||
|
|
||||||
for(int col=0;col<=pgci->grid_size.width;col++)
|
for(int col=0;col<=pgci->grid_size.Width();col++)
|
||||||
{
|
{
|
||||||
vertex->WriteLine(Vector3f(left+col,top, 0),
|
vertex->WriteLine(Vector3f(left+col,top, 0),
|
||||||
Vector3f(left+col,bottom,0));
|
Vector3f(left+col,bottom,0));
|
||||||
@ -192,17 +192,17 @@ namespace hgl
|
|||||||
AutoDelete<VB1f> lum=rc.AccessVAD<VB1f>(VAN::Luminance);
|
AutoDelete<VB1f> lum=rc.AccessVAD<VB1f>(VAN::Luminance);
|
||||||
if(lum)
|
if(lum)
|
||||||
{
|
{
|
||||||
for(int row=0;row<=pgci->grid_size.height;row++)
|
for(int row=0;row<=pgci->grid_size.Height();row++)
|
||||||
{
|
{
|
||||||
if((row%pgci->sub_count.height)==0)
|
if((row%pgci->sub_count.Height())==0)
|
||||||
lum->RepeatWrite(pgci->sub_lum,2);
|
lum->RepeatWrite(pgci->sub_lum,2);
|
||||||
else
|
else
|
||||||
lum->RepeatWrite(pgci->lum,2);
|
lum->RepeatWrite(pgci->lum,2);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(int col=0;col<=pgci->grid_size.width;col++)
|
for(int col=0;col<=pgci->grid_size.Width();col++)
|
||||||
{
|
{
|
||||||
if((col%pgci->sub_count.width)==0)
|
if((col%pgci->sub_count.Width())==0)
|
||||||
lum->RepeatWrite(pgci->sub_lum,2);
|
lum->RepeatWrite(pgci->sub_lum,2);
|
||||||
else
|
else
|
||||||
lum->RepeatWrite(pgci->lum,2);
|
lum->RepeatWrite(pgci->lum,2);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user