fixed few bug in BitmapLoad/DrawGeometry
This commit is contained in:
@@ -79,7 +79,7 @@ namespace hgl
|
|||||||
io::OpenFileInputStream fis(filename);
|
io::OpenFileInputStream fis(filename);
|
||||||
|
|
||||||
if(!fis)
|
if(!fis)
|
||||||
return(false);
|
return(nullptr);
|
||||||
|
|
||||||
return LoadBitmapFromTGA<T>(&fis);
|
return LoadBitmapFromTGA<T>(&fis);
|
||||||
}
|
}
|
||||||
|
@@ -54,9 +54,9 @@ namespace hgl
|
|||||||
|
|
||||||
bool GetPixel(int x,int y,T &color)
|
bool GetPixel(int x,int y,T &color)
|
||||||
{
|
{
|
||||||
if(!data)return(false);
|
if(!bitmap)return(false);
|
||||||
|
|
||||||
T *p=GetData(x,y);
|
T *p=bitmap->GetData(x,y);
|
||||||
|
|
||||||
if(!p)return(false);
|
if(!p)return(false);
|
||||||
|
|
||||||
@@ -78,6 +78,11 @@ namespace hgl
|
|||||||
return(true);
|
return(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool PutPixel(const Vector2i &v)
|
||||||
|
{
|
||||||
|
return PutPixel(v.x,v.y);
|
||||||
|
}
|
||||||
|
|
||||||
bool DrawHLine(int x,int y,int length)
|
bool DrawHLine(int x,int y,int length)
|
||||||
{
|
{
|
||||||
if(!bitmap)return(false);
|
if(!bitmap)return(false);
|
||||||
@@ -117,7 +122,7 @@ namespace hgl
|
|||||||
|
|
||||||
if(w<=0||h<=0)return(false);
|
if(w<=0||h<=0)return(false);
|
||||||
|
|
||||||
T *p=bitmap->GetData(x,y);
|
T *p=bitmap->GetData(l,t);
|
||||||
|
|
||||||
for(int y=t;y<t+h;y++)
|
for(int y=t;y<t+h;y++)
|
||||||
{
|
{
|
||||||
@@ -339,6 +344,11 @@ namespace hgl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DrawLine(const Vector2i &start,const Vector2i &end)
|
||||||
|
{
|
||||||
|
DrawLine(start.x,start.y,end.x,end.y);
|
||||||
|
}
|
||||||
|
|
||||||
void DrawSector(int x0, int y0, uint r, uint stangle, uint endangle)
|
void DrawSector(int x0, int y0, uint r, uint stangle, uint endangle)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user