23 Commits

Author SHA1 Message Date
Vulpovile
2af7077a0a Merge pull request #94 from Vulpovile/bugfix/partcollison
Fix part collisions
2022-10-05 20:32:58 -07:00
728e67e1a5 Fix part collisions 2022-10-05 22:53:54 -04:00
8fa056e191 Merge pull request #88 from Vulpovile/bugfix/hopperbin-crash
Placeholder hopperbin fix
2022-10-05 13:08:55 -04:00
Vulpovile
69aacebbb2 Merge branch 'master' into bugfix/hopperbin-crash 2022-10-04 23:41:08 -07:00
791fa55767 PR update 2022-10-05 02:33:06 -04:00
3b83e527f8 Fix Hopper selection crash, add some placeholder enums, add a compaitiblity shim 2022-10-05 02:10:51 -04:00
Vulpovile
de53dcf6b0 Merge pull request #86 from Vulpovile/cleanup/remove_aps_from_repo
Remove  .aps file from repo
2022-10-04 23:08:08 -07:00
Vulpovile
8ef3bcd352 Merge pull request #85 from Vulpovile/master
sync: master to develop
2022-10-04 23:03:09 -07:00
Vulpovile
7adf511bf7 Remove APS files 2022-10-04 23:00:55 -07:00
NT_x86
72cdf2af35 Merge pull request #84 from Vulpovile/NT_x86
Minor optimization in createBody
2022-10-05 08:59:37 +03:00
NT_x86
d9a0e1e120 Increment patch number 2022-10-05 08:49:56 +03:00
NT_x86
90a1a1b325 Merge branch 'master' of https://github.com/Vulpovile/Blocks3D.git into NT_x86 2022-10-05 07:42:24 +03:00
NT_x86
984bea6136 Run GetSize and GetPosition only once in CreateBody function 2022-10-05 07:34:49 +03:00
Vulpovile
083cb38e81 Merge pull request #83 from Vulpovile/master
sync: master to develop
2022-10-04 13:44:26 -07:00
Vulpovile
6d65cd2a56 Merge pull request #82 from Vulpovile/feature/workflows
Add workflow to sync to develop
2022-10-04 13:42:18 -07:00
Vulpovile
223364907f Add workflow to sync to develop 2022-10-04 13:13:15 -07:00
Vulpovile
d96bcd2a2b Merge pull request #78 from Vulpovile/bugfix/fix-broken-delete
Fix broken delete
2022-10-03 22:27:00 -07:00
Vulpovile
6de83febb5 Fix prefix 2022-10-03 22:26:09 -07:00
Vulpovile
aaceb4eb21 Version bump 2022-10-03 22:16:30 -07:00
Vulpovile
e1716e7417 Merge pull request #77 from Vulpovile/bugfix/fix-crash-on-void
Fix crash when bricks fall into void
2022-10-03 20:52:14 -07:00
Vulpovile
f5aaef5b16 Cleanup 2022-10-03 20:50:05 -07:00
Vulpovile
b66d524d7f Patch bump 2022-10-03 20:45:07 -07:00
Vulpovile
d468545428 Fix crash on falling into void 2022-10-03 20:44:23 -07:00
16 changed files with 158 additions and 39 deletions

25
.github/workflows/sync-develop.yml vendored Normal file
View File

@@ -0,0 +1,25 @@
name: Sync Back to Develop
on:
push:
branches:
- master
jobs:
sync-branches:
runs-on: ubuntu-latest
name: Syncing branches
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Node
uses: actions/setup-node@v1
with:
node-version: 12
- name: Opening pull request
id: pull
uses: tretuna/sync-branches@1.2.0
with:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
FROM_BRANCH: 'master'
TO_BRANCH: 'develop'

4
.gitignore vendored
View File

@@ -40,6 +40,9 @@
*.ilk
*.dep
# ResEditor files
*.aps
/Debug
/Release
stdout.txt
@@ -54,3 +57,4 @@ desktop.ini
#Redist
!Installer/Redist/*
UpgradeLog.htm

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="0.0.106.0"
version="0.0.106.2"
processorArchitecture="*"
name="Blocks3D.Blocks3D.Blocks3D"
type="win32"

View File

@@ -733,6 +733,14 @@
RelativePath=".\src\include\TextureHandler.h"
>
</File>
<File
RelativePath=".\src\include\ToolEnum.h"
>
</File>
<File
RelativePath=".\src\include\VS2005CompatShim.h"
>
</File>
<File
RelativePath=".\src\include\win32Defines.h"
>

Binary file not shown.

View File

@@ -7,6 +7,17 @@
#include <richedit.h>
#include "src/include/resource.h"
#define APP_GENER 0
#define APP_MAJOR 0
#define APP_MINOR 106
#define APP_PATCH 4
#define APP_VER_STRING APP_GENER.APP_MAJOR.APP_MINOR.APP_PATCH
#define VER_PREFIX( N ) v##N
#define HSTR( N ) #N
#define STR( N ) HSTR( N )
#define VER_STR( N ) STR( VER_PREFIX( N ) )
@@ -18,8 +29,8 @@ IDB_BITMAP1 BITMAP "Parts.bmp"
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
1 VERSIONINFO
FILEVERSION 0,0,106,0
PRODUCTVERSION 0,0,106,0
FILEVERSION APP_GENER,APP_MAJOR,APP_MINOR,APP_PATCH
PRODUCTVERSION APP_GENER,APP_MAJOR,APP_MINOR,APP_PATCH
FILEOS VOS__WINDOWS32
FILETYPE VFT_APP
FILESUBTYPE VFT2_UNKNOWN
@@ -33,14 +44,14 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
VALUE "Comments", ""
VALUE "CompanyName", "Blocks3D Team"
VALUE "FileDescription", "Blocks 3D"
VALUE "FileVersion", "v0.0.106.0"
VALUE "FileVersion", VER_STR(APP_VER_STRING)
VALUE "InternalName", "Blocks3D"
VALUE "LegalCopyright", "Blocks3D Team - 2022"
VALUE "LegalTrademarks", ""
VALUE "OriginalFilename", "Blocks3D.exe"
VALUE "PrivateBuild", ""
VALUE "ProductName", "Blocks3D"
VALUE "ProductVersion", "v0.0.106.0"
VALUE "ProductVersion", VER_STR(APP_VER_STRING)
VALUE "SpecialBuild", ""
}
}

View File

@@ -22,7 +22,7 @@
}
</style>
<body style="background-color: ButtonFace; margin: 0; padding: 5px; overflow: hidden; border: outset 2px;">
<span class="container" onmousedown="toolOvr(this)" onmouseup="toolOut(this)" onmouseout="toolOut(this)" onclick="alert(window.external.ToggleHopperBin(0))">
<span class="container" onmousedown="toolOvr(this)" onmouseup="toolOut(this)" onmouseout="toolOut(this)" onclick="window.external.ToggleHopperBin(0)">
<img src="../images/GameTool.png" />
</span>
<span class="container" onmousedown="toolOvr(this)" onmouseup="toolOut(this)" onmouseout="toolOut(this)" onclick="window.external.ToggleHopperBin(1)">

View File

@@ -1,6 +1,5 @@
#pragma once
#include "DataModelV2/Instance.h"
#include <set>
class PropertyWindow {
public:
@@ -15,4 +14,5 @@ private:
HWND _propGrid;
HWND _explorerComboBox;
void _resize();
void clearExplorer();
};

11
src/include/ToolEnum.h Normal file
View File

@@ -0,0 +1,11 @@
#pragma once
namespace Enum
{
namespace Hopper
{
enum Value {
GameTool = 0, Grab = 1, Clone = 2, Hammer = 3, Slingshot = 4, Rocket = 5, Laser = 6
};
}
}

View File

@@ -0,0 +1,26 @@
#ifndef COMPAT_SHIM
#define COMPAT_SHIM
#include <sstream>
#include <string>
template<class T>
std::string toString(const T &value)
{
std::ostringstream os;
os << value;
return os.str();
}
namespace std
{
std::string to_string( int value ) {return toString(value);}
std::string to_string( long value ) {return toString(value);}
std::string to_string( long long value ) {return toString(value);}
std::string to_string( unsigned value ) {return toString(value);}
std::string to_string( unsigned long value ) {return toString(value);}
std::string to_string( unsigned long long value ) {return toString(value);}
std::string to_string( float value ) {return toString(value);}
std::string to_string( double value ) {return toString(value);}
std::string to_string( long double value ) {return toString(value);}
}
#endif

View File

@@ -161,22 +161,23 @@ void Application::deleteInstance()
{
if(_dataModel->getSelectionService()->getSelection().size() > 0)
{
size_t undeletable = 0;
while(_dataModel->getSelectionService()->getSelection().size() > undeletable)
{
if(_dataModel->getSelectionService()->getSelection()[0]->canDelete)
std::vector<Instance *> selection = _dataModel->getSelectionService()->getSelection();
std::vector<Instance *> toDelete;
for(size_t i = 0; i < selection.size(); i++) {
if(selection[i]->canDelete) {
toDelete.push_back(selection[i]);
}
}
if(toDelete.size() > 0)
{
AudioPlayer::playSound(GetFileInPath("/content/sounds/pageturn.wav"));
Instance* selectedInstance = g_dataModel->getSelectionService()->getSelection()[0];
_dataModel->getSelectionService()->removeChild(selectedInstance);
for(size_t i = 0; i < toDelete.size(); i++) {
Instance* selectedInstance = toDelete[i];
_dataModel->getSelectionService()->removeSelected(selectedInstance);
selectedInstance->setParent(NULL);
delete selectedInstance;
selectedInstance = NULL;
}
else
{
undeletable++;
}
}
}
if(_dataModel->getSelectionService()->getSelection().size() == 0)

View File

@@ -21,6 +21,7 @@ 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();
@@ -30,11 +31,13 @@ void SelectionService::addSelected(Instance * 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++)
@@ -44,10 +47,12 @@ void SelectionService::addSelected(const std::vector<Instance *> &instances){
}
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());
}

View File

@@ -202,8 +202,8 @@ void PartInstance::setSize(Vector3 newSize)
size = Vector3(sizex, sizey, sizez);
g_dataModel->getEngine()->deleteBody(this);
g_dataModel->getEngine()->createBody(this);
}
Vector3 PartInstance::getSize()
{
@@ -224,6 +224,8 @@ void PartInstance::setShape(Enum::Shape::Value shape)
this->shape = shape;
this->setSize(this->getSize());
}
g_dataModel->getEngine()->deleteBody(this);
g_dataModel->getEngine()->createBody(this);
changed = true;
}
@@ -237,6 +239,7 @@ void PartInstance::setAnchored(bool anchored)
{
this->anchored = anchored;
g_dataModel->getEngine()->deleteBody(this);
g_dataModel->getEngine()->createBody(this);
}
bool PartInstance::isAnchored()

View File

@@ -2,7 +2,6 @@
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#include <Commdlg.h>
#include "IEBrowser.h"
@@ -11,6 +10,9 @@
#include "ax.h"
#include "Tool/SurfaceTool.h"
#include "Application.h"
#include "Enum.h"
#include "ToolEnum.h"
#include "VS2005CompatShim.h"
HRESULT IEBrowser::doExternal(std::wstring funcName,
DISPID dispIdMember,
@@ -30,9 +32,24 @@ HRESULT IEBrowser::doExternal(std::wstring funcName,
}
else if (funcName==L"ToggleHopperBin")
{
pVarResult->vt = VT_INT;
pVarResult->intVal = 5;
//MessageBox(NULL, "BOOP", "Boopity boop",MB_OK);
MessageBox(NULL, "BOOP", "Boopity boop",MB_OK);
/*To-do Make enums in ToolEnum work with this properly,
commented code is not fully tested.*/
/*MessageBox(NULL,
std::to_string(pDispParams->rgvarg->intVal).c_str(),
"Is it working?",
MB_OK);
Enum::Hopper::Value cont = (Enum::Hopper::Value)pDispParams->rgvarg->intVal;
switch (cont)
{
case GameTool
case Grab
break;
}*/
return S_OK;
}
else if (funcName==L"SetController")
{

View File

@@ -3,7 +3,6 @@
#include "WindowFunctions.h"
#include "resource.h"
#include "PropertyWindow.h"
#include "Globals.h"
#include "strsafe.h"
#include "Application.h"
@@ -203,6 +202,12 @@ LRESULT CALLBACK PropProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
return 0;
}
void PropertyWindow::clearExplorer()
{
SendMessage(_explorerComboBox,CB_RESETCONTENT,0,0);
SendMessage(_explorerComboBox,CB_SETCURSEL,0,(LPARAM)0);
}
void PropertyWindow::refreshExplorer(std::vector<Instance*> selectedInstances)
{
Instance * instance = selectedInstances[0];
@@ -338,7 +343,7 @@ void PropertyWindow::_resize()
void PropertyWindow::UpdateSelected(std::vector<Instance *> instances)
{
if(instances.size() < 0)
if(instances.size() <= 0)
{
ClearProperties();
return;
@@ -367,5 +372,6 @@ void PropertyWindow::UpdateSelected(std::vector<Instance *> instances)
void PropertyWindow::ClearProperties()
{
clearExplorer();
PropGrid_ResetContent(_propGrid);
}

View File

@@ -84,6 +84,8 @@ void XplicitNgine::createBody(PartInstance* partInstance)
// calculate collisions
//dSpaceCollide (physSpace,0,&collisionCallback);
Vector3 partSize = partInstance->getSize();
Vector3 partPosition = partInstance->getPosition();
if(partInstance->physBody == NULL)
{
// init body
@@ -93,9 +95,9 @@ void XplicitNgine::createBody(PartInstance* partInstance)
if(partInstance->shape == Enum::Shape::Block)
{
partInstance->physGeom[0] = dCreateBox(physSpace,
partInstance->getSize()[0],
partInstance->getSize()[1],
partInstance->getSize()[2]
partSize.x,
partSize.y,
partSize.z
);
dVector3 result;
@@ -108,11 +110,11 @@ void XplicitNgine::createBody(PartInstance* partInstance)
}
else
{
partInstance->physGeom[0] = dCreateSphere(physSpace, partInstance->getSize()[0]/2);
partInstance->physGeom[0] = dCreateSphere(physSpace, partSize[0]/2);
}
dMass mass;
mass.setBox(partInstance->getSize().x, partInstance->getSize().y, partInstance->getSize().z, 0.7F);
mass.setBox(partSize.x, partSize.y, partSize.z, 0.7F);
dBodySetMass(partInstance->physBody, &mass);
// Debug output
@@ -121,15 +123,15 @@ void XplicitNgine::createBody(PartInstance* partInstance)
// Create rigid body
//printf("[XplicitNgine] Created Geom for PartInstance\n");
dBodySetPosition(partInstance->physBody,
partInstance->getPosition()[0],
partInstance->getPosition()[1],
partInstance->getPosition()[2]
partPosition.x,
partPosition.y,
partPosition.z
);
dGeomSetPosition(partInstance->physGeom[0],
partInstance->getPosition()[0],
partInstance->getPosition()[1],
partInstance->getPosition()[2]);
partPosition.x,
partPosition.y,
partPosition.z);
Matrix3 g3dRot = partInstance->getCFrame().rotation;
float rotation [12] = { g3dRot[0][0], g3dRot[0][1], g3dRot[0][2], 0,