Jump to content

  • Log In with Google      Sign In   
  • Create Account

JeZ-l-Lee

Member Since 03 Jul 2010
Offline Last Active Oct 28 2014 09:07 AM

Topics I've Started

JeZxLee's"TetriAttack 3":Open-Source Cross-Platform!

28 October 2014 - 09:07 AM

JeZxLee's"TetriAttack 3":Open-Source Cross-Platform!

 

Hi,

My development team and I are proud to release our new open-source cross-platform puzzle game called "TetriAttack 3".
This is a nearly completed "Release Candidate" and we were hoping some of the people here could help test it.
After the conclusion of testing, the game will be released to OpenPandora Linux handheld console computer.

If you would like to help out then please download, decompress and play the ZIP file located at the below URL link:
TA3-WinLinux-ReleaseCandidate.zip
The ZIP contains both Windows and Linux versions(a makefile is included to build executable on any Linux distro)

Game Requirements:
- Windows XP/Vista/7/8 32Bit/64Bit desktop or notebook
- Any Linux 32Bit/64Bit desktop or notebook

* To build on Linux you will need the following:
- G++
- SDL 1.2 + dev
- SDL_Image 1.2 + dev
- SDL_Mixer 1.2 + dev
- SDL_TTF 1.2 + dev
- OpenGL for good performance

Thanks in advance!

JeZxLee
16BitSoft Inc.
Video Game Design Studio
www.16BitSoft.com

TA3-RC1_InGame.png
TA3-RC1_Title.png

 


JeZxLee's "Pixel Artist 2" - Open-Source Cross-Platform!

06 May 2014 - 02:13 AM

JeZxLee's "Pixel Artist 2" - Open-Source Cross-Platform!
 
Hi, 
 
My team and I are proud to announce the Beta1 release of our new SDL1 game: "Pixel Artist 2". 
Game is 100% open-source cross-platform and runs on ANY Windws® or Linux desktop or notebook. 
(MakeFile is included to build game on any Linux O.S.) 
 
Game Idea is 100% unique and not copied from any other video game ever made. 
 
Click below URL link to download the complete project with source code:
 
At the conclusion of Beta testing the game will be ported to Google Android O.S. smartphones and tablets 
using licensed YoYo Games "GameMaker: Studio". 
 
Please help test our new game! 
 
Some Screenshots:
PA2_Title.png
PA2_InGame.png
 
_________________
JeZ+Lee 
JessePalser <AT> Gmail <DOT> com 
16BitSoft Inc.
Video Game Design Studio 
www.16BitSoft.com

DirectX 9.0c: DrawTextA() Onto DirectX Texture?

11 November 2013 - 07:18 AM

Hi,

 

I am trying without success to draw TTF text onto a DirectX 9 texture.

I am using the DirectX 9 "DrawTextA()" function.

 

Please look at the below code and tell me what is wrong with it.

(focus on the source at the bottom)

 

Thanks in advance.

 

JeZ+Lee

bool Visuals::LoadSpritesIntoMemoryAndInitialize(void)
{
HRESULT result;
char filePath[256];

    strcpy_s(filePath, "~\0");

    for (int index = 0; index < NumberOfSprites; index++)
    {
        switch(index)
        {
            case 0:
                strcpy_s(filePath, "Data/Visuals/Screen-Fade-Black-Box.png");
                break;

            case 5:
                strcpy_s(filePath, "Data/Visuals/16BitSoft-Logo.png");
                break;

            case 6:
                strcpy_s(filePath, "Data/Visuals/Title-BG.png");
                break;

            case 7:
                strcpy_s(filePath, "Data/Visuals/TC5-Logo.png");
                break;


            case 1001:
                strcpy_s(filePath, "Data/Visuals/Button.png");
                break;

            case 1002:
                strcpy_s(filePath, "Data/Visuals/Button.png");
                break;

            case 1003:
                strcpy_s(filePath, "Data/Visuals/Button.png");
                break;

            case 1004:
                strcpy_s(filePath, "Data/Visuals/Button.png");
                break;

            case 1005:
                strcpy_s(filePath, "Data/Visuals/Button.png");
                break;

            case 1006:
                strcpy_s(filePath, "Data/Visuals/Button.png");
                break;

            case 1007:
                strcpy_s(filePath, "Data/Visuals/Button.png");
                break;


            default:
                strcpy_s(filePath, "~");
                break;
        }

        strcat_s(filePath, "\0");

        if (filePath[0] != '~')
        {
            D3DXIMAGE_INFO imageInfo;
            result = D3DXGetImageInfoFromFileA(filePath, &imageInfo);
//            if FAILED (hResult){
//              return false;
//              }

            D3DXCreateTextureFromFileExA(DXDevice, filePath,  imageInfo.Width, imageInfo.Height, D3DX_DEFAULT, 0, D3DFMT_UNKNOWN,
                                         D3DPOOL_MANAGED, D3DX_DEFAULT, D3DX_DEFAULT, 0, NULL, NULL, &Sprites[index].Texture);

            result = D3DXCreateSprite(DXDevice, &Sprites[index].DXSprite);

            Sprites[index].ScreenX = 400.0f;
            Sprites[index].ScreenY = 240.0f;
            Sprites[index].ScaleX = 1.0f;
            Sprites[index].ScaleY = 1.0f;
            Sprites[index].RotationDegree = 0.0f;
            Sprites[index].RedHue = 255;
            Sprites[index].GreenHue = 255;
            Sprites[index].BlueHue = 255;
            Sprites[index].Transparency = 255;
            Sprites[index].Smooth = true;
            Sprites[index].FlipX = false;
            Sprites[index].FlipY = false;
            Sprites[index].OriginalWidth = imageInfo.Width;
            Sprites[index].OriginalHeight = imageInfo.Height;

            D3DSURFACE_DESC textureInfo;
            Sprites[index].Texture->GetLevelDesc(0, &textureInfo);
            Sprites[index].TextureWidth = textureInfo.Width;
            Sprites[index].TextureHeight = textureInfo.Height;

            Sprites[index].AnimationTimer = -1.0f;

            if (index > 1000 && index < 1008)
            {
                LPDIRECT3DSURFACE9 pRenderSurface = NULL;
                Sprites[index].Texture->GetSurfaceLevel(0, &pRenderSurface);
                DXDevice->SetRenderTarget(0, pRenderSurface);

                DXDevice->BeginScene();
                DXDevice->SetTexture(0, Sprites[index].Texture);

                RECT rect, textSize;
                int posX, posY;

                Font[0]->DrawTextA( NULL, "START!", -1, &textSize, DT_CALCRECT, D3DCOLOR_RGBA(255, 255, 255, 255) );

                posX = (Sprites[index].TextureWidth / 2) - (textSize.right / 2) - 3;
                posY = Sprites[index].TextureHeight / 2;

                for (int screenY = -2; screenY < 3; screenY++)
                {
                    for (int screenX = -2; screenX < 3; screenX++)
                    {
                        SetRect( &rect, posX+screenX, posY+screenY, 0, 0 );
                        if (screenY != 0 && screenX != 0)
                            Font[0]->DrawTextA(NULL, "START!", -1, &rect, DT_NOCLIP, D3DCOLOR_RGBA(100, 100, 100, 255) );
                    }
                }

                SetRect( &rect, posX, posY, 0, 0 );
                Font[0]->DrawTextA( NULL, "START!", -1, &rect, DT_NOCLIP, D3DCOLOR_RGBA(255, 255, 255, 255) );

                DXDevice->EndScene();
            }
        }
    }

    return(true);
}


DirectX 9.0c: Draw TTF Text On DirectX Sprite?

10 November 2013 - 10:09 AM

Hi,

 

I am working on a DirectX 9.0c 2D game engine now.

I am currently designing the interface core.

 

My question is:

Can I draw TTF text onto a DirectX Sprite?

Imagine that I have a single blank button PNG image.

And I load it 7 times and draw the following texts on it:

[START!]

[Options]

[How To Play]

[High Scores]

[About]

[Exit]

[Back]

 

The 7 button PNG images are loaded as DirectX Sprites.

 

Any help would be appreciated!

Thank you!

 

JeZ+Lee

 

TC5-Buttons_Have_No_Text.png

//-------------------------------------------------------------------------------------------------------------------------------
bool Visuals::LoadSpritesIntoMemoryAndInitialize(void)
{
HRESULT result;
char filePath[256];

    strcpy_s(filePath, "~\0");

    for (int index = 0; index < NumberOfSprites; index++)
    {
        switch(index)
        {
            case 0:
                strcpy_s(filePath, "Data/Visuals/Screen-Fade-Black-Box.png");
                break;

            case 5:
                strcpy_s(filePath, "Data/Visuals/16BitSoft-Logo.png");
                break;

            case 6:
                strcpy_s(filePath, "Data/Visuals/Title-BG.png");
                break;

            case 7:
                strcpy_s(filePath, "Data/Visuals/TC5-Logo.png");
                break;


            case 1001:
                strcpy_s(filePath, "Data/Visuals/Button.png");
                break;

            case 1002:
                strcpy_s(filePath, "Data/Visuals/Button.png");
                break;

            case 1003:
                strcpy_s(filePath, "Data/Visuals/Button.png");
                break;

            case 1004:
                strcpy_s(filePath, "Data/Visuals/Button.png");
                break;

            case 1005:
                strcpy_s(filePath, "Data/Visuals/Button.png");
                break;

            case 1006:
                strcpy_s(filePath, "Data/Visuals/Button.png");
                break;

            case 1007:
                strcpy_s(filePath, "Data/Visuals/Button.png");
                break;


            default:
                strcpy_s(filePath, "~");
                break;
        }

        strcat_s(filePath, "\0");

        if (filePath[0] != '~')
        {
            D3DXIMAGE_INFO imageInfo;
            result = D3DXGetImageInfoFromFileA(filePath, &imageInfo);
//            if FAILED (hResult){
//              return false;
//              }

            D3DXCreateTextureFromFileExA(DXDevice, filePath,  imageInfo.Width, imageInfo.Height, D3DX_DEFAULT, 0, D3DFMT_UNKNOWN,
                                         D3DPOOL_MANAGED, D3DX_DEFAULT, D3DX_DEFAULT, 0, NULL, NULL, &Sprites[index].Texture);

            result = D3DXCreateSprite(DXDevice, &Sprites[index].DXSprite);

            Sprites[index].ScreenX = 400.0f;
            Sprites[index].ScreenY = 240.0f;
            Sprites[index].ScaleX = 1.0f;
            Sprites[index].ScaleY = 1.0f;
            Sprites[index].RotationDegree = 0.0f;
            Sprites[index].RedHue = 255;
            Sprites[index].GreenHue = 255;
            Sprites[index].BlueHue = 255;
            Sprites[index].Transparency = 255;
            Sprites[index].Smooth = true;
            Sprites[index].FlipX = false;
            Sprites[index].FlipY = false;
            Sprites[index].OriginalWidth = imageInfo.Width;
            Sprites[index].OriginalHeight = imageInfo.Height;

            D3DSURFACE_DESC textureInfo;
            Sprites[index].Texture->GetLevelDesc(0, &textureInfo);
            Sprites[index].TextureWidth = textureInfo.Width;
            Sprites[index].TextureHeight = textureInfo.Height;

            Sprites[index].AnimationTimer = -1.0f;

            if (index > 1000 && index < 1008)
            {
                RECT rect, textSize;
                int posX, posY;

                textSize.top = 0;
                textSize.left = 0;
                textSize.right = textureInfo.Width;
                textSize.bottom = textureInfo.Height;

                D3DXMATRIX matrixFixTextAfterSpriteDrawing;
                D3DXMatrixTransformation2D(&matrixFixTextAfterSpriteDrawing, NULL, NULL, NULL, NULL, NULL, NULL);
                D3DXMatrixIdentity(&matrixFixTextAfterSpriteDrawing);

                Font[0]->DrawTextA( NULL, "START!", -1, &textSize, DT_CALCRECT, D3DCOLOR_RGBA(255, 255, 255, 255) );

                posX = (textureInfo.Width / 2) - (textSize.right / 2) - 3;
                posY = textureInfo.Height / 2;

                for (int screenY = -2; screenY < 3; screenY++)
                {
                    for (int screenX = -2; screenX < 3; screenX++)
                    {
                        SetRect( &rect, posX+screenX, posY+screenY, 0, 0 );
                        if (screenY != 0 && screenX != 0)
                        Font[0]->DrawTextA( Sprites[index].DXSprite, "START!", -1, &rect, DT_NOCLIP, D3DCOLOR_RGBA(100, 100, 100, 255) );
                    }
               }

               SetRect( &rect, posX, posY, 0, 0 );
               Font[0]->DrawTextA( Sprites[index].DXSprite, "START!", -1, &rect, DT_NOCLIP, D3DCOLOR_RGBA(255, 255, 255, 255) );
            }
        }
    }

    return(true);
}


DirectX 9.0c: Handling "Lost Device"?

09 November 2013 - 07:19 AM

Hi,

 

What is the best method to handle a "lost device" in DirectX 9.0c?

Please look at the source code below and tell me if I am doing it correctly or not.

I "Reset" the DirectX device and reload the DirectX Sprites...

 

Thanks!

 

JeZ+Lee

 

 

Sprite Loading Function:

bool Visuals::LoadSpritesIntoMemoryAndInitialize(bool DeviceReset)
{
HRESULT result;
char filePath[256];

    strcpy_s(filePath, "~\0");

    for (int index = 0; index < NumberOfSprites; index++)
    {
        switch(index)
        {
            case 0:
                strcpy_s(filePath, "Data/Visuals/Screen-Fade-Black-Box.png");
                break;

            case 5:
                strcpy_s(filePath, "Data/Visuals/16BitSoft-Logo.png");
                break;

            case 6:
                strcpy_s(filePath, "Data/Visuals/Title-BG.png");
                break;

            case 7:
                strcpy_s(filePath, "Data/Visuals/TC5-Logo.png");
                break;

            default:
                strcpy_s(filePath, "~");
                break;
        }

        strcat_s(filePath, "\0");

        if (filePath[0] != '~')
        {
            D3DXIMAGE_INFO imageInfo;
            result = D3DXGetImageInfoFromFileA(filePath, &imageInfo);
//            if FAILED (hResult){
//            return false;
//            }

            D3DXCreateTextureFromFileExA(DXDevice, filePath,  imageInfo.Width, imageInfo.Height, D3DX_DEFAULT, 0, D3DFMT_UNKNOWN,
                                         D3DPOOL_MANAGED, D3DX_DEFAULT, D3DX_DEFAULT, 0, NULL, NULL, &Sprites[index].Texture);

            result = D3DXCreateSprite(DXDevice, &Sprites[index].DXSprite);

            if (DeviceReset == false)
            {
                Sprites[index].ScreenX = 400.0f;
                Sprites[index].ScreenY = 240.0f;
                Sprites[index].ScaleX = 1.0f;
                Sprites[index].ScaleY = 1.0f;
                Sprites[index].RotationDegree = 0.0f;
                Sprites[index].RedHue = 255;
                Sprites[index].GreenHue = 255;
                Sprites[index].BlueHue = 255;
                Sprites[index].Transparency = 255;
                Sprites[index].Smooth = true;
                Sprites[index].FlipX = false;
                Sprites[index].FlipY = false;
                Sprites[index].OriginalWidth = imageInfo.Width;
                Sprites[index].OriginalHeight = imageInfo.Height;

                D3DSURFACE_DESC textureInfo;
                Sprites[index].Texture->GetLevelDesc(0, &textureInfo);
                Sprites[index].TextureWidth = textureInfo.Width;
                Sprites[index].TextureHeight = textureInfo.Height;

                Sprites[index].AnimationTimer = -1.0f;
            }
        }
    }

    return(true);
}

Screen Render Function:

void Visuals::DisplayScreenBufferOntoDisplay(void)
{
HRESULT result;

    result = DXDevice->Present( NULL, NULL, NULL, NULL );

    if (result != D3D_OK)
    {
        D3DDISPLAYMODE d3ddm;
        DXD3D->GetAdapterDisplayMode( D3DADAPTER_DEFAULT, &d3ddm );
        D3DPRESENT_PARAMETERS d3dpp;
        ZeroMemory( &d3dpp, sizeof(d3dpp) );
        d3dpp.Windowed               = TRUE;
        d3dpp.SwapEffect             = D3DSWAPEFFECT_DISCARD;
        d3dpp.BackBufferFormat       = d3ddm.Format;
        d3dpp.EnableAutoDepthStencil = TRUE;
        d3dpp.AutoDepthStencilFormat = D3DFMT_D16;
        d3dpp.PresentationInterval   = D3DPRESENT_INTERVAL_IMMEDIATE;
        DXDevice->Reset(&d3dpp);

        for (int index = 0; index < NumberOfSprites; index++)
        {
            if (Sprites[index].DXSprite != NULL)  Sprites[index].DXSprite->Release();
            if (Sprites[index].Texture != NULL)  Sprites[index].Texture->Release();
        }

        LoadSpritesIntoMemoryAndInitialize(true);
    }
}

PARTNERS