About Store Forum Documentation Contact



Post Reply 
Code Editor and DECLARE_CACHE Bug?
Author Message
SamNainocard Offline
Member

Post: #1
Code Editor and DECLARE_CACHE Bug?
Hi, I'm trying to use DECLARE_CACHE with custom Game::ObjParams using editor, it's work fine until I chance some attribute inside them.
PHP Code:
class AbilityParam Game::ObjParams
{
   
UID  uid;
   
int  usage_mode;
   
flt  cooldown,
        
speed_mod,
        
ap_cost;
                           
// remove this line also seems to fix
   
Vec  radius;
   
uint target_type,
        
target_shape;
private:
   
bool _created=false;
};
DECLARE_CACHE(AbilityParamAbilityParamsAbilityParamPtr)
DEFINE_CACHE (AbilityParamAbilityParams8"Ability Param"

WeaponParam
PHP Code:
class WeaponParam Game::ObjParams
{
   
UID uid;
   
int physical,
       
magical,
       
weight,
       
durability_max,
       
//attack_range,     // << this line make things weird, even empty line, but remove it seems fixed
       
cost;
private:
   
bool _created=false;
}
DECLARE_CACHE(WeaponParamWeaponParamsWeaponParamPtr)
DEFINE_CACHE (WeaponParamWeaponParams8"Weapon Object"

Error:
Code:
D:\Main Folder\Project\Esenthel\Projects\_Build_\App\Project.vcxproj : warning  : Platform 'Emscripten' referenced in the project file 'App' cannot be found.
1>------ Build started: Project: App, Configuration: Debug Win32 ------
1>  AbilityParam.cpp
1>d:\main folder\project\esenthel\projects\_build_\app\source\@abilityparam.h(24): error C2065: 'Weram' : undeclared identifier
1>d:\main folder\project\esenthel\projects\_build_\app\source\@abilityparam.h(24): error C2923: 'EE::Cache' : 'Weram' is not a valid template type argument for parameter 'TYPE'
1>d:\main folder\project\esenthel\projects\_build_\app\source\@abilityparam.h(24): error C2371: '_WeaponParams' : redefinition; different basic types
1>          d:\main folder\project\esenthel\projects\_build_\app\source\@@forward.h(13) : see declaration of '_WeaponParams'
1>d:\main folder\project\esenthel\projects\_build_\app\source\@abilityparam.h(24): error C2923: 'EE::CacheCounted' : 'Weram' is not a valid template type argument for parameter 'TYPE'
1>d:\main folder\project\esenthel\projects\_build_\app\source\@abilityparam.h(24): error C2371: 'WeaponParams' : redefinition; different basic types
1>          d:\main folder\project\esenthel\projects\_build_\app\source\@@forward.h(13) : see declaration of 'WeaponParams'
1>d:\main folder\project\esenthel\projects\_build_\app\source\@abilityparam.h(24): error C2923: 'EE::CacheElmPtr' : 'Weram' is not a valid template type argument for parameter 'TYPE'
1>d:\main folder\project\esenthel\projects\_build_\app\source\@abilityparam.h(24): error C2371: 'WeaponParamPtr' : redefinition; different basic types
1>          d:\main folder\project\esenthel\projects\_build_\app\source\@@forward.h(13) : see declaration of 'WeaponParamPtr'
1>  Generating Code...
1>  Compiling...
1>  Auto.cpp
1>d:\main folder\project\esenthel\projects\_build_\app\source\@abilityparam.h(24): error C2065: 'Weram' : undeclared identifier
1>d:\main folder\project\esenthel\projects\_build_\app\source\@abilityparam.h(24): error C2923: 'EE::Cache' : 'Weram' is not a valid template type argument for parameter 'TYPE'
1>d:\main folder\project\esenthel\projects\_build_\app\source\@abilityparam.h(24): error C2371: '_WeaponParams' : redefinition; different basic types
1>          d:\main folder\project\esenthel\projects\_build_\app\source\@@forward.h(13) : see declaration of '_WeaponParams'
1>d:\main folder\project\esenthel\projects\_build_\app\source\@abilityparam.h(24): error C2923: 'EE::CacheCounted' : 'Weram' is not a valid template type argument for parameter 'TYPE'
1>d:\main folder\project\esenthel\projects\_build_\app\source\@abilityparam.h(24): error C2371: 'WeaponParams' : redefinition; different basic types
1>          d:\main folder\project\esenthel\projects\_build_\app\source\@@forward.h(13) : see declaration of 'WeaponParams'
1>d:\main folder\project\esenthel\projects\_build_\app\source\@abilityparam.h(24): error C2923: 'EE::CacheElmPtr' : 'Weram' is not a valid template type argument for parameter 'TYPE'
1>d:\main folder\project\esenthel\projects\_build_\app\source\@abilityparam.h(24): error C2371: 'WeaponParamPtr' : redefinition; different basic types
1>          d:\main folder\project\esenthel\projects\_build_\app\source\@@forward.h(13) : see declaration of 'WeaponParamPtr'
1>  Generating Code...
1>  Compiling...
1>  WeaponParam.cpp
1>d:\main folder\project\esenthel\projects\_build_\app\source\@abilityparam.h(24): error C2065: 'Weram' : undeclared identifier
1>d:\main folder\project\esenthel\projects\_build_\app\source\@abilityparam.h(24): error C2923: 'EE::Cache' : 'Weram' is not a valid template type argument for parameter 'TYPE'
1>d:\main folder\project\esenthel\projects\_build_\app\source\@abilityparam.h(24): error C2371: '_WeaponParams' : redefinition; different basic types
1>          d:\main folder\project\esenthel\projects\_build_\app\source\@@forward.h(13) : see declaration of '_WeaponParams'
1>d:\main folder\project\esenthel\projects\_build_\app\source\@abilityparam.h(24): error C2923: 'EE::CacheCounted' : 'Weram' is not a valid template type argument for parameter 'TYPE'
1>d:\main folder\project\esenthel\projects\_build_\app\source\@abilityparam.h(24): error C2371: 'WeaponParams' : redefinition; different basic types
1>          d:\main folder\project\esenthel\projects\_build_\app\source\@@forward.h(13) : see declaration of 'WeaponParams'
1>d:\main folder\project\esenthel\projects\_build_\app\source\@abilityparam.h(24): error C2923: 'EE::CacheElmPtr' : 'Weram' is not a valid template type argument for parameter 'TYPE'
1>d:\main folder\project\esenthel\projects\_build_\app\source\@abilityparam.h(24): error C2371: 'WeaponParamPtr' : redefinition; different basic types
1>          d:\main folder\project\esenthel\projects\_build_\app\source\@@forward.h(13) : see declaration of 'WeaponParamPtr'
1>  Generating Code...
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Remove one of commented line seems to fix the problem, but why?


Attached File(s)
.7z  SourceCode.7z (Size: 1.32 KB / Downloads: 5)
.txt  Output.txt (Size: 4.88 KB / Downloads: 1)
05-25-2014 10:41 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Code Editor and DECLARE_CACHE Bug?
I've tried compiling your attachment (and even after uncommenting) and it didn't produce any errors:
Code:
1>------ Build started: Project: App, Configuration: Debug Win32 ------
1>Compiling...
1>stdafx.cpp
1>Compiling...
1>Auto.cpp
1>WeaponParam.cpp
1>Generating Code...
1>Compiling resources...
1>Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.1
1>Copyright (C) Microsoft Corporation.  All rights reserved.
1>Compiling manifest to resources...
1>Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.1
1>Copyright (C) Microsoft Corporation.  All rights reserved.
1>Linking...
1>EsenthelEngine.lib(Application.obj) : error LNK2019: unresolved external symbol "bool __cdecl Init(void)" (?Init@@YA_NXZ) referenced in function "public: bool __thiscall EE::Application::create1(void)" (?create1@Application@EE@@QAE_NXZ)
1>EsenthelEngine.lib(Application.obj) : error LNK2019: unresolved external symbol "void __cdecl InitPre(void)" (?InitPre@@YAXXZ) referenced in function "public: bool __thiscall EE::Application::create1(void)" (?create1@Application@EE@@QAE_NXZ)
1>EsenthelEngine.lib(Application.obj) : error LNK2019: unresolved external symbol "void __cdecl Shut(void)" (?Shut@@YAXXZ) referenced in function "public: void __thiscall EE::Application::del(void)" (?del@Application@EE@@QAEXXZ)
1>EsenthelEngine.lib(States.obj) : error LNK2019: unresolved external symbol "void __cdecl Draw(void)" (?Draw@@YAXXZ) referenced in function "void __cdecl EE::`dynamic initializer for 'StateMain''(void)" (??__EStateMain@EE@@YAXXZ)
1>EsenthelEngine.lib(States.obj) : error LNK2019: unresolved external symbol "bool __cdecl Update(void)" (?Update@@YA_NXZ) referenced in function "void __cdecl EE::`dynamic initializer for 'StateMain''(void)" (??__EStateMain@EE@@YAXXZ)
1>App.exe : fatal error LNK1120: 5 unresolved externals
1>App - 6 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


Are you using the latest version? (on Windows)
05-25-2014 11:45 PM
Find all posts by this user Quote this message in a reply
SamNainocard Offline
Member

Post: #3
RE: Code Editor and DECLARE_CACHE Bug?
Is Engine Build 32, Editor 17 latest?
I also have EE 1.0 co-exist, maybe it's problem.
05-26-2014 02:44 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
RE: Code Editor and DECLARE_CACHE Bug?
I think so, but I'm not sure you've attached the entire project, the files contained only one of your classes.
And it worked OK.
05-26-2014 11:26 PM
Find all posts by this user Quote this message in a reply
SamNainocard Offline
Member

Post: #5
RE: Code Editor and DECLARE_CACHE Bug?
You're right, I just check a source code I attach and your output, only have one class (bad copy perhaps?), anyways I just reupload, it should have 2 class now.


Attached File(s)
.7z  20k2q47642554^!sep_^9m3a.7z (Size: 1.29 KB / Downloads: 6)
05-27-2014 07:37 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #6
RE: Code Editor and DECLARE_CACHE Bug?
Thanks, I'm investigating this
05-27-2014 10:11 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #7
RE: Code Editor and DECLARE_CACHE Bug?
Ok, it was super hard to do, but I've managed to make it work.
For next release please:
-don't use DECLARE_CACHE (when using Code Editor)
-use just DEFINE_CACHE (when using Code Editor) but it will have the new parameter of the pointer name
like this:
#define DEFINE_CACHE(type, cache_name, ptr_name, debug_name)
instead of the old:
#define DEFINE_CACHE(type, cache_name, debug_name)
05-28-2014 05:15 AM
Find all posts by this user Quote this message in a reply
Post Reply