Skip to content

Commit

Permalink
3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Danilo1301 committed Mar 30, 2024
1 parent 240fd51 commit df85598
Show file tree
Hide file tree
Showing 284 changed files with 24,653 additions and 387 deletions.
3 changes: 1 addition & 2 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
"name": "Win32",
"includePath": [
"${workspaceFolder}/**",
"C:/Program Files/Java/jdk-22/include",
"C:/Program Files/Java/jdk-22/include/win32"
"/include"
],
"defines": [
"_DEBUG",
Expand Down
33 changes: 23 additions & 10 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
{
"files.associations": {
"format": "cpp",
"xstring": "cpp",
"fstream": "cpp",
"iosfwd": "cpp",
"ostream": "cpp",
"algorithm": "cpp",
"array": "cpp",
"atomic": "cpp",
"bit": "cpp",
"cctype": "cpp",
"charconv": "cpp",
"chrono": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"codecvt": "cpp",
"compare": "cpp",
"concepts": "cpp",
"cstddef": "cpp",
Expand All @@ -21,28 +19,46 @@
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"deque": "cpp",
"exception": "cpp",
"filesystem": "cpp",
"format": "cpp",
"forward_list": "cpp",
"fstream": "cpp",
"functional": "cpp",
"initializer_list": "cpp",
"iomanip": "cpp",
"ios": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"istream": "cpp",
"iterator": "cpp",
"limits": "cpp",
"list": "cpp",
"locale": "cpp",
"map": "cpp",
"memory": "cpp",
"new": "cpp",
"optional": "cpp",
"ostream": "cpp",
"ranges": "cpp",
"ratio": "cpp",
"set": "cpp",
"span": "cpp",
"sstream": "cpp",
"stack": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"string": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"typeinfo": "cpp",
"unordered_map": "cpp",
"utility": "cpp",
"vector": "cpp",
"xfacet": "cpp",
"xhash": "cpp",
"xiosbase": "cpp",
"xlocale": "cpp",
"xlocbuf": "cpp",
Expand All @@ -52,12 +68,9 @@
"xlocnum": "cpp",
"xloctime": "cpp",
"xmemory": "cpp",
"xstring": "cpp",
"xtr1common": "cpp",
"xtree": "cpp",
"xutility": "cpp",
"functional": "cpp",
"list": "cpp",
"unordered_map": "cpp",
"xhash": "cpp"
"xutility": "cpp"
}
}
10 changes: 0 additions & 10 deletions Android.mk

This file was deleted.

70 changes: 0 additions & 70 deletions GiroflexVSL.cpp

This file was deleted.

11 changes: 11 additions & 0 deletions GiroflexVSL/Android.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)
LOCAL_CPP_EXTENSION := .cpp .cc
LOCAL_CPP_FEATURES += exceptions
LOCAL_MODULE := GiroflexVSL
LOCAL_SRC_FILES := main.cpp mod/logger.cpp mod/config.cpp Log.cpp GiroflexVSL.cpp menu/Draw.cpp menu/Menu.cpp menu/Item.cpp menu/Window.cpp Input.cpp windows/WindowTest.cpp Vehicles.cpp Vehicle.cpp Globals.cpp LightGroup.cpp ModelInfo.cpp ModelInfos.cpp windows/WindowMain.cpp windows/WindowLightGroups.cpp windows/WindowSettings.cpp windows/WindowEditing.cpp Patterns.cpp LightGroupDatas.cpp windows/WindowWhiteCorona.cpp windows/WindowShadow.cpp windows/WindowPointLight.cpp windows/WindowFlare.cpp ModConfig.cpp json_reader.cpp json_value.cpp json_writer.cpp iniconfig/INIFile.cpp iniconfig/INISection.cpp SoundSystem.cpp AudioStream.cpp AudioStream3D.cpp windows/WindowSelectPanel.cpp windows/WindowSoundPanel.cpp windows/SoundPanelButton.cpp SoundPanelSystem.cpp windows/WindowSoundPanelSettings.cpp windows/WindowPanel.cpp ConvertOldVersion.cpp
LOCAL_CFLAGS += -O2 -mfloat-abi=softfp -DNDEBUG -std=c++17
LOCAL_C_INCLUDES += ./include
LOCAL_LDLIBS += -llog
include $(BUILD_SHARED_LIBRARY)
File renamed without changes.
94 changes: 94 additions & 0 deletions GiroflexVSL/AudioStream.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
#include "AudioStream.h"
#include "Log.h"

extern IBASS* BASS;

AudioStream::AudioStream(std::string src)
{
Log::file << "Loading audiostream '" << src << "'" << std::endl;

unsigned flags = BASS_SAMPLE_SOFTWARE;
//if (soundsys->bUseFPAudio) flags |= BASS_SAMPLE_FLOAT;

if (!(streamInternal = BASS->StreamCreateFile(false, src.c_str(), 0, 0, flags)))
{
Log::file << "Loading audiostream '" << src << "' failed. Error code: " << BASS->ErrorGetCode() << std::endl;
}
else
{
Log::file << "Loading audiostream OK" << std::endl;
}
}

void AudioStream::Play()
{
BASS->ChannelPlay(streamInternal, true);
}

void AudioStream::Pause()
{
BASS->ChannelPause(streamInternal);
}

void AudioStream::Stop()
{
BASS->ChannelPause(streamInternal);
BASS->ChannelSetPosition(streamInternal, 0, BASS_POS_BYTE);
}

void AudioStream::Resume()
{
BASS->ChannelPlay(streamInternal, false);
}

void AudioStream::Loop(bool enable)
{
BASS->ChannelFlags(streamInternal, enable ? BASS_SAMPLE_LOOP : 0, BASS_SAMPLE_LOOP);
}

void AudioStream::SetVolume(float val)
{
BASS->ChannelSetAttribute(streamInternal, BASS_ATTRIB_VOL, val);
}

void AudioStream::Destroy()
{
if (streamInternal) BASS->StreamFree(streamInternal);
}

int AudioStream::GetState()
{
switch (BASS->ChannelIsActive(streamInternal))
{
case BASS_ACTIVE_STOPPED:
default:
return -1;

case BASS_ACTIVE_PLAYING:
case BASS_ACTIVE_STALLED:
return 1;

case BASS_ACTIVE_PAUSED:
return 2;
};
}

void AudioStream::Set3DPosition(const CVector&)
{
Log::file << "Unimplemented CAudioStream::Set3DPosition(const CVector&)" << std::endl;
}

void AudioStream::Set3DPosition(float, float, float)
{
Log::file << "Unimplemented CAudioStream::Set3DPosition(float,float,float)" << std::endl;
}

void AudioStream::Link(CPlaceable*)
{
Log::file << "Unimplemented CAudioStream::Link(CPlaceable*)" << std::endl;
}

void AudioStream::Process()
{

}
26 changes: 26 additions & 0 deletions GiroflexVSL/AudioStream.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#pragma once

//https://github.com/AndroidModLoader/GTASA_CLEO_AudioStreams/blob/main/audiosystem.cpp

#include "pch.h"

class AudioStream {
public:
uint64_t streamInternal;

AudioStream(std::string src);

void Play();
void Pause();
void Stop();
void Resume();
void Loop(bool enable);
void SetVolume(float val);
void Destroy();
int GetState();

virtual void Set3DPosition(const CVector& pos);
virtual void Set3DPosition(float x, float y, float z);
virtual void Link(CPlaceable* placeable = NULL);
virtual void Process();
};
58 changes: 58 additions & 0 deletions GiroflexVSL/AudioStream3D.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#include "AudioStream3D.h"
#include "Log.h"

extern IBASS* BASS;

AudioStream3D::AudioStream3D(std::string src) : AudioStream(src)
{
Log::file << "Loading audiostream 3d '" << src << "'" << std::endl;

unsigned flags = BASS_SAMPLE_SOFTWARE;
//if (soundsys->bUseFPAudio) flags |= BASS_SAMPLE_FLOAT;

if (!(streamInternal = BASS->StreamCreateFile(false, src.c_str(), 0, 0, flags)))
{
Log::file << "Loading audiostream 3d '" << src << "' failed. Error code: " << BASS->ErrorGetCode() << std::endl;
}
else
{
Log::file << "Loading audiostream 3d OK" << std::endl;
}
}


void AudioStream3D::Set3DPosition(const CVector& pos)
{
position.x = pos.y;
position.y = pos.z;
position.z = pos.x;
link = NULL;
BASS->ChannelSet3DPosition(streamInternal, &position, NULL, NULL);
}

void AudioStream3D::Set3DPosition(float x, float y, float z)
{
position.x = y;
position.y = z;
position.z = x;
link = NULL;
BASS->ChannelSet3DPosition(streamInternal, &position, NULL, NULL);
}

void AudioStream3D::Link(CPlaceable* placeable)
{
link = placeable;
}

void AudioStream3D::Process()
{
if (link)
{
CVector* pVec = link->GetPosSA();
position.x = pVec->y;
position.y = pVec->z;
position.z = pVec->x;
}
BASS->ChannelSet3DPosition(streamInternal, &position, NULL, NULL);
//Log::file << "AudioStream3D pos: " << position.x << ", " << position.y << ", " << position.z << std::endl;
}
20 changes: 20 additions & 0 deletions GiroflexVSL/AudioStream3D.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#pragma once

//https://github.com/AndroidModLoader/GTASA_CLEO_AudioStreams/blob/main/audiosystem.cpp

#include "pch.h"

#include "AudioStream.h"

class AudioStream3D : public AudioStream {
public:
AudioStream3D(std::string src);
protected:
CPlaceable* link;
BASS_3DVECTOR position;

virtual void Set3DPosition(const CVector& pos);
virtual void Set3DPosition(float x, float y, float z);
virtual void Link(CPlaceable* placeable = NULL);
virtual void Process();
};
Loading

0 comments on commit df85598

Please sign in to comment.