Skip to content

Commit df301a7

Browse files
committed
up2
1 parent 33eb902 commit df301a7

File tree

26 files changed

+98
-115
lines changed

26 files changed

+98
-115
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ jobs:
113113
uses: microsoft/setup-msbuild@v2
114114

115115
- name: Build Solution (Debug, x64)
116-
run: mkdir temp && cd temp && ..\bin\windows\bin\cmake .. && msbuild quaesar.sln /p:Configuration=Debug /p:Platform="x64"
116+
run: mkdir temp && cd temp && ..\bin\win\cmake\bin\cmake.exe .. && msbuild quaesar.sln /p:Configuration=Debug /p:Platform="x64"
117+
117118

118119

VAmigaLib.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ add_subdirectory(libs/vAmiga)
66
add_subdirectory(libs/vAmiga_imp_lib)
77

88
quaesar_add_libs(VAmigaImpLib)
9+

libs/amDebugger/src/amDebugger/debuggerOps.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class OperationArgs : public qd::operation::BaseOpArgs
3030

3131
//////////////////////////////////////////////////////////////////////////
3232
template<class TClass>
33-
static amD::operation::Operation* createOperationCb_(const qd::TypeInfo& meta, qd::UiOperationCreator* cp)
33+
static amD::operation::Operation* createOperationCb_(const qd::TypeInfo& /*meta*/, qd::UiOperationCreator* cp)
3434
{
3535
TClass* pNewInst = new TClass();
3636
pNewInst->onOperationCreate(cp);

libs/amDebugger/src/amDebugger/vm/memory.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ const char* IVm::EMemSrc::to_string(EMemSrc value)
3939
return "WOM";
4040
case EMemSrc::EXT:
4141
return "EXT";
42+
default:
43+
return "???";
4244
}
43-
return "???";
4445
}
4546

4647

@@ -82,6 +83,7 @@ const char* IVm::EMemSrc::to_desc(EMemSrc value)
8283
return "Write-only memory";
8384
case EMemSrc::EXT:
8485
return "Extension ROM";
86+
default:
87+
return "???";
8588
}
86-
return "???";
8789
}

libs/qd/app/appPartsMgr.cpp

Lines changed: 43 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@ QD_MODULE_REGISTRATION(qd::AppPartsManager);
1414

1515
namespace qd {
1616

17-
void AppPartsManager::sendAppEventMsg(qd::appMsg::BaseMsg& in_msg)
18-
{
19-
for (size_t i = 0; i < m_pParts.size(); ++i)
20-
{
17+
void AppPartsManager::sendAppEventMsg(qd::appMsg::BaseMsg& in_msg) {
18+
19+
for (size_t i = 0; i < m_pParts.size(); ++i) {
2120
ApplicationPart* pCurPart = getPartByInd((int)i);
2221
if (!pCurPart)
2322
return;
@@ -26,23 +25,21 @@ void AppPartsManager::sendAppEventMsg(qd::appMsg::BaseMsg& in_msg)
2625
}
2726

2827

29-
qd::ApplicationPart* AppPartsManager::findPartByName(const qtd::string& strPartID) const
30-
{
31-
for (auto it = m_pParts.begin(); it != m_pParts.end(); ++it)
32-
{
33-
ApplicationPart* pCurPart = *it;
28+
qd::ApplicationPart* AppPartsManager::findPartByName(const qtd::string& strPartID) const {
29+
30+
for (const auto& pPart : m_pParts) {
31+
ApplicationPart* pCurPart = pPart;
3432
if (pCurPart && pCurPart->getPartName() == strPartID)
3533
return pCurPart;
3634
}
3735
return nullptr;
3836
}
3937

4038

41-
int AppPartsManager::findPartIndex(ApplicationPart* pPart) const
42-
{
39+
int AppPartsManager::findPartIndex(ApplicationPart* pPart) const {
40+
4341
int nSize = (int)m_pParts.size();
44-
for (int i = 0; i < nSize; ++i)
45-
{
42+
for (int i = 0; i < nSize; ++i) {
4643
ApplicationPart* pCurPart = m_pParts[i];
4744
if (pCurPart == pPart)
4845
return i;
@@ -51,20 +48,19 @@ int AppPartsManager::findPartIndex(ApplicationPart* pPart) const
5148
}
5249

5350

54-
bool AppPartsManager::addPartTry(ref_ptr<ApplicationPart> pPart)
55-
{
51+
bool AppPartsManager::addPartTry(ref_ptr<ApplicationPart> pPart) {
5652
assert(pPart);
5753
if (!pPart)
5854
return false;
5955

6056
const qtd::string& strPartName = pPart->getPartName();
6157
assert(!strPartName.empty());
6258

63-
if (qd::is_has(pPart, m_pParts))
64-
return false;
59+
// -Wambiguous-reversed-operator
60+
// if (qd::is_has(pPart, m_pParts))
61+
// return false;
6562

66-
if (findPartByName(strPartName))
67-
{
63+
if (findPartByName(strPartName)) {
6864
assert2(0, "addPartTry() Error - Part with this name already exists");
6965
return false;
7066
}
@@ -73,8 +69,7 @@ bool AppPartsManager::addPartTry(ref_ptr<ApplicationPart> pPart)
7369
}
7470

7571

76-
void AppPartsManager::addPart(ref_ptr<ApplicationPart> pPart)
77-
{
72+
void AppPartsManager::addPart(ref_ptr<ApplicationPart> pPart) {
7873
assert(pPart);
7974
if (!pPart)
8075
return;
@@ -83,22 +78,19 @@ void AppPartsManager::addPart(ref_ptr<ApplicationPart> pPart)
8378
if (strPartName.empty())
8479
pPart->setPartName(pPart->getTypeInfo().getTypeName());
8580

86-
if (!addPartTry(pPart))
87-
{
81+
if (!addPartTry(pPart)) {
8882
G_THROW_OR_DO(Exception("AddPartError: Duplicate Part Found: \"%s\"", strPartName.c_str()), return);
8983
}
9084
}
9185

9286

93-
void AppPartsManager::addPart(ref_ptr<ApplicationPart> p_part, const qtd::string& part_name_id)
94-
{
87+
void AppPartsManager::addPart(ref_ptr<ApplicationPart> p_part, const qtd::string& part_name_id) {
9588
p_part->setPartName(part_name_id);
9689
addPart(p_part);
9790
}
9891

9992

100-
void AppPartsManager::destroyPart(ref_ptr<ApplicationPart> pPart)
101-
{
93+
void AppPartsManager::destroyPart(ref_ptr<ApplicationPart> pPart) {
10294
if (!pPart)
10395
return;
10496

@@ -108,42 +100,36 @@ void AppPartsManager::destroyPart(ref_ptr<ApplicationPart> pPart)
108100

109101
m_pParts[nInd] = nullptr;
110102

111-
if (!pPart->isPartDone())
112-
{
103+
if (!pPart->isPartDone()) {
113104
pPart->destroy();
114105
pPart->setPartDone(true);
115106
}
116107
pPart = nullptr;
117108
}
118109

119110

120-
void AppPartsManager::destroy()
121-
{
111+
void AppPartsManager::destroy() {
122112
// CLog1::CSection cs("Destroy All Application Parts");
123113

124-
for (int i = 0; i < (int)m_pParts.size(); i++)
125-
{
114+
for (int i = 0; i < (int)m_pParts.size(); i++) {
126115
int nPart = ((int)m_pParts.size() - 1) - i;
127116
ApplicationPart* pPart = m_pParts[nPart];
128117
if (!pPart)
129118
continue;
130-
if (!pPart->isPartDone())
131-
{
119+
if (!pPart->isPartDone()) {
132120
qd::appMsg::ON_PRE_DESTROY p;
133121
pPart->onAppEventProcImp(p);
134122
}
135123
c_def(0);
136124
}
137125

138-
for (int i = 0; i < (int)m_pParts.size(); i++)
139-
{
126+
for (int i = 0; i < (int)m_pParts.size(); i++) {
140127
int nPart = ((int)m_pParts.size() - 1) - i;
141128
ref_ptr<ApplicationPart> pPart = m_pParts[nPart];
142129
m_pParts[nPart] = nullptr;
143130
if (!pPart)
144131
continue;
145-
if (!pPart->isPartDone())
146-
{
132+
if (!pPart->isPartDone()) {
147133
pPart->destroy();
148134
pPart->setPartDone(true);
149135
}
@@ -153,21 +139,17 @@ void AppPartsManager::destroy()
153139
}
154140

155141

156-
AppPartsManager::~AppPartsManager()
157-
{
142+
AppPartsManager::~AppPartsManager() {
158143
assert(m_pParts.empty());
159144
}
160145

161146

162-
void AppPartsManager::update(float dt, float time)
163-
{
147+
void AppPartsManager::update(float dt, float time) {
164148
m_timeNowFrame = (TTime64)std::time(nullptr);
165-
for (int i = 0; i < getNumAppParts(); i++)
166-
{
149+
for (int i = 0; i < getNumAppParts(); i++) {
167150
ApplicationPart* pCurPart = getPartByInd(i);
168151

169-
if (pCurPart && pCurPart->hasMtd(EAppPartMtd::UPDATE))
170-
{
152+
if (pCurPart && pCurPart->hasMtd(EAppPartMtd::UPDATE)) {
171153
pCurPart->updateActivateTime();
172154
if (!pCurPart->isReadyToActivate())
173155
continue;
@@ -178,13 +160,10 @@ void AppPartsManager::update(float dt, float time)
178160
}
179161

180162

181-
qd::EFlow AppPartsManager::onSdlEventProc(SDL_Event& event)
182-
{
183-
for (int i = 0; i < getNumAppParts(); i++)
184-
{
163+
qd::EFlow AppPartsManager::onSdlEventProc(SDL_Event& event) {
164+
for (int i = 0; i < getNumAppParts(); i++) {
185165
ApplicationPart* pCurPart = m_pParts[i];
186-
if (pCurPart && pCurPart->hasMtd(EAppPartMtd::UPDATE))
187-
{
166+
if (pCurPart && pCurPart->hasMtd(EAppPartMtd::UPDATE)) {
188167
qd::EFlow r = pCurPart->onSdlEventProc(event);
189168
if (r.isStop())
190169
return r;
@@ -194,39 +173,33 @@ qd::EFlow AppPartsManager::onSdlEventProc(SDL_Event& event)
194173
}
195174

196175

197-
void AppPartsManager::render()
198-
{
176+
void AppPartsManager::render() {
199177
static qd::vector<ApplicationPart*> pActParts;
200178
pActParts.clear();
201179

202180
// MAIN RENDER
203-
for (int i = 0; i < getNumAppParts(); i++)
204-
{
181+
for (int i = 0; i < getNumAppParts(); i++) {
205182
ApplicationPart* pCurPart = m_pParts[i];
206183
if (pCurPart && pCurPart->isPartRenderable())
207184
pActParts.push_back(pCurPart);
208185
}
209186
eastl::stable_sort(pActParts.begin(), pActParts.end(), &_getZOrderSort);
210187

211-
for (int i = 0; i < (int)pActParts.size(); ++i)
212-
{
188+
for (int i = 0; i < (int)pActParts.size(); ++i) {
213189
ApplicationPart* pCurPart = pActParts[i];
214190
pCurPart->renderAppPart();
215191
}
216192
}
217193

218194

219-
void AppPartsManager::onModuleMessageProc(qd::moduleMsg::BaseMsg& in_msg)
220-
{
221-
switch (in_msg.id)
222-
{
195+
void AppPartsManager::onModuleMessageProc(qd::moduleMsg::BaseMsg& in_msg) {
196+
switch (in_msg.id) {
223197
case qd::moduleMsg::RENDER_IMGUI_DEBUG_INFO_TREE::ID:
224198
{
225199
// auto p = static_cast<Enm::EModuleMsg::RENDER_IMGUI_DEBUG_INFO_TREE_t*>(pMsgData);
226200
// qd::ImAPI::CImGuiBase& im = p->im;
227201
//_onImGuiDebugControl(im);
228-
}
229-
break;
202+
} break;
230203
default:
231204
break;
232205
}
@@ -235,23 +208,20 @@ void AppPartsManager::onModuleMessageProc(qd::moduleMsg::BaseMsg& in_msg)
235208
}
236209

237210

238-
void AppPartsManager::_onImGuiDebugControl(qd::ImAPI::CImGuiBase& /*im*/)
239-
{
211+
void AppPartsManager::_onImGuiDebugControl(qd::ImAPI::CImGuiBase& /*im*/) {
212+
240213
#ifdef QDMOD_IMGUI
241-
for (ApplicationPart* pCurPart : m_pParts)
242-
{
214+
for (ApplicationPart* pCurPart : m_pParts) {
243215
if (!pCurPart)
244216
continue;
245217

246218
if (!ImGui::TreeNodeEx(pCurPart, ImGuiTreeNodeFlags_Framed, CC(pCurPart->getPartName()), 0))
247219
continue;
248220

249-
if (im.TreeNode("BasePartInfo"))
250-
{
221+
if (im.TreeNode("BasePartInfo")) {
251222
im.Text("Init: %i", (int)pCurPart->m_bPartInit);
252223
bool bVis = pCurPart->isPartRenderable();
253-
if (im.Checkbox("IsVisible", &bVis))
254-
{
224+
if (im.Checkbox("IsVisible", &bVis)) {
255225
pCurPart->setPartRenderable(bVis);
256226
}
257227
float zOrder = pCurPart->m_ZOrder.ToFloat();

libs/qd/app/appPartsMgr.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#pragma once
12
#include "qd/app/moduleManager.h"
23
#include <qd/stl/vector.h>
34
#include <qd/app/applicationPart.h>

libs/qd/base/base.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ template<typename T> constexpr inline T c_expr(T value) { return value; }
5454

5555
EA_DISABLE_VC_WARNING(4100) // unreferenced formal parameter
5656
template<typename... T> inline void unused(T&&... x) { (void(sizeof...(x))); }
57-
#define G_UNUSED(...) qd::unused(__VA_ARGS__)
57+
#define QD_UNUSED(...) qd::unused(__VA_ARGS__)
5858
EA_RESTORE_VC_WARNING()
5959

6060
}; // namespace qd

libs/qd/base/variant16.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ class Var16
116116

117117
template<int N>
118118
explicit Var16(const char (&pStr)[N]) {
119-
_setString(qtd::string_view(pStr, (uint32_t)(N - 1)));
119+
_setString(pStr, (uint32_t)(N - 1));
120120
}
121121

122122
Var16(const qtd::string_view& val) { _setString(val.data(), (int)val.size()); }

libs/qd/file/archiveBase.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include "fileBase.h"
44
#include "qd/base/base.h"
55
#include "qd/base/baseTypes.h" // SINGLETON
6-
#include "qd/base/tribool.h"
6+
#include "qd/base/Tribool.h"
77
#include "qd/debug/assert.h"
88
#include "qd/debug/exception.h"
99
#include "qd/stl/string.h"

0 commit comments

Comments
 (0)