Add floppy disk setup generation

This commit is contained in:
FlareMicrosystems
2022-10-15 19:37:06 -07:00
parent dc7f7f3cc5
commit 6b8ca28060
11 changed files with 364 additions and 0 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Installer/Output/Output.7z Normal file

Binary file not shown.

View File

@@ -0,0 +1,48 @@
;InnoSetupVersion=5.4.3
#define AppVer GetFileVersion('..\Blocks3D.exe')
[Setup]
AppName=Blocks3D
AppVersion=v{#AppVer}
AppId={{4C5DF268-0208-4CDE-A7F0-65F7E2CB5067}
AppPublisherURL=http://blocks3d.com/
AppSupportURL=http://blocks3d.com/
AppUpdatesURL=http://blocks3d.com/
DefaultDirName={%localappdata}\Blocks3D
OutputBaseFilename=Blocks3D_Setup_v{#AppVer}
Compression=lzma2
PrivilegesRequired=lowest
WizardImageFile=setup.bmp
DefaultGroupName=Blocks3D
[UninstallDelete]
Type: filesandordirs; Name: "{app}"
[Files]
Source: "Redist\vcredist_x86.exe"; DestDir: "{tmp}"; Flags: ignoreversion
Source: "Redist\vcredist_x64.exe"; DestDir: "{tmp}"; Check: "IsWin64"; Flags: ignoreversion
Source: "..\content\*"; DestDir: "{app}\content"; Flags: ignoreversion recursesubdirs
Source: "..\SDL.DLL"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs
Source: "..\Blocks3D.exe"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs
[Registry]
[Run]
Filename: "{tmp}\vcredist_x86.exe"; Parameters: "/q"; Tasks: instvc;
Filename: "{tmp}\vcredist_x64.exe"; Parameters: "/q"; Tasks: instvc; Check: "IsWin64";
Filename: "iexplore.exe"; Parameters: "http://www.blocks3d.com/FirstInstall"; Description: Start playing Blocks3D; Flags: shellexec postinstall nowait skipifsilent
[Icons]
Name: "{group}\Play Blocks3D"; Filename: "{%programfiles}\Internet Explorer\iexplore.exe"; Parameters: "http://www.blocks3d.com/Games"; IconFilename: "{app}\Blocks3D.exe"; Tasks: startscut;
Name: "{group}\Blocks3D Editor"; Filename: "{app}\Blocks3D.exe"; Tasks: startscut;
Name: "{userdesktop}\Play Blocks3D"; Filename: "{%programfiles}\Internet Explorer\iexplore.exe"; Parameters: "http://www.blocks3d.com/Games"; IconFilename: "{app}\Blocks3D.exe"; Tasks: startscut;
Name: "{userdesktop}\Blocks3D Editor"; Filename: "{app}\Blocks3D.exe"; Tasks: desktopicon
[Tasks]
Name: "instvc"; Description: "Install Visual C++ Redistributable 2005 SP1 (Requires elevated permissions)";
Name: "desktopicon"; Description: "Create Desktop Icons";
Name: "startscut"; Description: "Create Start Menu Icons";

View File

@@ -0,0 +1,24 @@
#pragma once
#include "ArrowTool.h"
class DraggerTool :
public ArrowTool
{
public:
DraggerTool(void);
~DraggerTool(void);
void onButton1MouseDown(Mouse);
void onButton1MouseUp(Mouse);
void onMouseMoved(Mouse mouse);
void onSelect(Mouse mouse);
void onKeyDown(int key);
void onKeyUp(int key);
void render(RenderDevice * rd, Mouse mouse);
private:
void createHandles();
void grabHandle(Mouse mouse);
bool hasHandles;
int handleGrabbed;
Vector3 center;
Sphere handles[6];
};

View File

@@ -0,0 +1,159 @@
#include "DataModelV2/SelectionService.h"
#include "DataModelV2/PartInstance.h"
//This is absolutely disgusting, and will not last long
#include "Application.h"
#include "Globals.h"
#define CURSOR 0
#define ARROWS 1
#define RESIZE 2
SelectionService::SelectionService(void){
Instance::Instance();
propertyWindow = NULL;
}
SelectionService::~SelectionService(void){
}
SelectionService::SelectionService(const SelectionService &oinst){
Instance::Instance(oinst);
propertyWindow = NULL;
}
std::vector<Instance *> SelectionService::getSelection(){
return this->selection;
}
void SelectionService::clearSelection(){
this->selection.clear();
if(propertyWindow != NULL)
propertyWindow->ClearProperties();
printf("selectionSize: %d\n", selection.size());
}
bool SelectionService::isSelected(Instance * instance){
return std::find(selection.begin(), selection.end(), instance) != selection.end();
}
void SelectionService::addSelected(Instance * instance){
if(!isSelected(instance))
this->selection.push_back(instance);
if(propertyWindow != NULL)
propertyWindow->UpdateSelected(selection);
printf("selectionSize: %d\n", selection.size());
}
void SelectionService::removeSelected(Instance * instance){
selection.erase(std::remove(selection.begin(), selection.end(), instance), selection.end());
if(propertyWindow != NULL)
propertyWindow->UpdateSelected(selection);
printf("selectionSize: %d\n", selection.size());
}
void SelectionService::addSelected(const std::vector<Instance *> &instances){
for(size_t i = 0; i < instances.size(); i++)
{
if(!isSelected(instances[i]))
this->selection.push_back(instances[i]);
}
if(propertyWindow != NULL)
propertyWindow->UpdateSelected(selection);
printf("selectionSize: %d\n", selection.size());
}
void SelectionService::setPropertyWindow(PropertyWindow * propertyWindow)
{
this->propertyWindow = propertyWindow;
if(propertyWindow != NULL)
propertyWindow->ClearProperties();
printf("selectionSize: %d\n", selection.size());
}
void drawOutline(Vector3 from, Vector3 to, RenderDevice* rd, Vector3 size, Vector3 pos, CoordinateFrame c);
void SelectionService::render(RenderDevice * rd)
{
for(size_t i = 0; i < selection.size(); i++)
{
if(PartInstance* part = dynamic_cast<PartInstance*>(selection[i]))
{
Vector3 size = part->getSize();
Vector3 pos = part->getPosition();
drawOutline(Vector3(0+size.x/2, 0+size.y/2, 0+size.z/2) ,Vector3(0-size.x/2,0-size.y/2,0-size.z/2), rd, Vector3(size.x/2, size.y/2, size.z/2), Vector3(pos.x, pos.y, pos.z), part->getCFrame());
}
}
}
void drawOutline(Vector3 from, Vector3 to, RenderDevice* rd, Vector3 size, Vector3 pos, CoordinateFrame c)
{
Color3 outline = Color3::cyan();//Color3(0.098F,0.6F,1.0F);
float offsetSize = 0.05F;
//X
Draw::box(c.toWorldSpace(Box(Vector3(from.x - offsetSize, from.y + offsetSize, from.z + offsetSize), Vector3(to.x + offsetSize, from.y - offsetSize, from.z - offsetSize))), rd, outline, Color4::clear());
Draw::box(c.toWorldSpace(Box(Vector3(from.x - offsetSize, to.y + offsetSize, from.z + offsetSize), Vector3(to.x + offsetSize, to.y - offsetSize, from.z - offsetSize))), rd, outline, Color4::clear());
Draw::box(c.toWorldSpace(Box(Vector3(from.x - offsetSize, to.y + offsetSize, to.z + offsetSize), Vector3(to.x + offsetSize, to.y - offsetSize, to.z - offsetSize))), rd, outline, Color4::clear());
Draw::box(c.toWorldSpace(Box(Vector3(from.x - offsetSize, from.y + offsetSize, to.z + offsetSize), Vector3(to.x + offsetSize, from.y - offsetSize, to.z - offsetSize))), rd, outline, Color4::clear());
//Y
Draw::box(c.toWorldSpace(Box(Vector3(from.x + offsetSize, from.y - offsetSize + 0.1, from.z + offsetSize), Vector3(from.x - offsetSize, to.y + offsetSize - 0.1, from.z - offsetSize))), rd, outline, Color4::clear());
Draw::box(c.toWorldSpace(Box(Vector3(to.x + offsetSize, from.y - offsetSize + 0.1, from.z + offsetSize), Vector3(to.x - offsetSize, to.y + offsetSize - 0.1, from.z - offsetSize))), rd, outline, Color4::clear());
Draw::box(c.toWorldSpace(Box(Vector3(to.x + offsetSize, from.y - offsetSize + 0.1, to.z + offsetSize), Vector3(to.x - offsetSize, to.y + offsetSize-0.1, to.z - offsetSize))), rd, outline, Color4::clear());
Draw::box(c.toWorldSpace(Box(Vector3(from.x + offsetSize, from.y - offsetSize + 0.1, to.z + offsetSize), Vector3(from.x - offsetSize, to.y + offsetSize - 0.1, to.z - offsetSize))), rd, outline, Color4::clear());
//Z
Draw::box(c.toWorldSpace(Box(Vector3(from.x + offsetSize, from.y + offsetSize, from.z - offsetSize), Vector3(from.x - offsetSize, from.y - offsetSize, to.z + offsetSize))), rd, outline, Color4::clear());
Draw::box(c.toWorldSpace(Box(Vector3(from.x + offsetSize, to.y + offsetSize, from.z - offsetSize), Vector3(from.x - offsetSize, to.y - offsetSize, to.z + offsetSize))), rd, outline, Color4::clear());
Draw::box(c.toWorldSpace(Box(Vector3(to.x + offsetSize, from.y + offsetSize, from.z - offsetSize), Vector3(to.x - offsetSize, from.y - offsetSize, to.z + offsetSize))), rd, outline, Color4::clear());
Draw::box(c.toWorldSpace(Box(Vector3(to.x + offsetSize, to.y + offsetSize, from.z - offsetSize), Vector3(to.x - offsetSize, to.y - offsetSize, to.z + offsetSize))), rd, outline, Color4::clear());
if(g_usableApp->getMode() == ARROWS)
{
AABox box;
c.toWorldSpace(Box(from, to)).getBounds(box);
float max = box.high().y - pos.y;
Draw::arrow(pos, Vector3(0, 1.5+max, 0), rd);
Draw::arrow(pos, Vector3(0, (-1.5)-max, 0), rd);
max = box.high().x - pos.x;
Draw::arrow(pos, Vector3(1.5+max, 0, 0), rd);
Draw::arrow(pos, Vector3((-1.5)-max, 0, 0), rd);
max = box.high().z - pos.z;
Draw::arrow(pos, Vector3(0, 0, 1.5+max), rd);
Draw::arrow(pos, Vector3(0, 0, (-1.5)-max), rd);
}
else if(g_usableApp->getMode()== RESIZE)
{
Color3 sphereColor = outline;
Vector3 gamepoint = pos;
Vector3 camerapoint = rd->getCameraToWorldMatrix().translation;
float distance = pow(pow((double)gamepoint.x - (double)camerapoint.x, 2) + pow((double)gamepoint.y - (double)camerapoint.y, 2) + pow((double)gamepoint.z - (double)camerapoint.z, 2), 0.5);
if(distance < 200)
{
float multiplier = distance * 0.050F/2;
if(multiplier < 0.50F)
multiplier = 0.50F;
Vector3 position = pos + (c.lookVector()*((size.z)+2));
Draw::sphere(Sphere(position, multiplier), rd, sphereColor, Color4::clear());
position = pos - (c.lookVector()*((size.z)+2));
Draw::sphere(Sphere(position, multiplier), rd, sphereColor, Color4::clear());
position = pos + (c.rightVector()*((size.x)+2));
Draw::sphere(Sphere(position, multiplier), rd, sphereColor, Color4::clear());
position = pos - (c.rightVector()*((size.x)+2));
Draw::sphere(Sphere(position, multiplier), rd, sphereColor, Color4::clear());
position = pos + (c.upVector()*((size.y)+2));
Draw::sphere(Sphere(position, multiplier), rd, sphereColor, Color4::clear());
position = pos - (c.upVector()*((size.y)+2));
Draw::sphere(Sphere(position, multiplier), rd, sphereColor, Color4::clear());
}
}
}

View File

@@ -0,0 +1,133 @@
#include "Tool/DraggerTool.h"
#include "Application.h"
#include "DataModelV2/SelectionService.h"
DraggerTool::DraggerTool(void)
{
createHandles();
}
DraggerTool::~DraggerTool(void)
{
}
void DraggerTool::onButton1MouseDown(Mouse mouse)
{
grabHandle(mouse);
if(handleGrabbed == -1)
{
ArrowTool::onButton1MouseDown(mouse);
createHandles();
} else
{
printf("GRABBED HANDLE!");
}
}
void DraggerTool::onButton1MouseUp(Mouse mouse)
{
ArrowTool::onButton1MouseUp(mouse);
createHandles();
}
void DraggerTool::onMouseMoved(Mouse mouse)
{
if(handleGrabbed != -1)
{
}
else ArrowTool::onMouseMoved(mouse);
}
void DraggerTool::onSelect(Mouse mouse)
{
ArrowTool::onSelect(mouse);
createHandles();
}
void DraggerTool::onKeyDown(int key)
{
ArrowTool::onKeyDown(key);
}
void DraggerTool::onKeyUp(int key)
{
ArrowTool::onKeyUp(key);
}
void DraggerTool::grabHandle(Mouse mouse)
{
handleGrabbed = -1;
if(hasHandles)
{
G3D::Ray ray = mouse.getRay();
float distance = G3D::inf();
for(int i = 0; i < 6; i++)
{
float newDistance = ray.intersectionTime(handles[i]);
if(isFinite(newDistance) && newDistance < distance)
{
distance = newDistance;
handleGrabbed = i;
}
}
}
}
void DraggerTool::createHandles()
{
handleGrabbed = -1;
hasHandles = false;
std::vector<Instance *> selection = g_dataModel->getSelectionService()->getSelection();
if(selection.size() == 1)
{
if(PartInstance* part = dynamic_cast<PartInstance*>(selection[0]))
{
hasHandles = true;
float offset = 2;
center = part->getPosition();
Vector3 size = part->getSize();
CoordinateFrame cFrame = part->getCFrame();
handles[0] = Sphere(center + cFrame.upVector()*(size.y/2+offset), 1);
handles[1] = Sphere(center - cFrame.upVector()*(size.y/2+offset), 1);
handles[2] = Sphere(center + cFrame.lookVector()*(size.z/2+offset), 1);
handles[3] = Sphere(center - cFrame.lookVector()*(size.z/2+offset), 1);
handles[4] = Sphere(center + cFrame.leftVector()*(size.x/2+offset), 1);
handles[5] = Sphere(center - cFrame.leftVector()*(size.x/2+offset), 1);
}
}
}
void DraggerTool::render(RenderDevice * rd, Mouse mouse)
{
if(hasHandles)
{
for(int i = 0; i < 6; i++)
{
G3D::Draw::arrow(center, handles[i].center-center, rd, Color3::orange(), 2);
}
}
std::vector<Instance *> selection = g_dataModel->getSelectionService()->getSelection();
for(size_t i = 0; i < selection.size(); i++)
{
if(PartInstance* part = dynamic_cast<PartInstance*>(selection[i]))
{
Ray ray = G3D::Ray::fromOriginAndDirection(part->getPosition(), part->getCFrame().lookVector()*100);
Vector3 intersection1 = ray.intersection(mouse.getPlane());
Vector3 intersection2 = ray.intersection(mouse.getInversePlane());
if(intersection1.isFinite())
{
Draw::sphere(Sphere(intersection1, 2), rd);
}
else if(intersection2.isFinite())
{
Draw::sphere(Sphere(intersection2, 2), rd);
}
}
}
}