ide, launcher: Move to new directory

This commit is contained in:
Michael Fabian 'Xaymar' Dirks
2019-01-19 18:31:46 +01:00
parent 0c3e74df62
commit c2f795e4ef
50 changed files with 2797 additions and 3416 deletions
+87
View File
@@ -0,0 +1,87 @@
#include <string>
#include <windows.h>
#include "checkdx.h"
#include "checkie.h"
using namespace std;
static const char* dx_err =
"You must have DirectX version 7 installed to run Blitz Basic.\n\n"
"DirectX 7 is provided on the Blitz Basic CD in the DirectX7 folder.\n\n"
"The latest version of DirectX is available from www.microsoft.com";
static const char* ie_err =
"You must have Internet Explorer version 4 installed to run Blitz Basic.\n\n"
"Internet Explorer 5 is provided on the Blitz Basic CD in the IExplorer5 folder.\n\n"
"The latest version of Internet Explorer is available from www.microsoft.com";
static const char* bb_err = "Unable to run Blitz Basic";
static const char* md_err =
"Your desktop must be in high-colour mode to use Blitz Basic.\n\n"
"You can change your display settings from the control panel.";
static string getAppDir()
{
char buff[MAX_PATH];
if (GetModuleFileName(0, buff, MAX_PATH)) {
string t = buff;
int n = t.find_last_of('\\');
if (n != string::npos)
t = t.substr(0, n);
return t;
}
return "";
}
static void fail(const char* p)
{
::MessageBox(0, p, "Blitz Basic Error", MB_SETFOREGROUND | MB_TOPMOST | MB_ICONERROR);
ExitProcess(-1);
}
static int desktopDepth()
{
HDC hdc = GetDC(GetDesktopWindow());
return GetDeviceCaps(hdc, BITSPIXEL);
}
int _stdcall WinMain(HINSTANCE inst, HINSTANCE prev, char* cmd, int show)
{
if (desktopDepth() < 16)
fail(md_err);
#ifndef PLUS
if (getDXVersion() < 7)
fail(dx_err);
#endif
if (getIEVersion() < 4)
fail(ie_err);
//Ugly hack to get application dir...
string blitzIdePath = getAppDir();
_putenv(("blitzpath=" + blitzIdePath).c_str());
SetCurrentDirectory(blitzIdePath.c_str());
blitzIdePath = blitzIdePath + "\\bin\\ide.exe " + cmd;
STARTUPINFO si;
PROCESS_INFORMATION pi;
ZeroMemory(&si, sizeof(si));
si.cb = sizeof(si);
if (!CreateProcess(0, (char*)blitzIdePath.c_str(), 0, 0, 0, 0, 0, 0, &si, &pi)) {
::MessageBox(0, bb_err, "Blitz Basic Error", MB_SETFOREGROUND | MB_TOPMOST | MB_ICONERROR);
ExitProcess(-1);
}
//wait for BB to start
WaitForInputIdle(pi.hProcess, INFINITE);
// Close process and thread handles.
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
return 0;
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

+72
View File
@@ -0,0 +1,72 @@
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_ICON1 ICON DISCARDABLE "bblaunch.ico"
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
+17
View File
@@ -0,0 +1,17 @@
prg_debug 1
prg_windowed 0
win_maximized 0
win_notoolbar 0
win_rect 0 0 691 542
font_editor blitz 12
font_tabs verdana 8
rgb_bkgrnd 206060
rgb_string ff00
rgb_ident ffffff
rgb_keyword ffe75f
rgb_comment ffff
rgb_digit c8f0ff
rgb_default fff0c8
edit_tabs 4
edit_blkcursor 0
img_toolbar toolbar.bmp
+336
View File
@@ -0,0 +1,336 @@
//-----------------------------------------------------------------------------
// File: GetDXVer.cpp
//
// Desc: Demonstrates how applications can detect what version of DirectX
// is installed.
//
// (C) Copyright 1995-1997 Microsoft Corp. All rights reserved.
//-----------------------------------------------------------------------------
#include <ddraw.h>
#include <windows.h>
#include <windowsx.h>
#define DIRECTINPUT_VERSION 0x0700
#include <dinput.h>
//#include <dmusici.h>
typedef HRESULT(WINAPI* DIRECTDRAWCREATE)(GUID*, LPDIRECTDRAW*, IUnknown*);
typedef HRESULT(WINAPI* DIRECTDRAWCREATEEX)(GUID*, VOID**, REFIID, IUnknown*);
typedef HRESULT(WINAPI* DIRECTINPUTCREATE)(HINSTANCE, DWORD, LPDIRECTINPUT*, IUnknown*);
//-----------------------------------------------------------------------------
// Name: GetDXVersion()
// Desc: This function returns two arguments:
// dwDXVersion:
// 0x0000 = No DirectX installed
// 0x0100 = DirectX version 1 installed
// 0x0200 = DirectX 2 installed
// 0x0300 = DirectX 3 installed
// 0x0500 = At least DirectX 5 installed.
// 0x0600 = At least DirectX 6 installed.
// 0x0601 = At least DirectX 6.1 installed.
// 0x0700 = At least DirectX 7 installed.
// dwDXPlatform:
// 0 = Unknown (This is a failure case)
// VER_PLATFORM_WIN32_WINDOWS = Windows 9X platform
// VER_PLATFORM_WIN32_NT = Windows NT platform
//
// Please note that this code is intended as a general guideline. Your
// app will probably be able to simply query for functionality (via
// QueryInterface) for one or two components.
//
// Please also note:
// "if (dxVer != 0x500) return FALSE;" is BAD.
// "if (dxVer < 0x500) return FALSE;" is MUCH BETTER.
// to ensure your app will run on future releases of DirectX.
//-----------------------------------------------------------------------------
VOID GetDXVersion(DWORD* pdwDXVersion, DWORD* pdwDXPlatform)
{
*pdwDXVersion = 0x0700;
*pdwDXPlatform = VER_PLATFORM_WIN32_NT;
// HRESULT hr;
// HINSTANCE DDHinst = 0;
// HINSTANCE DIHinst = 0;
// LPDIRECTDRAW pDDraw = 0;
// LPDIRECTDRAW2 pDDraw2 = 0;
// DIRECTDRAWCREATE DirectDrawCreate = 0;
// DIRECTDRAWCREATEEX DirectDrawCreateEx = 0;
// DIRECTINPUTCREATE DirectInputCreate = 0;
// OSVERSIONINFO osVer;
// LPDIRECTDRAWSURFACE pSurf = 0;
// LPDIRECTDRAWSURFACE3 pSurf3 = 0;
// LPDIRECTDRAWSURFACE4 pSurf4 = 0;
// // First get the windows platform
// osVer.dwOSVersionInfoSize = sizeof(osVer);
// if( !GetVersionEx( &osVer ) )
// {
// (*pdwDXPlatform) = 0;
// (*pdwDXVersion) = 0;
// return;
// }
// if( osVer.dwPlatformId == VER_PLATFORM_WIN32_NT )
// {
// (*pdwDXPlatform) = VER_PLATFORM_WIN32_NT;
// // NT is easy... NT 4.0 is DX2, 4.0 SP3 is DX3, 5.0 is DX5
// // and no DX on earlier versions.
// if( osVer.dwMajorVersion < 4 )
// {
// (*pdwDXVersion) = 0; // No DX on NT3.51 or earlier
// return;
// }
// if( osVer.dwMajorVersion == 4 )
// {
// // NT4 up to SP2 is DX2, and SP3 onwards is DX3, so we are at least DX2
// (*pdwDXVersion) = 0x200;
// // We're not supposed to be able to tell which SP we're on, so check for dinput
// DIHinst = LoadLibrary( "DINPUT.DLL" );
// if( DIHinst == 0 )
// {
// // No DInput... must be DX2 on NT 4 pre-SP3
// OutputDebugString( "Couldn't LoadLibrary DInput\r\n" );
// return;
// }
// DirectInputCreate = (DIRECTINPUTCREATE)GetProcAddress( DIHinst,
// "DirectInputCreateA" );
// FreeLibrary( DIHinst );
// if( DirectInputCreate == 0 )
// {
// // No DInput... must be pre-SP3 DX2
// OutputDebugString( "Couldn't GetProcAddress DInputCreate\r\n" );
// return;
// }
// // It must be NT4, DX2
// (*pdwDXVersion) = 0x300; // DX3 on NT4 SP3 or higher
// return;
// }
// // Else it's NT5 or higher, and it's DX5a or higher: Drop through to
// // Win9x tests for a test of DDraw (DX6 or higher)
// }
// else
// {
// // Not NT... must be Win9x
// (*pdwDXPlatform) = VER_PLATFORM_WIN32_WINDOWS;
// }
// // Now we know we are in Windows 9x (or maybe 3.1), so anything's possible.
// // First see if DDRAW.DLL even exists.
// DDHinst = LoadLibrary( "DDRAW.DLL" );
// if( DDHinst == 0 )
// {
// (*pdwDXVersion) = 0;
// (*pdwDXPlatform) = 0;
// FreeLibrary( DDHinst );
// return;
// }
// // See if we can create the DirectDraw object.
// DirectDrawCreate = (DIRECTDRAWCREATE)GetProcAddress( DDHinst, "DirectDrawCreate" );
// if( DirectDrawCreate == 0 )
// {
// (*pdwDXVersion) = 0;
// (*pdwDXPlatform) = 0;
// FreeLibrary( DDHinst );
// OutputDebugString( "Couldn't LoadLibrary DDraw\r\n" );
// return;
// }
// hr = DirectDrawCreate( NULL, &pDDraw, NULL );
// if( FAILED(hr) )
// {
// (*pdwDXVersion) = 0;
// (*pdwDXPlatform) = 0;
// FreeLibrary( DDHinst );
// OutputDebugString( "Couldn't create DDraw\r\n" );
// return;
// }
// // So DirectDraw exists. We are at least DX1.
// (*pdwDXVersion) = 0x100;
// // Let's see if IID_IDirectDraw2 exists.
// hr = pDDraw->QueryInterface( IID_IDirectDraw2, (VOID**)&pDDraw2 );
// if( FAILED(hr) )
// {
// // No IDirectDraw2 exists... must be DX1
// pDDraw->Release();
// FreeLibrary( DDHinst );
// OutputDebugString( "Couldn't QI DDraw2\r\n" );
// return;
// }
// // IDirectDraw2 exists. We must be at least DX2
// pDDraw2->Release();
// (*pdwDXVersion) = 0x200;
// ///////////////////////////////////////////////////////////////////////////
// // DirectX 3.0 Checks
// ///////////////////////////////////////////////////////////////////////////
// // DirectInput was added for DX3
// DIHinst = LoadLibrary( "DINPUT.DLL" );
// if( DIHinst == 0 )
// {
// // No DInput... must not be DX3
// OutputDebugString( "Couldn't LoadLibrary DInput\r\n" );
// pDDraw->Release();
// FreeLibrary( DDHinst );
// return;
// }
// DirectInputCreate = (DIRECTINPUTCREATE)GetProcAddress( DIHinst,
// "DirectInputCreateA" );
// if( DirectInputCreate == 0 )
// {
// // No DInput... must be DX2
// FreeLibrary( DIHinst );
// FreeLibrary( DDHinst );
// pDDraw->Release();
// OutputDebugString( "Couldn't GetProcAddress DInputCreate\r\n" );
// return;
// }
// // DirectInputCreate exists. We are at least DX3
// (*pdwDXVersion) = 0x300;
// FreeLibrary( DIHinst );
// // Can do checks for 3a vs 3b here
// ///////////////////////////////////////////////////////////////////////////
// // DirectX 5.0 Checks
// ///////////////////////////////////////////////////////////////////////////
// // We can tell if DX5 is present by checking for the existence of
// // IDirectDrawSurface3. First, we need a surface to QI off of.
// DDSURFACEDESC ddsd;
// ZeroMemory( &ddsd, sizeof(ddsd) );
// ddsd.dwSize = sizeof(ddsd);
// ddsd.dwFlags = DDSD_CAPS;
// ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
// hr = pDDraw->SetCooperativeLevel( NULL, DDSCL_NORMAL );
// if( FAILED(hr) )
// {
// // Failure. This means DDraw isn't properly installed.
// pDDraw->Release();
// FreeLibrary( DDHinst );
// (*pdwDXVersion) = 0;
// OutputDebugString( "Couldn't Set coop level\r\n" );
// return;
// }
// hr = pDDraw->CreateSurface( &ddsd, &pSurf, NULL );
// if( FAILED(hr) )
// {
// // Failure. This means DDraw isn't properly installed.
// pDDraw->Release();
// FreeLibrary( DDHinst );
// *pdwDXVersion = 0;
// OutputDebugString( "Couldn't CreateSurface\r\n" );
// return;
// }
// // Query for the IDirectDrawSurface3 interface
// if( FAILED( pSurf->QueryInterface( IID_IDirectDrawSurface3,
// (VOID**)&pSurf3 ) ) )
// {
// pDDraw->Release();
// FreeLibrary( DDHinst );
// return;
// }
// // QI for IDirectDrawSurface3 succeeded. We must be at least DX5
// (*pdwDXVersion) = 0x500;
// ///////////////////////////////////////////////////////////////////////////
// // DirectX 6.0 Checks
// ///////////////////////////////////////////////////////////////////////////
// // The IDirectDrawSurface4 interface was introduced with DX 6.0
// if( FAILED( pSurf->QueryInterface( IID_IDirectDrawSurface4,
// (VOID**)&pSurf4 ) ) )
// {
// pDDraw->Release();
// FreeLibrary( DDHinst );
// return;
// }
// // IDirectDrawSurface4 was create successfully. We must be at least DX6
// (*pdwDXVersion) = 0x600;
// pSurf->Release();
// pDDraw->Release();
// ///////////////////////////////////////////////////////////////////////////
// // DirectX 6.1 Checks
// ///////////////////////////////////////////////////////////////////////////
//// FIX: DirectMusic is deprecated.
// //// Check for DMusic, which was introduced with DX6.1
// //LPDIRECTMUSIC pDMusic = NULL;
// //CoInitialize( NULL );
// //hr = CoCreateInstance( CLSID_DirectMusic, NULL, CLSCTX_INPROC_SERVER,
// // IID_IDirectMusic, (VOID**)&pDMusic );
// //if( FAILED(hr) )
// //{
// // OutputDebugString( "Couldn't create CLSID_DirectMusic\r\n" );
// // FreeLibrary( DDHinst );
// // return;
// //}
// //// DirectMusic was created successfully. We must be at least DX6.1
// //(*pdwDXVersion) = 0x601;
// //pDMusic->Release();
// //CoUninitialize();
//
// ///////////////////////////////////////////////////////////////////////////
// // DirectX 7.0 Checks
// ///////////////////////////////////////////////////////////////////////////
// // Check for DirectX 7 by creating a DDraw7 object
// LPDIRECTDRAW7 pDD7;
// DirectDrawCreateEx = (DIRECTDRAWCREATEEX)GetProcAddress( DDHinst,
// "DirectDrawCreateEx" );
// if( NULL == DirectDrawCreateEx )
// {
// FreeLibrary( DDHinst );
// return;
// }
// if( FAILED( DirectDrawCreateEx( NULL, (VOID**)&pDD7, IID_IDirectDraw7,
// NULL ) ) )
// {
// FreeLibrary( DDHinst );
// return;
// }
// // DDraw7 was created successfully. We must be at least DX7.0
// (*pdwDXVersion) = 0x700;
// pDD7->Release();
//
// ///////////////////////////////////////////////////////////////////////////
// // End of checks
// ///////////////////////////////////////////////////////////////////////////
// // Close open libraries and return
// FreeLibrary( DDHinst );
//
return;
}
int getDXVersion()
{
DWORD version, platform;
GetDXVersion(&version, &platform);
return (version >> 8) & 0xff;
}
+7
View File
@@ -0,0 +1,7 @@
#ifndef CHECKDX_H
#define CHECKDX_H
int getDXVersion();
#endif
+26
View File
@@ -0,0 +1,26 @@
#include "checkie.h"
#include <windows.h>
int getIEVersion()
{
int version = 0;
HKEY key = HKEY_LOCAL_MACHINE;
if (RegOpenKey(key, "Software\\Microsoft\\Internet Explorer", &key) == ERROR_SUCCESS) {
char buff[MAX_PATH];
DWORD type, sz = MAX_PATH;
if (RegQueryValueEx(key, "Version", 0, &type, (PBYTE)buff, &sz) == ERROR_SUCCESS) {
version = 4;
/*
char temp[4];
if( isdigit(buff[0]) && buff[1]=='.' && isdigit(buff[2]) && isdigit(buff[3]) && buff[4]=='.' ){
temp[0]=buff[0];temp[1]=buff[2];temp[2]=buff[3];temp[3]=0;
if( atoi(temp)>=471 ) version=4;
}
*/
}
RegCloseKey(key);
}
return version;
}
+7
View File
@@ -0,0 +1,7 @@
#ifndef CHECKIE_H
#define CHECKIE_H
int getIEVersion();
#endif
+47
View File
@@ -0,0 +1,47 @@
<HTML>
<HEAD>
<TITLE>Blitz Basic demo</TITLE>
</HEAD>
<BODY bgcolor=#f0f0f0>
<FONT face=tahoma size=2 color=#0040ff>
<FONT color=#ff2020>
<H3 align=center><B>Blitz Basic Demo</B></H3>
</FONT><BR>
<DIV>
Hi! Welcome to the Blitz Basic demo.
</DIV><BR>
<DIV>
With the Blitz Basic programming language, you can design awesome 2D games for the PC
with the minimum of effort.
</DIV><BR>
<DIV>
This demo will give you some idea of the power and flexibility of the Blitz Basic
programming language.
</DIV><BR>
<DIV>Click here to see some examples of Blitz in action.</DIV><BR>
<DIV>Click here to see a summary of Blitz Basic commands.</DIV><BR>
<DIV>Have fun!</DIV><BR>
<FONT size=1 color=#000000>
<DIV>Blitz Basic is published by Guildhall Leisure Services.</DIV><BR>
<DIV>For purchasing information, please contact
<A HREF=mailto:george@guildhallleisure.com>George Bray</A>.</DIV><BR>
<DIV>More information about Blitz is available at <A HREF=http://www.blitzbasic.com>
The Blitz Basic homepage</A></DIV><BR>
</FONT>
</FONT>
</BODY>
</HTML>
+16
View File
@@ -0,0 +1,16 @@
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by bblaunch.rc
//
#define IDI_ICON1 104
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 105
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif