///////////////////////////////
#include <acknex.h>
#include <default.c>
#include <d3d9.h>
///////////////////////////////
BMAP* bmpTest = "tex1024x1024.tga";
BMAP* bmpTestb = "tex1024x1024b.tga";
void levelNull()
{
level_load(NULL);
}
void material_set_texture(MATERIAL * mat, BMAP * bmap, char * name)
{
LPDIRECT3DTEXTURE9 tex = (LPDIRECT3DTEXTURE9)bmap->d3dtex;
if(tex == NULL)
{
printf("error in 'material_set_texture()': empty d3dtex pointer");
return;
}
if(mat == NULL)
{
printf("error in 'material_set_texture()': empty material pointer");
return;
}
if(name == NULL)
{
printf("error in 'material_set_texture()': empty name pointer");
return;
}
LPD3DXEFFECT eff = (LPD3DXEFFECT)mat->d3deffect;
if(eff != NULL)
{
eff->SetTexture(name, tex);
}
else
{
printf("error in 'material_set_texture()': empty effect");
return;
}
}
MATERIAL* mats[500];
void main()
{
fps_max = 9999;
video_mode = 10;
level_load(NULL);
int testMode = 0; // (0 == manual), (1 == _bmap)
int i;
for(i = 0; i < 500; i++)
{
MATERIAL* matNew = mtl_create();
if(testMode)
{
you = ent_create(CUBE_MDL,vector(100+random(100),random(100)-50,random(100)-50),NULL); //
effect_load(matNew,"testBmap.fx");
}
else
{
you = ent_create(CUBE_MDL,vector(100+random(100),random(100)-50,random(100)-50),NULL);
effect_load(matNew,"test.fx");
}
your.material = matNew;
mats[i] = matNew;
}
on_space = levelNull;
while(1)
{
DEBUG_VAR(time_frame*1000.0/16.0,200);
if(key_e)
{
for(i = 0; i < 500; i++)
{
material_set_texture(mats[i],bmpTest,"bmpTest_bma");
material_set_texture(mats[i],bmpTestb,"bmpTestb_bma");
}
}
if(total_frames < 3)
{
draw_quad(bmpTest,vector(0,0,0),NULL,NULL,NULL,NULL,100,0);
draw_quad(bmpTestb,vector(0,0,0),NULL,NULL,NULL,NULL,100,0);
}
wait(1);
}
}