Mercurial > projects > qtd
comparison tools/drcc/rcc.cpp @ 61:a2871e6b8b15
drcc: automatic initialization of resources with program start (disabled with option -no-static-initialize)
demos: resources fixes.
examples: resources fixes.
author | SokoL_SD |
---|---|
date | Tue, 19 May 2009 10:48:30 +0000 |
parents | 7be693ea7070 |
children | 39337877e05c |
comparison
equal
deleted
inserted
replaced
60:fbf7881c8b0f | 61:a2871e6b8b15 |
---|---|
344 m_compressThreshold(CONSTANT_COMPRESSTHRESHOLD_DEFAULT), | 344 m_compressThreshold(CONSTANT_COMPRESSTHRESHOLD_DEFAULT), |
345 m_treeOffset(0), | 345 m_treeOffset(0), |
346 m_namesOffset(0), | 346 m_namesOffset(0), |
347 m_dataOffset(0), | 347 m_dataOffset(0), |
348 m_useNameSpace(CONSTANT_USENAMESPACE), | 348 m_useNameSpace(CONSTANT_USENAMESPACE), |
349 m_errorDevice(0) | 349 m_errorDevice(0), |
350 m_staticInitialize(true) | |
350 { | 351 { |
351 m_out.reserve(30 * 1000 * 1000); | 352 m_out.reserve(30 * 1000 * 1000); |
352 } | 353 } |
353 | 354 |
354 RCCResourceLibrary::~RCCResourceLibrary() | 355 RCCResourceLibrary::~RCCResourceLibrary() |
923 writeString("qtd_unregister_resource_data(0x01, qt_resource_struct.ptr, " | 924 writeString("qtd_unregister_resource_data(0x01, qt_resource_struct.ptr, " |
924 "qt_resource_name.ptr, qt_resource_data.ptr);\n"); | 925 "qt_resource_name.ptr, qt_resource_data.ptr);\n"); |
925 } | 926 } |
926 writeString(" return 1;\n"); | 927 writeString(" return 1;\n"); |
927 writeString("}\n\n"); | 928 writeString("}\n\n"); |
929 | |
930 if(staticInitialize()) | |
931 { | |
932 writeString("static this() \n{\n "); | |
933 writeMangleNamespaceFunction(initResources.toLatin1()); | |
934 writeString("();\n}\n\n"); | |
935 | |
936 writeString("static ~this() \n{\n "); | |
937 writeMangleNamespaceFunction(cleanResources.toLatin1()); | |
938 writeString("();\n}\n\n"); | |
939 } | |
928 } else if (m_format == Binary) { | 940 } else if (m_format == Binary) { |
929 int i = 4; | 941 int i = 4; |
930 char *p = m_out.data(); | 942 char *p = m_out.data(); |
931 p[i++] = 0; // 0x01 | 943 p[i++] = 0; // 0x01 |
932 p[i++] = 0; | 944 p[i++] = 0; |