⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 showmsg.cpp

📁 3D俄罗斯方块源码.rar
💻 CPP
字号:
//--------------------------------------------------------------
/**\!File
  *
  *File name:SHOWMSG.cpp
  *
  *His:add by honghaier @2004/4/27
  *
  *Desc:SHOWMSG类
  */
//---------------------------------------------------------------
#include "ShowMsg.h"
#include "BASIC.h"
int g_stop[10][40]={
{0,0,0,0,1,1,1,0,0,0, 1,1,1,1,1,1,1,1,1,1, 0,0,0,0,1,1,0,0,0,0, 1,1,1,1,1,1,0,0,0,0},
{0,0,1,1,0,0,0,1,1,0, 1,0,0,0,1,1,0,0,0,1, 0,0,0,1,1,1,1,0,0,0, 0,1,1,0,0,0,1,1,0,0},
{0,0,1,1,0,0,0,0,0,0, 0,0,0,0,1,1,0,0,0,0, 0,0,1,0,0,0,0,1,0,0, 0,1,1,0,0,0,0,1,1,0},
{0,0,0,1,0,0,0,0,0,0, 0,0,0,0,1,1,0,0,0,0, 0,1,0,0,0,0,0,0,1,0, 0,1,1,0,0,0,0,1,1,0},
{0,0,0,0,1,0,0,0,0,0, 0,0,0,0,1,1,0,0,0,0, 1,1,0,0,0,0,0,0,1,1, 0,1,1,0,0,0,1,1,0,0},
{0,0,0,0,0,1,1,0,0,0, 0,0,0,0,1,1,0,0,0,0, 1,1,0,0,0,0,0,0,1,1, 0,1,1,1,1,1,1,0,0,0},
{0,0,0,0,0,0,1,1,0,0, 0,0,0,0,1,1,0,0,0,0, 0,1,0,0,0,0,0,0,1,0, 0,1,1,0,0,0,0,0,0,0},
{0,0,1,1,0,0,1,1,0,0, 0,0,0,0,1,1,0,0,0,0, 0,0,1,0,0,0,0,1,0,0, 0,1,1,0,0,0,0,0,0,0},	
{0,0,0,1,0,0,1,0,0,0, 0,0,0,0,1,1,0,0,0,0, 0,0,0,1,1,1,1,0,0,0, 0,1,1,0,0,0,0,0,0,0},
{0,0,0,0,1,1,0,0,0,0, 0,0,0,0,1,1,0,0,0,0, 0,0,0,0,1,1,0,0,0,0, 0,1,1,0,0,0,0,0,0,0}};
//---------------------------------------------------------------
bool ShowMsg::Init(LPDIRECT3DDEVICE8 g_pD3DDevice,C2DSOUND *_sound)
{	
	m_pD3DDevice=g_pD3DDevice;
	m_sound=_sound;
    m_tile=new CCuboid(m_pD3DDevice);
	m_tile->SetSize(2.0,2.0,2.0);
	m_tile->SetTexture("tex\\wood7.jpg");
	m_sound->Load("sou\\xiao.wav");
	return true;
}
ShowMsg::~ShowMsg()
{
SAFE_DELETE(m_tile);
}
void ShowMsg::SetMsg(int _type)
{
	switch(_type)
	{
	case 1:
		szInfo=&g_stop[0][0];
		break;
	case 2:
		break;
	case 3:
		break;
	case 4:
		break;
	}
}
void ShowMsg::Show()
{
	//static float t_x=0.0;

	//m_sound->Play();
	for(int i=0;i<10;i++)
		for(int j=0;j<40;j++)
		{
			if(szInfo[i*40+j]==1)
			{
	D3DXMATRIX matWorld,matWorld1;
	D3DXMatrixIdentity(&matWorld);
    D3DXMatrixRotationY( &matWorld, timeGetTime()/1000.f );
	D3DXMatrixIdentity(&matWorld1);
	D3DXMatrixTranslation(&matWorld1,80.0+j*2.0,-115.0+(-2.0)*i,-150.0f);
	D3DXMatrixMultiply(&matWorld,&matWorld,&matWorld1);
	m_pD3DDevice->SetTransform( D3DTS_WORLD, &matWorld);
	m_tile->Render();
			}
		}

//	}
/*
	else
	{
		m_sound->Play();
	D3DXMATRIX matWorld;
	D3DXMatrixIdentity(&matWorld);
    D3DXMatrixRotationY( &matWorld, timeGetTime()/10000.f );
	for(int i=0;i<10;i++)
		for(int j=0;j<40;j++)
		{
			if(szInfo[i*40+j]==1)
			{	
				  if(t_x>0)
				  {
					t_x-=0.1;
	D3DXMatrixTranslation(&matWorld,115.1,-125.0f,-150.0f);	
				  }
	m_pD3DDevice->SetTransform( D3DTS_WORLD, &matWorld);
	m_tile->Render();
			}
		}
	}
	*/
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -