Coder Social home page Coder Social logo

garagegames / torque2d Goto Github PK

View Code? Open in Web Editor NEW
1.7K 260.0 1.6K 175.96 MB

MIT Licensed Open Source version of Torque 2D game engine from GarageGames

License: MIT License

Shell 1.80% Objective-C 1.72% C 9.14% Java 0.16% C++ 75.93% Python 1.09% Assembly 0.13% Lua 0.02% JavaScript 0.01% Objective-C++ 3.63% C# 3.07% Batchfile 0.01% HTML 1.95% Makefile 0.63% CMake 0.37% Yacc 0.10% Lex 0.09% M4 0.11% Ruby 0.01% CSS 0.01%

torque2d's Introduction

Torque Logo

We've moved!

All torque engines have moved to a new organization, Torque Game Engines. Torque2D can be found at https://github.com/TorqueGameEngines/Torque2D. This repository will not be updated. We encourage you to use the new repository instead of this one. Thank you!

Torque 2D 3.4

MIT Licensed Open Source version of Torque 2D from GarageGames. Maintained by the T2D Steering Committee and contributions from the community.

Dedicated to 2D game development, Torque 2D is an extremely powerful, flexible, and fast C++ engine which has been used in hundreds of professional games. It is a true cross platform solution providing you access to Windows, OSX, Linux, iOS, Android, and the web - all from one codebase. It includes an OpenGL batched rendering system, Box2D physics, OpenAL audio, skeletal and spritesheet animation, automated asset management, a modular project structure, TAML object persistence, and a C-like scripting language.

Branches

Here is an overview of the branches found in the Torque 2D repository:

  • master: this branch contains the current stable release code that can be used in a production environment.
  • development: this branch is dedicated to active development. It contains the latest bug fixes, new features, and other updates. All pull requests need to go to the development branch. While we try our best to test all incoming changes, it is possible for mistakes to slip in therefore this branch should always be considered unstable.
  • gh-pages: this branch currently contains the html pages generated from doxygen for the engine and TorqueScript references.

Precompiled Version

If you do not wish to compile the source code yourself, precompiled binary files for Windows and OSX are available from the Torque 2D Release Page.

Building the Source

After downloading a copy of the source code, the following project files for each platform are provided for you and can be found in the engine/compilers folder.

  • Windows: Visual Studio 2017 (works with the free Community Edition)
  • OSX: Xcode
  • Linux: Make
  • iOS: Xcode_iOS
  • Android: Android Studio
  • Web: Emscripten/Cmake

See the wiki for available guides on platform setup and development.

Batteries Included

Running Torque 2D for the first time out of the box will start you off in the Sandbox. The Sandbox is a collection of over 30 simple "toys" (or modules) which demonstrate various features in T2D. The default toy is a side scrolling level with a monster truck. To see a list of the available modules/toys to choose from, click on the Show Tools button in the lower right corner of the screen.

Naturally all of the script code and assets for each toy are available to you in the modules folder to use as practical examples while learning T2D.

The Sandbox is also an excellent framework for rapidly prototyping your own game ideas - it allows for easy integration of additional modules and provides numerous debugging features, like console access and real-time metrics.

Documentation

All documentation for the open source version of Torque 2D can be found on our Github wiki page. It contains many tutorials, detailed technical information on engine systems, a script reference guide automatically generated from the source code, and articles on how to contribute to our open source development.

Community

Don't go it alone! Join the active Torque community. Ask questions, talk about T2D and general game development topics, learn the latest news, or post a blog promoting your game or showing off additional engine features in your T2D fork.

You also might be able to find useful information on the less active GarageGames website.

Support

Torque 2D is completely free to use, but like all things, it takes time and energy to maintain and develop. You can support T2D by becoming a sponsor on Patreon. Doing so ensures that T2D will continue receiving the attention it needs to remain competitive.

Become a Patron

You can also support development directly by submitting pull requests or joining the steering committee! See the wiki for details.

License

Copyright (c) 2012 GarageGames, LLC

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

torque2d's People

Contributors

3ddeters avatar camporter avatar chaigler avatar crabmusket avatar doodaddy64 avatar dottools avatar elementc avatar greenfire27 avatar jaeggerr avatar jamesu avatar krytarowski avatar kynora avatar lilligreen avatar losinggeneration avatar marauder2k7 avatar melvynmay avatar michperry-gg avatar olet-toporkov avatar pchan126 avatar richardranft avatar timmgt avatar vbif avatar williamleesims avatar yurembo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

torque2d's Issues

Compiler Failure for VS2012 pro 'std::tuple' : too many template arguments

\github\torque2d\engine\source\testing\googletest\include\gtest\gtest-printers.h(550): error C2977: 'std::tuple' : too many template arguments (....\source\testing\tests\platformFileIoTests.cc)
4> c:\program files (x86)\microsoft visual studio 11.0\vc\include\utility(73) : see declaration of 'std::tuple'

Error 5 error C2955: 'std::tuple' : use of class template requires template argument list (....\source\testing\tests\platformFileIoTests.cc) \github\torque2d\engine\source\testing\googletest\include\gtest\internal\gtest-param-util-generated.h 4017 1 Torque2D

This results in a total of 208 Errors

==Compiler Info ==
Microsoft Visual Studio Professional 2012
Version 11.051106.01 Update 1

Wiki Page "Getting started guide", Chapter 7

"If you run your program now, your window should turn Black. If something went wrong with your SceneWindow setup, your program should still display its "CornFlowerBlue" background."

After spending some time looking for my mistake, I realised that the color finally changed after calling setScene(). Before that, the sole SceneWindow didn't make any difference.

I took a look at the log file and initially thought that "Failed to load profile bitmap ((null))" caused my problem, so it might be a good idea to mention that this is not one of those "something went wrong".

Modules not properly unloading with a fresh pull of T2D master

Does not matter which module is loded up in the sandbox. Modulemanager fails to unload the toy when T2D is closed.

//-------------------------- 2/12/2013 -- 14:48:40 -----

Console trace is off.

Video Initialization:

Video initialization:
Accelerated OpenGL display device detected.

Activating the OpenGL display device...
Activating the OpenGL display device...
Setting screen mode to 1024x600x32 (w)...
Creating a new window...
Acquiring a new device context...
Pixel format set:
32 color bits, 24 depth bits, 8 stencil bits
Creating a new rendering context...
Making the new rendering context current...
OpenGL driver information:
Vendor: ATI Technologies Inc.
Renderer: AMD Radeon HD 6310 Graphics
Version: 4.2.12002 Compatibility Profile Context 9.12.0.0
OpenGL Init: Enabled Extensions
ARB_multitexture (Max Texture Units: 8)
EXT_blend_color
EXT_blend_minmax
EXT_compiled_vertex_array
EXT_texture_env_combine
EXT_packed_pixels
EXT_fog_coord
ARB_texture_compression
EXT_texture_compression_s3tc
(ARB|EXT)_texture_env_add
EXT_texture_filter_anisotropic (Max anisotropy: 16)
WGL_EXT_swap_control
OpenGL Init: Disabled Extensions
EXT_paletted_texture
NV_vertex_array_range
3DFX_texture_compression_FXT1

Max Texture Size reported as: 16384
OpenAL Driver Init
OpenAL Driver Init Success
Module Manager: Cannot unload explicit module Id 'TruckToy' as it is not loaded.
Failed to unload the toy 'TruckToy'.
Shutting down the OpenGL display device...
Making the GL rendering context not current...
Deleting the GL rendering context...
Releasing the device context...

Wiki: Input Guide (Initial Submission)

Since Github does not support pull requests for wiki content, my proposal for community submitted articles would be:

  1. Fork a local copy of the wiki, make sure edit permission is for everyone
  2. Edit/Create the intended document
  3. When finished, submit an issue with a link to the document
  4. After review and approval, someone with wiki access can copy/paste the markdown formatted content to the main T2D wiki

With that in mind, I've put together an Input Guide (Torque 2D Engine Reference - Input). It can be found here:

https://github.com/lilligreen/Torque2D/wiki/Input-Guide

It's an edited/updated version of the legacy documents on input. The only thing I could not personally test were the iOS specific touch/motion controls though.

Behavior based keyboard bindings don't work when cloned

Steps to reproduce:

  1. Grab the WorldWrapToy from me if you don't have a module with a movement based behavior readily available. Add it to the Sandbox. https://github.com/t2Dtutorials/Modules

  2. Run it, see that bindObj works as it should for keyboard movement.

  3. In the toy's game.cs file, change the createPlayer function to add a clone of the player object to the scene instead of directly adding the player object.

    %clone = %object.clone();
    // Add the sprite to the scene.
    SandboxScene.add(%clone);

  4. Run the toy again, this time you will not be able to move the arrow sprite.

Any other behavior properties (like linear damping) work fine if given a velocity from an outside force. If you export the sprite as a Taml file, the behavior and its fields are properly added. I've tested other non-movement behaviors and they seem to work after cloning, I've only found so far that keyboard bindings don't copy correctly.

not working

Hi, I just download the engine and I can't compile with express 2012

Streaming audio sources not playing

Looks like streaming audio based sources are not playing. T2D would init the stream this way:


// setup a streaming source to play
static void alxSourcePlay(AudioStreamSource *streamSource)
{
ALuint source = streamSource->mSource;
Audio::Description& desc = streamSource->mDescription;

bool ret = streamSource->initStream();

alSourcef(source, AL_GAIN, Audio::linearToDB(desc.mVolume * mAudioChannelVolumes[desc.mVolumeChannel] * mMasterVolume));

...
}

streamSource->initStream(); is missing in the Torque 2D. I added it in my local repo, and they now play.

TexturePacker errors

I couldn't commit the changes myself due to no permissions and being new to all of this github stuff. So here are two very simple fixes for the TexturePacker exporter. Discussion also as to why the changes are required.

It's a simple edit of both files, a single character being deleted and a bool changing to false. Solves the crash when using TexturePacker + T2D. Solves the warping caused by T2D's lack of trimming feature support.

http://www.garagegames.com/community/forums/viewthread/133247/1#comment-840681

Would love to see TexturePacker better supported in future releases of T2D. Trimming is TexturePacker's most powerful feature, and what sets it far above other image packing software.

%worldPosition calculates different on Y Position for iOS than OSX effects onTouchDown, etc.

%worldPosition calculates different on Y Position for iOS than OSX effects onTouchDown, etc.

Noticed this when I deployed an app to my iPad. Seems as if I have to Touch about 20-25 units below the Object for it to trigger a Touch to the object. It's spot on correct when it runs on OSX. I have not investigated Source Code

In order for things to work correctly on my iPad I wrote this in my onTouchDown Function.

%x = getWord(%worldPosition,0);
%y = getWord(%worldPosition,1);

%newy = %y -25;
%newWorldPosition = %x SPC %newY;

%picked = mainScene.pickPoint(%newWorldPosition);

and the rest of the function as it would be.

Video showing Bug: http://youtu.be/yINDKZFqon4

Solution Folders compatibility - Visual C++ 2010 Express

When opening the Solution file in Microsoft Visual C++ 2010 Express, the following error is generated

Solution folders are not supported in this version of the application.
Solution folder 'Libraries' will be displayed as unavailable.

Once the error message is dismissed, the Output window displays the following message

Some of the properties associated with the solution could not be read.

Note that the solution still compiles without issues, in Debug, Release and Shipping build configurations.

There does not appear to be an option in the Express Edition to remove or manage Solution Folders.

Even removing the 'Libraries' folder from the Solution Explorer still generates the error.

String print functions are not safe

Neither dSprintf nor dVsprintf pass through the buffer length to the underlying libc function. This essentially means a carefully constructed string passed though to either function can cause a buffer overflow.

In addition dSprintf doesn't call va_end to end the va_list, which depending on the underlying implementation may be bad.

For reference, the offending lines in winStrings.cc are:

bufferSize;
S32 len = vsprintf(buffer, format, args);

and

bufferSize;
S32 len = vsprintf(buffer, format, (char*)arglist);

Similar code is present for unix and osx platforms.

canvas.setCursor( ) is not working

When you try to change the cursor image using canvas.setCursor() nothing happens and the default cursor stays the same.

new GuiCursor(newCursor)
{
hotSpot = "1 1";
renderOffset = "0 0";
bitmapName = "./assets/images/newCursor.png";
};
canvas.setCursor(newCursor);

This issue is confirmed only on Windows.

Don´t compile on VS2012

For compile in VS2012:

  • Set Torque2D Project Properties/Linker/Advanced/Image Has Safe Exception Handlers to NO
  • Set Torque2D Project Properties/Debugging/Working directory to ´..\ ..\ ..'
  • googletest has some problems with std::tuple and VS2012 http://code.google.com/p/googletest/issues/detail?id=412. Modify \engine\source\testing\unitTesting.h
#ifndef TORQUE_SHIPPING

//http://code.google.com/p/googletest/issues/detail?id=412
//VS2012 tuple default max arguments is 5
#if _MSC_VER == 1700
#define _VARIADIC_MAX 10   
#endif

#include "gtest/gtest.h"

#endif // TORQUE_SHIPPING

SpriteBatch::findSpriteName() fails to find sprites

SpriteBatch::findSpriteName() attempts to find a named sprite by searching through the mSpriteNames hashmap. Unfortunately this search will always return NULL because no key/value pairs are ever inserted into mSpriteNames, so SpriteBatch has no way of knowing which names map to which sprites.

Loading objects with behaviors fails

When loading a scene file, objects with behaviors fail to load them. For example:

<Sprite
    internalName="DefaultBox"
    Image="@asset=BookReader:Crate_Damage_0ImageMap"
    size="3.0 3.0"
    Position="0 -7.5"
    Angle="0"
    currentSound="21"
    DefaultDensity="0.123114809"
    CollisionCallback="1">
    <Sprite.Behaviors>
        <InputTargetBehavior
            Id="1" />
        <MouseJointBehavior
            Id="2" />
    </Sprite.Behaviors>
    <Sprite.BehaviorConnections>
        <Connection
            inputDown="1"
            onDown="2" />
        <Connection
            inputUp="1"
            onUp="2" />
    </Sprite.BehaviorConnections>
    <Sprite.CollisionShapes>
        <Polygon
            Density="1"
            Point0="0.54903 -0.22584"
            Point1="0.54903 0.95278"
            Point2="-0.62959 0.95278"
            Point3="-0.62959 -0.22584" />
    </Sprite.CollisionShapes>
</Sprite>

The sprite loads and displays, the collision shape is correctly loaded, but the behaviors' onAdd() is never called and the behavior instances do not respond as they should. The behavior scripts are loaded and the templates exist, and there are no errors in the console.

Drop me an email at [email protected] if there are questions.

ParticleAsset creation in TorqueScript is broken

Graph fields that are created in TorqueScript are not being properly written out to an asset definition file.

My first guess is that ParticleAssetFieldCollection::findField is not returning the field name like it should, but instead just a bool that the field was found.

Here is the script I used:

// Create a bare asset.
%effect = new ParticleAsset();

// Configure the basic asset details.
%effect.AssetName = "Steam";

// Create a bare asset emitter.
%emitter = %effect.createEmitter();

// Configure the basic emitter details.
%emitter.EmitterName = "Plume";
%emitter.EmitterType = "LINE";
%emitter.EmitterSize = "10 0";
%emitter.OldestInFront = "true";
%emitter.Image = "ParticleViewer:Particles4";
%emitter.Frame = "0";

// Create the emitter graph fields and populate them with data keys
%emitter.selectField("Lifetime");
echo(%emitter.getSelectedField());
%emitter.addDataKey(0, 2);
%emitter.deselectField();

%emitter.selectField("LifetimeVariation");
echo(%emitter.getSelectedField());
%emitter.addDataKey(0, 1);
%emitter.deselectField();

%emitter.selectField("Quantity");
echo(%emitter.getSelectedField());
%emitter.addDataKey(0, 50);
%emitter.deselectField();

%emitter.selectField("QuantityVariation");
echo(%emitter.getSelectedField());
%emitter.addDataKey(0, 15);
%emitter.deselectField();

%emitter.selectField("SizeX");
echo(%emitter.getSelectedField());
%emitter.addDataKey(0, 8);
%emitter.deselectField();

// Save it as an asset definition to be used by the asset system.
TamlWrite(%effect, "test.asset.taml");

In the console, the echo(%emitter.getSelectedField()) returns "1" every time.

The TAML file that is created looks like this:

<ParticleAsset
    AssetName="Steam">
    <ParticleAssetEmitter
        EmitterName="Plume"
        EmitterType="LINE"
        EmitterSize="10 0"
        OldestInFront="1"
        Image="@asset=ParticleViewer:Particles4"
        Frame="0">
        <ParticleAssetEmitter.Fields>
            <Key
                Time="0"
                value="50" />
            <Key
                Time="0"
                value="1" />
            <Key
                Time="0"
                value="8" />
            <Key
                Time="0"
                value="15" />
        </ParticleAssetEmitter.Fields>
    </ParticleAssetEmitter>
</ParticleAsset>

The graph field names are not being written out (Lifetime, Quantity, SizeX, etc) and only 4 out of 5 data key entries are there.

ParticlePlayer::stop not working correctly

Here is what I have found:

The default call ParticlePlayer.stop() - getIsPlaying always returns true, no callback issued
stop(false, false) - ok
stop(false, true) - ok
stop(true, true) - getIsPlaying always true, no callback, effect is not killed

ImageFont TAML export bug

When doing a TamlWrite on the following object:

%font = new ImageFont();
%font.Image = "ToyAssets:Font";
%font.Text = "Lorem ipsum dolor sit amet";
%font.TextAlignment = "Right";
%font.FontSize = "4 2";
%font.FontPadding = 2.5;

The export process doesn't include fontSize and alters the value of fontPadding.

<ImageFont
    BodyType="Static"
    Image="@asset=ToyAssets:Font"
    text="Lorem ipsum dolor sit amet"
    textAlignment="Right"
    fontPadding="2.80259693e-45" />

applyForce cannot be called without a world position

Well, it can - it just gives a console error. I'm using applyForce in an update method to apply a local force to an object, but I find I can only call the function with two single arguments (and I get a console error from the code below), or with two vectors (which is not my intent).

// Invalid
else
{
    Con::warnf("Scene::applyForce() - Invalid number of parameters!");
    return;
}

I would submit a pull-request, but I have no idea what the intent behind the code in this console method was and what I should preserve. Should arguments be passed as vectors, or individually?

CompositeSprite pickPoint depends on zoom level

When using pickPoint successful selection of an object in a composite sprite appears to depend on the zoom level. Discussed in thread http://www.garagegames.com/community/forums/viewthread/133693

Steps to reproduce

  1. Download www.dropbox.com/s/b346yr35oda4mlr/CompositeSectorTest.zip (a modified version of the CompositeSprite toy)
  2. Zoom out with the mouse wheel
  3. Move the cursor to a gem using the arrow keys (which scroll the composite sprite). The cursor should start spinning.
  4. Zoom in on the gem. The cursor should stop spinning even though the pickPoint location has not changed and should still be valid

Getting width & height for an individual cell in ImageAsset

There does not appear to be a way to get the cell width or height for an individual cell.
getCellWidth() returns the same for all cells, but what if the imageAsset has different cells with different widths!
The ConsoleMethods need to be updated to take a cell index like this getCellWidth(index) and getCellHeight(index).

ShapeVector.setPolyScale does nothing

Not really sure what this method is supposed to scale. Values between 0 and 1 do nothing to the shape. I followed mPolygonScale to ShapeVector::generateLocalPoly, it is used to calculate the polygon half-size but then nothing is done with the half-size value. Scale is later set with mSize.

Don't know whether to classify this as a bug or just a method that is no longer needed and can be purged.

Deleting a clone of a named object breaks the named object.

If you clone a named object, then delete the clone, the named object will no longer be the type of object it was when it was cloned. This makes it impossible to further clone the object.

Expected: Deleting an object does not affect the object it was cloned from.

Steps to reproduce:

  1. In any toy, add the following functions to main.cs.
    function createMyObject()
    {
    new Sprite(MyObject)
    {
    class = "MyClass";
    image = "ToyAssets:crate";
    size = "16 16";
    position = "16 16";
    };
    SandboxScene.add(MyObject);
    }

    function deleteclone()
    {
    $MyClone.safeDelete();
    }

    function createclone()
    {
    $MyClone = MyObject.clone(true);
    $MyClone.setPosition(-16, -16);
    SandboxScene.add($MyClone);
    }

  2. at the end of toy creation or reset, add the following.
    // test scripts
    createMyObject();

  3. Run the toy. You should see one crate added on top of the scene.

  4. Open the console sing "show log".

  5. type command createclone();

  6. Observe a second crate is created.

  7. type command deleteclone();

  8. Observe the second crate is deleted.

  9. type command createclone();

  10. Observe the error from the log:
    ==>deleteclone();
    ==>createclone();
    modules/FlipToy/1/main.cs (75): Unknown command clone.
    Object MyObject(1706) MyObject -> MyClass
    modules/FlipToy/1/main.cs (76): Unable to find object: '' attempting to call function 'setPosition'
    Scene::addToScene() - Could not find the specified object ''.

Note: If the class is not set for the object, the issue does not occur. This problem was introduced in commit 6de480a on March 14th 2013.

Wiki Page "Module Manager Guide"

"Well the answer is that in the absence of any module dependencies it will simply load the latest version of any module Id so in the examples above, the RedModule at version 1 is loaded and unloaded."

As I understand it, the latest version of RedModule is version 2.

T2D is not compatible with OSX 10.6.8

I can't run Torque2D.app on my OSX 10.6.8 MAC, the system alerts me that I need OS 10.7 or later to run. My Mac is limited to OSX 10.6.8 and can't be updated to OSX 10.7.

I used the latest xcode for OS 10.6.8 which is 3.6.2 and couldn't compile the source because I get 348 warning and 167 errors. I also used appCode to compile with no luck.

I read somewhere that in order to succeed in compiling the code one needs to have xcode 4 or later which is not compatible with OSX older than 10.7.

I'm certain that this issue will likely result in the games being developed for MAC will be rejected by game portals.

setScreenMode() on OSX issue

When using setScreenMode(800, 600, 24, false) to switch from full screen to windowed mode the canvas turns white and it never switches to windowed mode and the application stops responding.

CompositeSprite position issue

The CompositeSprite class doubles its position, i.e. when using CompositeSprite.Position="2 3" or CompositeSprite.setPosition(2,3) it will render at position 4,6.

TextureManager::loadBitmap bug

TextureManager.CC should be updated from using:

Platform::makeFullPathName( pTextureKey, fileNameBuffer, 512 );

to using the console method of:

// Expand the file-name into the filename buffer.
Con::expandPath( fileNameBuffer, sizeof(fileNameBuffer), pTextureKey );

This will allow the use of expando's as well as relative pathing before going to the makeFullPathName.

Getting width & height for an individual cell in ImageAsset

There does not appear to be a way to get the cell width or height for an individual cell.
getCellWidth() returns the same for all cells, but what if the imageAsset has different cells with different widths!
The ConsoleMethods need to be updated to take a cell index like this getCellWidth(index) and getCellHeight(index).

Dev Branch Truck toy collision issues

In the truck toy, many object's collisions are no longer working correctly. This can be seen on the bridge planks and the brick objects.

This is due to some recent collision changes.

PVR Support

PVR images aren't supported, when added they produce an error - OpenGL error 0x0500 in glClipPlane

createPath(%path) no longer creates a path.

When calling createPath, the path is not created. This occurs on all platforms.

the following code isn't working:

// When we create the toy, we want to check for a save file.
// set up our path and filename for save data.   
 PixelPainter.savedirectory = getUserDataDirectory() @ "/PixelPainter";

// if the save directory doesn't exist, create it.
 if (!isDirectory(PixelPainter.savedirectory))
 {
    createPath(PixelPainter.savedirectory);
 }

The isDirectory call returns false and the createPath call returns true, but the path is not created.

This was working as soon as a week ago when I implemented this script.

Deleting a clone of an object with a custom class breaks the original object.

If you clone a named object, then delete the clone, the named object will no longer be the type of object it was when it was cloned. This makes it impossible to further clone the object.

Expected: Deleting an object does not affect the object it was cloned from.

Steps to reproduce:

  1. In any toy, add the following functions to main.cs.
    function createMyObject()
    {
    new Sprite(MyObject)
    {
    class = "MyClass";
    image = "ToyAssets:crate";
    size = "16 16";
    position = "16 16";
    };
    SandboxScene.add(MyObject);
    }

    function deleteclone()
    {
    $MyClone.safeDelete();
    }

    function createclone()
    {
    $MyClone = MyObject.clone(true);
    $MyClone.setPosition(-16, -16);
    SandboxScene.add($MyClone);
    }

  2. at the end of toy creation or reset, add the following.
    // test scripts
    createMyObject();

  3. Run the toy. You should see one crate added on top of the scene.

  4. Open the console sing "show log".

  5. type command createclone();

  6. Observe a second crate is created.

  7. type command deleteclone();

  8. Observe the second crate is deleted.

  9. type command createclone();

  10. Observe the error from the log:
    ==>deleteclone();
    ==>createclone();
    modules/FlipToy/1/main.cs (75): Unknown command clone.
    Object MyObject(1706) MyObject -> MyClass
    modules/FlipToy/1/main.cs (76): Unable to find object: '' attempting to call function 'setPosition'
    Scene::addToScene() - Could not find the specified object ''.

Note: If the class is not set for the object, the issue does not occur. This problem was introduced in commit 6de480a on March 14th 2013.

Compile errors on VS2012

Hello, first time Torque2D user here.

I was compiling Torque2D (the master branch version), when this happened.

The other 3 projects (ljpeg, lpng, zlib) all compiled successfully.


1>------ Build started: Project: Torque2D, Configuration: Debug Win32 ------
1>  Performing Custom Build Tools
1>  nasm: unable to open output file `../../Link/VC2012.Debug.Win32/Torque2D/mMath_ASM.obj'
1>  Performing Custom Build Tools
1>  nasm: unable to open output file `../../Link/VC2012.Debug.Win32/Torque2D/mMathAMD_ASM.obj'
1>  Performing Custom Build Tools
1>  nasm: unable to open output file `../../Link/VC2012.Debug.Win32/Torque2D/mMathSSE_ASM.obj'
1>  Performing Custom Build Tools
1>  nasm: unable to open output file `../../Link/VC2012.Debug.Win32/Torque2D/platformCPUInfo.obj'
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets(172,5): error MSB6006: "cmd.exe" exited with code 1.
========== Build: 0 succeeded, 1 failed, 3 up-to-date, 0 skipped ==========

I'm not any sort of expert, but I think that the assembly files
mMath_ASM.asm, mMathAMD_ASM.asm, mMathSSE_ASM.asm, and platformCPUInfo.asm aren't being assembled properly.

I've checked the project properties, and I have no idea where this Custom Build Tool command is originating from - the field is blank in every configuration.

System / Compiler Info:
Windows 8 Pro 64-bit
Microsoft Visual Studio 2012 Pro

Thanks!

Problem with boolean fields in TAML

In a TAML file like this:

<Sprite
    CollisionCallback = "true" >
    <Sprite.Behaviors>
        <SomeBehavior
            deleteMe = "true" />
    </Sprite.Behaviors>
</Sprite>

In first tier fields (here: CollisionCallback) you can set a boolean field up as either false/true or 0/1 and it will evaluate correctly. Within a behavior (here: deleteMe), the words false/true do not work, the field needs to be assigned either 0 or 1 to properly be evaluated as a bool.

Rendering - Objects pop in and out when zooming in some toys.

In the Truck toy and the DeathBall toy, when you zoom in some of the sprites pop in and out.

Expected: Sprites that are on screen render appropriately.

Steps to reproduce:

  1. Start the sandbox and load the Truck toy.
  2. Zoom in slowly with the mouse wheel.
  3. Observe as you zoom in, different objects dissappear and reappear.

Note: This looks like a sorting/culling issue.

Possible issue with ShapeVector::setSize?

I updated the ShapeVectorToy to use setPolyPrimitive and let users create more polygon shapes. In the toy, a circle with a radius of 20 fits inside a square with a size of 20.

edit:updated to reflect size differences between ShapeVectors and SceneObjects.

TAML "WriteDefaults" field fatal error

%taml.WriteDefaults=true;

generates a fatal error: fatal error simObject.cc @ 935 -> field value cannot be NULL.

setWriteDefaults() also generates the same error.

However ..

%taml.WriteDefaults=false;

does not generate any errors.

I'm on Windows XP, using T2D development.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.